[PATCH v2 3/4] iio: adc: ade9000: add support for ADE9039

From: Antoniu Miclaus

Date: Thu Oct 22 2026 - 07:19:57 EST


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@xxxxxxxxxx>
Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
---
Changes in v2:
- List the ADE9039 in numeric part order in the channel declarations,
the chip_info definitions, the SPI and OF ID tables and the Kconfig
help text.

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..238957243476 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -601,6 +601,7 @@ config ADE9000
highly accurate, multiphase energy and power quality monitoring
integrated circuits:
- ADE9000
+ - ADE9039
- ADE9078
- ADE9430

diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index fb69cbbb38fc..b7a29d6b09fc 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -681,6 +681,8 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {

ADE9000_DECLARE_CHANNELS(ade9000_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL,
ADE9000_POWER_REACTIVE_ENTRY);
+ADE9000_DECLARE_CHANNELS(ade9039_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL,
+ ADE9000_NO_POWER_REACTIVE_ENTRY);
ADE9000_DECLARE_CHANNELS(ade9078_channels, ADE9000_ALTVOLTAGE_RMS_CHANNEL_NO_EVENTS,
ADE9000_POWER_REACTIVE_ENTRY);

@@ -698,6 +700,16 @@ static const struct ade9000_chip_info ade9000_chip_info = {
.has_digital_integrator = true,
};

+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 ade9000_chip_info ade9078_chip_info = {
.name = "ade9078",
.channels = ade9078_channels,
@@ -1883,6 +1895,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 = "ade9039", .driver_data = (kernel_ulong_t)&ade9039_chip_info },
{ .name = "ade9078", .driver_data = (kernel_ulong_t)&ade9078_chip_info },
{ .name = "ade9430", .driver_data = (kernel_ulong_t)&ade9430_chip_info },
{ }
@@ -1891,6 +1904,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,ade9039", .data = &ade9039_chip_info },
{ .compatible = "adi,ade9078", .data = &ade9078_chip_info },
{ .compatible = "adi,ade9430", .data = &ade9430_chip_info },
{ }
--
2.43.0