diff options
author | Oder Chiou <oder_chiou@realtek.com> | 2014-09-18 02:45:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-22 20:52:45 -0400 |
commit | 90bdbb46f41c9fa670d7b0709e0c8a92ad82bdfe (patch) | |
tree | 1ca0ab1f174ebd95b470a2b7f9a73abea8c342cb /sound/soc/codecs | |
parent | 48561afef401876b4b0e35a303d89884c10fe468 (diff) |
ASoC: rt5677: Add sidetone function
Add sidetone function
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/rt5677.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/rt5677.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 1d4719f5fe75..4a0f3dfb2a47 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c | |||
@@ -541,6 +541,7 @@ static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); | |||
541 | static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); | 541 | static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); |
542 | static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); | 542 | static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); |
543 | static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); | 543 | static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); |
544 | static const DECLARE_TLV_DB_SCALE(st_vol_tlv, -4650, 150, 0); | ||
544 | 545 | ||
545 | /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ | 546 | /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ |
546 | static unsigned int bst_tlv[] = { | 547 | static unsigned int bst_tlv[] = { |
@@ -605,6 +606,10 @@ static const struct snd_kcontrol_new rt5677_snd_controls[] = { | |||
605 | RT5677_MONO_ADC_L_VOL_SFT, RT5677_MONO_ADC_R_VOL_SFT, 127, 0, | 606 | RT5677_MONO_ADC_L_VOL_SFT, RT5677_MONO_ADC_R_VOL_SFT, 127, 0, |
606 | adc_vol_tlv), | 607 | adc_vol_tlv), |
607 | 608 | ||
609 | /* Sidetone Control */ | ||
610 | SOC_SINGLE_TLV("Sidetone Volume", RT5677_SIDETONE_CTRL, | ||
611 | RT5677_ST_VOL_SFT, 31, 0, st_vol_tlv), | ||
612 | |||
608 | /* ADC Boost Volume Control */ | 613 | /* ADC Boost Volume Control */ |
609 | SOC_DOUBLE_TLV("STO1 ADC Boost Volume", RT5677_STO1_2_ADC_BST, | 614 | SOC_DOUBLE_TLV("STO1 ADC Boost Volume", RT5677_STO1_2_ADC_BST, |
610 | RT5677_STO1_ADC_L_BST_SFT, RT5677_STO1_ADC_R_BST_SFT, 3, 0, | 615 | RT5677_STO1_ADC_L_BST_SFT, RT5677_STO1_ADC_R_BST_SFT, 3, 0, |
@@ -1993,6 +1998,9 @@ static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = { | |||
1993 | /* Sidetone Mux */ | 1998 | /* Sidetone Mux */ |
1994 | SND_SOC_DAPM_MUX("Sidetone Mux", SND_SOC_NOPM, 0, 0, | 1999 | SND_SOC_DAPM_MUX("Sidetone Mux", SND_SOC_NOPM, 0, 0, |
1995 | &rt5677_sidetone_mux), | 2000 | &rt5677_sidetone_mux), |
2001 | SND_SOC_DAPM_SUPPLY("Sidetone Power", RT5677_SIDETONE_CTRL, | ||
2002 | RT5677_ST_EN_SFT, 0, NULL, 0), | ||
2003 | |||
1996 | /* VAD Mux*/ | 2004 | /* VAD Mux*/ |
1997 | SND_SOC_DAPM_MUX("VAD ADC Mux", SND_SOC_NOPM, 0, 0, | 2005 | SND_SOC_DAPM_MUX("VAD ADC Mux", SND_SOC_NOPM, 0, 0, |
1998 | &rt5677_vad_src_mux), | 2006 | &rt5677_vad_src_mux), |
@@ -2704,6 +2712,7 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = { | |||
2704 | { "Sidetone Mux", "DMIC4 L", "DMIC L4" }, | 2712 | { "Sidetone Mux", "DMIC4 L", "DMIC L4" }, |
2705 | { "Sidetone Mux", "ADC1", "ADC 1" }, | 2713 | { "Sidetone Mux", "ADC1", "ADC 1" }, |
2706 | { "Sidetone Mux", "ADC2", "ADC 2" }, | 2714 | { "Sidetone Mux", "ADC2", "ADC 2" }, |
2715 | { "Sidetone Mux", NULL, "Sidetone Power" }, | ||
2707 | 2716 | ||
2708 | { "Stereo DAC MIXL", "ST L Switch", "Sidetone Mux" }, | 2717 | { "Stereo DAC MIXL", "ST L Switch", "Sidetone Mux" }, |
2709 | { "Stereo DAC MIXL", "DAC1 L Switch", "DAC1 MIXL" }, | 2718 | { "Stereo DAC MIXL", "DAC1 L Switch", "DAC1 MIXL" }, |
diff --git a/sound/soc/codecs/rt5677.h b/sound/soc/codecs/rt5677.h index b61b72cfcbd7..1fe88727a063 100644 --- a/sound/soc/codecs/rt5677.h +++ b/sound/soc/codecs/rt5677.h | |||
@@ -382,6 +382,10 @@ | |||
382 | #define RT5677_ST_SEL_SFT 9 | 382 | #define RT5677_ST_SEL_SFT 9 |
383 | #define RT5677_ST_EN (0x1 << 6) | 383 | #define RT5677_ST_EN (0x1 << 6) |
384 | #define RT5677_ST_EN_SFT 6 | 384 | #define RT5677_ST_EN_SFT 6 |
385 | #define RT5677_ST_GAIN (0x1 << 5) | ||
386 | #define RT5677_ST_GAIN_SFT 5 | ||
387 | #define RT5677_ST_VOL_MASK (0x1f << 0) | ||
388 | #define RT5677_ST_VOL_SFT 0 | ||
385 | 389 | ||
386 | /* Analog DAC1/2/3 Source Control (0x15) */ | 390 | /* Analog DAC1/2/3 Source Control (0x15) */ |
387 | #define RT5677_ANA_DAC3_SRC_SEL_MASK (0x3 << 4) | 391 | #define RT5677_ANA_DAC3_SRC_SEL_MASK (0x3 << 4) |