[PATCH 0/3] ASoC: SOF: mediatek: update SOF driver for mt8186
In these patches, we update SOF driver for mt8186
Chunxu Li (3): ASoC: SOF: mediatek: Add dai driver for mt8186 ASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box ASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field
sound/soc/sof/mediatek/mt8186/mt8186.c | 49 ++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 7 deletions(-)
Add dsp ops callback to register AFE DL1/DL2/UL1/UL2 SOF dai's with ALSA
Signed-off-by: Chunxu Li chunxu.li@mediatek.com --- sound/soc/sof/mediatek/mt8186/mt8186.c | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index 014afe33b3d9..b47bb7a6ba70 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -468,6 +468,37 @@ static int mt8186_ipc_msg_data(struct snd_sof_dev *sdev, return 0; }
+static struct snd_soc_dai_driver mt8186_dai[] = { +{ + .name = "SOF_DL1", + .playback = { + .channels_min = 1, + .channels_max = 2, + }, +}, +{ + .name = "SOF_DL2", + .playback = { + .channels_min = 1, + .channels_max = 2, + }, +}, +{ + .name = "SOF_UL1", + .capture = { + .channels_min = 1, + .channels_max = 2, + }, +}, +{ + .name = "SOF_UL2", + .capture = { + .channels_min = 1, + .channels_max = 2, + }, +}, +}; + /* mt8186 ops */ static struct snd_sof_dsp_ops sof_mt8186_ops = { /* probe and remove */ @@ -503,6 +534,10 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = { /* Firmware ops */ .dsp_arch_ops = &sof_xtensa_arch_ops,
+ /* DAI drivers */ + .drv = mt8186_dai, + .num_drv = ARRAY_SIZE(mt8186_dai), + /* PM */ .suspend = mt8186_dsp_suspend, .resume = mt8186_dsp_resume,
Use generic IPC stream and mailbox ops for mt8186
Signed-off-by: Chunxu Li chunxu.li@mediatek.com --- sound/soc/sof/mediatek/mt8186/mt8186.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index b47bb7a6ba70..5fc206bb0da0 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -512,6 +512,10 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = { .block_read = sof_block_read, .block_write = sof_block_write,
+ /* Mailbox IO */ + .mailbox_read = sof_mailbox_read, + .mailbox_write = sof_mailbox_write, + /* Register IO */ .write = sof_io_write, .read = sof_io_read, @@ -528,6 +532,10 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = { /* misc */ .get_bar_index = mt8186_get_bar_index,
+ /* stream callbacks */ + .pcm_open = sof_stream_pcm_open, + .pcm_close = sof_stream_pcm_close, + /* firmware loading */ .load_firmware = snd_sof_load_firmware_memcpy,
Use generic sof_ipc_msg_data instead of specific implementation as they do the same things
Signed-off-by: Chunxu Li chunxu.li@mediatek.com --- sound/soc/sof/mediatek/mt8186/mt8186.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index 5fc206bb0da0..a1be5d74f40b 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -460,14 +460,6 @@ static int mt8186_get_bar_index(struct snd_sof_dev *sdev, u32 type) return type; }
-static int mt8186_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 struct snd_soc_dai_driver mt8186_dai[] = { { .name = "SOF_DL1", @@ -526,7 +518,7 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = { .send_msg = mt8186_send_msg, .get_mailbox_offset = mt8186_get_mailbox_offset, .get_window_offset = mt8186_get_window_offset, - .ipc_msg_data = mt8186_ipc_msg_data, + .ipc_msg_data = sof_ipc_msg_data, .set_stream_data_offset = sof_set_stream_data_offset,
/* misc */
On Thu, 25 Aug 2022 14:54:08 +0800, Chunxu Li wrote:
In these patches, we update SOF driver for mt8186
Chunxu Li (3): ASoC: SOF: mediatek: Add dai driver for mt8186 ASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box ASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: SOF: mediatek: Add dai driver for mt8186 commit: f3b75e9b56780e3bfaa910e560cb9ba4d8f38e53 [2/3] ASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box commit: 82e93430e0ad13cc31e411cfa575e63118bb0ed4 [3/3] ASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field commit: 059846071f468da8389dcb8b8bbb38a781b02955
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Chunxu Li
-
Mark Brown