diff options
| -rw-r--r-- | sound/soc/codecs/rt286.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 1d1c7f8a9af2..847cc4b9bee5 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c | |||
| @@ -417,6 +417,8 @@ static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0); | |||
| 417 | static const struct snd_kcontrol_new rt286_snd_controls[] = { | 417 | static const struct snd_kcontrol_new rt286_snd_controls[] = { |
| 418 | SOC_DOUBLE_R_TLV("DAC0 Playback Volume", RT286_DACL_GAIN, | 418 | SOC_DOUBLE_R_TLV("DAC0 Playback Volume", RT286_DACL_GAIN, |
| 419 | RT286_DACR_GAIN, 0, 0x7f, 0, out_vol_tlv), | 419 | RT286_DACR_GAIN, 0, 0x7f, 0, out_vol_tlv), |
| 420 | SOC_DOUBLE_R("ADC0 Capture Switch", RT286_ADCL_GAIN, | ||
| 421 | RT286_ADCR_GAIN, 7, 1, 1), | ||
| 420 | SOC_DOUBLE_R_TLV("ADC0 Capture Volume", RT286_ADCL_GAIN, | 422 | SOC_DOUBLE_R_TLV("ADC0 Capture Volume", RT286_ADCL_GAIN, |
| 421 | RT286_ADCR_GAIN, 0, 0x7f, 0, out_vol_tlv), | 423 | RT286_ADCR_GAIN, 0, 0x7f, 0, out_vol_tlv), |
| 422 | SOC_SINGLE_TLV("AMIC Volume", RT286_MIC_GAIN, | 424 | SOC_SINGLE_TLV("AMIC Volume", RT286_MIC_GAIN, |
| @@ -538,32 +540,6 @@ static int rt286_set_dmic1_event(struct snd_soc_dapm_widget *w, | |||
| 538 | return 0; | 540 | return 0; |
| 539 | } | 541 | } |
| 540 | 542 | ||
| 541 | static int rt286_adc_event(struct snd_soc_dapm_widget *w, | ||
| 542 | struct snd_kcontrol *kcontrol, int event) | ||
| 543 | { | ||
| 544 | struct snd_soc_codec *codec = w->codec; | ||
| 545 | unsigned int nid; | ||
| 546 | |||
| 547 | nid = (w->reg >> 20) & 0xff; | ||
| 548 | |||
| 549 | switch (event) { | ||
| 550 | case SND_SOC_DAPM_POST_PMU: | ||
| 551 | snd_soc_update_bits(codec, | ||
| 552 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0), | ||
| 553 | 0x7080, 0x7000); | ||
| 554 | break; | ||
| 555 | case SND_SOC_DAPM_PRE_PMD: | ||
| 556 | snd_soc_update_bits(codec, | ||
| 557 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0), | ||
| 558 | 0x7080, 0x7080); | ||
| 559 | break; | ||
| 560 | default: | ||
| 561 | return 0; | ||
| 562 | } | ||
| 563 | |||
| 564 | return 0; | ||
| 565 | } | ||
| 566 | |||
| 567 | static int rt286_vref_event(struct snd_soc_dapm_widget *w, | 543 | static int rt286_vref_event(struct snd_soc_dapm_widget *w, |
| 568 | struct snd_kcontrol *kcontrol, int event) | 544 | struct snd_kcontrol *kcontrol, int event) |
| 569 | { | 545 | { |
| @@ -667,12 +643,10 @@ static const struct snd_soc_dapm_widget rt286_dapm_widgets[] = { | |||
| 667 | SND_SOC_DAPM_ADC("ADC 1", NULL, SND_SOC_NOPM, 0, 0), | 643 | SND_SOC_DAPM_ADC("ADC 1", NULL, SND_SOC_NOPM, 0, 0), |
| 668 | 644 | ||
| 669 | /* ADC Mux */ | 645 | /* ADC Mux */ |
| 670 | SND_SOC_DAPM_MUX_E("ADC 0 Mux", RT286_SET_POWER(RT286_ADC_IN1), 0, 1, | 646 | SND_SOC_DAPM_MUX("ADC 0 Mux", RT286_SET_POWER(RT286_ADC_IN1), 0, 1, |
| 671 | &rt286_adc0_mux, rt286_adc_event, SND_SOC_DAPM_PRE_PMD | | 647 | &rt286_adc0_mux), |
| 672 | SND_SOC_DAPM_POST_PMU), | 648 | SND_SOC_DAPM_MUX("ADC 1 Mux", RT286_SET_POWER(RT286_ADC_IN2), 0, 1, |
| 673 | SND_SOC_DAPM_MUX_E("ADC 1 Mux", RT286_SET_POWER(RT286_ADC_IN2), 0, 1, | 649 | &rt286_adc1_mux), |
| 674 | &rt286_adc1_mux, rt286_adc_event, SND_SOC_DAPM_PRE_PMD | | ||
| 675 | SND_SOC_DAPM_POST_PMU), | ||
| 676 | 650 | ||
| 677 | /* Audio Interface */ | 651 | /* Audio Interface */ |
| 678 | SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), | 652 | SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), |
