hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/sound/soc/amd/acp-rt5645.c
....@@ -47,8 +47,8 @@
4747 struct snd_pcm_hw_params *params)
4848 {
4949 int ret = 0;
50
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
51
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
50
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
51
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
5252
5353 ret = snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK,
5454 CZ_PLAT_CLK, params_rate(params) * 512);
....@@ -73,7 +73,7 @@
7373 struct snd_soc_card *card;
7474 struct snd_soc_component *codec;
7575
76
- codec = rtd->codec_dai->component;
76
+ codec = asoc_rtd_to_codec(rtd, 0)->component;
7777 card = rtd->card;
7878
7979 ret = snd_soc_card_jack_new(card, "Headset Jack",
....@@ -95,29 +95,34 @@
9595 .hw_params = cz_aif1_hw_params,
9696 };
9797
98
+SND_SOC_DAILINK_DEF(designware1,
99
+ DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.1.auto")));
100
+SND_SOC_DAILINK_DEF(designware2,
101
+ DAILINK_COMP_ARRAY(COMP_CPU("designware-i2s.2.auto")));
102
+
103
+SND_SOC_DAILINK_DEF(codec,
104
+ DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5650:00", "rt5645-aif1")));
105
+
106
+SND_SOC_DAILINK_DEF(platform,
107
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_audio_dma.0.auto")));
108
+
98109 static struct snd_soc_dai_link cz_dai_rt5650[] = {
99110 {
100111 .name = "amd-rt5645-play",
101112 .stream_name = "RT5645_AIF1",
102
- .platform_name = "acp_audio_dma.0.auto",
103
- .cpu_dai_name = "designware-i2s.1.auto",
104
- .codec_dai_name = "rt5645-aif1",
105
- .codec_name = "i2c-10EC5650:00",
106113 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
107114 | SND_SOC_DAIFMT_CBM_CFM,
108115 .init = cz_init,
109116 .ops = &cz_aif1_ops,
117
+ SND_SOC_DAILINK_REG(designware1, codec, platform),
110118 },
111119 {
112120 .name = "amd-rt5645-cap",
113121 .stream_name = "RT5645_AIF1",
114
- .platform_name = "acp_audio_dma.0.auto",
115
- .cpu_dai_name = "designware-i2s.2.auto",
116
- .codec_dai_name = "rt5645-aif1",
117
- .codec_name = "i2c-10EC5650:00",
118122 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
119123 | SND_SOC_DAIFMT_CBM_CFM,
120124 .ops = &cz_aif1_ops,
125
+ SND_SOC_DAILINK_REG(designware2, codec, platform),
121126 },
122127 };
123128
....@@ -177,11 +182,13 @@
177182 return 0;
178183 }
179184
185
+#ifdef CONFIG_ACPI
180186 static const struct acpi_device_id cz_audio_acpi_match[] = {
181187 { "AMDI1002", 0 },
182188 {},
183189 };
184190 MODULE_DEVICE_TABLE(acpi, cz_audio_acpi_match);
191
+#endif
185192
186193 static struct platform_driver cz_pcm_driver = {
187194 .driver = {