.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * zylonite.c -- SoC audio for Zylonite |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2008 Wolfson Microelectronics PLC. |
---|
5 | 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or |
---|
8 | | - * modify it under the terms of the GNU General Public License as |
---|
9 | | - * published by the Free Software Foundation; either version 2 of the |
---|
10 | | - * License, or (at your option) any later version. |
---|
11 | | - * |
---|
12 | 7 | */ |
---|
13 | 8 | |
---|
14 | 9 | #include <linux/module.h> |
---|
.. | .. |
---|
71 | 66 | static int zylonite_wm9713_init(struct snd_soc_pcm_runtime *rtd) |
---|
72 | 67 | { |
---|
73 | 68 | if (clk_pout) |
---|
74 | | - snd_soc_dai_set_pll(rtd->codec_dai, 0, 0, |
---|
| 69 | + snd_soc_dai_set_pll(asoc_rtd_to_codec(rtd, 0), 0, 0, |
---|
75 | 70 | clk_get_rate(pout), 0); |
---|
76 | 71 | |
---|
77 | 72 | return 0; |
---|
.. | .. |
---|
80 | 75 | static int zylonite_voice_hw_params(struct snd_pcm_substream *substream, |
---|
81 | 76 | struct snd_pcm_hw_params *params) |
---|
82 | 77 | { |
---|
83 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
84 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
85 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 78 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 79 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 80 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
86 | 81 | unsigned int wm9713_div = 0; |
---|
87 | 82 | int ret = 0; |
---|
88 | 83 | int rate = params_rate(params); |
---|
.. | .. |
---|
127 | 122 | .hw_params = zylonite_voice_hw_params, |
---|
128 | 123 | }; |
---|
129 | 124 | |
---|
| 125 | +SND_SOC_DAILINK_DEFS(ac97, |
---|
| 126 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")), |
---|
| 127 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-hifi")), |
---|
| 128 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 129 | + |
---|
| 130 | +SND_SOC_DAILINK_DEFS(ac97_aux, |
---|
| 131 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")), |
---|
| 132 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-aux")), |
---|
| 133 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 134 | + |
---|
| 135 | +SND_SOC_DAILINK_DEFS(voice, |
---|
| 136 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa-ssp-dai.2")), |
---|
| 137 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-voice")), |
---|
| 138 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
---|
| 139 | + |
---|
130 | 140 | static struct snd_soc_dai_link zylonite_dai[] = { |
---|
131 | 141 | { |
---|
132 | 142 | .name = "AC97", |
---|
133 | 143 | .stream_name = "AC97 HiFi", |
---|
134 | | - .codec_name = "wm9713-codec", |
---|
135 | | - .platform_name = "pxa-pcm-audio", |
---|
136 | | - .cpu_dai_name = "pxa2xx-ac97", |
---|
137 | | - .codec_dai_name = "wm9713-hifi", |
---|
138 | 144 | .init = zylonite_wm9713_init, |
---|
| 145 | + SND_SOC_DAILINK_REG(ac97), |
---|
139 | 146 | }, |
---|
140 | 147 | { |
---|
141 | 148 | .name = "AC97 Aux", |
---|
142 | 149 | .stream_name = "AC97 Aux", |
---|
143 | | - .codec_name = "wm9713-codec", |
---|
144 | | - .platform_name = "pxa-pcm-audio", |
---|
145 | | - .cpu_dai_name = "pxa2xx-ac97-aux", |
---|
146 | | - .codec_dai_name = "wm9713-aux", |
---|
| 150 | + SND_SOC_DAILINK_REG(ac97_aux), |
---|
147 | 151 | }, |
---|
148 | 152 | { |
---|
149 | 153 | .name = "WM9713 Voice", |
---|
150 | 154 | .stream_name = "WM9713 Voice", |
---|
151 | | - .codec_name = "wm9713-codec", |
---|
152 | | - .platform_name = "pxa-pcm-audio", |
---|
153 | | - .cpu_dai_name = "pxa-ssp-dai.2", |
---|
154 | | - .codec_dai_name = "wm9713-voice", |
---|
155 | 155 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
156 | 156 | SND_SOC_DAIFMT_CBS_CFS, |
---|
157 | 157 | .ops = &zylonite_voice_ops, |
---|
| 158 | + SND_SOC_DAILINK_REG(voice), |
---|
158 | 159 | }, |
---|
159 | 160 | }; |
---|
160 | 161 | |
---|