Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20230531075334.168637-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

David Lin and committed by
Mark Brown
8315d8ad b48aa6a3

+7
+7
sound/soc/codecs/nau8825.c
··· 1704 1704 { 1705 1705 struct regmap *regmap = nau8825->regmap; 1706 1706 1707 + /* Enable HSD function */ 1708 + regmap_update_bits(regmap, NAU8825_REG_HSD_CTRL, 1709 + NAU8825_HSD_AUTO_MODE, NAU8825_HSD_AUTO_MODE); 1710 + 1707 1711 /* Enable headset jack type detection complete interruption and 1708 1712 * jack ejection interruption. 1709 1713 */ ··· 1958 1954 /* Update to the default divider of internal clock for power saving */ 1959 1955 regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER, 1960 1956 NAU8825_CLK_MCLK_SRC_MASK, 0xf); 1957 + 1958 + /* Disable HSD function */ 1959 + regmap_update_bits(regmap, NAU8825_REG_HSD_CTRL, NAU8825_HSD_AUTO_MODE, 0); 1961 1960 1962 1961 /* Leaving HPOL/R grounded after jack insert by default. They will be 1963 1962 * ungrounded as part of the widget power up sequence at the beginning