Re: [PATCH] ASoC: cs35l56: Allow factory calibration through ALSA controls

From: Mark Brown

Date: Tue Mar 24 2026 - 10:05:10 EST


On Tue, Mar 24, 2026 at 11:03:02AM +0000, Richard Fitzgerald wrote:

> +static int cs35l56_cal_ambient_ctl_set(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
> + struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component);
> + struct snd_soc_dapm_context *dapm;
> + int ret;
> +
> + if (!in_range(ucontrol->value.integer.value[0], 5, 35))
> + return -EINVAL;

The values range from 5..35...

> +static const struct snd_kcontrol_new cs35l56_cal_perform_controls[] = {
> + SOC_SINGLE_EXT("CAL_AMBIENT", SND_SOC_NOPM, 0, 40, 0,
> + cs35l56_cal_ambient_ctl_get, cs35l56_cal_ambient_ctl_set),

...but the range is from 0..40? I'd expect mixer-test to complain about
both these controls too, they're not flagged as volatile.

Attachment: signature.asc
Description: PGP signature