diff options
author | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-11-05 09:53:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-06 11:28:29 -0400 |
commit | ce6120cca2589ede530200c7cfe11ac9f144333c (patch) | |
tree | 6ea7c26ce64dd4753e7cf9a3b048e74614b169dc /sound/soc/s3c24xx | |
parent | 22e2fda5660cdf62513acabdb5c82a5af415f838 (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')
-rw-r--r-- | sound/soc/s3c24xx/aquila_wm8994.c | 25 | ||||
-rw-r--r-- | sound/soc/s3c24xx/goni_wm8994.c | 21 | ||||
-rw-r--r-- | sound/soc/s3c24xx/jive_wm8750.c | 19 | ||||
-rw-r--r-- | sound/soc/s3c24xx/neo1973_gta02_wm8753.c | 41 | ||||
-rw-r--r-- | sound/soc/s3c24xx/neo1973_wm8753.c | 123 | ||||
-rw-r--r-- | sound/soc/s3c24xx/rx1950_uda1380.c | 11 | ||||
-rw-r--r-- | sound/soc/s3c24xx/s3c24xx_simtec_hermes.c | 15 | ||||
-rw-r--r-- | sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c | 15 | ||||
-rw-r--r-- | sound/soc/s3c24xx/smartq_wm8987.c | 21 | ||||
-rw-r--r-- | sound/soc/s3c24xx/smdk64xx_wm8580.c | 16 |
10 files changed, 160 insertions, 147 deletions
diff --git a/sound/soc/s3c24xx/aquila_wm8994.c b/sound/soc/s3c24xx/aquila_wm8994.c index 235d1973f7d..33bebdae08a 100644 --- a/sound/soc/s3c24xx/aquila_wm8994.c +++ b/sound/soc/s3c24xx/aquila_wm8994.c | |||
@@ -93,27 +93,28 @@ static const struct snd_soc_dapm_route aquila_dapm_routes[] = { | |||
93 | static int aquila_wm8994_init(struct snd_soc_pcm_runtime *rtd) | 93 | static int aquila_wm8994_init(struct snd_soc_pcm_runtime *rtd) |
94 | { | 94 | { |
95 | struct snd_soc_codec *codec = rtd->codec; | 95 | struct snd_soc_codec *codec = rtd->codec; |
96 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
96 | int ret; | 97 | int ret; |
97 | 98 | ||
98 | /* add aquila specific widgets */ | 99 | /* add aquila specific widgets */ |
99 | snd_soc_dapm_new_controls(codec, aquila_dapm_widgets, | 100 | snd_soc_dapm_new_controls(dapm, aquila_dapm_widgets, |
100 | ARRAY_SIZE(aquila_dapm_widgets)); | 101 | ARRAY_SIZE(aquila_dapm_widgets)); |
101 | 102 | ||
102 | /* set up aquila specific audio routes */ | 103 | /* set up aquila specific audio routes */ |
103 | snd_soc_dapm_add_routes(codec, aquila_dapm_routes, | 104 | snd_soc_dapm_add_routes(dapm, aquila_dapm_routes, |
104 | ARRAY_SIZE(aquila_dapm_routes)); | 105 | ARRAY_SIZE(aquila_dapm_routes)); |
105 | 106 | ||
106 | /* set endpoints to not connected */ | 107 | /* set endpoints to not connected */ |
107 | snd_soc_dapm_nc_pin(codec, "IN2LP:VXRN"); | 108 | snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN"); |
108 | snd_soc_dapm_nc_pin(codec, "IN2RP:VXRP"); | 109 | snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP"); |
109 | snd_soc_dapm_nc_pin(codec, "LINEOUT1N"); | 110 | snd_soc_dapm_nc_pin(dapm, "LINEOUT1N"); |
110 | snd_soc_dapm_nc_pin(codec, "LINEOUT1P"); | 111 | snd_soc_dapm_nc_pin(dapm, "LINEOUT1P"); |
111 | snd_soc_dapm_nc_pin(codec, "LINEOUT2N"); | 112 | snd_soc_dapm_nc_pin(dapm, "LINEOUT2N"); |
112 | snd_soc_dapm_nc_pin(codec, "LINEOUT2P"); | 113 | snd_soc_dapm_nc_pin(dapm, "LINEOUT2P"); |
113 | snd_soc_dapm_nc_pin(codec, "SPKOUTRN"); | 114 | snd_soc_dapm_nc_pin(dapm, "SPKOUTRN"); |
114 | snd_soc_dapm_nc_pin(codec, "SPKOUTRP"); | 115 | snd_soc_dapm_nc_pin(dapm, "SPKOUTRP"); |
115 | 116 | ||
116 | snd_soc_dapm_sync(codec); | 117 | snd_soc_dapm_sync(dapm); |
117 | 118 | ||
118 | /* Headset jack detection */ | 119 | /* Headset jack detection */ |
119 | ret = snd_soc_jack_new(&aquila, "Headset Jack", | 120 | ret = snd_soc_jack_new(&aquila, "Headset Jack", |
diff --git a/sound/soc/s3c24xx/goni_wm8994.c b/sound/soc/s3c24xx/goni_wm8994.c index 694f702cc8e..052729c6540 100644 --- a/sound/soc/s3c24xx/goni_wm8994.c +++ b/sound/soc/s3c24xx/goni_wm8994.c | |||
@@ -97,25 +97,26 @@ static const struct snd_soc_dapm_route goni_dapm_routes[] = { | |||
97 | static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd) | 97 | static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd) |
98 | { | 98 | { |
99 | struct snd_soc_codec *codec = rtd->codec; | 99 | struct snd_soc_codec *codec = rtd->codec; |
100 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
100 | int ret; | 101 | int ret; |
101 | 102 | ||
102 | /* add goni specific widgets */ | 103 | /* add goni specific widgets */ |
103 | snd_soc_dapm_new_controls(codec, goni_dapm_widgets, | 104 | snd_soc_dapm_new_controls(dapm, goni_dapm_widgets, |
104 | ARRAY_SIZE(goni_dapm_widgets)); | 105 | ARRAY_SIZE(goni_dapm_widgets)); |
105 | 106 | ||
106 | /* set up goni specific audio routes */ | 107 | /* set up goni specific audio routes */ |
107 | snd_soc_dapm_add_routes(codec, goni_dapm_routes, | 108 | snd_soc_dapm_add_routes(dapm, goni_dapm_routes, |
108 | ARRAY_SIZE(goni_dapm_routes)); | 109 | ARRAY_SIZE(goni_dapm_routes)); |
109 | 110 | ||
110 | /* set endpoints to not connected */ | 111 | /* set endpoints to not connected */ |
111 | snd_soc_dapm_nc_pin(codec, "IN2LP:VXRN"); | 112 | snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN"); |
112 | snd_soc_dapm_nc_pin(codec, "IN2RP:VXRP"); | 113 | snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP"); |
113 | snd_soc_dapm_nc_pin(codec, "LINEOUT1N"); | 114 | snd_soc_dapm_nc_pin(dapm, "LINEOUT1N"); |
114 | snd_soc_dapm_nc_pin(codec, "LINEOUT1P"); | 115 | snd_soc_dapm_nc_pin(dapm, "LINEOUT1P"); |
115 | snd_soc_dapm_nc_pin(codec, "LINEOUT2N"); | 116 | snd_soc_dapm_nc_pin(dapm, "LINEOUT2N"); |
116 | snd_soc_dapm_nc_pin(codec, "LINEOUT2P"); | 117 | snd_soc_dapm_nc_pin(dapm, "LINEOUT2P"); |
117 | 118 | ||
118 | snd_soc_dapm_sync(codec); | 119 | snd_soc_dapm_sync(dapm); |
119 | 120 | ||
120 | /* Headset jack detection */ | 121 | /* Headset jack detection */ |
121 | ret = snd_soc_jack_new(&goni, "Headset Jack", | 122 | ret = snd_soc_jack_new(&goni, "Headset Jack", |
diff --git a/sound/soc/s3c24xx/jive_wm8750.c b/sound/soc/s3c24xx/jive_wm8750.c index 49605cd8394..e3599e28356 100644 --- a/sound/soc/s3c24xx/jive_wm8750.c +++ b/sound/soc/s3c24xx/jive_wm8750.c | |||
@@ -111,18 +111,19 @@ static struct snd_soc_ops jive_ops = { | |||
111 | static int jive_wm8750_init(struct snd_soc_pcm_runtime *rtd) | 111 | static int jive_wm8750_init(struct snd_soc_pcm_runtime *rtd) |
112 | { | 112 | { |
113 | struct snd_soc_codec *codec = rtd->codec; | 113 | struct snd_soc_codec *codec = rtd->codec; |
114 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
114 | int err; | 115 | int err; |
115 | 116 | ||
116 | /* These endpoints are not being used. */ | 117 | /* These endpoints are not being used. */ |
117 | snd_soc_dapm_nc_pin(codec, "LINPUT2"); | 118 | snd_soc_dapm_nc_pin(dapm, "LINPUT2"); |
118 | snd_soc_dapm_nc_pin(codec, "RINPUT2"); | 119 | snd_soc_dapm_nc_pin(dapm, "RINPUT2"); |
119 | snd_soc_dapm_nc_pin(codec, "LINPUT3"); | 120 | snd_soc_dapm_nc_pin(dapm, "LINPUT3"); |
120 | snd_soc_dapm_nc_pin(codec, "RINPUT3"); | 121 | snd_soc_dapm_nc_pin(dapm, "RINPUT3"); |
121 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 122 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
122 | snd_soc_dapm_nc_pin(codec, "MONO"); | 123 | snd_soc_dapm_nc_pin(dapm, "MONO"); |
123 | 124 | ||
124 | /* Add jive specific widgets */ | 125 | /* Add jive specific widgets */ |
125 | err = snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets, | 126 | err = snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, |
126 | ARRAY_SIZE(wm8750_dapm_widgets)); | 127 | ARRAY_SIZE(wm8750_dapm_widgets)); |
127 | if (err) { | 128 | if (err) { |
128 | printk(KERN_ERR "%s: failed to add widgets (%d)\n", | 129 | printk(KERN_ERR "%s: failed to add widgets (%d)\n", |
@@ -130,8 +131,8 @@ static int jive_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
130 | return err; | 131 | return err; |
131 | } | 132 | } |
132 | 133 | ||
133 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 134 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
134 | snd_soc_dapm_sync(codec); | 135 | snd_soc_dapm_sync(dapm); |
135 | 136 | ||
136 | return 0; | 137 | return 0; |
137 | } | 138 | } |
diff --git a/sound/soc/s3c24xx/neo1973_gta02_wm8753.c b/sound/soc/s3c24xx/neo1973_gta02_wm8753.c index e97bdf150a0..c3f63ef8ab1 100644 --- a/sound/soc/s3c24xx/neo1973_gta02_wm8753.c +++ b/sound/soc/s3c24xx/neo1973_gta02_wm8753.c | |||
@@ -333,16 +333,17 @@ static const struct snd_kcontrol_new wm8753_neo1973_gta02_controls[] = { | |||
333 | static int neo1973_gta02_wm8753_init(struct snd_soc_pcm_runtime *rtd) | 333 | static int neo1973_gta02_wm8753_init(struct snd_soc_pcm_runtime *rtd) |
334 | { | 334 | { |
335 | struct snd_soc_codec *codec = rtd->codec; | 335 | struct snd_soc_codec *codec = rtd->codec; |
336 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
336 | int err; | 337 | int err; |
337 | 338 | ||
338 | /* set up NC codec pins */ | 339 | /* set up NC codec pins */ |
339 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 340 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
340 | snd_soc_dapm_nc_pin(codec, "OUT4"); | 341 | snd_soc_dapm_nc_pin(dapm, "OUT4"); |
341 | snd_soc_dapm_nc_pin(codec, "LINE1"); | 342 | snd_soc_dapm_nc_pin(dapm, "LINE1"); |
342 | snd_soc_dapm_nc_pin(codec, "LINE2"); | 343 | snd_soc_dapm_nc_pin(dapm, "LINE2"); |
343 | 344 | ||
344 | /* Add neo1973 gta02 specific widgets */ | 345 | /* Add neo1973 gta02 specific widgets */ |
345 | snd_soc_dapm_new_controls(codec, wm8753_dapm_widgets, | 346 | snd_soc_dapm_new_controls(dapm, wm8753_dapm_widgets, |
346 | ARRAY_SIZE(wm8753_dapm_widgets)); | 347 | ARRAY_SIZE(wm8753_dapm_widgets)); |
347 | 348 | ||
348 | /* add neo1973 gta02 specific controls */ | 349 | /* add neo1973 gta02 specific controls */ |
@@ -353,25 +354,25 @@ static int neo1973_gta02_wm8753_init(struct snd_soc_pcm_runtime *rtd) | |||
353 | return err; | 354 | return err; |
354 | 355 | ||
355 | /* set up neo1973 gta02 specific audio path audio_map */ | 356 | /* set up neo1973 gta02 specific audio path audio_map */ |
356 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 357 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
357 | 358 | ||
358 | /* set endpoints to default off mode */ | 359 | /* set endpoints to default off mode */ |
359 | snd_soc_dapm_disable_pin(codec, "Stereo Out"); | 360 | snd_soc_dapm_disable_pin(dapm, "Stereo Out"); |
360 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 361 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
361 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 362 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
362 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 363 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
363 | snd_soc_dapm_disable_pin(codec, "Handset Mic"); | 364 | snd_soc_dapm_disable_pin(dapm, "Handset Mic"); |
364 | snd_soc_dapm_disable_pin(codec, "Handset Spk"); | 365 | snd_soc_dapm_disable_pin(dapm, "Handset Spk"); |
365 | 366 | ||
366 | /* allow audio paths from the GSM modem to run during suspend */ | 367 | /* allow audio paths from the GSM modem to run during suspend */ |
367 | snd_soc_dapm_ignore_suspend(codec, "Stereo Out"); | 368 | snd_soc_dapm_ignore_suspend(dapm, "Stereo Out"); |
368 | snd_soc_dapm_ignore_suspend(codec, "GSM Line Out"); | 369 | snd_soc_dapm_ignore_suspend(dapm, "GSM Line Out"); |
369 | snd_soc_dapm_ignore_suspend(codec, "GSM Line In"); | 370 | snd_soc_dapm_ignore_suspend(dapm, "GSM Line In"); |
370 | snd_soc_dapm_ignore_suspend(codec, "Headset Mic"); | 371 | snd_soc_dapm_ignore_suspend(dapm, "Headset Mic"); |
371 | snd_soc_dapm_ignore_suspend(codec, "Handset Mic"); | 372 | snd_soc_dapm_ignore_suspend(dapm, "Handset Mic"); |
372 | snd_soc_dapm_ignore_suspend(codec, "Handset Spk"); | 373 | snd_soc_dapm_ignore_suspend(dapm, "Handset Spk"); |
373 | 374 | ||
374 | snd_soc_dapm_sync(codec); | 375 | snd_soc_dapm_sync(dapm); |
375 | 376 | ||
376 | return 0; | 377 | return 0; |
377 | } | 378 | } |
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c index f4f2ee731f0..e94ffe01a4a 100644 --- a/sound/soc/s3c24xx/neo1973_wm8753.c +++ b/sound/soc/s3c24xx/neo1973_wm8753.c | |||
@@ -237,81 +237,83 @@ static int neo1973_get_scenario(struct snd_kcontrol *kcontrol, | |||
237 | 237 | ||
238 | static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) | 238 | static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) |
239 | { | 239 | { |
240 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
241 | |||
240 | pr_debug("Entered %s\n", __func__); | 242 | pr_debug("Entered %s\n", __func__); |
241 | 243 | ||
242 | switch (neo1973_scenario) { | 244 | switch (neo1973_scenario) { |
243 | case NEO_AUDIO_OFF: | 245 | case NEO_AUDIO_OFF: |
244 | snd_soc_dapm_disable_pin(codec, "Audio Out"); | 246 | snd_soc_dapm_disable_pin(dapm, "Audio Out"); |
245 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 247 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
246 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 248 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
247 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 249 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
248 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 250 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
249 | break; | 251 | break; |
250 | case NEO_GSM_CALL_AUDIO_HANDSET: | 252 | case NEO_GSM_CALL_AUDIO_HANDSET: |
251 | snd_soc_dapm_enable_pin(codec, "Audio Out"); | 253 | snd_soc_dapm_enable_pin(dapm, "Audio Out"); |
252 | snd_soc_dapm_enable_pin(codec, "GSM Line Out"); | 254 | snd_soc_dapm_enable_pin(dapm, "GSM Line Out"); |
253 | snd_soc_dapm_enable_pin(codec, "GSM Line In"); | 255 | snd_soc_dapm_enable_pin(dapm, "GSM Line In"); |
254 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 256 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
255 | snd_soc_dapm_enable_pin(codec, "Call Mic"); | 257 | snd_soc_dapm_enable_pin(dapm, "Call Mic"); |
256 | break; | 258 | break; |
257 | case NEO_GSM_CALL_AUDIO_HEADSET: | 259 | case NEO_GSM_CALL_AUDIO_HEADSET: |
258 | snd_soc_dapm_enable_pin(codec, "Audio Out"); | 260 | snd_soc_dapm_enable_pin(dapm, "Audio Out"); |
259 | snd_soc_dapm_enable_pin(codec, "GSM Line Out"); | 261 | snd_soc_dapm_enable_pin(dapm, "GSM Line Out"); |
260 | snd_soc_dapm_enable_pin(codec, "GSM Line In"); | 262 | snd_soc_dapm_enable_pin(dapm, "GSM Line In"); |
261 | snd_soc_dapm_enable_pin(codec, "Headset Mic"); | 263 | snd_soc_dapm_enable_pin(dapm, "Headset Mic"); |
262 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 264 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
263 | break; | 265 | break; |
264 | case NEO_GSM_CALL_AUDIO_BLUETOOTH: | 266 | case NEO_GSM_CALL_AUDIO_BLUETOOTH: |
265 | snd_soc_dapm_disable_pin(codec, "Audio Out"); | 267 | snd_soc_dapm_disable_pin(dapm, "Audio Out"); |
266 | snd_soc_dapm_enable_pin(codec, "GSM Line Out"); | 268 | snd_soc_dapm_enable_pin(dapm, "GSM Line Out"); |
267 | snd_soc_dapm_enable_pin(codec, "GSM Line In"); | 269 | snd_soc_dapm_enable_pin(dapm, "GSM Line In"); |
268 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 270 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
269 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 271 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
270 | break; | 272 | break; |
271 | case NEO_STEREO_TO_SPEAKERS: | 273 | case NEO_STEREO_TO_SPEAKERS: |
272 | snd_soc_dapm_enable_pin(codec, "Audio Out"); | 274 | snd_soc_dapm_enable_pin(dapm, "Audio Out"); |
273 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 275 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
274 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 276 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
275 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 277 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
276 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 278 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
277 | break; | 279 | break; |
278 | case NEO_STEREO_TO_HEADPHONES: | 280 | case NEO_STEREO_TO_HEADPHONES: |
279 | snd_soc_dapm_enable_pin(codec, "Audio Out"); | 281 | snd_soc_dapm_enable_pin(dapm, "Audio Out"); |
280 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 282 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
281 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 283 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
282 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 284 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
283 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 285 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
284 | break; | 286 | break; |
285 | case NEO_CAPTURE_HANDSET: | 287 | case NEO_CAPTURE_HANDSET: |
286 | snd_soc_dapm_disable_pin(codec, "Audio Out"); | 288 | snd_soc_dapm_disable_pin(dapm, "Audio Out"); |
287 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 289 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
288 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 290 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
289 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 291 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
290 | snd_soc_dapm_enable_pin(codec, "Call Mic"); | 292 | snd_soc_dapm_enable_pin(dapm, "Call Mic"); |
291 | break; | 293 | break; |
292 | case NEO_CAPTURE_HEADSET: | 294 | case NEO_CAPTURE_HEADSET: |
293 | snd_soc_dapm_disable_pin(codec, "Audio Out"); | 295 | snd_soc_dapm_disable_pin(dapm, "Audio Out"); |
294 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 296 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
295 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 297 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
296 | snd_soc_dapm_enable_pin(codec, "Headset Mic"); | 298 | snd_soc_dapm_enable_pin(dapm, "Headset Mic"); |
297 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 299 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
298 | break; | 300 | break; |
299 | case NEO_CAPTURE_BLUETOOTH: | 301 | case NEO_CAPTURE_BLUETOOTH: |
300 | snd_soc_dapm_disable_pin(codec, "Audio Out"); | 302 | snd_soc_dapm_disable_pin(dapm, "Audio Out"); |
301 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 303 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
302 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 304 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
303 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 305 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
304 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 306 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
305 | break; | 307 | break; |
306 | default: | 308 | default: |
307 | snd_soc_dapm_disable_pin(codec, "Audio Out"); | 309 | snd_soc_dapm_disable_pin(dapm, "Audio Out"); |
308 | snd_soc_dapm_disable_pin(codec, "GSM Line Out"); | 310 | snd_soc_dapm_disable_pin(dapm, "GSM Line Out"); |
309 | snd_soc_dapm_disable_pin(codec, "GSM Line In"); | 311 | snd_soc_dapm_disable_pin(dapm, "GSM Line In"); |
310 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 312 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
311 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 313 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
312 | } | 314 | } |
313 | 315 | ||
314 | snd_soc_dapm_sync(codec); | 316 | snd_soc_dapm_sync(dapm); |
315 | 317 | ||
316 | return 0; | 318 | return 0; |
317 | } | 319 | } |
@@ -502,20 +504,21 @@ static const struct snd_kcontrol_new wm8753_neo1973_controls[] = { | |||
502 | static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) | 504 | static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) |
503 | { | 505 | { |
504 | struct snd_soc_codec *codec = rtd->codec; | 506 | struct snd_soc_codec *codec = rtd->codec; |
507 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
505 | int err; | 508 | int err; |
506 | 509 | ||
507 | pr_debug("Entered %s\n", __func__); | 510 | pr_debug("Entered %s\n", __func__); |
508 | 511 | ||
509 | /* set up NC codec pins */ | 512 | /* set up NC codec pins */ |
510 | snd_soc_dapm_nc_pin(codec, "LOUT2"); | 513 | snd_soc_dapm_nc_pin(dapm, "LOUT2"); |
511 | snd_soc_dapm_nc_pin(codec, "ROUT2"); | 514 | snd_soc_dapm_nc_pin(dapm, "ROUT2"); |
512 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 515 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
513 | snd_soc_dapm_nc_pin(codec, "OUT4"); | 516 | snd_soc_dapm_nc_pin(dapm, "OUT4"); |
514 | snd_soc_dapm_nc_pin(codec, "LINE1"); | 517 | snd_soc_dapm_nc_pin(dapm, "LINE1"); |
515 | snd_soc_dapm_nc_pin(codec, "LINE2"); | 518 | snd_soc_dapm_nc_pin(dapm, "LINE2"); |
516 | 519 | ||
517 | /* Add neo1973 specific widgets */ | 520 | /* Add neo1973 specific widgets */ |
518 | snd_soc_dapm_new_controls(codec, wm8753_dapm_widgets, | 521 | snd_soc_dapm_new_controls(dapm, wm8753_dapm_widgets, |
519 | ARRAY_SIZE(wm8753_dapm_widgets)); | 522 | ARRAY_SIZE(wm8753_dapm_widgets)); |
520 | 523 | ||
521 | /* set endpoints to default mode */ | 524 | /* set endpoints to default mode */ |
@@ -528,10 +531,10 @@ static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) | |||
528 | return err; | 531 | return err; |
529 | 532 | ||
530 | /* set up neo1973 specific audio routes */ | 533 | /* set up neo1973 specific audio routes */ |
531 | err = snd_soc_dapm_add_routes(codec, dapm_routes, | 534 | err = snd_soc_dapm_add_routes(dapm, dapm_routes, |
532 | ARRAY_SIZE(dapm_routes)); | 535 | ARRAY_SIZE(dapm_routes)); |
533 | 536 | ||
534 | snd_soc_dapm_sync(codec); | 537 | snd_soc_dapm_sync(dapm); |
535 | return 0; | 538 | return 0; |
536 | } | 539 | } |
537 | 540 | ||
diff --git a/sound/soc/s3c24xx/rx1950_uda1380.c b/sound/soc/s3c24xx/rx1950_uda1380.c index ffd5cf2fb0a..105d177fa42 100644 --- a/sound/soc/s3c24xx/rx1950_uda1380.c +++ b/sound/soc/s3c24xx/rx1950_uda1380.c | |||
@@ -232,26 +232,27 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream, | |||
232 | static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd) | 232 | static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd) |
233 | { | 233 | { |
234 | struct snd_soc_codec *codec = rtd->codec; | 234 | struct snd_soc_codec *codec = rtd->codec; |
235 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
235 | int err; | 236 | int err; |
236 | 237 | ||
237 | /* Add rx1950 specific widgets */ | 238 | /* Add rx1950 specific widgets */ |
238 | err = snd_soc_dapm_new_controls(codec, uda1380_dapm_widgets, | 239 | err = snd_soc_dapm_new_controls(dapm, uda1380_dapm_widgets, |
239 | ARRAY_SIZE(uda1380_dapm_widgets)); | 240 | ARRAY_SIZE(uda1380_dapm_widgets)); |
240 | 241 | ||
241 | if (err) | 242 | if (err) |
242 | return err; | 243 | return err; |
243 | 244 | ||
244 | /* Set up rx1950 specific audio path audio_mapnects */ | 245 | /* Set up rx1950 specific audio path audio_mapnects */ |
245 | err = snd_soc_dapm_add_routes(codec, audio_map, | 246 | err = snd_soc_dapm_add_routes(dapm, audio_map, |
246 | ARRAY_SIZE(audio_map)); | 247 | ARRAY_SIZE(audio_map)); |
247 | 248 | ||
248 | if (err) | 249 | if (err) |
249 | return err; | 250 | return err; |
250 | 251 | ||
251 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 252 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
252 | snd_soc_dapm_enable_pin(codec, "Speaker"); | 253 | snd_soc_dapm_enable_pin(dapm, "Speaker"); |
253 | 254 | ||
254 | snd_soc_dapm_sync(codec); | 255 | snd_soc_dapm_sync(dapm); |
255 | 256 | ||
256 | snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE, | 257 | snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE, |
257 | &hp_jack); | 258 | &hp_jack); |
diff --git a/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c b/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c index f88453735ae..05c793705d9 100644 --- a/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c +++ b/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c | |||
@@ -76,19 +76,20 @@ static const struct snd_soc_dapm_route base_map[] = { | |||
76 | static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd) | 76 | static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd) |
77 | { | 77 | { |
78 | struct snd_soc_codec *codec = rtd->codec; | 78 | struct snd_soc_codec *codec = rtd->codec; |
79 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
79 | 80 | ||
80 | snd_soc_dapm_new_controls(codec, dapm_widgets, | 81 | snd_soc_dapm_new_controls(dapm, dapm_widgets, |
81 | ARRAY_SIZE(dapm_widgets)); | 82 | ARRAY_SIZE(dapm_widgets)); |
82 | 83 | ||
83 | snd_soc_dapm_add_routes(codec, base_map, ARRAY_SIZE(base_map)); | 84 | snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map)); |
84 | 85 | ||
85 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 86 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
86 | snd_soc_dapm_enable_pin(codec, "Line In"); | 87 | snd_soc_dapm_enable_pin(dapm, "Line In"); |
87 | snd_soc_dapm_enable_pin(codec, "Line Out"); | 88 | snd_soc_dapm_enable_pin(dapm, "Line Out"); |
88 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 89 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
89 | 90 | ||
90 | simtec_audio_init(rtd); | 91 | simtec_audio_init(rtd); |
91 | snd_soc_dapm_sync(codec); | 92 | snd_soc_dapm_sync(dapm); |
92 | 93 | ||
93 | return 0; | 94 | return 0; |
94 | } | 95 | } |
diff --git a/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c b/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c index c0967593510..653dc7592e8 100644 --- a/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c +++ b/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c | |||
@@ -65,19 +65,20 @@ static const struct snd_soc_dapm_route base_map[] = { | |||
65 | static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) | 65 | static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) |
66 | { | 66 | { |
67 | struct snd_soc_codec *codec = rtd->codec; | 67 | struct snd_soc_codec *codec = rtd->codec; |
68 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
68 | 69 | ||
69 | snd_soc_dapm_new_controls(codec, dapm_widgets, | 70 | snd_soc_dapm_new_controls(dapm, dapm_widgets, |
70 | ARRAY_SIZE(dapm_widgets)); | 71 | ARRAY_SIZE(dapm_widgets)); |
71 | 72 | ||
72 | snd_soc_dapm_add_routes(codec, base_map, ARRAY_SIZE(base_map)); | 73 | snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map)); |
73 | 74 | ||
74 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 75 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
75 | snd_soc_dapm_enable_pin(codec, "Line In"); | 76 | snd_soc_dapm_enable_pin(dapm, "Line In"); |
76 | snd_soc_dapm_enable_pin(codec, "Line Out"); | 77 | snd_soc_dapm_enable_pin(dapm, "Line Out"); |
77 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 78 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
78 | 79 | ||
79 | simtec_audio_init(rtd); | 80 | simtec_audio_init(rtd); |
80 | snd_soc_dapm_sync(codec); | 81 | snd_soc_dapm_sync(dapm); |
81 | 82 | ||
82 | return 0; | 83 | return 0; |
83 | } | 84 | } |
diff --git a/sound/soc/s3c24xx/smartq_wm8987.c b/sound/soc/s3c24xx/smartq_wm8987.c index dd20ca7f468..1f6da1e27b1 100644 --- a/sound/soc/s3c24xx/smartq_wm8987.c +++ b/sound/soc/s3c24xx/smartq_wm8987.c | |||
@@ -158,10 +158,11 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
158 | 158 | ||
159 | static int smartq_wm8987_init(struct snd_soc_codec *codec) | 159 | static int smartq_wm8987_init(struct snd_soc_codec *codec) |
160 | { | 160 | { |
161 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
161 | int err = 0; | 162 | int err = 0; |
162 | 163 | ||
163 | /* Add SmartQ specific widgets */ | 164 | /* Add SmartQ specific widgets */ |
164 | snd_soc_dapm_new_controls(codec, wm8987_dapm_widgets, | 165 | snd_soc_dapm_new_controls(dapm, wm8987_dapm_widgets, |
165 | ARRAY_SIZE(wm8987_dapm_widgets)); | 166 | ARRAY_SIZE(wm8987_dapm_widgets)); |
166 | 167 | ||
167 | /* add SmartQ specific controls */ | 168 | /* add SmartQ specific controls */ |
@@ -172,20 +173,20 @@ static int smartq_wm8987_init(struct snd_soc_codec *codec) | |||
172 | return err; | 173 | return err; |
173 | 174 | ||
174 | /* setup SmartQ specific audio path */ | 175 | /* setup SmartQ specific audio path */ |
175 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 176 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
176 | 177 | ||
177 | /* set endpoints to not connected */ | 178 | /* set endpoints to not connected */ |
178 | snd_soc_dapm_nc_pin(codec, "LINPUT1"); | 179 | snd_soc_dapm_nc_pin(dapm, "LINPUT1"); |
179 | snd_soc_dapm_nc_pin(codec, "RINPUT1"); | 180 | snd_soc_dapm_nc_pin(dapm, "RINPUT1"); |
180 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 181 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
181 | snd_soc_dapm_nc_pin(codec, "ROUT1"); | 182 | snd_soc_dapm_nc_pin(dapm, "ROUT1"); |
182 | 183 | ||
183 | /* set endpoints to default off mode */ | 184 | /* set endpoints to default off mode */ |
184 | snd_soc_dapm_enable_pin(codec, "Internal Speaker"); | 185 | snd_soc_dapm_enable_pin(dapm, "Internal Speaker"); |
185 | snd_soc_dapm_enable_pin(codec, "Internal Mic"); | 186 | snd_soc_dapm_enable_pin(dapm, "Internal Mic"); |
186 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 187 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
187 | 188 | ||
188 | err = snd_soc_dapm_sync(codec); | 189 | err = snd_soc_dapm_sync(dapm); |
189 | if (err) | 190 | if (err) |
190 | return err; | 191 | return err; |
191 | 192 | ||
diff --git a/sound/soc/s3c24xx/smdk64xx_wm8580.c b/sound/soc/s3c24xx/smdk64xx_wm8580.c index 052e499b68d..291939cf848 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[] = { | |||
182 | static int smdk64xx_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd) | 182 | static 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) | |||
204 | static int smdk64xx_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd) | 205 | static 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 | } |