.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * poodle.c -- SoC audio for Poodle |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * |
---|
7 | 8 | * Authors: Liam Girdwood <lrg@slimlogic.co.uk> |
---|
8 | 9 | * Richard Purdie <richard@openedhand.com> |
---|
9 | | - * |
---|
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 | 10 | */ |
---|
16 | 11 | |
---|
17 | 12 | #include <linux/module.h> |
---|
.. | .. |
---|
61 | 56 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
---|
62 | 57 | } |
---|
63 | 58 | |
---|
64 | | - /* set the enpoints to their new connetion states */ |
---|
| 59 | + /* set the endpoints to their new connection states */ |
---|
65 | 60 | if (poodle_spk_func == POODLE_SPK_ON) |
---|
66 | 61 | snd_soc_dapm_enable_pin(dapm, "Ext Spk"); |
---|
67 | 62 | else |
---|
.. | .. |
---|
73 | 68 | |
---|
74 | 69 | static int poodle_startup(struct snd_pcm_substream *substream) |
---|
75 | 70 | { |
---|
76 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
| 71 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
77 | 72 | |
---|
78 | 73 | /* check the jack status at stream startup */ |
---|
79 | 74 | poodle_ext_control(&rtd->card->dapm); |
---|
.. | .. |
---|
94 | 89 | static int poodle_hw_params(struct snd_pcm_substream *substream, |
---|
95 | 90 | struct snd_pcm_hw_params *params) |
---|
96 | 91 | { |
---|
97 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
98 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
99 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 92 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 93 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 94 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
100 | 95 | unsigned int clk = 0; |
---|
101 | 96 | int ret = 0; |
---|
102 | 97 | |
---|
.. | .. |
---|
224 | 219 | }; |
---|
225 | 220 | |
---|
226 | 221 | /* poodle digital audio interface glue - connects codec <--> CPU */ |
---|
| 222 | +SND_SOC_DAILINK_DEFS(wm8731, |
---|
| 223 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")), |
---|
| 224 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8731.0-001b", "wm8731-hifi")), |
---|
| 225 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 226 | + |
---|
227 | 227 | static struct snd_soc_dai_link poodle_dai = { |
---|
228 | 228 | .name = "WM8731", |
---|
229 | 229 | .stream_name = "WM8731", |
---|
230 | | - .cpu_dai_name = "pxa2xx-i2s", |
---|
231 | | - .codec_dai_name = "wm8731-hifi", |
---|
232 | | - .platform_name = "pxa-pcm-audio", |
---|
233 | | - .codec_name = "wm8731.0-001b", |
---|
234 | 230 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
235 | 231 | SND_SOC_DAIFMT_CBS_CFS, |
---|
236 | 232 | .ops = &poodle_ops, |
---|
| 233 | + SND_SOC_DAILINK_REG(wm8731), |
---|
237 | 234 | }; |
---|
238 | 235 | |
---|
239 | 236 | /* poodle audio machine driver */ |
---|