summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek/mt6797/mt6797-dai-hostless.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mediatek/mt6797/mt6797-dai-hostless.c')
-rw-r--r--sound/soc/mediatek/mt6797/mt6797-dai-hostless.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/mediatek/mt6797/mt6797-dai-hostless.c b/sound/soc/mediatek/mt6797/mt6797-dai-hostless.c
index 4cf985b15a11..ed23e6a53b08 100644
--- a/sound/soc/mediatek/mt6797/mt6797-dai-hostless.c
+++ b/sound/soc/mediatek/mt6797/mt6797-dai-hostless.c
@@ -100,13 +100,19 @@ static struct snd_soc_dai_driver mtk_dai_hostless_driver[] = {
int mt6797_dai_hostless_register(struct mtk_base_afe *afe)
{
- int id = MT6797_DAI_HOSTLESS_LPBK;
+ struct mtk_base_afe_dai *dai;
- afe->sub_dais[id].dai_drivers = mtk_dai_hostless_driver;
- afe->sub_dais[id].num_dai_drivers = ARRAY_SIZE(mtk_dai_hostless_driver);
+ dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL);
+ if (!dai)
+ return -ENOMEM;
- afe->sub_dais[id].dapm_routes = mtk_dai_hostless_routes;
- afe->sub_dais[id].num_dapm_routes = ARRAY_SIZE(mtk_dai_hostless_routes);
+ list_add(&dai->list, &afe->sub_dais);
+
+ dai->dai_drivers = mtk_dai_hostless_driver;
+ dai->num_dai_drivers = ARRAY_SIZE(mtk_dai_hostless_driver);
+
+ dai->dapm_routes = mtk_dai_hostless_routes;
+ dai->num_dapm_routes = ARRAY_SIZE(mtk_dai_hostless_routes);
return 0;
}