Re: [PATCH v2 7/7] ASoC: codecs: aw88261: make volume control usable

Mark Brown <[email protected]>
Newsgroups org.kernel.vger.phone-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound
Message-ID <[email protected]>
On Mon, May 18, 2026 at 06:44:36PM -0300, Val Packett wrote:

> @@ -424,17 +415,7 @@ static int aw88261_dev_reg_update(struct aw88261 *aw88261,
>  			break;
>  	}
>  
> -	ret = aw88261_dev_set_vcalb(aw_dev);
> -	if (ret)
> -		return ret;
> -
> -	if (aw_dev->prof_cur != aw_dev->prof_index)
> -		vol_desc->ctl_volume = 0;
> -
> -	/* keep min volume */
> -	aw88261_dev_set_volume(aw_dev, vol_desc->mute_volume);
> -
> -	return ret;
> +	return aw88261_dev_set_vcalb(aw_dev);
>  }

This looks like it was intentional in order to ensure that things are
muted until we power up (there's an unmute in _dev_start())?

> @@ -983,13 +965,13 @@ static int aw88261_volume_set(struct snd_kcontrol *kcontrol,
>  	struct aw_volume_desc *vol_desc = &aw88261->aw_pa->volume_desc;
>  	struct soc_mixer_control *mc =
>  		(struct soc_mixer_control *)kcontrol->private_value;
> -	int value;
> -
> -	value = ucontrol->value.integer.value[0];
> +	int value = ucontrol->value.integer.value[0];
>  
>  	if (value < mc->min || value > mc->max)
>  		return -EINVAL;
>  
> +	value = AW88261_MUTE_VOL - (value * 2);
> +

We're doing the invert of the value scale before we store it, currently
the default value is defined as 0 in the header so we'll default to
maximum volume which is likely to lead to some distress at some point.
The default should be updated as well.
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmoMjdwACgkQJNaLcl1U
h9DUVwf/XNn5pf4E2MfjoRLBrUye3qifzdbq6sD1E0/C4vuGjeCSwUFCGZOE0iDD
ayRdQ8zyrRumVN5GNoguTaWmwPX1MDtpEeUJ4Uu+Fh7kMrbARHsTXWExo8oqc+UU
cfWTPa9xNy58jBhbQAiiCXPnBSqENa8bPaEgjuI3llkOIMC01lT6smP/1NPNkeEq
vPAoIG0/ZuYODIMMrG3xCEE0SDViJCAc4fChz+vcoHptRI+EGmEe0NjehoQiZo5b
qEHcc7Ordy5INDiEL/LyEIzQnLGiHybPfVJYb7a1xhlcEeTttq/E5WGXvxTaNypL
9u8ZUs9/yNgt6YdIXbVGr5bUrovqvA==
=oZ6i
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.