summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-08-25 15:37:57 +0300
committerMark Brown <broonie@kernel.org>2022-08-25 15:37:57 +0300
commitfcc245c6f6061e86903f37ffc130ae4ed07a5ae3 (patch)
tree235cd6e00b4db0b366ad758dedd46d849b258d28
parent671d119e75c8dfbf25c1813a167eeb2616c8acd5 (diff)
parent059846071f468da8389dcb8b8bbb38a781b02955 (diff)
downloadlinux-fcc245c6f6061e86903f37ffc130ae4ed07a5ae3.tar.xz
ASoC: SOF: mediatek: update SOF driver for mt8186
Merge series from Chunxu Li <chunxu.li@mediatek.com>: In these patches, we update SOF driver for mt8186
-rw-r--r--sound/soc/sof/mediatek/mt8186/mt8186.c49
1 files changed, 42 insertions, 7 deletions
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index 014afe33b3d9..a1be5d74f40b 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -460,13 +460,36 @@ 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)
+static struct snd_soc_dai_driver mt8186_dai[] = {
{
- sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
- return 0;
-}
+ .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 = {
@@ -481,6 +504,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,
@@ -491,18 +518,26 @@ 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 */
.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,
/* 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,