[PATCH v2 1/6] iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes

Antoniu Miclaus <[email protected]>
Newsgroups org.kernel.vger.linux-doc,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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")
Signed-off-by: Antoniu Miclaus <[email protected]>
---
Changes in v2:
- no changes.

 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.