aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/smdk64xx_wm8580.c
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@slimlogic.co.uk>2010-11-05 09:53:46 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-06 11:28:29 -0400
commitce6120cca2589ede530200c7cfe11ac9f144333c (patch)
tree6ea7c26ce64dd4753e7cf9a3b048e74614b169dc /sound/soc/s3c24xx/smdk64xx_wm8580.c
parent22e2fda5660cdf62513acabdb5c82a5af415f838 (diff)
ASoC: Decouple DAPM from CODECs
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths. This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec. This patch does not change current functionality and a large part of changes come because of structure and internal API changes. Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <jhnikula@gmail.com>. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Manuel Lauss <manuel.lauss@googlemail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Cliff Cai <cliff.cai@analog.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Ryan Mallon <ryan@bluewatersys.com> Cc: Timur Tabi <timur@freescale.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Jassi Brar <jassi.brar@samsung.com> Cc: Daniel Gloeckner <dg@emlix.com> Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/s3c24xx/smdk64xx_wm8580.c')
-rw-r--r--sound/soc/s3c24xx/smdk64xx_wm8580.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/soc/s3c24xx/smdk64xx_wm8580.c b/sound/soc/s3c24xx/smdk64xx_wm8580.c
index 052e499b68d1..291939cf8483 100644
--- a/sound/soc/s3c24xx/smdk64xx_wm8580.c
+++ b/sound/soc/s3c24xx/smdk64xx_wm8580.c
@@ -182,21 +182,22 @@ static const struct snd_soc_dapm_route audio_map_rx[] = {
182static int smdk64xx_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd) 182static int smdk64xx_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd)
183{ 183{
184 struct snd_soc_codec *codec = rtd->codec; 184 struct snd_soc_codec *codec = rtd->codec;
185 struct snd_soc_dapm_context *dapm = &codec->dapm;
185 186
186 /* Add smdk64xx specific Capture widgets */ 187 /* Add smdk64xx specific Capture widgets */
187 snd_soc_dapm_new_controls(codec, wm8580_dapm_widgets_cpt, 188 snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_cpt,
188 ARRAY_SIZE(wm8580_dapm_widgets_cpt)); 189 ARRAY_SIZE(wm8580_dapm_widgets_cpt));
189 190
190 /* Set up PAIFTX audio path */ 191 /* Set up PAIFTX audio path */
191 snd_soc_dapm_add_routes(codec, audio_map_tx, ARRAY_SIZE(audio_map_tx)); 192 snd_soc_dapm_add_routes(dapm, audio_map_tx, ARRAY_SIZE(audio_map_tx));
192 193
193 /* Enabling the microphone requires the fitting of a 0R 194 /* Enabling the microphone requires the fitting of a 0R
194 * resistor to connect the line from the microphone jack. 195 * resistor to connect the line from the microphone jack.
195 */ 196 */
196 snd_soc_dapm_disable_pin(codec, "MicIn"); 197 snd_soc_dapm_disable_pin(dapm, "MicIn");
197 198
198 /* signal a DAPM event */ 199 /* signal a DAPM event */
199 snd_soc_dapm_sync(codec); 200 snd_soc_dapm_sync(dapm);
200 201
201 return 0; 202 return 0;
202} 203}
@@ -204,16 +205,17 @@ static int smdk64xx_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd)
204static int smdk64xx_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd) 205static int smdk64xx_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd)
205{ 206{
206 struct snd_soc_codec *codec = rtd->codec; 207 struct snd_soc_codec *codec = rtd->codec;
208 struct snd_soc_dapm_context *dapm = &codec->dapm;
207 209
208 /* Add smdk64xx specific Playback widgets */ 210 /* Add smdk64xx specific Playback widgets */
209 snd_soc_dapm_new_controls(codec, wm8580_dapm_widgets_pbk, 211 snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_pbk,
210 ARRAY_SIZE(wm8580_dapm_widgets_pbk)); 212 ARRAY_SIZE(wm8580_dapm_widgets_pbk));
211 213
212 /* Set up PAIFRX audio path */ 214 /* Set up PAIFRX audio path */
213 snd_soc_dapm_add_routes(codec, audio_map_rx, ARRAY_SIZE(audio_map_rx)); 215 snd_soc_dapm_add_routes(dapm, audio_map_rx, ARRAY_SIZE(audio_map_rx));
214 216
215 /* signal a DAPM event */ 217 /* signal a DAPM event */
216 snd_soc_dapm_sync(codec); 218 snd_soc_dapm_sync(dapm);
217 219
218 return 0; 220 return 0;
219} 221}