Skip to content

Commit e3dd442

Browse files
oder-chioubroonie
authored andcommitted
ASoC: rt5640: Fix the wrong state of the JD in the HDA header
The patch fixes the wrong state of the JD with 1M pull up resistor in the HDA header. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20211201095629.21818-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent b80155f commit e3dd442

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

sound/soc/codecs/rt5640.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ static int rt5640_set_bias_level(struct snd_soc_component *component,
19731973
RT5640_PWR_FV1 | RT5640_PWR_FV2,
19741974
RT5640_PWR_FV1 | RT5640_PWR_FV2);
19751975
snd_soc_component_update_bits(component, RT5640_DUMMY1,
1976-
0x0301, 0x0301);
1976+
0x1, 0x1);
19771977
snd_soc_component_update_bits(component, RT5640_MICBIAS,
19781978
0x0030, 0x0030);
19791979
}
@@ -2533,7 +2533,7 @@ static void rt5640_enable_hda_jack_detect(
25332533
snd_soc_component_update_bits(component, RT5640_GPIO_CTRL3,
25342534
RT5640_GP1_PF_MASK, RT5640_GP1_PF_OUT);
25352535

2536-
snd_soc_component_update_bits(component, RT5640_DUMMY1, 0x700, 0x300);
2536+
snd_soc_component_update_bits(component, RT5640_DUMMY1, 0x400, 0x0);
25372537

25382538
rt5640->jack = jack;
25392539

@@ -2651,13 +2651,16 @@ static int rt5640_probe(struct snd_soc_component *component)
26512651

26522652
if (device_property_read_u32(component->dev,
26532653
"realtek,jack-detect-source", &val) == 0) {
2654-
if (val <= RT5640_JD_SRC_GPIO4)
2654+
if (val <= RT5640_JD_SRC_GPIO4) {
26552655
rt5640->jd_src = val << RT5640_JD_SFT;
2656-
else if (val == RT5640_JD_SRC_HDA_HEADER)
2656+
} else if (val == RT5640_JD_SRC_HDA_HEADER) {
26572657
rt5640->jd_src = RT5640_JD_SRC_HDA_HEADER;
2658-
else
2658+
snd_soc_component_update_bits(component, RT5640_DUMMY1,
2659+
0x0300, 0x0);
2660+
} else {
26592661
dev_warn(component->dev, "Warning: Invalid jack-detect-source value: %d, leaving jack-detect disabled\n",
26602662
val);
2663+
}
26612664
}
26622665

26632666
if (!device_property_read_bool(component->dev, "realtek,jack-detect-not-inverted"))

0 commit comments

Comments
 (0)