ASoC: SOF: imx: Use newly introduced generic IPC stream ops
authorDaniel Baluta <daniel.baluta@nxp.com>
Mon, 4 Oct 2021 15:21:46 +0000 (18:21 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 7 Oct 2021 15:57:56 +0000 (16:57 +0100)
This makes IMX use the newly introduced generic IPC ops
instead of imx specific ones, and removes the old IMX
ipc ops, as they are no longer needed.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/imx/imx8.c
sound/soc/sof/imx/imx8m.c

index 195297b14dbc00c487877311c35325fe5848cfd8..20695fe288cec3998ab2161512cab9b20ce76ed8 100644 (file)
@@ -369,21 +369,6 @@ static int imx8_get_bar_index(struct snd_sof_dev *sdev, u32 type)
        return type;
 }
 
-static int imx8_ipc_msg_data(struct snd_sof_dev *sdev,
-                            struct snd_pcm_substream *substream,
-                            void *p, size_t sz)
-{
-       sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
-       return 0;
-}
-
-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;
-}
-
 static struct snd_soc_dai_driver imx8_dai[] = {
 {
        .name = "esai0",
@@ -431,8 +416,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,
@@ -444,6 +429,10 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
        .dbg_dump = imx8_dump,
        .debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
 
+       /* stream callbacks */
+       .pcm_open = sof_stream_pcm_open,
+       .pcm_close = sof_stream_pcm_close,
+
        /* Firmware ops */
        .dsp_arch_ops = &sof_xtensa_arch_ops,
 
@@ -482,8 +471,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,
@@ -495,6 +484,10 @@ struct snd_sof_dsp_ops sof_imx8x_ops = {
        .dbg_dump = imx8_dump,
        .debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
 
+       /* stream callbacks */
+       .pcm_open = sof_stream_pcm_open,
+       .pcm_close = sof_stream_pcm_close,
+
        /* Firmware ops */
        .dsp_arch_ops = &sof_xtensa_arch_ops,
 
index a19f89b7755f1610c409e82536d5fc407bb900dc..ae1b48abbae049a3ffe9b7ecb8f8a3c909e8bc36 100644 (file)
@@ -232,21 +232,6 @@ static int imx8m_get_bar_index(struct snd_sof_dev *sdev, u32 type)
        return type;
 }
 
-static int imx8m_ipc_msg_data(struct snd_sof_dev *sdev,
-                             struct snd_pcm_substream *substream,
-                             void *p, size_t sz)
-{
-       sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
-       return 0;
-}
-
-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",
@@ -294,8 +279,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,
@@ -307,6 +292,9 @@ struct snd_sof_dsp_ops sof_imx8m_ops = {
        .dbg_dump = imx8_dump,
        .debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
 
+       /* stream callbacks */
+       .pcm_open       = sof_stream_pcm_open,
+       .pcm_close      = sof_stream_pcm_close,
        /* Firmware ops */
        .dsp_arch_ops = &sof_xtensa_arch_ops,