[Sound-open-firmware] [PATCH 2/4] [SQUASHME]ASoC: SOF: Split DSP ops into core ops and audio ops
Daniel Baluta
daniel.baluta at nxp.com
Wed Oct 30 16:41:59 CET 2019
Signed-off-by: Daniel Baluta <daniel.baluta at nxp.com>
---
sound/soc/sof/imx/imx8.c | 22 +++++++++++++++-------
sound/soc/sof/sof-of-dev.c | 2 ++
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
index cfefcfd92798..363645389d1d 100644
--- a/sound/soc/sof/imx/imx8.c
+++ b/sound/soc/sof/imx/imx8.c
@@ -21,6 +21,7 @@
#include <linux/firmware/imx/svc/misc.h>
#include <dt-bindings/firmware/imx/rsrc.h>
#include "../ops.h"
+#include "../sof-audio.h"
/* DSP memories */
#define IRAM_OFFSET 0x10000
@@ -345,7 +346,7 @@ static void imx8_ipc_msg_data(struct snd_sof_dev *sdev,
sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
}
-static int imx8_ipc_pcm_params(struct snd_sof_dev *sdev,
+static int imx8_ipc_pcm_params(struct snd_soc_component *scomp,
struct snd_pcm_substream *substream,
const struct sof_ipc_pcm_params_reply *reply)
{
@@ -377,7 +378,6 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
.get_window_offset = imx8_get_window_offset,
.ipc_msg_data = imx8_ipc_msg_data,
- .ipc_pcm_params = imx8_ipc_pcm_params,
/* module loading */
.load_module = snd_sof_parse_module_memcpy,
@@ -385,17 +385,25 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
/* firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,
- /* DAI drivers */
- .drv = imx8_dai,
- .num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
+
+};
+EXPORT_SYMBOL(sof_imx8_ops);
+
+/* imx8 audio ops */
+const struct snd_sof_audio_ops sof_imx8_audio_ops = {
+ /* IPC */
+ .ipc_pcm_params = imx8_ipc_pcm_params,
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP
+ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
+ /* DAI drivers */
+ .drv = imx8_dai,
+ .num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
};
-EXPORT_SYMBOL(sof_imx8_ops);
+EXPORT_SYMBOL(sof_imx8_audio_ops);
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c
index b7b8f226217c..6c268634baff 100644
--- a/sound/soc/sof/sof-of-dev.c
+++ b/sound/soc/sof/sof-of-dev.c
@@ -13,6 +13,7 @@
#include "ops.h"
extern struct snd_sof_dsp_ops sof_imx8_ops;
+extern struct snd_sof_audio_ops sof_imx8_audio_ops;
/* platform specific devices */
#if IS_ENABLED(CONFIG_SND_SOC_SOF_IMX8)
@@ -22,6 +23,7 @@ static struct sof_dev_desc sof_of_imx8qxp_desc = {
.nocodec_fw_filename = "sof-imx8.ri",
.nocodec_tplg_filename = "sof-imx8-nocodec.tplg",
.ops = &sof_imx8_ops,
+ .audio_ops = &sof_imx8_audio_ops,
};
#endif
--
2.17.1
More information about the Sound-open-firmware
mailing list