[PATCH] ASoC: rt715: add main capture switch and main capture volume

Mark Brown broonie at kernel.org
Wed Mar 17 15:08:41 CET 2021


On Mon, Mar 15, 2021 at 03:16:53AM +0000, Jack Yu wrote:

> @@ -57,14 +57,14 @@ static void rt715_get_gain(struct rt715_priv *rt715, unsigned int addr_h,
>  {
>  	int ret;
>  	/* R Channel */
> -	*r_val = (val_h << 8);
> +	*r_val = val_h << 8;
>  	ret = regmap_read(rt715->regmap, addr_l, r_val);
>  	if (ret < 0)
>  		pr_err("Failed to get R channel gain.\n");
>  
>  	/* L Channel */
>  	val_h |= 0x20;
> -	*l_val = (val_h << 8);
> +	*l_val = val_h << 8;
>  	ret = regmap_read(rt715->regmap, addr_h, l_val);
>  	if (ret < 0)
>  		pr_err("Failed to get L channel gain.\n");

This looks like an unrelated formatting change.

> @@ -188,8 +205,8 @@ static int rt715_set_amp_gain_get(struct snd_kcontrol *kcontrol,
>  
>  	if (mc->invert) {
>  		/* for mute status */
> -		read_ll = !((read_ll & 0x80) >> RT715_MUTE_SFT);
> -		read_rl = !((read_rl & 0x80) >> RT715_MUTE_SFT);
> +		read_ll = !(read_ll & 0x80);
> +		read_rl = !(read_rl & 0x80);
>  	} else {
>  		/* for gain */
>  		read_ll = read_ll & 0x7f;

This too.

> +	for (j = 0; j < loop_cnt; j++) {
> +		/* Can't use update bit function, so read the original value first */
> +		addr_h = capture_reg_H[j];

Why not?
-------------- 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/20210317/72cea7b6/attachment.sig>


More information about the Alsa-devel mailing list