From: David Lechner <dlechner@baylibre.com>
To: "Sabau, Radu bogdan" <Radu.Sabau@analog.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Sa, Nuno" <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>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Linus Walleij" <linusw@kernel.org>,
"Bartosz Golaszewski" <brgl@kernel.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pwm@vger.kernel.org" <linux-pwm@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v11 2/6] iio: adc: ad4691: add initial driver for AD4691 family
Date: Mon, 18 May 2026 10:05:09 -0500 [thread overview]
Message-ID: <7d338351-5f1f-4eb8-a266-b8756d0e60f5@baylibre.com> (raw)
In-Reply-To: <LV9PR03MB841445D5BD1087FB3204EBD9F7032@LV9PR03MB8414.namprd03.prod.outlook.com>
On 5/18/26 9:59 AM, Sabau, Radu bogdan wrote:
>> -----Original Message-----
>> From: David Lechner <dlechner@baylibre.com>
>> Sent: Saturday, May 16, 2026 8:11 PM
>
> ...
>
>>> +static int ad4691_reg_read(void *context, unsigned int reg, unsigned int
>> *val)
>>> +{
>>> + struct spi_device *spi = context;
>>> + u8 tx[2], rx[4];
>>> + int ret;
>>> +
>>> + /* Set bit 15 to mark the operation as READ. */
>>
>> Can't we just set read_flag_mask in the regmap config?
>>
>
> As far as I can tell read_flag_mask is applied by the standard SPI regmap bus
> backend, which constructs and sends the address byte itself before reading
> the response. When using devm_regmap_init() with custom reg_read/reg_write
> callbacks, the regmap core calls those callbacks directly with the raw register
> address - it never touches read_flag_mask.
>
>>> + put_unaligned_be16(0x8000 | reg, tx);
>>> +
>>> + switch (reg) {
>>> + case 0 ... AD4691_OSC_FREQ_REG:
>>> + case AD4691_SPARE_CONTROL ... AD4691_ACC_MASK_REG - 1:
>
> ...
>
>>> +static int ad4691_write_raw(struct iio_dev *indio_dev,
>>> + struct iio_chan_spec const *chan,
>>> + int val, int val2, long mask)
>>> +{
>>> + switch (mask) {
>>> + case IIO_CHAN_INFO_SAMP_FREQ:
>>
>> Should we aquire direct mode so that we can't change the rate during
>> buffered read?
>>
>
> It is in set_sampling_freq already. Do you think it would make more sense
> to move it here in order to help readability?
>
IIRC, I think it was resolved in a later patch in the series. So
could just be a problem of it not getting added in the right patch.
In general though, yes it would make it easier review if the
direct mode claim was made here.
next prev parent reply other threads:[~2026-05-18 15:05 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 13:31 [PATCH v11 0/6] iio: adc: ad4691: add driver for AD4691 multichannel SAR ADC family Radu Sabau via B4 Relay
2026-05-15 13:31 ` [PATCH v11 1/6] dt-bindings: iio: adc: add AD4691 family Radu Sabau via B4 Relay
2026-05-15 13:37 ` sashiko-bot
2026-05-15 17:08 ` Conor Dooley
2026-05-15 13:31 ` [PATCH v11 2/6] iio: adc: ad4691: add initial driver for " Radu Sabau via B4 Relay
2026-05-15 14:12 ` sashiko-bot
2026-05-16 17:11 ` David Lechner
2026-05-17 11:50 ` Jonathan Cameron
2026-05-17 12:14 ` Jonathan Cameron
2026-05-18 14:59 ` Sabau, Radu bogdan
2026-05-18 15:05 ` David Lechner [this message]
2026-05-17 11:52 ` Jonathan Cameron
2026-05-18 15:05 ` Sabau, Radu bogdan
2026-05-17 12:19 ` Jonathan Cameron
2026-05-15 13:31 ` [PATCH v11 3/6] iio: adc: ad4691: add triggered buffer support Radu Sabau via B4 Relay
2026-05-15 14:55 ` sashiko-bot
2026-05-16 17:32 ` David Lechner
2026-05-17 12:25 ` Jonathan Cameron
2026-05-17 19:21 ` David Lechner
2026-05-18 14:21 ` Jonathan Cameron
2026-05-18 14:36 ` David Lechner
2026-05-18 15:25 ` Jonathan Cameron
2026-05-16 18:48 ` Jonathan Cameron
2026-05-15 13:31 ` [PATCH v11 4/6] iio: adc: ad4691: add SPI offload support Radu Sabau via B4 Relay
2026-05-16 17:53 ` David Lechner
2026-05-18 15:14 ` Sabau, Radu bogdan
2026-05-18 15:16 ` David Lechner
2026-05-18 18:26 ` Andy Shevchenko
2026-05-20 10:36 ` Jonathan Cameron
2026-05-15 13:31 ` [PATCH v11 5/6] iio: adc: ad4691: add oversampling support Radu Sabau via B4 Relay
2026-05-15 16:14 ` sashiko-bot
2026-05-16 18:10 ` David Lechner
2026-05-16 18:55 ` Jonathan Cameron
2026-05-15 13:31 ` [PATCH v11 6/6] docs: iio: adc: ad4691: add driver documentation Radu Sabau via B4 Relay
2026-05-15 16:21 ` sashiko-bot
2026-05-16 18:18 ` David Lechner
2026-05-17 12:32 ` 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=7d338351-5f1f-4eb8-a266-b8756d0e60f5@baylibre.com \
--to=dlechner@baylibre.com \
--cc=Michael.Hennerich@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=Radu.Sabau@analog.com \
--cc=andy@kernel.org \
--cc=brgl@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=ukleinek@kernel.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