mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: Re: [PATCH] ASoC: cs35l56: Allow factory calibration through ALSA controls
Date: Tue, 24 Mar 2026 14:24:21 +0000	[thread overview]
Message-ID: <37b15eab-7dd1-4ec9-9439-bab9389f93f2@opensource.cirrus.com> (raw)
In-Reply-To: <626b66fa-3f7a-4777-b510-18d0c0df3bf5@sirena.org.uk>

On 24/03/2026 2:02 pm, Mark Brown wrote:
> 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...
> 

The second argument to in_range() isn't a max.
But if I'm sending a new version to make them volatile I can also change
it to not use the in_range() macro.

>> +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.


  reply	other threads:[~2026-03-24 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 11:03 Richard Fitzgerald
2026-03-24 14:02 ` Mark Brown
2026-03-24 14:24   ` Richard Fitzgerald [this message]
2026-03-24 14:40     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37b15eab-7dd1-4ec9-9439-bab9389f93f2@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®