Linux IIO development
 help / color / mirror / Atom feed
* ad7768-1: GPIO reset path delays do not match the datasheet
@ 2026-05-13 15:00 Stepan Ionichev
  2026-05-13 20:37 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Stepan Ionichev @ 2026-05-13 15:00 UTC (permalink / raw)
  To: Michael.Hennerich, nuno.sa
  Cc: lars, jic23, dlechner, andy, linux-iio, linux-kernel, sozdayvek

Hi all,

Reading drivers/iio/adc/ad7768-1.c I noticed the GPIO reset path
uses two bare fsleep() calls that seem to disagree with the AD7768-1
datasheet (Rev. B). I do not have AD7768-1 hardware to test this,
so I am reporting it rather than sending a patch -- maybe someone
with a board can verify and fix.

Code (drivers/iio/adc/ad7768-1.c, around lines 1249-1252):

    if (st->gpio_reset) {
        fsleep(10);
        gpiod_set_value_cansleep(st->gpio_reset, 0);
        fsleep(200);
    }

Compared with the datasheet (AD7768-1 Rev. B, page 6, Table 1
"Specifications", ADC RESET section):

    Reset Low Pulse Width        minimum 100 us
    ADC Start-Up Time After Reset           17 ms
                                  (Reset rising edge to first DRDY,
                                   PIN mode, decimate by 8)

So the in-tree code:
  - holds the RESET pin low for ~10 us, where the datasheet
    requires a minimum of 100 us;
  - waits ~200 us after deasserting RESET before issuing SPI
    traffic / set_mode, where the datasheet specifies 17 ms from
    the reset rising edge to the first DRDY.

The neighbouring SPI-reset branch already cites the datasheet
(page 70), which is why this jumped out.

If anyone with an AD7768-1 board can confirm whether the chip
actually needs the datasheet-spec timing (or whether something
else makes the shorter waits fine in practice), this looks worth
a follow-up patch -- something like:

    if (st->gpio_reset) {
        /* RESET low pulse width: datasheet Rev. B, page 6,
         * Table 1, min 100 us. */
        fsleep(100);
        gpiod_set_value_cansleep(st->gpio_reset, 0);
        /* ADC start-up time after reset: datasheet Rev. B,
         * page 6, Table 1, 17 ms (reset rising edge to first
         * DRDY, PIN mode, decimate by 8). */
        msleep(17);
    }

I am happy to send the patch myself if someone with hardware
confirms it does not regress -- I would rather not submit an
untested timing change blind.

Stepan

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ad7768-1: GPIO reset path delays do not match the datasheet
  2026-05-13 15:00 ad7768-1: GPIO reset path delays do not match the datasheet Stepan Ionichev
@ 2026-05-13 20:37 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-05-13 20:37 UTC (permalink / raw)
  To: Stepan Ionichev
  Cc: Michael.Hennerich, nuno.sa, lars, jic23, dlechner, andy,
	linux-iio, linux-kernel

On Wed, May 13, 2026 at 08:00:42PM +0500, Stepan Ionichev wrote:

> Reading drivers/iio/adc/ad7768-1.c I noticed the GPIO reset path
> uses two bare fsleep() calls that seem to disagree with the AD7768-1
> datasheet (Rev. B). I do not have AD7768-1 hardware to test this,
> so I am reporting it rather than sending a patch -- maybe someone
> with a board can verify and fix.

...

> I am happy to send the patch myself if someone with hardware
> confirms it does not regress -- I would rather not submit an
> untested timing change blind.

This is ADI chip, right? We have a few senior developers from there in this ML,
let's ask them!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-13 20:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 15:00 ad7768-1: GPIO reset path delays do not match the datasheet Stepan Ionichev
2026-05-13 20:37 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox