Re: [PATCH v2 7/7] ASoC: codecs: aw88261: make volume control usable
Val Packett <[email protected]>
| Newsgroups | org.kernel.vger.phone-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound |
|---|---|
| Message-ID | <[email protected]> |
On 5/19/26 1:20 PM, Mark Brown wrote: > 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())? Sure.. that doesn't seem required but I can keep it to err on the side of safety / keeping what works. >> @@ -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. Ack ~val