diff options
Diffstat (limited to 'sound/soc/codecs/mc13783.c')
-rw-r--r-- | sound/soc/codecs/mc13783.c | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index 115a40301810..bc955999c8aa 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c | |||
@@ -426,16 +426,16 @@ static int mc13783_set_tdm_slot_sync(struct snd_soc_dai *dai, | |||
426 | } | 426 | } |
427 | 427 | ||
428 | static const struct snd_kcontrol_new mc1l_amp_ctl = | 428 | static const struct snd_kcontrol_new mc1l_amp_ctl = |
429 | SOC_DAPM_SINGLE("Switch", 38, 7, 1, 0); | 429 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 7, 1, 0); |
430 | 430 | ||
431 | static const struct snd_kcontrol_new mc1r_amp_ctl = | 431 | static const struct snd_kcontrol_new mc1r_amp_ctl = |
432 | SOC_DAPM_SINGLE("Switch", 38, 5, 1, 0); | 432 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 5, 1, 0); |
433 | 433 | ||
434 | static const struct snd_kcontrol_new mc2_amp_ctl = | 434 | static const struct snd_kcontrol_new mc2_amp_ctl = |
435 | SOC_DAPM_SINGLE("Switch", 38, 9, 1, 0); | 435 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 9, 1, 0); |
436 | 436 | ||
437 | static const struct snd_kcontrol_new atx_amp_ctl = | 437 | static const struct snd_kcontrol_new atx_amp_ctl = |
438 | SOC_DAPM_SINGLE("Switch", 38, 11, 1, 0); | 438 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 11, 1, 0); |
439 | 439 | ||
440 | 440 | ||
441 | /* Virtual mux. The chip does the input selection automatically | 441 | /* Virtual mux. The chip does the input selection automatically |
@@ -461,22 +461,22 @@ static const struct snd_kcontrol_new right_input_mux = | |||
461 | SOC_DAPM_ENUM_VIRT("Route", adcr_enum); | 461 | SOC_DAPM_ENUM_VIRT("Route", adcr_enum); |
462 | 462 | ||
463 | static const struct snd_kcontrol_new samp_ctl = | 463 | static const struct snd_kcontrol_new samp_ctl = |
464 | SOC_DAPM_SINGLE("Switch", 36, 3, 1, 0); | 464 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 3, 1, 0); |
465 | 465 | ||
466 | static const struct snd_kcontrol_new lamp_ctl = | 466 | static const struct snd_kcontrol_new lamp_ctl = |
467 | SOC_DAPM_SINGLE("Switch", 36, 5, 1, 0); | 467 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 5, 1, 0); |
468 | 468 | ||
469 | static const struct snd_kcontrol_new hlamp_ctl = | 469 | static const struct snd_kcontrol_new hlamp_ctl = |
470 | SOC_DAPM_SINGLE("Switch", 36, 10, 1, 0); | 470 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 10, 1, 0); |
471 | 471 | ||
472 | static const struct snd_kcontrol_new hramp_ctl = | 472 | static const struct snd_kcontrol_new hramp_ctl = |
473 | SOC_DAPM_SINGLE("Switch", 36, 9, 1, 0); | 473 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 9, 1, 0); |
474 | 474 | ||
475 | static const struct snd_kcontrol_new llamp_ctl = | 475 | static const struct snd_kcontrol_new llamp_ctl = |
476 | SOC_DAPM_SINGLE("Switch", 36, 16, 1, 0); | 476 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 16, 1, 0); |
477 | 477 | ||
478 | static const struct snd_kcontrol_new lramp_ctl = | 478 | static const struct snd_kcontrol_new lramp_ctl = |
479 | SOC_DAPM_SINGLE("Switch", 36, 15, 1, 0); | 479 | SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 15, 1, 0); |
480 | 480 | ||
481 | static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = { | 481 | static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = { |
482 | /* Input */ | 482 | /* Input */ |
@@ -487,13 +487,13 @@ static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = { | |||
487 | SND_SOC_DAPM_INPUT("RXINL"), | 487 | SND_SOC_DAPM_INPUT("RXINL"), |
488 | SND_SOC_DAPM_INPUT("TXIN"), | 488 | SND_SOC_DAPM_INPUT("TXIN"), |
489 | 489 | ||
490 | SND_SOC_DAPM_SUPPLY("MC1 Bias", 38, 0, 0, NULL, 0), | 490 | SND_SOC_DAPM_SUPPLY("MC1 Bias", MC13783_AUDIO_TX, 0, 0, NULL, 0), |
491 | SND_SOC_DAPM_SUPPLY("MC2 Bias", 38, 1, 0, NULL, 0), | 491 | SND_SOC_DAPM_SUPPLY("MC2 Bias", MC13783_AUDIO_TX, 1, 0, NULL, 0), |
492 | 492 | ||
493 | SND_SOC_DAPM_SWITCH("MC1L Amp", 38, 7, 0, &mc1l_amp_ctl), | 493 | SND_SOC_DAPM_SWITCH("MC1L Amp", MC13783_AUDIO_TX, 7, 0, &mc1l_amp_ctl), |
494 | SND_SOC_DAPM_SWITCH("MC1R Amp", 38, 5, 0, &mc1r_amp_ctl), | 494 | SND_SOC_DAPM_SWITCH("MC1R Amp", MC13783_AUDIO_TX, 5, 0, &mc1r_amp_ctl), |
495 | SND_SOC_DAPM_SWITCH("MC2 Amp", 38, 9, 0, &mc2_amp_ctl), | 495 | SND_SOC_DAPM_SWITCH("MC2 Amp", MC13783_AUDIO_TX, 9, 0, &mc2_amp_ctl), |
496 | SND_SOC_DAPM_SWITCH("TXIN Amp", 38, 11, 0, &atx_amp_ctl), | 496 | SND_SOC_DAPM_SWITCH("TXIN Amp", MC13783_AUDIO_TX, 11, 0, &atx_amp_ctl), |
497 | 497 | ||
498 | SND_SOC_DAPM_VIRT_MUX("PGA Left Input Mux", SND_SOC_NOPM, 0, 0, | 498 | SND_SOC_DAPM_VIRT_MUX("PGA Left Input Mux", SND_SOC_NOPM, 0, 0, |
499 | &left_input_mux), | 499 | &left_input_mux), |
@@ -503,12 +503,12 @@ static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = { | |||
503 | SND_SOC_DAPM_PGA("PGA Left Input", SND_SOC_NOPM, 0, 0, NULL, 0), | 503 | SND_SOC_DAPM_PGA("PGA Left Input", SND_SOC_NOPM, 0, 0, NULL, 0), |
504 | SND_SOC_DAPM_PGA("PGA Right Input", SND_SOC_NOPM, 0, 0, NULL, 0), | 504 | SND_SOC_DAPM_PGA("PGA Right Input", SND_SOC_NOPM, 0, 0, NULL, 0), |
505 | 505 | ||
506 | SND_SOC_DAPM_ADC("ADC", "Capture", 40, 11, 0), | 506 | SND_SOC_DAPM_ADC("ADC", "Capture", MC13783_AUDIO_CODEC, 11, 0), |
507 | SND_SOC_DAPM_SUPPLY("ADC_Reset", 40, 15, 0, NULL, 0), | 507 | SND_SOC_DAPM_SUPPLY("ADC_Reset", MC13783_AUDIO_CODEC, 15, 0, NULL, 0), |
508 | 508 | ||
509 | /* Output */ | 509 | /* Output */ |
510 | SND_SOC_DAPM_SUPPLY("DAC_E", 41, 11, 0, NULL, 0), | 510 | SND_SOC_DAPM_SUPPLY("DAC_E", MC13783_AUDIO_DAC, 11, 0, NULL, 0), |
511 | SND_SOC_DAPM_SUPPLY("DAC_Reset", 41, 15, 0, NULL, 0), | 511 | SND_SOC_DAPM_SUPPLY("DAC_Reset", MC13783_AUDIO_DAC, 15, 0, NULL, 0), |
512 | SND_SOC_DAPM_OUTPUT("RXOUTL"), | 512 | SND_SOC_DAPM_OUTPUT("RXOUTL"), |
513 | SND_SOC_DAPM_OUTPUT("RXOUTR"), | 513 | SND_SOC_DAPM_OUTPUT("RXOUTR"), |
514 | SND_SOC_DAPM_OUTPUT("HSL"), | 514 | SND_SOC_DAPM_OUTPUT("HSL"), |
@@ -516,14 +516,18 @@ static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = { | |||
516 | SND_SOC_DAPM_OUTPUT("LSP"), | 516 | SND_SOC_DAPM_OUTPUT("LSP"), |
517 | SND_SOC_DAPM_OUTPUT("SP"), | 517 | SND_SOC_DAPM_OUTPUT("SP"), |
518 | 518 | ||
519 | SND_SOC_DAPM_SWITCH("Speaker Amp", 36, 3, 0, &samp_ctl), | 519 | SND_SOC_DAPM_SWITCH("Speaker Amp", MC13783_AUDIO_RX0, 3, 0, &samp_ctl), |
520 | SND_SOC_DAPM_SWITCH("Loudspeaker Amp", SND_SOC_NOPM, 0, 0, &lamp_ctl), | 520 | SND_SOC_DAPM_SWITCH("Loudspeaker Amp", SND_SOC_NOPM, 0, 0, &lamp_ctl), |
521 | SND_SOC_DAPM_SWITCH("Headset Amp Left", 36, 10, 0, &hlamp_ctl), | 521 | SND_SOC_DAPM_SWITCH("Headset Amp Left", MC13783_AUDIO_RX0, 10, 0, |
522 | SND_SOC_DAPM_SWITCH("Headset Amp Right", 36, 9, 0, &hramp_ctl), | 522 | &hlamp_ctl), |
523 | SND_SOC_DAPM_SWITCH("Line out Amp Left", 36, 16, 0, &llamp_ctl), | 523 | SND_SOC_DAPM_SWITCH("Headset Amp Right", MC13783_AUDIO_RX0, 9, 0, |
524 | SND_SOC_DAPM_SWITCH("Line out Amp Right", 36, 15, 0, &lramp_ctl), | 524 | &hramp_ctl), |
525 | SND_SOC_DAPM_DAC("DAC", "Playback", 36, 22, 0), | 525 | SND_SOC_DAPM_SWITCH("Line out Amp Left", MC13783_AUDIO_RX0, 16, 0, |
526 | SND_SOC_DAPM_PGA("DAC PGA", 37, 5, 0, NULL, 0), | 526 | &llamp_ctl), |
527 | SND_SOC_DAPM_SWITCH("Line out Amp Right", MC13783_AUDIO_RX0, 15, 0, | ||
528 | &lramp_ctl), | ||
529 | SND_SOC_DAPM_DAC("DAC", "Playback", MC13783_AUDIO_RX0, 22, 0), | ||
530 | SND_SOC_DAPM_PGA("DAC PGA", MC13783_AUDIO_RX1, 5, 0, NULL, 0), | ||
527 | }; | 531 | }; |
528 | 532 | ||
529 | static struct snd_soc_dapm_route mc13783_routes[] = { | 533 | static struct snd_soc_dapm_route mc13783_routes[] = { |
@@ -581,8 +585,6 @@ static int mc13783_probe(struct snd_soc_codec *codec) | |||
581 | { | 585 | { |
582 | struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec); | 586 | struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec); |
583 | 587 | ||
584 | codec->control_data = priv->mc13xxx; | ||
585 | |||
586 | mc13xxx_lock(priv->mc13xxx); | 588 | mc13xxx_lock(priv->mc13xxx); |
587 | 589 | ||
588 | /* these are the reset values */ | 590 | /* these are the reset values */ |