Devicetree
 help / color / mirror / Atom feed
From: Petar Stepanovic <pstepanovic@axiado.com>
To: "David Lechner" <dlechner@baylibre.com>,
	"Akhila Kavi" <akavi@axiado.com>,
	"Prasad Bolisetty" <pbolisetty@axiado.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>,
	"Harshit Shah" <hshah@axiado.com>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] iio: adc: add Axiado SARADC driver
Date: Mon, 29 Jun 2026 04:33:00 +0200	[thread overview]
Message-ID: <b06005e0-b7bc-4967-ac7b-cb170219f131@axiado.com> (raw)
In-Reply-To: <6770a7af-06cc-4240-9b20-c299e7080ab1@baylibre.com>


On 6/28/2026 1:07 AM, David Lechner wrote:
>> +#define AX_SARADC_CH(_index, _id)                                       \
>> +     {                                                               \
>> +             .type = IIO_VOLTAGE,                                    \
>> +             .indexed = 1,                                           \
>> +             .channel = (_index),                                    \
>> +             .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),           \
>> +             .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),   \
>> +             .datasheet_name = (_id),                                \
> This could probably be:
>
>                 .datasheet_name = "adc" #_index,
>
> and avoid the need for _id.

Thanks for the review, David.
Yes, that makes sense. I will update this and remove the extra _id
argument.

>> +     }
>> +
>> +static const struct iio_chan_spec axiado_saradc_iio_channels[] = {
>> +     AX_SARADC_CH(0, "adc0"),   AX_SARADC_CH(1, "adc1"),
>> +     AX_SARADC_CH(2, "adc2"),   AX_SARADC_CH(3, "adc3"),
>> +     AX_SARADC_CH(4, "adc4"),   AX_SARADC_CH(5, "adc5"),
>> +     AX_SARADC_CH(6, "adc6"),   AX_SARADC_CH(7, "adc7"),
>> +     AX_SARADC_CH(8, "adc8"),   AX_SARADC_CH(9, "adc9"),
>> +     AX_SARADC_CH(10, "adc10"), AX_SARADC_CH(11, "adc11"),
>> +     AX_SARADC_CH(12, "adc12"), AX_SARADC_CH(13, "adc13"),
>> +     AX_SARADC_CH(14, "adc14"), AX_SARADC_CH(15, "adc15"),
> Two columns looks a bit odd.

I will also reformat the channel table to one entry per line.

>> +};
>> +
>> +static void axiado_saradc_disable(void *data)
>> +{
>> +     struct axiado_saradc *info = data;
>> +
>> +     writel(AX_SARADC_GLOBAL_CTRL_PD, info->regs + AX_SARADC_GLOBAL_CTRL_REG);
> People usual make read and write wrappers or use regmap to avoid having
> to write `info->regs + AX_SARADC_GLOBAL_CTRL_REG` so many times.

My understanding is that simple read/write wrappers are not always
preferred unless they provide additional value. Would switching the
driver to regmap be acceptable here to avoid repeating the base address
calculation?

Regards,
Petar


  reply	other threads:[~2026-06-29  2:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22  7:47 [PATCH v3 0/2] iio: adc: Add Axiado SARADC driver Petar Stepanovic
2026-06-22  7:47 ` [PATCH v3 1/2] dt-bindings: iio: adc: add Axiado AX3000/AX3005 SARADC Petar Stepanovic
2026-06-22  7:53   ` sashiko-bot
2026-06-22  7:47 ` [PATCH v3 2/2] iio: adc: add Axiado SARADC driver Petar Stepanovic
2026-06-22  7:54   ` sashiko-bot
2026-06-22  9:55   ` Joshua Crofts
2026-06-23  8:30     ` Petar Stepanovic
2026-07-02 19:54       ` Jonathan Cameron
2026-06-27 23:07   ` David Lechner
2026-06-29  2:33     ` Petar Stepanovic [this message]
2026-06-29  6:05       ` Andy Shevchenko
2026-06-29 14:54       ` David Lechner

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=b06005e0-b7bc-4967-ac7b-cb170219f131@axiado.com \
    --to=pstepanovic@axiado.com \
    --cc=akavi@axiado.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=hshah@axiado.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=pbolisetty@axiado.com \
    --cc=robh@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