* [PATCH] iio: adc: ad4080: enable address ascension for chip identification
@ 2026-09-22 11:09 Antoniu Miclaus
2026-09-22 14:15 ` Nuno Sá
0 siblings, 1 reply; 3+ messages in thread
From: Antoniu Miclaus @ 2026-09-22 11:09 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Antoniu Miclaus, Jonathan Cameron,
David Lechner, linux, linux-iio, linux-kernel
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")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/adc/ad4080.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c
index 4843ecdd91a8..4ed82aa42400 100644
--- a/drivers/iio/adc/ad4080.c
+++ b/drivers/iio/adc/ad4080.c
@@ -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
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: adc: ad4080: enable address ascension for chip identification
2026-09-22 11:09 [PATCH] iio: adc: ad4080: enable address ascension for chip identification Antoniu Miclaus
@ 2026-09-22 14:15 ` Nuno Sá
2026-09-25 2:58 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Nuno Sá @ 2026-09-22 14:15 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Michael Hennerich, Jonathan Cameron, David Lechner, linux,
linux-iio, linux-kernel
On Tue, Sep 22, 2026 at 02:09:58PM +0300, Antoniu Miclaus wrote:
> 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")
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
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:
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> drivers/iio/adc/ad4080.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c
> index 4843ecdd91a8..4ed82aa42400 100644
> --- a/drivers/iio/adc/ad4080.c
> +++ b/drivers/iio/adc/ad4080.c
> @@ -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
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: adc: ad4080: enable address ascension for chip identification
2026-09-22 14:15 ` Nuno Sá
@ 2026-09-25 2:58 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-09-25 2:58 UTC (permalink / raw)
To: Nuno Sá
Cc: Antoniu Miclaus, Michael Hennerich, David Lechner, linux,
linux-iio, linux-kernel
On Tue, 22 Sep 2026 15:15:19 +0100
Nuno Sá <nuno.sa@analog.com> wrote:
> On Tue, Sep 22, 2026 at 02:09:58PM +0300, Antoniu Miclaus wrote:
> > 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")
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> > ---
>
> 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:
>
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
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
>
> > drivers/iio/adc/ad4080.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c
> > index 4843ecdd91a8..4ed82aa42400 100644
> > --- a/drivers/iio/adc/ad4080.c
> > +++ b/drivers/iio/adc/ad4080.c
> > @@ -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
> > --
> > 2.43.0
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-25 2:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 11:09 [PATCH] iio: adc: ad4080: enable address ascension for chip identification Antoniu Miclaus
2026-09-22 14:15 ` Nuno Sá
2026-09-25 2:58 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®