diff mbox series

[3/3] ASoc: rt286: Handle headphones in combo jack correctly

Message ID 20210308221817.12908-4-david.ward@gatech.edu
State New
Headers show
Series ASoc: rt286: Fix combojack detection for ALC3263 (Dell XPS 13 9343) | expand

Commit Message

David Ward March 8, 2021, 10:18 p.m. UTC
If headphones are detected in the combo jack instead of a headset, set the
index register RT286_CBJ_CTRL1 to the correct value (from the HDA driver).

Signed-off-by: David Ward <david.ward@gatech.edu>
---
 sound/soc/codecs/rt286.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index c0129edf5993..7e67165a43e6 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -260,6 +260,12 @@  static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
 				else
 					*mic = false;
 			}
+
+			if (!*mic) {
+				regmap_update_bits(rt286->regmap,
+					RT286_CBJ_CTRL1, 0xfcc0, 0xc400);
+			}
+
 			regmap_update_bits(rt286->regmap,
 				RT286_DC_GAIN, 0x200, 0x0);