.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * tosa.c -- SoC audio for Tosa |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * Authors: Liam Girdwood <lrg@slimlogic.co.uk> |
---|
8 | 9 | * Richard Purdie <richard@openedhand.com> |
---|
9 | 10 | * |
---|
10 | | - * This program is free software; you can redistribute it and/or modify it |
---|
11 | | - * under the terms of the GNU General Public License as published by the |
---|
12 | | - * Free Software Foundation; either version 2 of the License, or (at your |
---|
13 | | - * option) any later version. |
---|
14 | | - * |
---|
15 | 11 | * GPIO's |
---|
16 | 12 | * 1 - Jack Insertion |
---|
17 | 13 | * 5 - Hookswitch (headset answer/hang up switch) |
---|
18 | | - * |
---|
19 | 14 | */ |
---|
20 | 15 | |
---|
21 | 16 | #include <linux/module.h> |
---|
.. | .. |
---|
77 | 72 | |
---|
78 | 73 | static int tosa_startup(struct snd_pcm_substream *substream) |
---|
79 | 74 | { |
---|
80 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
| 75 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
81 | 76 | |
---|
82 | 77 | /* check the jack status at stream startup */ |
---|
83 | 78 | tosa_ext_control(&rtd->card->dapm); |
---|
.. | .. |
---|
182 | 177 | tosa_set_spk), |
---|
183 | 178 | }; |
---|
184 | 179 | |
---|
| 180 | +SND_SOC_DAILINK_DEFS(ac97, |
---|
| 181 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")), |
---|
| 182 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")), |
---|
| 183 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 184 | + |
---|
| 185 | +SND_SOC_DAILINK_DEFS(ac97_aux, |
---|
| 186 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")), |
---|
| 187 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")), |
---|
| 188 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 189 | + |
---|
185 | 190 | static struct snd_soc_dai_link tosa_dai[] = { |
---|
186 | 191 | { |
---|
187 | 192 | .name = "AC97", |
---|
188 | 193 | .stream_name = "AC97 HiFi", |
---|
189 | | - .cpu_dai_name = "pxa2xx-ac97", |
---|
190 | | - .codec_dai_name = "wm9712-hifi", |
---|
191 | | - .platform_name = "pxa-pcm-audio", |
---|
192 | | - .codec_name = "wm9712-codec", |
---|
193 | 194 | .ops = &tosa_ops, |
---|
| 195 | + SND_SOC_DAILINK_REG(ac97), |
---|
194 | 196 | }, |
---|
195 | 197 | { |
---|
196 | 198 | .name = "AC97 Aux", |
---|
197 | 199 | .stream_name = "AC97 Aux", |
---|
198 | | - .cpu_dai_name = "pxa2xx-ac97-aux", |
---|
199 | | - .codec_dai_name = "wm9712-aux", |
---|
200 | | - .platform_name = "pxa-pcm-audio", |
---|
201 | | - .codec_name = "wm9712-codec", |
---|
202 | 200 | .ops = &tosa_ops, |
---|
| 201 | + SND_SOC_DAILINK_REG(ac97_aux), |
---|
203 | 202 | }, |
---|
204 | 203 | }; |
---|
205 | 204 | |
---|