Skip to content

Commit 9bc5fd7

Browse files
shumingfanbroonie
authored andcommitted
ASoC: rt5682: fix the pop noise while OMTP type headset plugin
To turn the headphone output switch off during jack type detection, it could avoid the pop noise when jack type switches to OMTP type. Signed-off-by: Shuming Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 15217d1 commit 9bc5fd7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sound/soc/codecs/rt5682.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,9 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
932932
RT5682_PWR_ANLG_1, RT5682_PWR_FV2, RT5682_PWR_FV2);
933933
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
934934
RT5682_PWR_CBJ, RT5682_PWR_CBJ);
935-
935+
snd_soc_component_update_bits(component,
936+
RT5682_HP_CHARGE_PUMP_1,
937+
RT5682_OSW_L_MASK | RT5682_OSW_R_MASK, 0);
936938
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
937939
RT5682_TRIG_JD_MASK, RT5682_TRIG_JD_HIGH);
938940

@@ -956,6 +958,11 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
956958
rt5682->jack_type = SND_JACK_HEADPHONE;
957959
break;
958960
}
961+
962+
snd_soc_component_update_bits(component,
963+
RT5682_HP_CHARGE_PUMP_1,
964+
RT5682_OSW_L_MASK | RT5682_OSW_R_MASK,
965+
RT5682_OSW_L_EN | RT5682_OSW_R_EN);
959966
} else {
960967
rt5682_enable_push_button_irq(component, false);
961968
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,

0 commit comments

Comments
 (0)