summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/mediatek/mt8195
diff options
context:
space:
mode:
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>2023-05-03 13:34:09 +0200
committerMark Brown <broonie@kernel.org>2023-05-08 08:48:21 +0900
commit06ba8020287f43fc13962b158d8dec2689448a5a (patch)
treee279a7da81dd8e5e975541a0f0a513d30b618b0d /sound/soc/sof/mediatek/mt8195
parentac9a78681b921877518763ba0e89202254349d1b (diff)
downloadlinux-stable-06ba8020287f43fc13962b158d8dec2689448a5a.tar.gz
linux-stable-06ba8020287f43fc13962b158d8dec2689448a5a.tar.bz2
linux-stable-06ba8020287f43fc13962b158d8dec2689448a5a.zip
ASoC: SOF: mediatek: mt8195: Use snd_sof_ipc_process_reply() helper
Function mt8195_get_reply() performs practically the same operation as the common snd_sof_ipc_get_reply() helper: removing the custom function allows us to simply perform a call to the sof-priv helper snd_sof_ipc_process_reply(), simplifying and shortening this driver and getting all the benefits of using a common API. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230503113413.149235-2-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org
Diffstat (limited to 'sound/soc/sof/mediatek/mt8195')
-rw-r--r--sound/soc/sof/mediatek/mt8195/mt8195.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c
index 42bae574c87a..7d6a568556ea 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -49,47 +49,13 @@ static int mt8195_send_msg(struct snd_sof_dev *sdev,
return mtk_adsp_ipc_send(priv->dsp_ipc, MTK_ADSP_IPC_REQ, MTK_ADSP_IPC_OP_REQ);
}
-static void mt8195_get_reply(struct snd_sof_dev *sdev)
-{
- struct snd_sof_ipc_msg *msg = sdev->msg;
- struct sof_ipc_reply reply;
- int ret = 0;
-
- if (!msg) {
- dev_warn(sdev->dev, "unexpected ipc interrupt\n");
- return;
- }
-
- /* get reply */
- sof_mailbox_read(sdev, sdev->host_box.offset, &reply, sizeof(reply));
- if (reply.error < 0) {
- memcpy(msg->reply_data, &reply, sizeof(reply));
- ret = reply.error;
- } else {
- /* reply has correct size? */
- if (reply.hdr.size != msg->reply_size) {
- dev_err(sdev->dev, "error: reply expected %zu got %u bytes\n",
- msg->reply_size, reply.hdr.size);
- ret = -EINVAL;
- }
-
- /* read the message */
- if (msg->reply_size > 0)
- sof_mailbox_read(sdev, sdev->host_box.offset,
- msg->reply_data, msg->reply_size);
- }
-
- msg->reply_error = ret;
-}
-
static void mt8195_dsp_handle_reply(struct mtk_adsp_ipc *ipc)
{
struct adsp_priv *priv = mtk_adsp_ipc_get_data(ipc);
unsigned long flags;
spin_lock_irqsave(&priv->sdev->ipc_lock, flags);
- mt8195_get_reply(priv->sdev);
- snd_sof_ipc_reply(priv->sdev, 0);
+ snd_sof_ipc_process_reply(priv->sdev, 0);
spin_unlock_irqrestore(&priv->sdev->ipc_lock, flags);
}