LF-3774-2 ASoC: SOF: imx: Use newly introduced generic IPC stream ops
authorDaniel Baluta <daniel.baluta@nxp.com>
Tue, 11 May 2021 17:52:48 +0000 (20:52 +0300)
committerDaniel Baluta <daniel.baluta@nxp.com>
Thu, 13 May 2021 06:33:53 +0000 (09:33 +0300)
This makes IMX use the newly introduced generic IPC ops
instead of imx specific ones.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
sound/soc/sof/imx/imx8.c
sound/soc/sof/imx/imx8m.c

index af34723..c285b75 100644 (file)
@@ -455,23 +455,6 @@ static int imx8_get_bar_index(struct snd_sof_dev *sdev, u32 type)
        return type;
 }
 
-static void imx8_ipc_msg_data(struct snd_sof_dev *sdev,
-                             struct snd_sof_pcm_stream *sps,
-                             void *p, size_t sz)
-{
-       if (!sps || !sdev->stream_box.size)
-               sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
-       else
-               sof_mailbox_read(sdev, sdev->stream_box.offset, p, sz);
-}
-
-static int imx8_ipc_pcm_params(struct snd_sof_dev *sdev,
-                              struct snd_pcm_substream *substream,
-                              const struct sof_ipc_pcm_params_reply *reply)
-{
-       return 0;
-}
-
 int imx8_suspend(struct snd_sof_dev *sdev)
 {
        int i;
@@ -610,8 +593,8 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
        .get_mailbox_offset     = imx8_get_mailbox_offset,
        .get_window_offset      = imx8_get_window_offset,
 
-       .ipc_msg_data   = imx8_ipc_msg_data,
-       .ipc_pcm_params = imx8_ipc_pcm_params,
+       .ipc_msg_data   = sof_ipc_msg_data,
+       .ipc_pcm_params = sof_ipc_pcm_params,
 
        /* module loading */
        .load_module    = snd_sof_parse_module_memcpy,
@@ -622,6 +605,10 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
        /* Debug information */
        .dbg_dump = imx8_dump,
 
+       /* stream callbacks */
+       .pcm_open = sof_stream_pcm_open,
+       .pcm_close = sof_stream_pcm_close,
+
        /* Firmware ops */
        .arch_ops = &sof_xtensa_arch_ops,
 
@@ -674,8 +661,8 @@ struct snd_sof_dsp_ops sof_imx8x_ops = {
        .get_mailbox_offset     = imx8_get_mailbox_offset,
        .get_window_offset      = imx8_get_window_offset,
 
-       .ipc_msg_data   = imx8_ipc_msg_data,
-       .ipc_pcm_params = imx8_ipc_pcm_params,
+       .ipc_msg_data   = sof_ipc_msg_data,
+       .ipc_pcm_params = sof_ipc_pcm_params,
 
        /* module loading */
        .load_module    = snd_sof_parse_module_memcpy,
@@ -686,6 +673,10 @@ struct snd_sof_dsp_ops sof_imx8x_ops = {
        /* Debug information */
        .dbg_dump = imx8_dump,
 
+       /* stream callbacks */
+       .pcm_open = sof_stream_pcm_open,
+       .pcm_close = sof_stream_pcm_close,
+
        /* Firmware ops */
        .arch_ops = &sof_xtensa_arch_ops,
 
index fc67cdd..5032e8c 100644 (file)
@@ -382,23 +382,6 @@ static int imx8m_get_bar_index(struct snd_sof_dev *sdev, u32 type)
        return type;
 }
 
-static void imx8m_ipc_msg_data(struct snd_sof_dev *sdev,
-                              struct snd_sof_pcm_stream *sps,
-                              void *p, size_t sz)
-{
-       if (!sps || !sdev->stream_box.size)
-               sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
-       else
-               sof_mailbox_read(sdev, sdev->stream_box.offset, p, sz);
-}
-
-static int imx8m_ipc_pcm_params(struct snd_sof_dev *sdev,
-                               struct snd_pcm_substream *substream,
-                               const struct sof_ipc_pcm_params_reply *reply)
-{
-       return 0;
-}
-
 static struct snd_soc_dai_driver imx8m_dai[] = {
 {
        .name = "sai1",
@@ -536,8 +519,8 @@ struct snd_sof_dsp_ops sof_imx8m_ops = {
        .get_mailbox_offset     = imx8m_get_mailbox_offset,
        .get_window_offset      = imx8m_get_window_offset,
 
-       .ipc_msg_data   = imx8m_ipc_msg_data,
-       .ipc_pcm_params = imx8m_ipc_pcm_params,
+       .ipc_msg_data   = sof_ipc_msg_data,
+       .ipc_pcm_params = sof_ipc_pcm_params,
 
        /* module loading */
        .load_module    = snd_sof_parse_module_memcpy,
@@ -548,6 +531,9 @@ struct snd_sof_dsp_ops sof_imx8m_ops = {
        /* Debug information */
        .dbg_dump = imx8_dump,
 
+       /* stream callbacks */
+       .pcm_open       = sof_stream_pcm_open,
+       .pcm_close      = sof_stream_pcm_close,
        /* Firmware ops */
        .arch_ops = &sof_xtensa_arch_ops,