public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm8978: Support the recording function of codec
@ 2022-09-12  8:23 Mengchen Li
  2022-09-12  9:23 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Mengchen Li @ 2022-09-12  8:23 UTC (permalink / raw)
  To: lgirdwood
  Cc: broonie, perex, tiwai, ckeepax, steve, patches, alsa-devel,
	linux-kernel, Mengchen Li

If we want to use the microphone function of the wm8978 codec,
we must enable the microphone bias circuit and power up the bias
circuit,otherwise the microphone can not vibrate for sound source
sampling.The bit that controls the output voltage of the bias circuit
is the fourth bit of the WM8978_POWER_MANAGEMENT_1 register,so this
bit must be set to 1.This patch can support the recording function of
the wm8978 codec.

Signed-off-by: Mengchen Li <mengchenli64@gmail.com>
---
 sound/soc/codecs/wm8978.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index a682f80..fdd5429 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -822,7 +822,9 @@ static int wm8978_hw_params(struct snd_pcm_substream *substream,
 
 	snd_soc_component_write(component, WM8978_AUDIO_INTERFACE, iface_ctl);
 	snd_soc_component_write(component, WM8978_ADDITIONAL_CONTROL, add_ctl);
-
+	/* Enable MICBEN */
+	snd_soc_component_write(component, WM8978_POWER_MANAGEMENT_1,
+		snd_soc_component_read(component, WM8978_POWER_MANAGEMENT_1) | 0x10);
 	if (wm8978->sysclk != current_clk_id) {
 		if (wm8978->sysclk == WM8978_PLL)
 			/* Run CODEC from PLL instead of MCLK */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-12  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12  8:23 [PATCH] ASoC: wm8978: Support the recording function of codec Mengchen Li
2022-09-12  9:23 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox