aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-09-07 15:28:51 +0100
committerMark Brown <broonie@kernel.org>2022-09-07 15:28:51 +0100
commite0d38f88e977e7fb6a8aa4d4f31720b1c9b7817e (patch)
tree29a6a754841d862e0dc397eba7305e46ad196d69
parentASoC: soc-dapm.c: random cleanup (diff)
parentASoC: SOF: mediatek: mt8195: Add devicetree support to select topologies (diff)
downloadlinux-dev-e0d38f88e977e7fb6a8aa4d4f31720b1c9b7817e.tar.xz
linux-dev-e0d38f88e977e7fb6a8aa4d4f31720b1c9b7817e.zip
ASoC: Fixes for MT8195 SOF support
Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>: This series fixes Sound Open Firmware support for MT8195 by making sure that the sound card driver is actually able to probe and IPC can finally happen. It is now possible to get DSP support for audio. Tested on MT8195 Tomato - Acer Chromebook Spin 513 CP513-2H (Pipewire).
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-mt6359.c6
-rw-r--r--sound/soc/sof/mediatek/mt8195/mt8195.c32
2 files changed, 29 insertions, 9 deletions
diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359.c b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
index c530e3fc27e4..961e769602d6 100644
--- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c
+++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
@@ -1383,7 +1383,13 @@ static int mt8195_mt6359_dev_probe(struct platform_device *pdev)
sof_priv->num_streams = ARRAY_SIZE(g_sof_conn_streams);
sof_priv->sof_dai_link_fixup = mt8195_dai_link_fixup;
soc_card_data->sof_priv = sof_priv;
+ card->probe = mtk_sof_card_probe;
card->late_probe = mtk_sof_card_late_probe;
+ if (!card->topology_shortname_created) {
+ snprintf(card->topology_shortname, 32, "sof-%s", card->name);
+ card->topology_shortname_created = true;
+ }
+ card->name = card->topology_shortname;
sof_on = 1;
}
diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c
index 9c146015cd1b..c12192c8a6f8 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -496,14 +496,6 @@ static int mt8195_get_bar_index(struct snd_sof_dev *sdev, u32 type)
return type;
}
-static int mt8195_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 void mt8195_adsp_dump(struct snd_sof_dev *sdev, u32 flags)
{
u32 dbg_pc, dbg_data, dbg_bus0, dbg_bus1, dbg_inst;
@@ -574,6 +566,10 @@ static struct snd_sof_dsp_ops sof_mt8195_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,
@@ -584,12 +580,16 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = {
.send_msg = mt8195_send_msg,
.get_mailbox_offset = mt8195_get_mailbox_offset,
.get_window_offset = mt8195_get_window_offset,
- .ipc_msg_data = mt8195_ipc_msg_data,
+ .ipc_msg_data = sof_ipc_msg_data,
.set_stream_data_offset = sof_set_stream_data_offset,
/* misc */
.get_bar_index = mt8195_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,
@@ -615,7 +615,20 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = {
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
};
+static struct snd_sof_of_mach sof_mt8195_machs[] = {
+ {
+ .compatible = "google,tomato",
+ .sof_tplg_filename = "sof-mt8195-mt6359-rt1019-rt5682-dts.tplg"
+ }, {
+ .compatible = "mediatek,mt8195",
+ .sof_tplg_filename = "sof-mt8195.tplg"
+ }, {
+ /* sentinel */
+ }
+};
+
static const struct sof_dev_desc sof_of_mt8195_desc = {
+ .of_machines = sof_mt8195_machs,
.ipc_supported_mask = BIT(SOF_IPC),
.ipc_default = SOF_IPC,
.default_fw_path = {
@@ -652,4 +665,5 @@ static struct platform_driver snd_sof_of_mt8195_driver = {
module_platform_driver(snd_sof_of_mt8195_driver);
MODULE_IMPORT_NS(SND_SOC_SOF_XTENSA);
+MODULE_IMPORT_NS(SND_SOC_SOF_MTK_COMMON);
MODULE_LICENSE("Dual BSD/GPL");