summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorDavid Ward <david.ward@gatech.edu>2021-04-18 15:46:55 +0200
committerMark Brown <broonie@kernel.org>2021-04-19 17:53:23 +0200
commitb15c3ea7e0d2c53b33adc8ca0896de378d6df853 (patch)
treeba24b528fe587d40641e9fd8a4cc63ac44b94af7 /sound/soc
parentASoC: rt286: Make RT286_SET_GPIO_* readable and writable (diff)
downloadlinux-b15c3ea7e0d2c53b33adc8ca0896de378d6df853.tar.xz
linux-b15c3ea7e0d2c53b33adc8ca0896de378d6df853.zip
ASoC: rt286: Configure combo jack for headphones
During jack detection, the combo jack is configured for a CTIA headset, and then for an OMTP headset, while sensing the mic connection. If a mic is not found in either case, the combo jack should be re-configured for headphones only. This is consistent with the HDA driver behavior. Signed-off-by: David Ward <david.ward@gatech.edu> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210418134658.4333-3-david.ward@gatech.edu Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/rt286.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index e16e7237156f..45e4a48ef5bf 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -255,11 +255,16 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
msleep(300);
regmap_read(rt286->regmap,
RT286_CBJ_CTRL2, &val);
- if (0x0070 == (val & 0x0070))
+ if (0x0070 == (val & 0x0070)) {
*mic = true;
- else
+ } else {
*mic = false;
+ regmap_update_bits(rt286->regmap,
+ RT286_CBJ_CTRL1,
+ 0xfcc0, 0xc400);
+ }
}
+
regmap_update_bits(rt286->regmap,
RT286_DC_GAIN, 0x200, 0x0);