All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: HyeongJun An <sammiee5311@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	patches@opensource.cirrus.com,
	Zhang Yi <zhangyi@everest-semi.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: core: Warn about controls whose register fields overlap
Date: Mon, 19 Oct 2026 10:24:44 +0100	[thread overview]
Message-ID: <atXh3Br+fuH83S0q@opensource.cirrus.com> (raw)
In-Reply-To: <20261019051321.2973771-1-sammiee5311@gmail.com>

On Mon, Oct 19, 2026 at 02:13:21PM +0900, HyeongJun An wrote:
> A control that writes part of another control's register field also
> changes that control. Usually the bits it was meant to own are then out
> of reach. 26 of these were fixed in codec drivers this cycle. Most
> dated back to the first version of the driver.
> 
> So check each control as it is added. If it shares a register with a
> control of the same component, and the two fields overlap but are not
> the same, print a warning. Identical fields are not reported, as some
> drivers expose one field under two names.
> 
> Only controls with the volsw, volsw_sx and enum_double put callbacks
> are checked. For other controls the bits written are not known.
> 
> Add a KUnit test for the field calculation.
> 
> Suggested-by: Mark Brown <broonie@kernel.org>
> Link: https://lore.kernel.org/all/0fefbfe1-021b-46b2-8945-15956e75e37f@sirena.org.uk/
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
> ---
> 
> Notes:
>     On for-7.4 an allmodconfig build gives four warnings in three drivers:
>     
>       cs42l56: ADC Mute Switch with ADCA Invert and ADCB Invert

Looking at this one I think it makes sense to drop the control
here. As the control doesn't currently point to the right bits we
know no one is successfully using it, and really it is simplest
to have either automatic muting or manual muting not both.

I can do a patch to fix up if you like? Or happy for you to do so
if you prefer?

Thanks,
Charles

  reply	other threads:[~2026-10-19  9:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  5:13 [PATCH] ASoC: core: Warn about controls whose register fields overlap HyeongJun An
2026-10-19  9:24 ` Charles Keepax [this message]
2026-10-19 12:38   ` HyeongJun An
2026-10-19 12:48     ` Charles Keepax

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=atXh3Br+fuH83S0q@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=sammiee5311@gmail.com \
    --cc=tiwai@suse.com \
    --cc=zhangyi@everest-semi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.