diff mbox series

[1/2] ASoC: nau8825: Adjust internal clock during jack detection

Message ID 20221122073855.43024-1-CTLIN0@nuvoton.com (mailing list archive)
State Accepted
Commit fa0fb0738e9c412d3c4a9fe655948ac9a87c6274
Headers show
Series [1/2] ASoC: nau8825: Adjust internal clock during jack detection | expand

Commit Message

David Lin Nov. 22, 2022, 7:38 a.m. UTC
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: David Lin <CTLIN0@nuvoton.com>
---
 sound/soc/codecs/nau8825.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Mark Brown Nov. 22, 2022, 2:49 p.m. UTC | #1
On Tue, 22 Nov 2022 15:38:55 +0800, David Lin wrote:
> 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: nau8825: Adjust internal clock during jack detection
      commit: fa0fb0738e9c412d3c4a9fe655948ac9a87c6274
[2/2] ASoC: nau8825: Add a manually mechanism for detection failure
      commit: 7a37265046618b890adf7d7a1f9f1f5fbae908a7

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 3eac7c92df88..ba7f5ec28609 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1686,6 +1686,9 @@  static void nau8825_setup_auto_irq(struct nau8825 *nau8825)
 
 	/* Enable internal VCO needed for interruptions */
 	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 */
 	regmap_update_bits(regmap, NAU8825_REG_ENA_CTRL,
@@ -1800,6 +1803,10 @@  static int nau8825_jack_insert(struct nau8825 *nau8825)
 		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
 	 * ungrounded as part of the widget power up sequence at the beginning
 	 * of playback to reduce pop.