Skip to content

Commit 9600181

Browse files
committed
ASoC: cs42l84: Double tip and ring sense debounce timings
There are user reports of unreliable headset detection on Macbooks with cs42l84 jack codecs like in #294. One way to reproduce this is to insert a headset jack not fully but only until tip sense tiggers. The headset/mic detection fails and is not retried once the jack is fully inserted. This might not be related to the issue the user sees. Another possiblility is that the headset detection parameters / algorithm differs from macos and doesn't detect this particular headset reliably. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent fca8dbb commit 9600181

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

sound/soc/codecs/cs42l84.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,14 +906,14 @@ static void cs42l84_setup_plug_detect(struct cs42l84_private *cs42l84)
906906
CS42L84_RING_SENSE_CTL_INV | CS42L84_RING_SENSE_CTL_UNK1 |
907907
CS42L84_RING_SENSE_CTL_RISETIME | CS42L84_RING_SENSE_CTL_FALLTIME,
908908
CS42L84_RING_SENSE_CTL_INV | CS42L84_RING_SENSE_CTL_UNK1 |
909-
FIELD_PREP(CS42L84_RING_SENSE_CTL_RISETIME, CS42L84_DEBOUNCE_TIME_125MS) |
910-
FIELD_PREP(CS42L84_RING_SENSE_CTL_FALLTIME, CS42L84_DEBOUNCE_TIME_125MS));
909+
FIELD_PREP(CS42L84_RING_SENSE_CTL_RISETIME, CS42L84_DEBOUNCE_TIME_250MS) |
910+
FIELD_PREP(CS42L84_RING_SENSE_CTL_FALLTIME, CS42L84_DEBOUNCE_TIME_250MS));
911911
regmap_update_bits(cs42l84->regmap, CS42L84_TIP_SENSE_CTL,
912912
CS42L84_TIP_SENSE_CTL_INV |
913913
CS42L84_TIP_SENSE_CTL_RISETIME | CS42L84_TIP_SENSE_CTL_FALLTIME,
914914
CS42L84_TIP_SENSE_CTL_INV |
915-
FIELD_PREP(CS42L84_TIP_SENSE_CTL_RISETIME, CS42L84_DEBOUNCE_TIME_500MS) |
916-
FIELD_PREP(CS42L84_TIP_SENSE_CTL_FALLTIME, CS42L84_DEBOUNCE_TIME_125MS));
915+
FIELD_PREP(CS42L84_TIP_SENSE_CTL_RISETIME, CS42L84_DEBOUNCE_TIME_1000MS) |
916+
FIELD_PREP(CS42L84_TIP_SENSE_CTL_FALLTIME, CS42L84_DEBOUNCE_TIME_250MS));
917917
regmap_update_bits(cs42l84->regmap, CS42L84_MSM_BLOCK_EN3,
918918
CS42L84_MSM_BLOCK_EN3_TR_SENSE,
919919
CS42L84_MSM_BLOCK_EN3_TR_SENSE);

sound/soc/codecs/cs42l84.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@
208208
#define CS42L84_ASP_TX_CH2_WIDTH 0x506e
209209

210210
#define CS42L84_DEBOUNCE_TIME_125MS 0b001
211+
#define CS42L84_DEBOUNCE_TIME_250MS 0b010
211212
#define CS42L84_DEBOUNCE_TIME_500MS 0b011
213+
#define CS42L84_DEBOUNCE_TIME_750MS 0b100
214+
#define CS42L84_DEBOUNCE_TIME_1000MS 0b101
212215

213216
#define CS42L84_BOOT_TIME_US 3000
214217
#define CS42L84_CLOCK_SWITCH_DELAY_US 150

0 commit comments

Comments
 (0)