.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/sound/soc/pxa/z2.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (C) 2009 Ken McGuire <kenm@desertweyr.com> |
---|
7 | 8 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License version 2 as |
---|
11 | | - * published by the Free Software Foundation. |
---|
12 | 9 | */ |
---|
13 | 10 | |
---|
14 | 11 | #include <linux/module.h> |
---|
.. | .. |
---|
36 | 33 | static int z2_hw_params(struct snd_pcm_substream *substream, |
---|
37 | 34 | struct snd_pcm_hw_params *params) |
---|
38 | 35 | { |
---|
39 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
40 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
41 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 36 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 37 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 38 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
42 | 39 | unsigned int clk = 0; |
---|
43 | 40 | int ret = 0; |
---|
44 | 41 | |
---|
.. | .. |
---|
157 | 154 | }; |
---|
158 | 155 | |
---|
159 | 156 | /* z2 digital audio interface glue - connects codec <--> CPU */ |
---|
| 157 | +SND_SOC_DAILINK_DEFS(wm8750, |
---|
| 158 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")), |
---|
| 159 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-001b", "wm8750-hifi")), |
---|
| 160 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 161 | + |
---|
160 | 162 | static struct snd_soc_dai_link z2_dai = { |
---|
161 | 163 | .name = "wm8750", |
---|
162 | 164 | .stream_name = "WM8750", |
---|
163 | | - .cpu_dai_name = "pxa2xx-i2s", |
---|
164 | | - .codec_dai_name = "wm8750-hifi", |
---|
165 | | - .platform_name = "pxa-pcm-audio", |
---|
166 | | - .codec_name = "wm8750.0-001b", |
---|
167 | 165 | .init = z2_wm8750_init, |
---|
168 | 166 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
169 | 167 | SND_SOC_DAIFMT_CBS_CFS, |
---|
170 | 168 | .ops = &z2_ops, |
---|
| 169 | + SND_SOC_DAILINK_REG(wm8750), |
---|
171 | 170 | }; |
---|
172 | 171 | |
---|
173 | 172 | /* z2 audio machine driver */ |
---|