]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: mediatek: cmdq: Use mailbox rx_callback instead of cmdq_task_cb
authorChun-Kuang Hu <chunkuang.hu@kernel.org>
Sat, 16 Apr 2022 09:54:28 +0000 (17:54 +0800)
committerMatthias Brugger <matthias.bgg@gmail.com>
Wed, 20 Apr 2022 12:14:59 +0000 (14:14 +0200)
rx_callback is a standard mailbox callback mechanism and could cover the
function of proprietary cmdq_task_cb, so use the standard one instead of
the proprietary one. Client has changed to use the standard callback
machanism and sync dma buffer in client driver, so remove the proprietary
callback in cmdq helper.

Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Reviewed-by: jason-jh.lin <jason-jh.lin@mediatek.com>
Tested-by: jason-jh.lin <jason-jh.lin@mediatek.com>
Link: https://lore.kernel.org/r/1650102868-26219-1-git-send-email-chunkuang.hu@kernel.org
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
drivers/soc/mediatek/mtk-cmdq-helper.c
include/linux/soc/mediatek/mtk-cmdq.h

index 3c8e4212d9419904acd92d67b40763ea50ab76b0..c1837a468267372eb588a087c630cd7ad605e9ce 100644 (file)
@@ -425,34 +425,11 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
 }
 EXPORT_SYMBOL(cmdq_pkt_finalize);
 
-static void cmdq_pkt_flush_async_cb(struct cmdq_cb_data data)
-{
-       struct cmdq_pkt *pkt = (struct cmdq_pkt *)data.data;
-       struct cmdq_task_cb *cb = &pkt->cb;
-       struct cmdq_client *client = (struct cmdq_client *)pkt->cl;
-
-       dma_sync_single_for_cpu(client->chan->mbox->dev, pkt->pa_base,
-                               pkt->cmd_buf_size, DMA_TO_DEVICE);
-       if (cb->cb) {
-               data.data = cb->data;
-               cb->cb(data);
-       }
-}
-
-int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb,
-                        void *data)
+int cmdq_pkt_flush_async(struct cmdq_pkt *pkt)
 {
        int err;
        struct cmdq_client *client = (struct cmdq_client *)pkt->cl;
 
-       pkt->cb.cb = cb;
-       pkt->cb.data = data;
-       pkt->async_cb.cb = cmdq_pkt_flush_async_cb;
-       pkt->async_cb.data = pkt;
-
-       dma_sync_single_for_device(client->chan->mbox->dev, pkt->pa_base,
-                                  pkt->cmd_buf_size, DMA_TO_DEVICE);
-
        err = mbox_send_message(client->chan, pkt);
        if (err < 0)
                return err;
index ac6b5f3cba953a10062b4f30d231ee40cf8f593e..2b498f4f394649551ecc0783aa57e566004429bb 100644 (file)
@@ -268,8 +268,6 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt);
  * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ
  *                          packet and call back at the end of done packet
  * @pkt:       the CMDQ packet
- * @cb:                called at the end of done packet
- * @data:      this data will pass back to cb
  *
  * Return: 0 for success; else the error code is returned
  *
@@ -277,7 +275,6 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt);
  * at the end of done packet. Note that this is an ASYNC function. When the
  * function returned, it may or may not be finished.
  */
-int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb,
-                        void *data);
+int cmdq_pkt_flush_async(struct cmdq_pkt *pkt);
 
 #endif /* __MTK_CMDQ_H__ */