Skip to content

Commit d5e8936

Browse files
povikmarcan
authored andcommitted
ASoC: cs42l84: Adjust mic-detection voltage threshold
Raise the mic-detection voltage threshold to address some mics not getting detected. Signed-off-by: Martin Povišer <[email protected]>
1 parent 671976e commit d5e8936

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

sound/soc/codecs/cs42l84.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,10 @@ static void cs42l84_setup_plug_detect(struct cs42l84_private *cs42l84)
878878
(CS42L84_TS_PLUG | CS42L84_TS_UNPLUG)) >>
879879
CS42L84_TS_PLUG_SHIFT;
880880

881-
/* Set up mic detection */
881+
/* Set mic-detection threshold */
882+
regmap_update_bits(cs42l84->regmap,
883+
CS42L84_MIC_DET_CTL1, CS42L84_MIC_DET_CTL1_HS_DET_LEVEL,
884+
FIELD_PREP(CS42L84_MIC_DET_CTL1_HS_DET_LEVEL, 0x2c)); /* ~1.9 V */
882885

883886
/* Disconnect HSBIAS (initially) */
884887
regmap_write(cs42l84->regmap,

sound/soc/codecs/cs42l84.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
#define CS42L84_MISC_DET_CTL_HSBIAS_CTL GENMASK(2, 1)
107107
#define CS42L84_MISC_DET_CTL_PDN_MIC_LVL_DET BIT(0)
108108

109+
#define CS42L84_MIC_DET_CTL1 0x1475
110+
#define CS42L84_MIC_DET_CTL1_HS_DET_LEVEL GENMASK(5, 0)
111+
109112
#define CS42L84_MIC_DET_CTL4 0x1477
110113
#define CS42L84_MIC_DET_CTL4_LATCH_TO_VP BIT(1)
111114

0 commit comments

Comments
 (0)