forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/sh/migor.c
....@@ -45,8 +45,8 @@
4545 static int migor_hw_params(struct snd_pcm_substream *substream,
4646 struct snd_pcm_hw_params *params)
4747 {
48
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
49
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
48
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
49
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
5050 int ret;
5151 unsigned int rate = params_rate(params);
5252
....@@ -67,7 +67,7 @@
6767 clk_set_rate(&siumckb_clk, codec_freq);
6868 dev_dbg(codec_dai->dev, "%s: configure %luHz\n", __func__, codec_freq);
6969
70
- ret = snd_soc_dai_set_sysclk(rtd->cpu_dai, SIU_CLKB_EXT,
70
+ ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), SIU_CLKB_EXT,
7171 codec_freq / 2, SND_SOC_CLOCK_IN);
7272
7373 if (!ret)
....@@ -78,8 +78,8 @@
7878
7979 static int migor_hw_free(struct snd_pcm_substream *substream)
8080 {
81
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
82
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
81
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
82
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
8383
8484 if (use_count) {
8585 use_count--;
....@@ -123,16 +123,18 @@
123123 };
124124
125125 /* migor digital audio interface glue - connects codec <--> CPU */
126
+SND_SOC_DAILINK_DEFS(wm8978,
127
+ DAILINK_COMP_ARRAY(COMP_CPU("siu-pcm-audio")),
128
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8978.0-001a", "wm8978-hifi")),
129
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("siu-pcm-audio")));
130
+
126131 static struct snd_soc_dai_link migor_dai = {
127132 .name = "wm8978",
128133 .stream_name = "WM8978",
129
- .cpu_dai_name = "siu-pcm-audio",
130
- .codec_dai_name = "wm8978-hifi",
131
- .platform_name = "siu-pcm-audio",
132
- .codec_name = "wm8978.0-001a",
133134 .dai_fmt = SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_I2S |
134135 SND_SOC_DAIFMT_CBS_CFS,
135136 .ops = &migor_dai_ops,
137
+ SND_SOC_DAILINK_REG(wm8978),
136138 };
137139
138140 /* migor audio machine driver */