diff options
author | oder_chiou@realtek.com <oder_chiou@realtek.com> | 2017-12-13 20:54:07 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-12-14 06:13:33 -0500 |
commit | 958d022e326810fd762505bd02007aced79ffcbc (patch) | |
tree | 8e5f58ada4b53a80738c7f671f1ee6a777d8012f | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
ASoC: rt5663: Fix the wrong result of the first jack detection
In the first jack detection while booting, the result will always show as
headset, even we insert the headphone.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/rt5663.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/rt5663.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c index b036c9dc0c8c..d329bf719d80 100644 --- a/sound/soc/codecs/rt5663.c +++ b/sound/soc/codecs/rt5663.c | |||
@@ -1560,6 +1560,10 @@ static int rt5663_jack_detect(struct snd_soc_codec *codec, int jack_insert) | |||
1560 | RT5663_IRQ_POW_SAV_MASK, RT5663_IRQ_POW_SAV_EN); | 1560 | RT5663_IRQ_POW_SAV_MASK, RT5663_IRQ_POW_SAV_EN); |
1561 | snd_soc_update_bits(codec, RT5663_IRQ_1, | 1561 | snd_soc_update_bits(codec, RT5663_IRQ_1, |
1562 | RT5663_EN_IRQ_JD1_MASK, RT5663_EN_IRQ_JD1_EN); | 1562 | RT5663_EN_IRQ_JD1_MASK, RT5663_EN_IRQ_JD1_EN); |
1563 | snd_soc_update_bits(codec, RT5663_EM_JACK_TYPE_1, | ||
1564 | RT5663_EM_JD_MASK, RT5663_EM_JD_RST); | ||
1565 | snd_soc_update_bits(codec, RT5663_EM_JACK_TYPE_1, | ||
1566 | RT5663_EM_JD_MASK, RT5663_EM_JD_NOR); | ||
1563 | 1567 | ||
1564 | while (true) { | 1568 | while (true) { |
1565 | regmap_read(rt5663->regmap, RT5663_INT_ST_2, &val); | 1569 | regmap_read(rt5663->regmap, RT5663_INT_ST_2, &val); |
diff --git a/sound/soc/codecs/rt5663.h b/sound/soc/codecs/rt5663.h index c5a9b69579ad..03adc8004ba9 100644 --- a/sound/soc/codecs/rt5663.h +++ b/sound/soc/codecs/rt5663.h | |||
@@ -1029,6 +1029,10 @@ | |||
1029 | #define RT5663_POL_EXT_JD_SHIFT 10 | 1029 | #define RT5663_POL_EXT_JD_SHIFT 10 |
1030 | #define RT5663_POL_EXT_JD_EN (0x1 << 10) | 1030 | #define RT5663_POL_EXT_JD_EN (0x1 << 10) |
1031 | #define RT5663_POL_EXT_JD_DIS (0x0 << 10) | 1031 | #define RT5663_POL_EXT_JD_DIS (0x0 << 10) |
1032 | #define RT5663_EM_JD_MASK (0x1 << 7) | ||
1033 | #define RT5663_EM_JD_SHIFT 7 | ||
1034 | #define RT5663_EM_JD_NOR (0x1 << 7) | ||
1035 | #define RT5663_EM_JD_RST (0x0 << 7) | ||
1032 | 1036 | ||
1033 | /* DACREF LDO Control (0x0112)*/ | 1037 | /* DACREF LDO Control (0x0112)*/ |
1034 | #define RT5663_PWR_LDO_DACREFL_MASK (0x1 << 9) | 1038 | #define RT5663_PWR_LDO_DACREFL_MASK (0x1 << 9) |