aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mediatek/mt6797/mt6797-dai-pcm.c')
-rw-r--r--sound/soc/mediatek/mt6797/mt6797-dai-pcm.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c b/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c
index 16d5b5067204..3136f0bc7827 100644
--- a/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c
+++ b/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c
@@ -298,15 +298,20 @@ static struct snd_soc_dai_driver mtk_dai_pcm_driver[] = {
int mt6797_dai_pcm_register(struct mtk_base_afe *afe)
{
- int id = MT6797_DAI_PCM_1;
+ struct mtk_base_afe_dai *dai;
- afe->sub_dais[id].dai_drivers = mtk_dai_pcm_driver;
- afe->sub_dais[id].num_dai_drivers = ARRAY_SIZE(mtk_dai_pcm_driver);
+ dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL);
+ if (!dai)
+ return -ENOMEM;
- afe->sub_dais[id].dapm_widgets = mtk_dai_pcm_widgets;
- afe->sub_dais[id].num_dapm_widgets = ARRAY_SIZE(mtk_dai_pcm_widgets);
- afe->sub_dais[id].dapm_routes = mtk_dai_pcm_routes;
- afe->sub_dais[id].num_dapm_routes = ARRAY_SIZE(mtk_dai_pcm_routes);
+ list_add(&dai->list, &afe->sub_dais);
+ dai->dai_drivers = mtk_dai_pcm_driver;
+ dai->num_dai_drivers = ARRAY_SIZE(mtk_dai_pcm_driver);
+
+ dai->dapm_widgets = mtk_dai_pcm_widgets;
+ dai->num_dapm_widgets = ARRAY_SIZE(mtk_dai_pcm_widgets);
+ dai->dapm_routes = mtk_dai_pcm_routes;
+ dai->num_dapm_routes = ARRAY_SIZE(mtk_dai_pcm_routes);
return 0;
}