aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/neo1973_wm8753.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/s3c24xx/neo1973_wm8753.c')
-rw-r--r--sound/soc/s3c24xx/neo1973_wm8753.c123
1 files changed, 63 insertions, 60 deletions
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
238static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) 238static 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[] = {
502static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) 504static 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