.. | .. |
---|
45 | 45 | static int migor_hw_params(struct snd_pcm_substream *substream, |
---|
46 | 46 | struct snd_pcm_hw_params *params) |
---|
47 | 47 | { |
---|
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); |
---|
50 | 50 | int ret; |
---|
51 | 51 | unsigned int rate = params_rate(params); |
---|
52 | 52 | |
---|
.. | .. |
---|
67 | 67 | clk_set_rate(&siumckb_clk, codec_freq); |
---|
68 | 68 | dev_dbg(codec_dai->dev, "%s: configure %luHz\n", __func__, codec_freq); |
---|
69 | 69 | |
---|
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, |
---|
71 | 71 | codec_freq / 2, SND_SOC_CLOCK_IN); |
---|
72 | 72 | |
---|
73 | 73 | if (!ret) |
---|
.. | .. |
---|
78 | 78 | |
---|
79 | 79 | static int migor_hw_free(struct snd_pcm_substream *substream) |
---|
80 | 80 | { |
---|
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); |
---|
83 | 83 | |
---|
84 | 84 | if (use_count) { |
---|
85 | 85 | use_count--; |
---|
.. | .. |
---|
123 | 123 | }; |
---|
124 | 124 | |
---|
125 | 125 | /* 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 | + |
---|
126 | 131 | static struct snd_soc_dai_link migor_dai = { |
---|
127 | 132 | .name = "wm8978", |
---|
128 | 133 | .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", |
---|
133 | 134 | .dai_fmt = SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_I2S | |
---|
134 | 135 | SND_SOC_DAIFMT_CBS_CFS, |
---|
135 | 136 | .ops = &migor_dai_ops, |
---|
| 137 | + SND_SOC_DAILINK_REG(wm8978), |
---|
136 | 138 | }; |
---|
137 | 139 | |
---|
138 | 140 | /* migor audio machine driver */ |
---|