Commit 8315d8ad authored by David Lin's avatar David Lin Committed by Mark Brown

ASoC: nau8825: Add the management of headset detection for power saving

The patch is to manage HSD feature for power saving. The detail is to
disable HSD feature after the headset detection is done. When the jack
is inserted, the HSD feature will be enabled again.
Signed-off-by: default avatarDavid Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20230531075334.168637-1-CTLIN0@nuvoton.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b48aa6a3
...@@ -1704,6 +1704,10 @@ static void nau8825_setup_auto_irq(struct nau8825 *nau8825) ...@@ -1704,6 +1704,10 @@ static void nau8825_setup_auto_irq(struct nau8825 *nau8825)
{ {
struct regmap *regmap = nau8825->regmap; struct regmap *regmap = nau8825->regmap;
/* Enable HSD function */
regmap_update_bits(regmap, NAU8825_REG_HSD_CTRL,
NAU8825_HSD_AUTO_MODE, NAU8825_HSD_AUTO_MODE);
/* Enable headset jack type detection complete interruption and /* Enable headset jack type detection complete interruption and
* jack ejection interruption. * jack ejection interruption.
*/ */
...@@ -1955,6 +1959,9 @@ static int nau8825_jack_insert(struct nau8825 *nau8825) ...@@ -1955,6 +1959,9 @@ static int nau8825_jack_insert(struct nau8825 *nau8825)
regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER, regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER,
NAU8825_CLK_MCLK_SRC_MASK, 0xf); NAU8825_CLK_MCLK_SRC_MASK, 0xf);
/* Disable HSD function */
regmap_update_bits(regmap, NAU8825_REG_HSD_CTRL, NAU8825_HSD_AUTO_MODE, 0);
/* 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment