summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5682.c
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2018-07-03 13:07:25 +0800
committerMark Brown <broonie@kernel.org>2018-07-03 16:00:21 +0100
commit2daf3d9962c5a11fb79fe17bae03125df5d60236 (patch)
tree6bb262a36b8848a3caf2752ff4c4761b18677a59 /sound/soc/codecs/rt5682.c
parent424e2b4b3521334812d833eef27df77671428698 (diff)
downloadtalos-op-linux-2daf3d9962c5a11fb79fe17bae03125df5d60236.tar.gz
talos-op-linux-2daf3d9962c5a11fb79fe17bae03125df5d60236.zip
ASoC: rt5682: add button detection mode control
We are currently using power saving mode for button detection. However, it will impact the headset recording performance. This patch will switch button detection to normal mode in capture and switch to power saving mode in the end of capture. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5682.c')
-rw-r--r--sound/soc/codecs/rt5682.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index baad177908ab..640d400ca013 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -857,6 +857,8 @@ static int rt5682_button_detect(struct snd_soc_component *component)
btn_type = val & 0xfff0;
snd_soc_component_write(component, RT5682_4BTN_IL_CMD_1, val);
pr_debug("%s btn_type=%x\n", __func__, btn_type);
+ snd_soc_component_update_bits(component,
+ RT5682_SAR_IL_CMD_2, 0x10, 0x10);
return btn_type;
}
@@ -1645,6 +1647,8 @@ static const struct snd_soc_dapm_widget rt5682_dapm_widgets[] = {
SND_SOC_DAPM_MIXER("Stereo1 ADC MIXR", RT5682_STO1_ADC_DIG_VOL,
RT5682_R_MUTE_SFT, 1, rt5682_sto1_adc_r_mix,
ARRAY_SIZE(rt5682_sto1_adc_r_mix)),
+ SND_SOC_DAPM_SUPPLY("BTN Detection Mode", RT5682_SAR_IL_CMD_1,
+ 14, 1, NULL, 0),
/* ADC PGA */
SND_SOC_DAPM_PGA("Stereo1 ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
@@ -1807,6 +1811,8 @@ static const struct snd_soc_dapm_route rt5682_dapm_routes[] = {
{"Stereo1 ADC MIXR", "ADC2 Switch", "Stereo1 ADC R2 Mux"},
{"Stereo1 ADC MIXR", NULL, "ADC Stereo1 Filter"},
+ {"ADC Stereo1 Filter", NULL, "BTN Detection Mode"},
+
{"Stereo1 ADC MIX", NULL, "Stereo1 ADC MIXL"},
{"Stereo1 ADC MIX", NULL, "Stereo1 ADC MIXR"},
OpenPOWER on IntegriCloud