Skip to contentSkip to conversation

iio: adc: ad4080: enable address ascension for chip identification

PATCH In review Antoniu Miclaus 3 participants 3 messages Sep 22 – Sep 25

Subsystems (3)
lore
Share & tools
lore

Antoniu Miclaus

author maintainer
#0 lore raw

PATCH 1/1 iio: adc: ad4080: enable address ascension for chip identification

The two byte bulk read at AD4080_REG_PRODUCT_ID_L expects PRODUCT_ID_L followed by PRODUCT_ID_H. After a software reset the AD408x defaults to descending address mode, so the second byte comes from CHIP_TYPE (0x03) instead. CHIP_TYPE reads 0x07 on all AD408x parts, so an AD4080 reports 0x0750 rather than 0x0050 and every part logs "Unrecognized CHIP_ID".

Set ADDR_ASC along with SDO_ENABLE before the read. This is the only multi byte transfer in the driver, so no other access is affected.

Fixes b66cddc8be72 ("iio: adc: ad4080: fix chip identification")
---
 drivers/iio/adc/ad4080.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/ad4080.c +2 -1
index 4843ecdd91a8..4ed82aa42400 100644
@@ -710,7 +710,8 @@ static int ad4080_setup_channel(struct ad4080_state *st, unsigned int ch)
 		return ret;
 
 	ret = regmap_write(st->regmap[ch], AD4080_REG_INTERFACE_CONFIG_A,
-			   AD4080_INTERFACE_CONFIG_A_SDO_ENABLE);
+			   AD4080_INTERFACE_CONFIG_A_SDO_ENABLE |
+			   AD4080_INTERFACE_CONFIG_A_ADDR_ASC);
 	if (ret)
 		return ret;
 

base-commit: dceba8e581e3e8f475da0efbd7a73f3d9524ddd2

Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Antoniu Miclaus

The two byte bulk read at AD4080_REG_PRODUCT_ID_L expects PRODUCT_ID_L followed by PRODUCT_ID_H. After a software reset the AD408x defaults to descending address mode, so the second byte comes from CHIP_TYPE (0x03) instead. CHIP_TYPE reads 0x07 on all AD408x parts, so an AD4080 reports 0x0750 rather than 0x0050 and every part logs "Unrecognized CHIP_ID".

Quoted 6 lines

Set ADDR_ASC along with SDO_ENABLE before the read. This is the only multi byte transfer in the driver, so no other access is affected.

Fixes b66cddc8be72 ("iio: adc: ad4080: fix chip identification")

---

You could also just use change AD4080_REG_PRODUCT_ID_L to AD4080_REG_PRODUCT_ID_H (maybe a slight smaller diff). Nut no strong feelings:

Quoted 22 lines
 drivers/iio/adc/ad4080.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/ad4080.c +2 -1
index 4843ecdd91a8..4ed82aa42400 100644
@@ -710,7 +710,8 @@ static int ad4080_setup_channel(struct ad4080_state *st, unsigned int ch)
 		return ret;
 
 	ret = regmap_write(st->regmap[ch], AD4080_REG_INTERFACE_CONFIG_A,
-			   AD4080_INTERFACE_CONFIG_A_SDO_ENABLE);
+			   AD4080_INTERFACE_CONFIG_A_SDO_ENABLE |
+			   AD4080_INTERFACE_CONFIG_A_ADDR_ASC);
 	if (ret)
 		return ret;
 

base-commit: dceba8e581e3e8f475da0efbd7a73f3d9524ddd2

Signature · 1 line
2.43.0
maintainer
#2 lore raw
Quoted 14 lines · On Tue, 22 Sep 2026 15:15:19 +0100 Nuno Sá <[email protected]> wrote:
Quoted 6 lines · Antoniu Miclaus

The two byte bulk read at AD4080_REG_PRODUCT_ID_L expects PRODUCT_ID_L followed by PRODUCT_ID_H. After a software reset the AD408x defaults to descending address mode, so the second byte comes from CHIP_TYPE (0x03) instead. CHIP_TYPE reads 0x07 on all AD408x parts, so an AD4080 reports 0x0750 rather than 0x0050 and every part logs "Unrecognized CHIP_ID".

Quoted 6 lines

Set ADDR_ASC along with SDO_ENABLE before the read. This is the only multi byte transfer in the driver, so no other access is affected.

Fixes b66cddc8be72 ("iio: adc: ad4080: fix chip identification")

---

Quoted 5 lines

You could also just use change AD4080_REG_PRODUCT_ID_L to AD4080_REG_PRODUCT_ID_H (maybe a slight smaller diff). Nut no strong feelings:

Applied to the testing branch of iio.git and marked for stable. I think this one can wait for the merge window. In reality it is likely so will all the other fixes I currently have on the iio-fixes branch.

Thanks.

Jonathan

Quoted 23 lines
Quoted 23 lines
 drivers/iio/adc/ad4080.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/ad4080.c +2 -1
index 4843ecdd91a8..4ed82aa42400 100644
@@ -710,7 +710,8 @@ static int ad4080_setup_channel(struct ad4080_state *st, unsigned int ch)
 		return ret;
 
 	ret = regmap_write(st->regmap[ch], AD4080_REG_INTERFACE_CONFIG_A,
-			   AD4080_INTERFACE_CONFIG_A_SDO_ENABLE);
+			   AD4080_INTERFACE_CONFIG_A_SDO_ENABLE |
+			   AD4080_INTERFACE_CONFIG_A_ADDR_ASC);
 	if (ret)
 		return ret;
 

base-commit: dceba8e581e3e8f475da0efbd7a73f3d9524ddd2

Signature · 1 line
2.43.0