diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 50cf51a8c9cca2..6ee683583c4e3e 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -29,23 +29,17 @@ static struct adsp_chip_info *adsp_info; +static struct snd_soc_acpi_mach sof_mt8195_mach = { + .id = "819501", + .drv_name = "mt8195_mt6359_rt1019_rt5682", + .sof_tplg_filename = "sof-mt8195-mt6359-rt1019-rt5682.tplg", +}; + static void *get_adsp_chip_data(void) { return (void *)adsp_info; } -void __iomem *get_adsp_reg_base(void) -{ - struct adsp_chip_info *adsp; - - adsp = get_adsp_chip_data(); - if (!adsp) - return NULL; - - return adsp->va_cfgreg; -} -EXPORT_SYMBOL(get_adsp_reg_base); - void __iomem *get_mbox_reg_base(u32 id) { struct adsp_chip_info *adsp; @@ -345,6 +339,26 @@ static int mt8195_dsp_remove(struct snd_sof_dev *sdev) return 0; } +static void mt8195_machine_select(struct snd_sof_dev *sdev) +{ + struct snd_sof_pdata *sof_pdata = sdev->pdata; + struct snd_soc_acpi_mach *mach; + + mach = &sof_mt8195_mach; + if (!mach) { + dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); + return; + } + + sof_pdata->tplg_filename = mach->sof_tplg_filename; + sof_pdata->machine = mach; + + /* get machine node and save it to mach->pdata */ + mach->pdata = of_get_child_by_name(sdev->dev->of_node, "sound"); + if (!mach->pdata) + dev_warn(sdev->dev, "warning: get child machine node \"sound\" failed\n"); +} + /* mt8195 ops */ struct snd_sof_dsp_ops sof_mt8195_ops = { /* probe and remove */ @@ -355,12 +369,16 @@ struct snd_sof_dsp_ops sof_mt8195_ops = { .block_read = sof_block_read, .block_write = sof_block_write, - /* Module IO */ + /* Register IO */ .write = sof_io_write, .read = sof_io_read, .write64 = sof_io_write64, .read64 = sof_io_read64, + /* machine driver */ + .machine_select = mt8195_machine_select, + .machine_register = sof_machine_register, + /* Firmware ops */ .dsp_arch_ops = &sof_xtensa_arch_ops, };