From: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Petar Stepanovic" <pstepanovic@axiado.com>,
"Akhila Kavi" <akavi@axiado.com>,
"Prasad Bolisetty" <pbolisetty@axiado.com>,
"David Lechner" <dlechner@baylibre.com>,
"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>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: adc: add Axiado SARADC driver
Date: Sat, 18 Jul 2026 02:40:04 +0100 [thread overview]
Message-ID: <20260718023952.5627abec@jic23-huawei> (raw)
In-Reply-To: <alnpMFK6_ZkdWlLi@ashevche-desk.local>
On Fri, 17 Jul 2026 11:34:56 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Thu, Jul 16, 2026 at 10:53:02PM -0700, Petar Stepanovic wrote:
> > Add support for the SARADC controller found on Axiado AX3000 and
> > AX3005 SoCs.
> >
> > The driver supports single-shot voltage reads through the IIO
> > subsystem. The number of available input channels is selected from
> > the SoC match data, allowing AX3000 and AX3005 variants to use the
> > same driver.
>
Andy already commented everywhere I'd have said things, so just
a few places where I'd take a different approach to resolving stuff.
Thanks,
Jonathan
>
> ...
>
> > +/* GLOBAL_CTRL register values */
> > +#define AX_SARADC_GLOBAL_CTRL_SAMPLE_16 \
> > + FIELD_PREP(AX_SARADC_GLOBAL_CTRL_SAMPLE_MASK, 0)
> > +
> > +#define AX_SARADC_GLOBAL_CTRL_MODE_MANUAL \
> > + FIELD_PREP(AX_SARADC_GLOBAL_CTRL_MODE_MASK, 1)
>
> FIELD_PREP_CONST() in both cases.
>
For this second one I'd rather see defines for the values the
field takes and then FIELD_PREP only used inline.
#define AX_SARADC_GLOBAL_CTL_MODE_something 0
#define AX_SARADC_GLOBAL_CTL_MODE_MANUAL 1
To me that acts as clearer documentation of what is
going on at the point of the write.
Similar applies for the SAMPLE_MASK field where I'd define the
value 0 with a name then have the FIELD_PREP() inline.
> ...
>
> > +#define AX_SARADC_MANUAL_CTRL_EN(ch) \
> > + (AX_SARADC_MANUAL_CTRL_ENABLE | \
> > + FIELD_PREP(AX_SARADC_MANUAL_CTRL_CH_SEL_MASK, ch))
>
> Missing parentheses for ch. Also wrong indentation of the second line, missing
> one space.
>
I wonder if it would be more readable to just push that inline rather
than having this define at all.
next prev parent reply other threads:[~2026-07-18 1:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 5:53 [PATCH v4 0/2] iio: adc: Add Axiado SARADC driver Petar Stepanovic
2026-07-17 5:53 ` [PATCH v4 1/2] dt-bindings: iio: adc: add Axiado AX3000/AX3005 SARADC Petar Stepanovic
2026-07-17 5:53 ` [PATCH v4 2/2] iio: adc: add Axiado SARADC driver Petar Stepanovic
2026-07-17 8:34 ` Andy Shevchenko
2026-07-17 8:38 ` Andy Shevchenko
2026-07-18 1:40 ` Jonathan Cameron [this message]
2026-07-18 13:51 ` Uwe Kleine-König
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=20260718023952.5627abec@jic23-huawei \
--to=jonathan.cameron@oss.qualcomm.com \
--cc=akavi@axiado.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=hshah@axiado.com \
--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=pstepanovic@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