未验证 提交 fa0fb073 编写于 作者: D David Lin 提交者: Mark Brown

ASoC: nau8825: Adjust internal clock during jack detection

This patch is to rasie up internal clock during jack detection.
The fast clock will accelerate charge and discharge effect.
So this mechanism will make jack detection more robust.
Signed-off-by: NDavid Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20221122073855.43024-1-CTLIN0@nuvoton.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 a9248c86
...@@ -1686,6 +1686,9 @@ static void nau8825_setup_auto_irq(struct nau8825 *nau8825) ...@@ -1686,6 +1686,9 @@ static void nau8825_setup_auto_irq(struct nau8825 *nau8825)
/* Enable internal VCO needed for interruptions */ /* Enable internal VCO needed for interruptions */
nau8825_configure_sysclk(nau8825, NAU8825_CLK_INTERNAL, 0); nau8825_configure_sysclk(nau8825, NAU8825_CLK_INTERNAL, 0);
/* Raise up the internal clock for jack detection */
regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER,
NAU8825_CLK_MCLK_SRC_MASK, 0);
/* Enable ADC needed for interruptions */ /* Enable ADC needed for interruptions */
regmap_update_bits(regmap, NAU8825_REG_ENA_CTRL, regmap_update_bits(regmap, NAU8825_REG_ENA_CTRL,
...@@ -1800,6 +1803,10 @@ static int nau8825_jack_insert(struct nau8825 *nau8825) ...@@ -1800,6 +1803,10 @@ static int nau8825_jack_insert(struct nau8825 *nau8825)
break; break;
} }
/* Update to the default divider of internal clock for power saving */
regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER,
NAU8825_CLK_MCLK_SRC_MASK, 0xf);
/* Leaving HPOL/R grounded after jack insert by default. They will be /* Leaving HPOL/R grounded after jack insert by default. They will be
* ungrounded as part of the widget power up sequence at the beginning * ungrounded as part of the widget power up sequence at the beginning
* of playback to reduce pop. * of playback to reduce pop.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册