mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: raffaele.tranfaglia@gmail.com
Cc: Mark Brown <broonie@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Jonathan Cameron <jic23@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	driver-core@lists.linux.dev, linux-sound@vger.kernel.org,
	Neo Chang <YLCHANG2@nuvoton.com>
Subject: Re: [PATCH v2 1/3] ASoC: codecs: nau8360: set val_bits to the widest register size
Date: Wed, 25 Nov 2026 15:25:21 +0200	[thread overview]
Message-ID: <awbhwVw52eSTTmiu@ashevche-desk.local> (raw)
In-Reply-To: <20261125-regmap-kunit-val-bits-v2-1-81db3b79cd3f@gmail.com>

On Wed, Nov 25, 2026 at 08:09:30AM +0000, Raffaele Tranfaglia via B4 Relay wrote:
> 
> The regmap is configured with val_bits = 16, but the two DSP registers
> are 32 bits wide: nau8360_reg_write() sends four bytes for them, and the
> DSP messages written with snd_soc_component_write() use all 32 bits.
> 
> This works because the driver provides its own reg_read() and
> reg_write() and regmap passes the value through unmodified. As regmap is
> going to mask values to val_bits, set it to 32, the size of the widest
> register. The size of each access is still selected in the driver's
> reg_read() and reg_write().

Hmm... While it works, it might be not the best approach. In cases like this
elsewhere we create two regmaps (one per each val_bits size) and choose them
based on the register offset.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-11-25 13:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  8:09 [PATCH v2 0/3] regmap: handle values wider than val_bits consistently Raffaele Tranfaglia via B4 Relay
2026-11-25  8:09 ` [PATCH v2 1/3] ASoC: codecs: nau8360: set val_bits to the widest register size Raffaele Tranfaglia via B4 Relay
2026-11-25 13:25   ` Andy Shevchenko [this message]
2026-11-25  8:09 ` [PATCH v2 2/3] regmap: mask values to val_bits on write Raffaele Tranfaglia via B4 Relay
     [not found]   ` <awbk6Ah554O_Nxg5@ashevche-desk.local>
2026-11-25 13:49     ` Andy Shevchenko
2026-11-25  8:09 ` [PATCH v2 3/3] regmap: kunit: add tests for values wider than val_bits Raffaele Tranfaglia via B4 Relay
2026-11-25 13:42   ` Andy Shevchenko

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=awbhwVw52eSTTmiu@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=YLCHANG2@nuvoton.com \
    --cc=broonie@kernel.org \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=johan@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rafael@kernel.org \
    --cc=raffaele.tranfaglia@gmail.com \
    --cc=tiwai@suse.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®