Messages in this thread |  | | Date | Tue, 5 May 2026 10:33:32 +0900 | | From | Mark Brown <> | | Subject | Re: [PATCH v3] ASoC: tegra: Add per-stream Mixer Fade controls |
| |
On Mon, May 04, 2026 at 10:00:51AM +0000, Sheetal wrote:
> +static int tegra210_mixer_put_fade_duration(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct soc_mixer_control *mc = > + (struct soc_mixer_control *)kcontrol->private_value; > + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); > + struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt); > + unsigned int id = mc->reg; > + u32 duration = ucontrol->value.integer.value[0]; > + > + if (duration == 0) > + return -EINVAL; > + > + if (mixer->duration[id] == duration) > + return 0; > + > + mixer->duration[id] = duration; > + mixer->fade_pending[id] = true; > + > + return 1;
We're not validating against TEGRA210_MIXER_FADE_DURATION_MAX here, similarly for the gain.
> +static int tegra210_mixer_get_fade_status(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{
> + if (count >= mixer->duration[id]) { > + ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_IDLE; > + mixer->in_fade[id] = false;
This doesn't disable the sample counting so subsequent enables will be noops (due to use of _update_bits()). [unhandled content-type:application/pgp-signature] |  |