Skip to content

Commit 1dd28fd

Browse files
Jack Yubroonie
authored andcommitted
ASoC: rt5682s: Adjust SAR ADC button mode to fix noise issue
Adjust register settings for SAR adc button detection mode to fix noise issue in headset. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://patch.msgid.link/766cd1d2dd7a403ba65bb4cc44845f71@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f7a5195 commit 1dd28fd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

sound/soc/codecs/rt5682s.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,15 @@ static void rt5682s_sar_power_mode(struct snd_soc_component *component, int mode
653653
switch (mode) {
654654
case SAR_PWR_SAVING:
655655
snd_soc_component_update_bits(component, RT5682S_CBJ_CTRL_3,
656-
RT5682S_CBJ_IN_BUF_MASK, RT5682S_CBJ_IN_BUF_DIS);
656+
RT5682S_CBJ_IN_BUF_MASK, RT5682S_CBJ_IN_BUF_EN);
657657
snd_soc_component_update_bits(component, RT5682S_CBJ_CTRL_1,
658-
RT5682S_MB1_PATH_MASK | RT5682S_MB2_PATH_MASK,
659-
RT5682S_CTRL_MB1_REG | RT5682S_CTRL_MB2_REG);
658+
RT5682S_MB1_PATH_MASK | RT5682S_MB2_PATH_MASK |
659+
RT5682S_VREF_POW_MASK, RT5682S_CTRL_MB1_FSM |
660+
RT5682S_CTRL_MB2_FSM | RT5682S_VREF_POW_FSM);
660661
snd_soc_component_update_bits(component, RT5682S_SAR_IL_CMD_1,
661662
RT5682S_SAR_BUTDET_MASK | RT5682S_SAR_BUTDET_POW_MASK |
662663
RT5682S_SAR_SEL_MB1_2_CTL_MASK, RT5682S_SAR_BUTDET_DIS |
663-
RT5682S_SAR_BUTDET_POW_SAV | RT5682S_SAR_SEL_MB1_2_MANU);
664+
RT5682S_SAR_BUTDET_POW_NORM | RT5682S_SAR_SEL_MB1_2_MANU);
664665
usleep_range(5000, 5500);
665666
snd_soc_component_update_bits(component, RT5682S_SAR_IL_CMD_1,
666667
RT5682S_SAR_BUTDET_MASK, RT5682S_SAR_BUTDET_EN);
@@ -688,7 +689,7 @@ static void rt5682s_sar_power_mode(struct snd_soc_component *component, int mode
688689
snd_soc_component_update_bits(component, RT5682S_SAR_IL_CMD_1,
689690
RT5682S_SAR_BUTDET_MASK | RT5682S_SAR_BUTDET_POW_MASK |
690691
RT5682S_SAR_SEL_MB1_2_CTL_MASK, RT5682S_SAR_BUTDET_DIS |
691-
RT5682S_SAR_BUTDET_POW_SAV | RT5682S_SAR_SEL_MB1_2_MANU);
692+
RT5682S_SAR_BUTDET_POW_NORM | RT5682S_SAR_SEL_MB1_2_MANU);
692693
break;
693694
default:
694695
dev_err(component->dev, "Invalid SAR Power mode: %d\n", mode);
@@ -725,7 +726,7 @@ static void rt5682s_disable_push_button_irq(struct snd_soc_component *component)
725726
snd_soc_component_update_bits(component, RT5682S_SAR_IL_CMD_1,
726727
RT5682S_SAR_BUTDET_MASK | RT5682S_SAR_BUTDET_POW_MASK |
727728
RT5682S_SAR_SEL_MB1_2_CTL_MASK, RT5682S_SAR_BUTDET_DIS |
728-
RT5682S_SAR_BUTDET_POW_SAV | RT5682S_SAR_SEL_MB1_2_MANU);
729+
RT5682S_SAR_BUTDET_POW_NORM | RT5682S_SAR_SEL_MB1_2_MANU);
729730
}
730731

731732
/**
@@ -786,7 +787,7 @@ static int rt5682s_headset_detect(struct snd_soc_component *component, int jack_
786787
jack_type = SND_JACK_HEADSET;
787788
snd_soc_component_write(component, RT5682S_SAR_IL_CMD_3, 0x024c);
788789
snd_soc_component_update_bits(component, RT5682S_CBJ_CTRL_1,
789-
RT5682S_FAST_OFF_MASK, RT5682S_FAST_OFF_EN);
790+
RT5682S_FAST_OFF_MASK, RT5682S_FAST_OFF_DIS);
790791
snd_soc_component_update_bits(component, RT5682S_SAR_IL_CMD_1,
791792
RT5682S_SAR_SEL_MB1_2_MASK, val << RT5682S_SAR_SEL_MB1_2_SFT);
792793
rt5682s_enable_push_button_irq(component);
@@ -966,7 +967,7 @@ static int rt5682s_set_jack_detect(struct snd_soc_component *component,
966967
RT5682S_EMB_JD_MASK | RT5682S_DET_TYPE |
967968
RT5682S_POL_FAST_OFF_MASK | RT5682S_MIC_CAP_MASK,
968969
RT5682S_EMB_JD_EN | RT5682S_DET_TYPE |
969-
RT5682S_POL_FAST_OFF_HIGH | RT5682S_MIC_CAP_HS);
970+
RT5682S_POL_FAST_OFF_LOW | RT5682S_MIC_CAP_HS);
970971
regmap_update_bits(rt5682s->regmap, RT5682S_SAR_IL_CMD_1,
971972
RT5682S_SAR_POW_MASK, RT5682S_SAR_POW_EN);
972973
regmap_update_bits(rt5682s->regmap, RT5682S_GPIO_CTRL_1,

0 commit comments

Comments
 (0)