* [PATCH 0/4] iio: adc: ade9000: add ADE9430 support
@ 2026-09-07 10:16 Antoniu Miclaus
2026-09-07 10:16 ` [PATCH 1/4] iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes Antoniu Miclaus
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Antoniu Miclaus @ 2026-09-07 10:16 UTC (permalink / raw)
To: Nuno Sá, Michael Hennerich, Antoniu Miclaus,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Corbet, Shuah Khan, Randy Dunlap,
Marcelo Schmitt, Joshua Crofts, Radu Sabau, Salih Erim,
Jishnu Prakash, Jakub Szczudlo, linux, linux-iio, devicetree,
linux-kernel, linux-doc
The ADE9430 is a polyphase energy metering device from the same family as
the ADE9000. It is register-compatible with the ADE9000 but omits the
on-chip dip/swell detection and has no on-chip digital integrator; it
relies on an external analog integrator for Rogowski coil current sensors.
This series adds ADE9430 support to the existing ade9000 driver, reusing
the dip/swell-less channel table introduced for the ADE9078 and adding a
matching chip_info for the ADE9430 full-scale codes. A has_digital_integrator
flag in chip_info gates the DICOEFF register write so it is skipped on the
ADE9430.
Patch 1 is a standalone fix included with this series because it corrects
the ADE9000 full-scale RMS/PCF codes to the same family-A values the
ADE9430 uses. It carries a Fixes: tag and Cc: stable and can be applied
independently of the rest of the series.
Antoniu Miclaus (4):
iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes
dt-bindings: iio: adc: adi,ade9000: add adi,ade9430 compatible
iio: adc: ade9000: add support for ADE9430
docs: iio: ade9000: document ADE9430 support
.../bindings/iio/adc/adi,ade9000.yaml | 22 +++++++-----
Documentation/iio/ade9000.rst | 36 ++++++++++---------
drivers/iio/adc/Kconfig | 1 +
drivers/iio/adc/ade9000.c | 29 +++++++++++++--
4 files changed, 59 insertions(+), 29 deletions(-)
base-commit: 26bdafb3bdf58436579a1f6f0ef1ddb9011015ea
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes
2026-09-07 10:16 [PATCH 0/4] iio: adc: ade9000: add ADE9430 support Antoniu Miclaus
@ 2026-09-07 10:16 ` Antoniu Miclaus
2026-09-07 10:29 ` sashiko-bot
2026-09-07 10:16 ` [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9430 compatible Antoniu Miclaus
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Antoniu Miclaus @ 2026-09-07 10:16 UTC (permalink / raw)
To: Nuno Sá, Michael Hennerich, Antoniu Miclaus,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Corbet, Shuah Khan, Randy Dunlap,
Marcelo Schmitt, Joshua Crofts, Radu Sabau, Salih Erim,
Jishnu Prakash, Jakub Szczudlo, linux, linux-iio, devicetree,
linux-kernel, linux-doc
Cc: stable
The ADE9000 chip_info uses full-scale codes that do not match the
datasheet. The RMS full-scale code was set to 52866837, which is the
ADE9078 value; per the ADE9000 datasheet the xRMS/xFRMS full-scale
reading is 52702092. The PCF full-scale code was set to 74770000, a
value that appears in no datasheet; the ADE9000 xI_PCF/xV_PCF full-scale
reading is 74532013.
Because the IIO scale of the RMS and PCF channels is reported as
1 / full_scale_codes, these wrong values make the affected current and
voltage channels read about 0.3% low on real hardware. The active power
(WATT) full-scale code was already correct and is left unchanged. These
are the same family-A values already used by the ADE9430.
Fixes: 81de7b4619fc ("iio: adc: add ade9000 support")
Cc: stable@vger.kernel.org
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/adc/ade9000.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index fd1362a98052..0f64bfb221da 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -677,9 +677,9 @@ static const struct ade9000_chip_info ade9000_chip_info = {
.name = "ade9000",
.channels = ade9000_channels,
.num_channels = ARRAY_SIZE(ade9000_channels),
- .rms_full_scale_codes = 52866837,
+ .rms_full_scale_codes = 52702092,
.watt_full_scale_codes = 20694066,
- .pcf_full_scale_codes = 74770000,
+ .pcf_full_scale_codes = 74532013,
};
static const struct ade9000_chip_info ade9078_chip_info = {
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9430 compatible
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 ` Antoniu Miclaus
2026-09-07 10:16 ` [PATCH 3/4] iio: adc: ade9000: add support for ADE9430 Antoniu Miclaus
2026-09-07 10:16 ` [PATCH 4/4] docs: iio: ade9000: document ADE9430 support Antoniu Miclaus
3 siblings, 0 replies; 7+ messages in thread
From: Antoniu Miclaus @ 2026-09-07 10:16 UTC (permalink / raw)
To: Nuno Sá, Michael Hennerich, Antoniu Miclaus,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Corbet, Shuah Khan, Randy Dunlap,
Marcelo Schmitt, Joshua Crofts, Radu Sabau, Salih Erim,
Jishnu Prakash, Jakub Szczudlo, linux, linux-iio, devicetree,
linux-kernel, linux-doc
The ADE9430 is a polyphase energy metering device from the same family as
the ADE9000. It is register-compatible with the ADE9000 but does not
provide the on-chip dip/swell detection, and it has no on-chip digital
integrator (it relies on an external analog integrator for Rogowski coil
current sensors).
Add the new compatible. No spi-max-frequency constraint is needed as the
ADE9430 supports the same 20 MHz maximum SPI clock as the ADE9000.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
.../bindings/iio/adc/adi,ade9000.yaml | 22 +++++++++++--------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
index 1e940e8c7297..ec68e6887142 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
@@ -5,23 +5,26 @@
$id: http://devicetree.org/schemas/iio/adc/adi,ade9000.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Analog Devices ADE9000/ADE9078 High Performance, Polyphase Energy Metering
+title: Analog Devices ADE9000/ADE9078/ADE9430 High Performance, Polyphase Energy Metering
maintainers:
- Antoniu Miclaus <antoniu.miclaus@analog.com>
description: |
- The ADE9000 and ADE9078 are highly accurate, fully integrated, multiphase
- energy and power quality monitoring devices. Superior analog performance and a
- digital signal processing (DSP) core enable accurate energy monitoring over a
- wide dynamic range. An integrated high end reference ensures low drift over
- temperature with a combined drift of less than ±25 ppm/°C maximum for the
- entire channel including a programmable gain amplifier (PGA) and an
- analog-to-digital converter (ADC). The ADE9078 does not provide the on-chip
- dip/swell detection available on the ADE9000.
+ The ADE9000, ADE9078 and ADE9430 are highly accurate, fully integrated,
+ multiphase energy and power quality monitoring devices. Superior analog
+ performance and a digital signal processing (DSP) core enable accurate energy
+ monitoring over a wide dynamic range. An integrated high end reference ensures
+ low drift over temperature with a combined drift of less than ±25 ppm/°C
+ maximum for the entire channel including a programmable gain amplifier (PGA)
+ and an analog-to-digital converter (ADC). The ADE9078 and ADE9430 do not
+ provide the on-chip dip/swell detection available on the ADE9000, and the
+ ADE9430 has no on-chip digital integrator (it uses an external analog
+ integrator for Rogowski coils).
https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9000.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9078.pdf
+ https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9430.pdf
$ref: /schemas/spi/spi-peripheral-props.yaml#
@@ -30,6 +33,7 @@ properties:
enum:
- adi,ade9000
- adi,ade9078
+ - adi,ade9430
reg:
maxItems: 1
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] iio: adc: ade9000: add support for ADE9430
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 ` Antoniu Miclaus
2026-09-07 10:26 ` sashiko-bot
2026-09-07 10:16 ` [PATCH 4/4] docs: iio: ade9000: document ADE9430 support Antoniu Miclaus
3 siblings, 1 reply; 7+ messages in thread
From: Antoniu Miclaus @ 2026-09-07 10:16 UTC (permalink / raw)
To: Nuno Sá, Michael Hennerich, Antoniu Miclaus,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Corbet, Shuah Khan, Randy Dunlap,
Marcelo Schmitt, Joshua Crofts, Radu Sabau, Salih Erim,
Jishnu Prakash, Jakub Szczudlo, linux, linux-iio, devicetree,
linux-kernel, linux-doc
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>
---
drivers/iio/adc/Kconfig | 1 +
drivers/iio/adc/ade9000.c | 25 ++++++++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 6431592c5fa3..85a10524c76a 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -587,6 +587,7 @@ config ADE9000
integrated circuits:
- ADE9000
- ADE9078
+ - ADE9430
The devices feature high-precision analog-to-digital converters
and digital signal processing to compute RMS values, power factor,
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
@@ -290,6 +290,7 @@ enum ade9000_wfb_cfg {
* @rms_full_scale_codes: digital code produced at full-scale RMS input
* @watt_full_scale_codes: digital code produced at full-scale power input
* @pcf_full_scale_codes: digital code produced at full-scale xI_PCF/xV_PCF input
+ * @has_digital_integrator: part has an on-chip digital integrator (DICOEFF)
*
* The full-scale codes are taken from the respective datasheets and are used to
* derive the IIO scale of the raw measurement channels.
@@ -301,6 +302,7 @@ struct ade9000_chip_info {
unsigned int rms_full_scale_codes;
unsigned int watt_full_scale_codes;
unsigned int pcf_full_scale_codes;
+ bool has_digital_integrator;
};
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);
/*
* Full-scale codes referred from the respective datasheets. These are the
@@ -680,6 +683,7 @@ static const struct ade9000_chip_info ade9000_chip_info = {
.rms_full_scale_codes = 52702092,
.watt_full_scale_codes = 20694066,
.pcf_full_scale_codes = 74532013,
+ .has_digital_integrator = true,
};
static const struct ade9000_chip_info ade9078_chip_info = {
@@ -689,6 +693,16 @@ static const struct ade9000_chip_info ade9078_chip_info = {
.rms_full_scale_codes = 52866837,
.watt_full_scale_codes = 20823646,
.pcf_full_scale_codes = 74680000,
+ .has_digital_integrator = true,
+};
+
+static const struct ade9000_chip_info ade9430_chip_info = {
+ .name = "ade9430",
+ .channels = ade9430_channels,
+ .num_channels = ARRAY_SIZE(ade9430_channels),
+ .rms_full_scale_codes = 52702092,
+ .watt_full_scale_codes = 20694066,
+ .pcf_full_scale_codes = 74532013,
};
static const struct reg_sequence ade9000_initialization_sequence[] = {
@@ -704,7 +718,6 @@ static const struct reg_sequence ade9000_initialization_sequence[] = {
{ ADE9000_REG_EVENT_MASK, ADE9000_EVENT_DISABLE },
{ ADE9000_REG_WFB_CFG, ADE9000_WFB_CFG },
{ ADE9000_REG_VLEVEL, ADE9000_VLEVEL },
- { ADE9000_REG_DICOEFF, ADE9000_DICOEFF },
{ ADE9000_REG_EGY_TIME, ADE9000_EGY_TIME },
{ ADE9000_REG_EP_CFG, ADE9000_EP_CFG },
/* Clear all pending status bits by writing 1s */
@@ -1672,6 +1685,14 @@ static int ade9000_setup(struct ade9000_state *st)
if (ret)
return dev_err_probe(dev, ret, "Failed to write register sequence");
+ /* The ADE9430 has no on-chip digital integrator and lacks DICOEFF. */
+ if (st->info->has_digital_integrator) {
+ ret = regmap_write(st->regmap, ADE9000_REG_DICOEFF,
+ ADE9000_DICOEFF);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to set DICOEFF\n");
+ }
+
fsleep(2000);
return 0;
@@ -1842,6 +1863,7 @@ static int ade9000_probe(struct spi_device *spi)
static const struct spi_device_id ade9000_id[] = {
{ .name = "ade9000", .driver_data = (kernel_ulong_t)&ade9000_chip_info },
{ .name = "ade9078", .driver_data = (kernel_ulong_t)&ade9078_chip_info },
+ { .name = "ade9430", .driver_data = (kernel_ulong_t)&ade9430_chip_info },
{ }
};
MODULE_DEVICE_TABLE(spi, ade9000_id);
@@ -1849,6 +1871,7 @@ MODULE_DEVICE_TABLE(spi, ade9000_id);
static const struct of_device_id ade9000_of_match[] = {
{ .compatible = "adi,ade9000", .data = &ade9000_chip_info },
{ .compatible = "adi,ade9078", .data = &ade9078_chip_info },
+ { .compatible = "adi,ade9430", .data = &ade9430_chip_info },
{ }
};
MODULE_DEVICE_TABLE(of, ade9000_of_match);
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] docs: iio: ade9000: document ADE9430 support
2026-09-07 10:16 [PATCH 0/4] iio: adc: ade9000: add ADE9430 support Antoniu Miclaus
` (2 preceding siblings ...)
2026-09-07 10:16 ` [PATCH 3/4] iio: adc: ade9000: add support for ADE9430 Antoniu Miclaus
@ 2026-09-07 10:16 ` Antoniu Miclaus
3 siblings, 0 replies; 7+ messages in thread
From: Antoniu Miclaus @ 2026-09-07 10:16 UTC (permalink / raw)
To: Nuno Sá, Michael Hennerich, Antoniu Miclaus,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Corbet, Shuah Khan, Randy Dunlap,
Marcelo Schmitt, Joshua Crofts, Radu Sabau, Salih Erim,
Jishnu Prakash, Jakub Szczudlo, linux, linux-iio, devicetree,
linux-kernel, linux-doc
Add the ADE9430 to the list of supported devices and note that, like the
ADE9078, it does not provide the on-chip dip/swell voltage events. Also
note that the ADE9430 has no on-chip digital integrator and instead uses
an external analog integrator for Rogowski coils.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Documentation/iio/ade9000.rst | 36 ++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/Documentation/iio/ade9000.rst b/Documentation/iio/ade9000.rst
index 72737b5ec59c..881b7ff2ad3e 100644
--- a/Documentation/iio/ade9000.rst
+++ b/Documentation/iio/ade9000.rst
@@ -1,29 +1,31 @@
.. SPDX-License-Identifier: GPL-2.0
-======================
-ADE9000/ADE9078 driver
-======================
+==============================
+ADE9000/ADE9078/ADE9430 driver
+==============================
-This driver supports Analog Device's ADE9000 and ADE9078 energy measurement
-ICs on SPI bus.
+This driver supports Analog Device's ADE9000, ADE9078 and ADE9430 energy
+measurement ICs on SPI bus.
1. Supported devices
====================
* `ADE9000 <https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9000.pdf>`_
* `ADE9078 <https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9078.pdf>`_
-
-The ADE9000 and ADE9078 are highly accurate, fully integrated, multiphase energy
-and power quality monitoring devices. Superior analog performance and a digital
-signal processing (DSP) core enable accurate energy monitoring over a wide
-dynamic range. An integrated high end reference ensures low drift over
-temperature with a combined drift of less than ±25 ppm/°C maximum for the entire
-channel including a programmable gain amplifier (PGA) and an analog-to-digital
-converter (ADC).
-
-The ADE9078 does not provide the on-chip dip/swell (sag) detection available on
-the ADE9000, so the RMS voltage swell/dip events described below are only
-available on the ADE9000.
+* `ADE9430 <https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9430.pdf>`_
+
+The ADE9000, ADE9078 and ADE9430 are highly accurate, fully integrated,
+multiphase energy and power quality monitoring devices. Superior analog
+performance and a digital signal processing (DSP) core enable accurate energy
+monitoring over a wide dynamic range. An integrated high end reference ensures
+low drift over temperature with a combined drift of less than ±25 ppm/°C maximum
+for the entire channel including a programmable gain amplifier (PGA) and an
+analog-to-digital converter (ADC).
+
+The ADE9078 and ADE9430 do not provide the on-chip dip/swell (sag) detection
+available on the ADE9000, so the RMS voltage swell/dip events described below are
+only available on the ADE9000. The ADE9430 additionally has no on-chip digital
+integrator and instead uses an external analog integrator for Rogowski coils.
2. Device attributes
====================
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/4] iio: adc: ade9000: add support for ADE9430
2026-09-07 10:16 ` [PATCH 3/4] iio: adc: ade9000: add support for ADE9430 Antoniu Miclaus
@ 2026-09-07 10:26 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-09-07 10:26 UTC (permalink / raw)
To: Antoniu Miclaus; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The ADE9000_REG_DICOEFF configuration register is written after the DSP has been started, violating initialization requirements for existing devices.
- [Medium] The ADE9430 full-scale ADC codes are identical to the ADE9000 codes, contradicting the commit message claim that they are different.
--
commit 95855f12cd746ba14c4e360029b507dc042d8327
Author: Antoniu Miclaus <antoniu.miclaus@analog.com>
iio: adc: ade9000: add support for ADE9430
This commit adds support for the ADE9430, noting it is register compatible
with the ADE9000 but lacks the on-chip digital integrator and has slightly
different full-scale ADC codes.
> 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.
[Severity: Medium]
The commit message mentions that the ADE9430 has "slightly different
full-scale ADC codes", but looking at the newly added ade9430_chip_info
struct below, the rms_full_scale_codes, watt_full_scale_codes, and
pcf_full_scale_codes are identical to the ADE9000 codes.
> diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
> index 0f64bfb221da0..2f5fe016a82f3 100644
> --- a/drivers/iio/adc/ade9000.c
> +++ b/drivers/iio/adc/ade9000.c
[ ... ]
> @@ -689,6 +693,16 @@ static const struct ade9000_chip_info ade9078_chip_info = {
> .rms_full_scale_codes = 52866837,
> .watt_full_scale_codes = 20823646,
> .pcf_full_scale_codes = 74680000,
> + .has_digital_integrator = true,
> +};
> +
> +static const struct ade9000_chip_info ade9430_chip_info = {
> + .name = "ade9430",
> + .channels = ade9430_channels,
> + .num_channels = ARRAY_SIZE(ade9430_channels),
> + .rms_full_scale_codes = 52702092,
> + .watt_full_scale_codes = 20694066,
> + .pcf_full_scale_codes = 74532013,
> };
>
Are these the correct values for the ADE9430, or were they inadvertently
copied from the ADE9000 without being updated from the datasheet?
> @@ -704,7 +718,6 @@ static const struct reg_sequence ade9000_initialization_sequence[] = {
> { ADE9000_REG_EVENT_MASK, ADE9000_EVENT_DISABLE },
> { ADE9000_REG_WFB_CFG, ADE9000_WFB_CFG },
> { ADE9000_REG_VLEVEL, ADE9000_VLEVEL },
> - { ADE9000_REG_DICOEFF, ADE9000_DICOEFF },
> { ADE9000_REG_EGY_TIME, ADE9000_EGY_TIME },
> { ADE9000_REG_EP_CFG, ADE9000_EP_CFG },
> /* Clear all pending status bits by writing 1s */
> { ADE9000_REG_STATUS0, GENMASK(31, 0) },
> { ADE9000_REG_STATUS1, GENMASK(31, 0) },
> { ADE9000_REG_RUN, ADE9000_RUN_ON }
> };
[ ... ]
> @@ -1672,6 +1685,14 @@ static int ade9000_setup(struct ade9000_state *st)
> if (ret)
> return dev_err_probe(dev, ret, "Failed to write register sequence");
>
> + /* The ADE9430 has no on-chip digital integrator and lacks DICOEFF. */
> + if (st->info->has_digital_integrator) {
> + ret = regmap_write(st->regmap, ADE9000_REG_DICOEFF,
> + ADE9000_DICOEFF);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to set DICOEFF\n");
> + }
> +
> fsleep(2000);
>
> return 0;
[Severity: High]
Does this change cause a regression for existing devices by writing the
DICOEFF register after the DSP has already been started?
Because ADE9000_REG_DICOEFF is removed from ade9000_initialization_sequence,
the multi-register sequence now concludes with setting ADE9000_REG_RUN to
ADE9000_RUN_ON without writing DICOEFF first.
Then, ade9000_setup() conditionally writes ADE9000_REG_DICOEFF after the
initialization sequence has already started the DSP. Could this lead to the
configuration being ignored or cause unpredictable calculations since it is
written while the DSP is running?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907101623.8730-1-antoniu.miclaus@analog.com?part=3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes
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:29 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-09-07 10:29 UTC (permalink / raw)
To: Antoniu Miclaus; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The driver defines `ADE9000_ST1_CROSSING_DEPTH` as 25, which limits the bitmap iteration in the IRQ handler, causing `ADE9000_ST1_DIPC_BIT` (bit index 25) to be silently ignored and never cleared.
--
commit 656c536a824cd57c69e995fb40cb1db36bf309ee
Author: Antoniu Miclaus <antoniu.miclaus@analog.com>
iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes
The ADE9000 chip_info uses full-scale codes that do not match the datasheet.
This commit corrects the RMS and PCF full-scale codes to the values from the
ADE9000 datasheet, fixing a 0.3% reading error on the affected channels.
> diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
> index fd1362a980523..0f64bfb221da0 100644
> --- a/drivers/iio/adc/ade9000.c
> +++ b/drivers/iio/adc/ade9000.c
> @@ -677,9 +677,9 @@ static const struct ade9000_chip_info ade9000_chip_info = {
> .name = "ade9000",
> .channels = ade9000_channels,
> .num_channels = ARRAY_SIZE(ade9000_channels),
> - .rms_full_scale_codes = 52866837,
> + .rms_full_scale_codes = 52702092,
> .watt_full_scale_codes = 20694066,
> - .pcf_full_scale_codes = 74770000,
> + .pcf_full_scale_codes = 74532013,
> };
[Severity: High]
This is a pre-existing issue, but I noticed a potential problem in
ade9000_irq1_thread() with how it handles the interrupts bitmap:
drivers/iio/adc/ade9000.c:ade9000_irq1_thread() {
...
bitmap_from_arr32(interrupt_bits, &interrupts, ADE9000_ST1_CROSSING_DEPTH);
for_each_set_bit_from(bit, interrupt_bits,
ADE9000_ST1_CROSSING_DEPTH) {
...
}
Since ADE9000_ST1_CROSSING_DEPTH is defined as 25, will this restrict the loop
bounds to bits 0-24, causing bit 25 (ADE9000_ST1_DIPC_BIT) to be completely
ignored?
If userspace enables the DIPC event and the threshold condition is met, bit 25
would be set in ADE9000_REG_STATUS1 asserting the IRQ. Because the handler
skips bit 25, the interrupt status bit is never cleared. Would this result in
an interrupt storm since the hardware register uses write-1-to-clear logic?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907101623.8730-1-antoniu.miclaus@analog.com?part=1
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-09-07 10:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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:29 ` sashiko-bot
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-07 10:26 ` sashiko-bot
2026-09-07 10:16 ` [PATCH 4/4] docs: iio: ade9000: document ADE9430 support Antoniu Miclaus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox