From: Jonathan Cameron <jic23@kernel.org>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Joshua Crofts" <joshua.crofts1@gmail.com>,
"Radu Sabau" <radu.sabau@analog.com>,
"Salih Erim" <salih.erim@amd.com>,
"Jishnu Prakash" <jishnu.prakash@oss.qualcomm.com>,
"Jakub Szczudlo" <jakubszczudlo40@gmail.com>,
linux@analog.com, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH 3/4] iio: adc: ade9000: add support for ADE9430
Date: Sun, 13 Sep 2026 23:19:04 +0100 [thread overview]
Message-ID: <20260913231904.6ba87d79@jic23-hlaptop> (raw)
In-Reply-To: <20260907101623.8730-4-antoniu.miclaus@analog.com>
On Mon, 7 Sep 2026 13:16:20 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> The ADE9430 is a polyphase energy metering device that is register
> compatible with the ADE9000. The differences relevant to the driver are
> the absence of the on-chip dip/swell detection, the absence of an on-chip
> digital integrator (the ADE9430 uses an external analog integrator for
> Rogowski coils, so the DICOEFF register does not exist) and slightly
> different full-scale ADC codes.
>
> Reuse the dip/swell-less channel table introduced for the ADE9078 and add
> a matching chip_info describing the ADE9430 full-scale codes. Add a
> has_digital_integrator flag to the chip_info so the DICOEFF write is only
> issued on parts that implement the register, and skip it for the ADE9430.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
I guess it is simple enough that I'm not that bothered, but my
normal preference would be to introduce the 'has_digital_integrator'
as a precursor where all device set that to true, then follow up with
the new part.
> diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
> index 0f64bfb221da..2f5fe016a82f 100644
> --- a/drivers/iio/adc/ade9000.c
> +++ b/drivers/iio/adc/ade9000.c
> };
>
> struct ade9000_state {
> @@ -668,6 +670,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
>
> ADE9000_DECLARE_CHANNELS(ade9000_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL);
> ADE9000_DECLARE_CHANNELS(ade9078_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL_NO_EVENTS);
> +ADE9000_DECLARE_CHANNELS(ade9430_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL_NO_EVENTS);
It it is identical. Just use the ade9078_channels. This sort of reuse
of exiting chan_spec arrays on new devices is very common in drivers
that support a lot of parts. Don't worry about the name. They should
be named after the first device that needed that particular chan_spec
array.
next prev parent reply other threads:[~2026-09-13 22:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 10:16 [PATCH 0/4] iio: adc: ade9000: add ADE9430 support Antoniu Miclaus
2026-09-07 10:16 ` [PATCH 1/4] iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes Antoniu Miclaus
2026-09-07 10:16 ` [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9430 compatible Antoniu Miclaus
2026-09-07 10:16 ` [PATCH 3/4] iio: adc: ade9000: add support for ADE9430 Antoniu Miclaus
2026-09-13 22:19 ` Jonathan Cameron [this message]
2026-09-07 10:16 ` [PATCH 4/4] docs: iio: ade9000: document ADE9430 support Antoniu Miclaus
2026-09-13 22:20 ` Jonathan Cameron
2026-09-13 22:12 ` [PATCH 0/4] iio: adc: ade9000: add " 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=20260913231904.6ba87d79@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jakubszczudlo40@gmail.com \
--cc=jishnu.prakash@oss.qualcomm.com \
--cc=joshua.crofts1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=marcelo.schmitt@analog.com \
--cc=nuno.sa@analog.com \
--cc=radu.sabau@analog.com \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=salih.erim@amd.com \
--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