[PATCH] ASoC: wm8978: Support the recording function of codec

Mark Brown broonie at kernel.org
Mon Sep 12 11:23:14 CEST 2022


On Mon, Sep 12, 2022 at 04:23:05PM +0800, Mengchen Li wrote:

> @@ -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);

This should be done by creating a supply widget for the MICBIAS
which will be connected by the machine driver to the microphone
widget.  This will mean that the MICBIAS is only enabled when
it's actively being used which saves power.  Look for MICBIAS
widgets in other CODEC drivers for examples.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20220912/adf1422a/attachment.sig>


More information about the Alsa-devel mailing list