| .. | .. |
|---|
| 47 | 47 | struct snd_pcm_hw_params *params) |
|---|
| 48 | 48 | { |
|---|
| 49 | 49 | 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); |
|---|
| 52 | 52 | |
|---|
| 53 | 53 | ret = snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK, |
|---|
| 54 | 54 | CZ_PLAT_CLK, params_rate(params) * 512); |
|---|
| .. | .. |
|---|
| 73 | 73 | struct snd_soc_card *card; |
|---|
| 74 | 74 | struct snd_soc_component *codec; |
|---|
| 75 | 75 | |
|---|
| 76 | | - codec = rtd->codec_dai->component; |
|---|
| 76 | + codec = asoc_rtd_to_codec(rtd, 0)->component; |
|---|
| 77 | 77 | card = rtd->card; |
|---|
| 78 | 78 | |
|---|
| 79 | 79 | ret = snd_soc_card_jack_new(card, "Headset Jack", |
|---|
| .. | .. |
|---|
| 95 | 95 | .hw_params = cz_aif1_hw_params, |
|---|
| 96 | 96 | }; |
|---|
| 97 | 97 | |
|---|
| 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 | + |
|---|
| 98 | 109 | static struct snd_soc_dai_link cz_dai_rt5650[] = { |
|---|
| 99 | 110 | { |
|---|
| 100 | 111 | .name = "amd-rt5645-play", |
|---|
| 101 | 112 | .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", |
|---|
| 106 | 113 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|---|
| 107 | 114 | | SND_SOC_DAIFMT_CBM_CFM, |
|---|
| 108 | 115 | .init = cz_init, |
|---|
| 109 | 116 | .ops = &cz_aif1_ops, |
|---|
| 117 | + SND_SOC_DAILINK_REG(designware1, codec, platform), |
|---|
| 110 | 118 | }, |
|---|
| 111 | 119 | { |
|---|
| 112 | 120 | .name = "amd-rt5645-cap", |
|---|
| 113 | 121 | .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", |
|---|
| 118 | 122 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|---|
| 119 | 123 | | SND_SOC_DAIFMT_CBM_CFM, |
|---|
| 120 | 124 | .ops = &cz_aif1_ops, |
|---|
| 125 | + SND_SOC_DAILINK_REG(designware2, codec, platform), |
|---|
| 121 | 126 | }, |
|---|
| 122 | 127 | }; |
|---|
| 123 | 128 | |
|---|
| .. | .. |
|---|
| 177 | 182 | return 0; |
|---|
| 178 | 183 | } |
|---|
| 179 | 184 | |
|---|
| 185 | +#ifdef CONFIG_ACPI |
|---|
| 180 | 186 | static const struct acpi_device_id cz_audio_acpi_match[] = { |
|---|
| 181 | 187 | { "AMDI1002", 0 }, |
|---|
| 182 | 188 | {}, |
|---|
| 183 | 189 | }; |
|---|
| 184 | 190 | MODULE_DEVICE_TABLE(acpi, cz_audio_acpi_match); |
|---|
| 191 | +#endif |
|---|
| 185 | 192 | |
|---|
| 186 | 193 | static struct platform_driver cz_pcm_driver = { |
|---|
| 187 | 194 | .driver = { |
|---|