Skip to content

Commit 5252c1c

Browse files
Chun-Kuang Humbgg
authored andcommitted
soc: mediatek: cmdq: Use mailbox rx_callback instead of cmdq_task_cb
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>
1 parent 81c5a41 commit 5252c1c

2 files changed

Lines changed: 2 additions & 28 deletions

File tree

drivers/soc/mediatek/mtk-cmdq-helper.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -425,34 +425,11 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
425425
}
426426
EXPORT_SYMBOL(cmdq_pkt_finalize);
427427

428-
static void cmdq_pkt_flush_async_cb(struct cmdq_cb_data data)
429-
{
430-
struct cmdq_pkt *pkt = (struct cmdq_pkt *)data.data;
431-
struct cmdq_task_cb *cb = &pkt->cb;
432-
struct cmdq_client *client = (struct cmdq_client *)pkt->cl;
433-
434-
dma_sync_single_for_cpu(client->chan->mbox->dev, pkt->pa_base,
435-
pkt->cmd_buf_size, DMA_TO_DEVICE);
436-
if (cb->cb) {
437-
data.data = cb->data;
438-
cb->cb(data);
439-
}
440-
}
441-
442-
int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb,
443-
void *data)
428+
int cmdq_pkt_flush_async(struct cmdq_pkt *pkt)
444429
{
445430
int err;
446431
struct cmdq_client *client = (struct cmdq_client *)pkt->cl;
447432

448-
pkt->cb.cb = cb;
449-
pkt->cb.data = data;
450-
pkt->async_cb.cb = cmdq_pkt_flush_async_cb;
451-
pkt->async_cb.data = pkt;
452-
453-
dma_sync_single_for_device(client->chan->mbox->dev, pkt->pa_base,
454-
pkt->cmd_buf_size, DMA_TO_DEVICE);
455-
456433
err = mbox_send_message(client->chan, pkt);
457434
if (err < 0)
458435
return err;

include/linux/soc/mediatek/mtk-cmdq.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,16 +268,13 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt);
268268
* cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ
269269
* packet and call back at the end of done packet
270270
* @pkt: the CMDQ packet
271-
* @cb: called at the end of done packet
272-
* @data: this data will pass back to cb
273271
*
274272
* Return: 0 for success; else the error code is returned
275273
*
276274
* Trigger CMDQ to asynchronously execute the CMDQ packet and call back
277275
* at the end of done packet. Note that this is an ASYNC function. When the
278276
* function returned, it may or may not be finished.
279277
*/
280-
int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb,
281-
void *data);
278+
int cmdq_pkt_flush_async(struct cmdq_pkt *pkt);
282279

283280
#endif /* __MTK_CMDQ_H__ */

0 commit comments

Comments
 (0)