* [PATCH 1/4] iio: adc: ade9000: parameterise the reactive power channel
2026-10-12 11:13 [PATCH 0/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
@ 2026-10-12 11:13 ` Antoniu Miclaus
2026-10-12 13:51 ` Joshua Crofts
2026-10-12 11:13 ` [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible Antoniu Miclaus
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Antoniu Miclaus @ 2026-10-12 11:13 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, Janani Sunil,
Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux, linux-iio,
devicetree, linux-kernel, linux-doc
The channel array is declared once by ADE9000_DECLARE_CHANNELS() and
specialised per part through the altvoltage_rms argument, which lets parts
without dip/swell hardware drop those events. Some parts in the family do
not compute total reactive power at all and have no AVAR register, so they
need to drop the reactive power channel as well.
Add a second argument that selects the reactive power entry and introduce
the ADE9000_POWER_REACTIVE_ENTRY()/ADE9000_NO_POWER_REACTIVE_ENTRY() pair
for it. The entry macros include their own trailing comma so that the
variant for parts lacking the register can expand to nothing.
No functional change: the preprocessed ade9000_channels and
ade9078_channels tables are unchanged.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/adc/ade9000.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index e0113b62a261..03b69556b62f 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -561,6 +561,15 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
.scan_index = -1 \
}
+/*
+ * The entry macros below carry their own trailing comma so that parts without
+ * a total reactive power register can expand to nothing.
+ */
+#define ADE9000_POWER_REACTIVE_ENTRY(num) \
+ ADE9000_POWER_REACTIVE_CHANNEL(num),
+
+#define ADE9000_NO_POWER_REACTIVE_ENTRY(num)
+
#define ADE9000_POWER_APPARENT_CHANNEL(num) { \
.type = IIO_POWER, \
.channel = num, \
@@ -618,8 +627,10 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
/*
* Declare a full channel array. @altvoltage_rms picks the RMS voltage channel
* variant so parts without dip/swell hardware (e.g. ADE9078) omit those events.
+ * @power_reactive picks the total reactive power entry so parts that only
+ * compute fundamental reactive power omit that channel.
*/
-#define ADE9000_DECLARE_CHANNELS(_name, altvoltage_rms) \
+#define ADE9000_DECLARE_CHANNELS(_name, altvoltage_rms, power_reactive) \
static const struct iio_chan_spec _name[] = { \
/* Phase A channels */ \
ADE9000_CURRENT_CHANNEL(ADE9000_PHASE_A_NR), \
@@ -627,7 +638,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
ADE9000_ALTCURRENT_RMS_CHANNEL(ADE9000_PHASE_A_NR), \
altvoltage_rms(ADE9000_PHASE_A_NR), \
ADE9000_POWER_ACTIVE_CHANNEL(ADE9000_PHASE_A_NR), \
- ADE9000_POWER_REACTIVE_CHANNEL(ADE9000_PHASE_A_NR), \
+ power_reactive(ADE9000_PHASE_A_NR) \
ADE9000_POWER_APPARENT_CHANNEL(ADE9000_PHASE_A_NR), \
ADE9000_ENERGY_ACTIVE_CHANNEL(ADE9000_PHASE_A_NR, \
ADE9000_REG_AWATTHR_LO), \
@@ -642,7 +653,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
ADE9000_ALTCURRENT_RMS_CHANNEL(ADE9000_PHASE_B_NR), \
altvoltage_rms(ADE9000_PHASE_B_NR), \
ADE9000_POWER_ACTIVE_CHANNEL(ADE9000_PHASE_B_NR), \
- ADE9000_POWER_REACTIVE_CHANNEL(ADE9000_PHASE_B_NR), \
+ power_reactive(ADE9000_PHASE_B_NR) \
ADE9000_POWER_APPARENT_CHANNEL(ADE9000_PHASE_B_NR), \
ADE9000_ENERGY_ACTIVE_CHANNEL(ADE9000_PHASE_B_NR, \
ADE9000_REG_BWATTHR_LO), \
@@ -657,7 +668,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
ADE9000_ALTCURRENT_RMS_CHANNEL(ADE9000_PHASE_C_NR), \
altvoltage_rms(ADE9000_PHASE_C_NR), \
ADE9000_POWER_ACTIVE_CHANNEL(ADE9000_PHASE_C_NR), \
- ADE9000_POWER_REACTIVE_CHANNEL(ADE9000_PHASE_C_NR), \
+ power_reactive(ADE9000_PHASE_C_NR) \
ADE9000_POWER_APPARENT_CHANNEL(ADE9000_PHASE_C_NR), \
ADE9000_ENERGY_ACTIVE_CHANNEL(ADE9000_PHASE_C_NR, \
ADE9000_REG_CWATTHR_LO), \
@@ -668,8 +679,10 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
ADE9000_POWER_FACTOR_CHANNEL(ADE9000_PHASE_C_NR), \
}
-ADE9000_DECLARE_CHANNELS(ade9000_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL);
-ADE9000_DECLARE_CHANNELS(ade9078_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL_NO_EVENTS);
+ADE9000_DECLARE_CHANNELS(ade9000_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL,
+ ADE9000_POWER_REACTIVE_ENTRY);
+ADE9000_DECLARE_CHANNELS(ade9078_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL_NO_EVENTS,
+ ADE9000_POWER_REACTIVE_ENTRY);
/*
* Full-scale codes referred from the respective datasheets. These are the
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 1/4] iio: adc: ade9000: parameterise the reactive power channel
2026-10-12 11:13 ` [PATCH 1/4] iio: adc: ade9000: parameterise the reactive power channel Antoniu Miclaus
@ 2026-10-12 13:51 ` Joshua Crofts
0 siblings, 0 replies; 11+ messages in thread
From: Joshua Crofts @ 2026-10-12 13:51 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Nuno Sá, Michael Hennerich, Jonathan Cameron, David Lechner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Marcelo Schmitt, Radu Sabau,
Janani Sunil, Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux,
linux-iio, devicetree, linux-kernel, linux-doc
On Mon, 12 Oct 2026 14:13:37 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> The channel array is declared once by ADE9000_DECLARE_CHANNELS() and
> specialised per part through the altvoltage_rms argument, which lets parts
> without dip/swell hardware drop those events. Some parts in the family do
> not compute total reactive power at all and have no AVAR register, so they
> need to drop the reactive power channel as well.
>
> Add a second argument that selects the reactive power entry and introduce
> the ADE9000_POWER_REACTIVE_ENTRY()/ADE9000_NO_POWER_REACTIVE_ENTRY() pair
> for it. The entry macros include their own trailing comma so that the
> variant for parts lacking the register can expand to nothing.
>
> No functional change: the preprocessed ade9000_channels and
> ade9078_channels tables are unchanged.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible
2026-10-12 11:13 [PATCH 0/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
2026-10-12 11:13 ` [PATCH 1/4] iio: adc: ade9000: parameterise the reactive power channel Antoniu Miclaus
@ 2026-10-12 11:13 ` Antoniu Miclaus
2026-10-12 13:46 ` Joshua Crofts
2026-10-12 18:59 ` Conor Dooley
2026-10-12 11:13 ` [PATCH 3/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
` (2 subsequent siblings)
4 siblings, 2 replies; 11+ messages in thread
From: Antoniu Miclaus @ 2026-10-12 11:13 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, Janani Sunil,
Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux, linux-iio,
devicetree, linux-kernel, linux-doc
The ADE9039 is a polyphase energy metering device from the same family as
the ADE9000. It is register compatible with the ADE9000 for everything the
driver uses, provides the same on-chip dip/swell detection, and shares the
full-scale codes of the ADE9078.
It computes only fundamental reactive power and has no total reactive power
register, which is noted in the description. Like the ADE9078 it supports a
maximum serial clock frequency of 10 MHz rather than 20 MHz, so extend the
existing spi-max-frequency constraint to cover it.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
.../bindings/iio/adc/adi,ade9000.yaml | 29 +++++++++++--------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
index bcc166aad713..70106dd052ce 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
@@ -5,26 +5,28 @@
$id: http://devicetree.org/schemas/iio/adc/adi,ade9000.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Analog Devices ADE9000/ADE9078/ADE9430 High Performance, Polyphase Energy Metering
+title: Analog Devices ADE9000/ADE9078/ADE9430/ADE9039 High Performance, Polyphase Energy Metering
maintainers:
- Antoniu Miclaus <antoniu.miclaus@analog.com>
description: |
- 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).
+ The ADE9000, ADE9078, ADE9430 and ADE9039 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 ADE9039, and the ADE9430 has no on-chip digital integrator
+ (it uses an external analog integrator for Rogowski coils). The ADE9039 only
+ computes fundamental reactive power and has no total reactive power register.
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
+ https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9039.pdf
$ref: /schemas/spi/spi-peripheral-props.yaml#
@@ -32,6 +34,7 @@ properties:
compatible:
enum:
- adi,ade9000
+ - adi,ade9039
- adi,ade9078
- adi,ade9430
@@ -79,7 +82,9 @@ allOf:
properties:
compatible:
contains:
- const: adi,ade9078
+ enum:
+ - adi,ade9039
+ - adi,ade9078
then:
properties:
spi-max-frequency:
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible
2026-10-12 11:13 ` [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible Antoniu Miclaus
@ 2026-10-12 13:46 ` Joshua Crofts
2026-10-12 18:59 ` Conor Dooley
1 sibling, 0 replies; 11+ messages in thread
From: Joshua Crofts @ 2026-10-12 13:46 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Nuno Sá, Michael Hennerich, Jonathan Cameron, David Lechner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Marcelo Schmitt, Radu Sabau,
Janani Sunil, Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux,
linux-iio, devicetree, linux-kernel, linux-doc
On Mon, 12 Oct 2026 14:13:38 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> The ADE9039 is a polyphase energy metering device from the same family as
> the ADE9000. It is register compatible with the ADE9000 for everything the
> driver uses, provides the same on-chip dip/swell detection, and shares the
> full-scale codes of the ADE9078.
>
> It computes only fundamental reactive power and has no total reactive power
> register, which is noted in the description. Like the ADE9078 it supports a
> maximum serial clock frequency of 10 MHz rather than 20 MHz, so extend the
> existing spi-max-frequency constraint to cover it.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
> .../bindings/iio/adc/adi,ade9000.yaml | 29 +++++++++++--------
> 1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
> index bcc166aad713..70106dd052ce 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
> @@ -5,26 +5,28 @@
> $id: http://devicetree.org/schemas/iio/adc/adi,ade9000.yaml#
> $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> -title: Analog Devices ADE9000/ADE9078/ADE9430 High Performance, Polyphase Energy Metering
> +title: Analog Devices ADE9000/ADE9078/ADE9430/ADE9039 High Performance, Polyphase Energy Metering
>
> maintainers:
> - Antoniu Miclaus <antoniu.miclaus@analog.com>
>
> description: |
> - 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).
> + The ADE9000, ADE9078, ADE9430 and ADE9039 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 ADE9039, and the ADE9430 has no on-chip digital integrator
> + (it uses an external analog integrator for Rogowski coils). The ADE9039 only
> + computes fundamental reactive power and has no total reactive power register.
>
> 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
> + https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9039.pdf
That is a very short datasheet :)
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible
2026-10-12 11:13 ` [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible Antoniu Miclaus
2026-10-12 13:46 ` Joshua Crofts
@ 2026-10-12 18:59 ` Conor Dooley
1 sibling, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2026-10-12 18:59 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Nuno Sá, Michael Hennerich, Jonathan Cameron, David Lechner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Marcelo Schmitt, Joshua Crofts,
Radu Sabau, Janani Sunil, Salih Erim, Jishnu Prakash,
Jakub Szczudlo, linux, linux-iio, devicetree, linux-kernel,
linux-doc
[-- Attachment #1: Type: text/plain, Size: 4349 bytes --]
On Mon, Oct 12, 2026 at 02:13:38PM +0300, Antoniu Miclaus wrote:
> The ADE9039 is a polyphase energy metering device from the same family as
> the ADE9000. It is register compatible with the ADE9000 for everything the
> driver uses, provides the same on-chip dip/swell detection, and shares the
> full-scale codes of the ADE9078.
>
> It computes only fundamental reactive power and has no total reactive power
> register, which is noted in the description. Like the ADE9078 it supports a
AFAICT, this first sentence here is what prevents using a fallback,
could you be more clear about that please?
Otherwise,
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
Thanks,
Conor.
> maximum serial clock frequency of 10 MHz rather than 20 MHz, so extend the
> existing spi-max-frequency constraint to cover it.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
> .../bindings/iio/adc/adi,ade9000.yaml | 29 +++++++++++--------
> 1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
> index bcc166aad713..70106dd052ce 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml
> @@ -5,26 +5,28 @@
> $id: http://devicetree.org/schemas/iio/adc/adi,ade9000.yaml#
> $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> -title: Analog Devices ADE9000/ADE9078/ADE9430 High Performance, Polyphase Energy Metering
> +title: Analog Devices ADE9000/ADE9078/ADE9430/ADE9039 High Performance, Polyphase Energy Metering
>
> maintainers:
> - Antoniu Miclaus <antoniu.miclaus@analog.com>
>
> description: |
> - 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).
> + The ADE9000, ADE9078, ADE9430 and ADE9039 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 ADE9039, and the ADE9430 has no on-chip digital integrator
> + (it uses an external analog integrator for Rogowski coils). The ADE9039 only
> + computes fundamental reactive power and has no total reactive power register.
>
> 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
> + https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9039.pdf
>
> $ref: /schemas/spi/spi-peripheral-props.yaml#
>
> @@ -32,6 +34,7 @@ properties:
> compatible:
> enum:
> - adi,ade9000
> + - adi,ade9039
> - adi,ade9078
> - adi,ade9430
>
> @@ -79,7 +82,9 @@ allOf:
> properties:
> compatible:
> contains:
> - const: adi,ade9078
> + enum:
> + - adi,ade9039
> + - adi,ade9078
> then:
> properties:
> spi-max-frequency:
> --
> 2.43.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 3/4] iio: adc: ade9000: add support for ADE9039
2026-10-12 11:13 [PATCH 0/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
2026-10-12 11:13 ` [PATCH 1/4] iio: adc: ade9000: parameterise the reactive power channel Antoniu Miclaus
2026-10-12 11:13 ` [PATCH 2/4] dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible Antoniu Miclaus
@ 2026-10-12 11:13 ` Antoniu Miclaus
2026-10-12 13:50 ` Joshua Crofts
2026-10-12 11:13 ` [PATCH 4/4] docs: iio: ade9000: document ADE9039 support Antoniu Miclaus
2026-10-13 9:51 ` [PATCH 0/4] iio: adc: ade9000: add support for ADE9039 Nuno Sá
4 siblings, 1 reply; 11+ messages in thread
From: Antoniu Miclaus @ 2026-10-12 11:13 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, Janani Sunil,
Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux, linux-iio,
devicetree, linux-kernel, linux-doc
The ADE9039 is a polyphase energy metering device that is register
compatible with the ADE9000 for every register the driver touches. The
differences relevant to the driver are that it shares the full-scale codes
of the ADE9078 rather than those of the ADE9000, and that it has no total
reactive power register: the register map has no AVAR at 0x211 and no
AVAROS at 0x010, only the fundamental AFVAR and AFVAROS.
Add a chip_info for it and a channel table that keeps the dip/swell events
of the ADE9000 but drops the three total reactive power channels. The
fundamental reactive energy channels are unaffected, as AFVARHR is present.
No change is needed in the CALIBBIAS path: with no channel carrying the
AVAR address, that case is simply never reached for this part.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/adc/Kconfig | 1 +
drivers/iio/adc/ade9000.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 02de4809ae31..3052a86c460f 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -603,6 +603,7 @@ config ADE9000
- ADE9000
- ADE9078
- ADE9430
+ - ADE9039
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 03b69556b62f..e7f509bbac77 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -683,6 +683,8 @@ ADE9000_DECLARE_CHANNELS(ade9000_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL,
ADE9000_POWER_REACTIVE_ENTRY);
ADE9000_DECLARE_CHANNELS(ade9078_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL_NO_EVENTS,
ADE9000_POWER_REACTIVE_ENTRY);
+ADE9000_DECLARE_CHANNELS(ade9039_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL,
+ ADE9000_NO_POWER_REACTIVE_ENTRY);
/*
* Full-scale codes referred from the respective datasheets. These are the
@@ -718,6 +720,16 @@ static const struct ade9000_chip_info ade9430_chip_info = {
.has_digital_integrator = false, /* no on-chip digital integrator */
};
+static const struct ade9000_chip_info ade9039_chip_info = {
+ .name = "ade9039",
+ .channels = ade9039_channels,
+ .num_channels = ARRAY_SIZE(ade9039_channels),
+ .rms_full_scale_codes = 52866837,
+ .watt_full_scale_codes = 20823646,
+ .pcf_full_scale_codes = 74680000,
+ .has_digital_integrator = true,
+};
+
static const struct reg_sequence ade9000_initialization_sequence[] = {
{ ADE9000_REG_PGA_GAIN, ADE9000_PGA_GAIN },
{ ADE9000_REG_CONFIG0, ADE9000_CONFIG0 },
@@ -1883,6 +1895,7 @@ 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 },
+ { .name = "ade9039", .driver_data = (kernel_ulong_t)&ade9039_chip_info },
{ }
};
MODULE_DEVICE_TABLE(spi, ade9000_id);
@@ -1891,6 +1904,7 @@ 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 },
+ { .compatible = "adi,ade9039", .data = &ade9039_chip_info },
{ }
};
MODULE_DEVICE_TABLE(of, ade9000_of_match);
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 3/4] iio: adc: ade9000: add support for ADE9039
2026-10-12 11:13 ` [PATCH 3/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
@ 2026-10-12 13:50 ` Joshua Crofts
0 siblings, 0 replies; 11+ messages in thread
From: Joshua Crofts @ 2026-10-12 13:50 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Nuno Sá, Michael Hennerich, Jonathan Cameron, David Lechner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Marcelo Schmitt, Radu Sabau,
Janani Sunil, Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux,
linux-iio, devicetree, linux-kernel, linux-doc
On Mon, 12 Oct 2026 14:13:39 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> The ADE9039 is a polyphase energy metering device that is register
> compatible with the ADE9000 for every register the driver touches. The
> differences relevant to the driver are that it shares the full-scale codes
> of the ADE9078 rather than those of the ADE9000, and that it has no total
> reactive power register: the register map has no AVAR at 0x211 and no
> AVAROS at 0x010, only the fundamental AFVAR and AFVAROS.
>
> Add a chip_info for it and a channel table that keeps the dip/swell events
> of the ADE9000 but drops the three total reactive power channels. The
> fundamental reactive energy channels are unaffected, as AFVARHR is present.
>
> No change is needed in the CALIBBIAS path: with no channel carrying the
> AVAR address, that case is simply never reached for this part.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 4/4] docs: iio: ade9000: document ADE9039 support
2026-10-12 11:13 [PATCH 0/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
` (2 preceding siblings ...)
2026-10-12 11:13 ` [PATCH 3/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
@ 2026-10-12 11:13 ` Antoniu Miclaus
2026-10-12 13:49 ` Joshua Crofts
2026-10-13 9:51 ` [PATCH 0/4] iio: adc: ade9000: add support for ADE9039 Nuno Sá
4 siblings, 1 reply; 11+ messages in thread
From: Antoniu Miclaus @ 2026-10-12 11:13 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, Janani Sunil,
Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux, linux-iio,
devicetree, linux-kernel, linux-doc
Add the ADE9039 to the list of supported devices and note that, unlike the
ADE9078 and ADE9430, it does provide the on-chip dip/swell events. Also
document that it exposes no total reactive power attributes, since the part
computes only fundamental reactive power.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Documentation/iio/ade9000.rst | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/Documentation/iio/ade9000.rst b/Documentation/iio/ade9000.rst
index 0c0a8ea8213b..13b7ecf83cb8 100644
--- a/Documentation/iio/ade9000.rst
+++ b/Documentation/iio/ade9000.rst
@@ -1,12 +1,11 @@
.. SPDX-License-Identifier: GPL-2.0
-==============================
-ADE9000/ADE9078/ADE9430 driver
-==============================
+======================================
+ADE9000/ADE9078/ADE9430/ADE9039 driver
+======================================
-+This driver supports Analog Devices' ADE9000, ADE9078 and ADE9430 energy
-+measurement ICs on SPI bus.
-ICs on SPI bus.
+This driver supports Analog Devices' ADE9000, ADE9078, ADE9430 and ADE9039
+energy measurement ICs on SPI bus.
1. Supported devices
====================
@@ -14,6 +13,7 @@ ICs on SPI bus.
* `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>`_
* `ADE9430 <https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9430.pdf>`_
+* `ADE9039 <https://www.analog.com/media/en/technical-documentation/data-sheets/ADE9039.pdf>`_
The supported parts are highly accurate, fully integrated,
multiphase energy and power quality monitoring devices. Superior analog
@@ -24,9 +24,15 @@ 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.
+available on the ADE9000 and the ADE9039, so the RMS voltage swell/dip events
+described below are only available on those two parts. The ADE9430 additionally
+has no on-chip digital integrator and instead uses an external analog integrator
+for Rogowski coils.
+
+The ADE9039 computes only fundamental reactive power and has no total reactive
+power register, so the ``in_power[0-2]_reactive_*`` files described below are
+not present on that part. The reactive energy files are unaffected, as every
+supported part accumulates fundamental reactive energy.
2. Device attributes
====================
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 4/4] docs: iio: ade9000: document ADE9039 support
2026-10-12 11:13 ` [PATCH 4/4] docs: iio: ade9000: document ADE9039 support Antoniu Miclaus
@ 2026-10-12 13:49 ` Joshua Crofts
0 siblings, 0 replies; 11+ messages in thread
From: Joshua Crofts @ 2026-10-12 13:49 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Nuno Sá, Michael Hennerich, Jonathan Cameron, David Lechner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Marcelo Schmitt, Radu Sabau,
Janani Sunil, Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux,
linux-iio, devicetree, linux-kernel, linux-doc
On Mon, 12 Oct 2026 14:13:40 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> Add the ADE9039 to the list of supported devices and note that, unlike the
> ADE9078 and ADE9430, it does provide the on-chip dip/swell events. Also
> document that it exposes no total reactive power attributes, since the part
> computes only fundamental reactive power.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/4] iio: adc: ade9000: add support for ADE9039
2026-10-12 11:13 [PATCH 0/4] iio: adc: ade9000: add support for ADE9039 Antoniu Miclaus
` (3 preceding siblings ...)
2026-10-12 11:13 ` [PATCH 4/4] docs: iio: ade9000: document ADE9039 support Antoniu Miclaus
@ 2026-10-13 9:51 ` Nuno Sá
4 siblings, 0 replies; 11+ messages in thread
From: Nuno Sá @ 2026-10-13 9:51 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Michael Hennerich, Jonathan Cameron, David Lechner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet, Shuah Khan,
Randy Dunlap, Marcelo Schmitt, Joshua Crofts, Radu Sabau,
Janani Sunil, Salih Erim, Jishnu Prakash, Jakub Szczudlo, linux,
linux-iio, devicetree, linux-kernel, linux-doc
On Mon, Oct 12, 2026 at 02:13:36PM +0300, Antoniu Miclaus wrote:
> Add support for the ADE9039, a polyphase energy monitoring device in the
> ADE9000 family. It is register compatible with the ADE9000 for every
> register the driver touches. The differences that matter here are:
>
> - full-scale codes match the ADE9078, not the ADE9000;
> - dip/swell detection and the digital integrator are both present;
> - there is no total reactive power: no AVAR at 0x211, no AVAROS at
> 0x010, only the fundamental AFVAR and AFVAROS;
> - maximum SPI clock is 10 MHz, as on the ADE9078.
>
> It is the first part needing dip/swell present together with total
> reactive power absent, which the channel-array macro could not express.
> Patch 1 adds a second selector argument for the reactive power entry; it
> is a no-op for the existing parts, with the preprocessed ade9000_channels
> and ade9078_channels tables byte identical before and after.
>
> The missing total reactive power channel is omitted rather than
> repointed at AFVAR, which would make in_power[0-2]_reactive_raw mean
> total power on the ADE9000 and fundamental power on the ADE9039 with no
> IIO modifier to tell them apart. The fundamental reactive energy
> channels are unaffected.
>
> Patch 4 also clears three stray characters left in the ade9000.rst
> introduction by the ADE9430 merge resolution. Happy to split that out.
>
> Antoniu Miclaus (4):
> iio: adc: ade9000: parameterise the reactive power channel
> dt-bindings: iio: adc: adi,ade9000: add adi,ade9039 compatible
> iio: adc: ade9000: add support for ADE9039
> docs: iio: ade9000: document ADE9039 support
>
> .../bindings/iio/adc/adi,ade9000.yaml | 29 ++++++++------
> Documentation/iio/ade9000.rst | 24 +++++++-----
> drivers/iio/adc/Kconfig | 1 +
> drivers/iio/adc/ade9000.c | 39 ++++++++++++++++---
> 4 files changed, 66 insertions(+), 27 deletions(-)
>
>
> base-commit: a22dc7ebb21a6bd4c8b63bc2c1dd46a24945aae7
> --
> 2.43.0
>
Don't love the power_reactive handling in terms of readability but
fine...
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
^ permalink raw reply [flat|nested] 11+ messages in thread