Skip to content

Commit 8a655ce

Browse files
Michael-zy2000broonie
authored andcommitted
ASoC: codecs: ES8326: Solve error interruption issue
We got an error report about headphone type detection and button detection. We fixed the headphone type detection error by adjusting the debounce timer configuration. And we fixed the button detection error by disabling the button detection feature when the headphone are unplugged and enabling it when headphone are plugged in. Signed-off-by: Zhang Yi <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2c603a4 commit 8a655ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sound/soc/codecs/es8326.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ static void es8326_jack_detect_handler(struct work_struct *work)
843843
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01);
844844
regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x0a);
845845
regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x03);
846+
regmap_write(es8326->regmap, ES8326_INT_SOURCE, ES8326_INT_SRC_PIN9);
846847
/*
847848
* Inverted HPJACK_POL bit to trigger one IRQ to double check HP Removal event
848849
*/
@@ -865,6 +866,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
865866
* set auto-check mode, then restart jack_detect_work after 400ms.
866867
* Don't report jack status.
867868
*/
869+
regmap_write(es8326->regmap, ES8326_INT_SOURCE,
870+
(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
868871
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01);
869872
es8326_enable_micbias(es8326->component);
870873
usleep_range(50000, 70000);
@@ -987,7 +990,7 @@ static int es8326_resume(struct snd_soc_component *component)
987990
regmap_write(es8326->regmap, ES8326_VMIDSEL, 0x0E);
988991
regmap_write(es8326->regmap, ES8326_ANA_LP, 0xf0);
989992
usleep_range(10000, 15000);
990-
regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xe9);
993+
regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xd9);
991994
regmap_write(es8326->regmap, ES8326_ANA_MICBIAS, 0xcb);
992995
/* set headphone default type and detect pin */
993996
regmap_write(es8326->regmap, ES8326_HPDET_TYPE, 0x83);
@@ -1038,8 +1041,7 @@ static int es8326_resume(struct snd_soc_component *component)
10381041
es8326_enable_micbias(es8326->component);
10391042
usleep_range(50000, 70000);
10401043
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x00);
1041-
regmap_write(es8326->regmap, ES8326_INT_SOURCE,
1042-
(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
1044+
regmap_write(es8326->regmap, ES8326_INT_SOURCE, ES8326_INT_SRC_PIN9);
10431045
regmap_write(es8326->regmap, ES8326_INTOUT_IO,
10441046
es8326->interrupt_clk);
10451047
regmap_write(es8326->regmap, ES8326_SDINOUT1_IO,

0 commit comments

Comments
 (0)