.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | |
---|
2 | 3 | #include <linux/module.h> |
---|
3 | 4 | #include <sound/soc.h> |
---|
.. | .. |
---|
10 | 11 | static int imote2_asoc_hw_params(struct snd_pcm_substream *substream, |
---|
11 | 12 | struct snd_pcm_hw_params *params) |
---|
12 | 13 | { |
---|
13 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
14 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
15 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 14 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 15 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 16 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
16 | 17 | unsigned int clk = 0; |
---|
17 | 18 | int ret; |
---|
18 | 19 | |
---|
.. | .. |
---|
46 | 47 | .hw_params = imote2_asoc_hw_params, |
---|
47 | 48 | }; |
---|
48 | 49 | |
---|
| 50 | +SND_SOC_DAILINK_DEFS(wm8940, |
---|
| 51 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")), |
---|
| 52 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8940-codec.0-0034", |
---|
| 53 | + "wm8940-hifi")), |
---|
| 54 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 55 | + |
---|
49 | 56 | static struct snd_soc_dai_link imote2_dai = { |
---|
50 | 57 | .name = "WM8940", |
---|
51 | 58 | .stream_name = "WM8940", |
---|
52 | | - .cpu_dai_name = "pxa2xx-i2s", |
---|
53 | | - .codec_dai_name = "wm8940-hifi", |
---|
54 | | - .platform_name = "pxa-pcm-audio", |
---|
55 | | - .codec_name = "wm8940-codec.0-0034", |
---|
56 | 59 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
57 | 60 | SND_SOC_DAIFMT_CBS_CFS, |
---|
58 | 61 | .ops = &imote2_asoc_ops, |
---|
| 62 | + SND_SOC_DAILINK_REG(wm8940), |
---|
59 | 63 | }; |
---|
60 | 64 | |
---|
61 | 65 | static struct snd_soc_card imote2 = { |
---|