The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Janani Sunil <jan.sun97@gmail.com>
To: "David Lechner" <dlechner@baylibre.com>,
	"Janani Sunil" <janani.sunil@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iio: dac: Add AD5529R DAC driver support
Date: Tue, 19 May 2026 09:11:49 +0200	[thread overview]
Message-ID: <739f50f4-b2f5-4e5f-8d1b-d5a6429ece28@gmail.com> (raw)
In-Reply-To: <2f74e76e-b066-40ac-9cb4-c75137c9825d@baylibre.com>


On 5/16/26 21:35, David Lechner wrote:
> On 5/8/26 6:55 AM, Janani Sunil wrote:
>> Add support for AD5529R 16-channel, 12/16 bit Digital to Analog Converter
>>
> ...
>
>
>> +		.realbits = (bits),				\
>> +		.storagebits = 16,				\
>> +	},							\
>> +}
>> +static struct regmap *ad5529r_get_regmap(struct ad5529r_state *st, unsigned int reg)
>> +{
>> +	if (reg <= AD5529R_8BIT_REG_MAX)
>> +		return st->regmap_8bit;
>> +
>> +	return st->regmap_16bit;
>> +}
> Another way we have done this is make custom read/write functions for the
> regmap itself so that we don't have to have two regmaps.

Dual regmap approach was chosen here because:

1) It leverages regmap's val_bits validation and endianness for 16 bit registers, rather than
implementing them manually.

2) The two distinct register banks- 8 bit and 16 bit map naturally to the separate regmap configs

3) Each regmap has a focused rd_table/wr_table ranges matching the hardware, rather than a complex unified table

The routing overhead is just an address comparison, similar to what custom functions would need, but with automatic validation
and endianness handling

Best Regards,
Janani Sunil


  reply	other threads:[~2026-05-19  7:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 11:55 [PATCH v2 0/3] iio: dac: Add support for AD5529R DAC Janani Sunil
2026-05-08 11:55 ` [PATCH v2 1/3] dt-bindings: iio: dac: Add AD5529R Janani Sunil
2026-05-08 12:48   ` Jonathan Cameron
2026-05-08 13:08     ` Jonathan Cameron
2026-05-19  6:59       ` Janani Sunil
2026-05-08 13:50     ` Rodrigo Alencar
2026-05-08 13:57     ` Nuno Sá
2026-05-16 19:25     ` David Lechner
2026-05-19  7:13       ` Janani Sunil
2026-05-20  9:41         ` Jonathan Cameron
2026-05-19  6:55     ` Janani Sunil
2026-05-08 11:55 ` [PATCH v2 2/3] iio: dac: Add AD5529R DAC driver support Janani Sunil
2026-05-08 13:30   ` Jonathan Cameron
2026-05-19  7:07     ` Janani Sunil
2026-05-16 19:35   ` David Lechner
2026-05-19  7:11     ` Janani Sunil [this message]
2026-05-08 11:55 ` [PATCH v2 3/3] Documentation: iio: Add AD5529R Documentation Janani Sunil
2026-05-08 13:00   ` Jonathan Cameron
2026-05-19  6:49     ` Janani Sunil
2026-05-08 12:36 ` [PATCH v2 0/3] iio: dac: Add support for AD5529R DAC Jonathan Cameron

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=739f50f4-b2f5-4e5f-8d1b-d5a6429ece28@gmail.com \
    --to=jan.sun97@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=janani.sunil@analog.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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