lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d1f9b0de-9972-b5e5-128c-2450f6345e5c@linaro.org>
Date:   Mon, 2 Oct 2017 10:52:00 +0100
From:   Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:     Jean-François Têtu 
        <jean-francois.tetu@...oirfairelinux.com>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Subject: Re: [PATCH] ASoC: codecs: msm8916-wcd-analog: fix micbias level

Thanks for the patch.

On 29/09/17 21:19, Jean-François Têtu wrote:
> The macro used to set the microphone bias level causes the
> snd_soc_write() call to overwrite other fields in the CDC_A_MICB_1_VAL
> register. The macro also does not return the proper level value
> to use. This fixes this by preserving all bits from the register
> that are not the level while setting the level.
> 
> Signed-off-by: Jean-François Têtu <jean-francois.tetu@...oirfairelinux.com>
> ---

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>


>   sound/soc/codecs/msm8916-wcd-analog.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c
> index f562f2d..e1534fe 100644
> --- a/sound/soc/codecs/msm8916-wcd-analog.c
> +++ b/sound/soc/codecs/msm8916-wcd-analog.c
> @@ -104,7 +104,7 @@
>   #define CDC_A_MICB_1_VAL		(0xf141)
>   #define MICB_MIN_VAL 1600
>   #define MICB_STEP_SIZE 50
> -#define MICB_VOLTAGE_REGVAL(v)		((v - MICB_MIN_VAL)/MICB_STEP_SIZE)
> +#define MICB_VOLTAGE_REGVAL(v)		(((v - MICB_MIN_VAL)/MICB_STEP_SIZE) << 3)
>   #define MICB_1_VAL_MICB_OUT_VAL_MASK	GENMASK(7, 3)
>   #define MICB_1_VAL_MICB_OUT_VAL_V2P70V	((0x16)  << 3)
>   #define MICB_1_VAL_MICB_OUT_VAL_V1P80V	((0x4)  << 3)
> @@ -349,8 +349,9 @@ static void pm8916_wcd_analog_micbias_enable(struct snd_soc_codec *codec)
>   			    | MICB_1_CTL_EXT_PRECHARG_EN_ENABLE);
>   
>   	if (wcd->micbias_mv) {
> -		snd_soc_write(codec, CDC_A_MICB_1_VAL,
> -			      MICB_VOLTAGE_REGVAL(wcd->micbias_mv));
> +		snd_soc_update_bits(codec, CDC_A_MICB_1_VAL,
> +				    MICB_1_VAL_MICB_OUT_VAL_MASK,
> +				    MICB_VOLTAGE_REGVAL(wcd->micbias_mv));
>   		/*
>   		 * Special headset needs MICBIAS as 2.7V so wait for
>   		 * 50 msec for the MICBIAS to reach 2.7 volts.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ