Skip to content

Commit b7c4098

Browse files
Michael-zy2000broonie
authored andcommitted
ASoC: codecs: ES8326: Solve headphone detection issue
When switching between OMTP and CTIA headset, we can hear pop noise. To solve this issue, We modified the configuration for headphone detection Signed-off-by: Zhang Yi <zhangyi@everest-semi.com> Link: https://msgid.link/r/20240604021946.2911-1-zhangyi@everest-semi.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent afe3772 commit b7c4098

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sound/soc/codecs/es8326.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,12 +857,16 @@ static void es8326_jack_detect_handler(struct work_struct *work)
857857
* set auto-check mode, then restart jack_detect_work after 400ms.
858858
* Don't report jack status.
859859
*/
860-
regmap_write(es8326->regmap, ES8326_INT_SOURCE,
861-
(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
860+
regmap_write(es8326->regmap, ES8326_INT_SOURCE, 0x00);
862861
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01);
862+
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x10, 0x00);
863863
es8326_enable_micbias(es8326->component);
864864
usleep_range(50000, 70000);
865865
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x00);
866+
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x10, 0x10);
867+
usleep_range(50000, 70000);
868+
regmap_write(es8326->regmap, ES8326_INT_SOURCE,
869+
(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
866870
regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x1f);
867871
regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x08);
868872
queue_delayed_work(system_wq, &es8326->jack_detect_work,

0 commit comments

Comments
 (0)