Linux IIO development
 help / color / mirror / Atom feed
From: Stepan Ionichev <sozdayvek@gmail.com>
To: Michael.Hennerich@analog.com, nuno.sa@analog.com
Cc: lars@metafoo.de, jic23@kernel.org, dlechner@baylibre.com,
	andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, sozdayvek@gmail.com
Subject: ad7768-1: GPIO reset path delays do not match the datasheet
Date: Wed, 13 May 2026 20:00:42 +0500	[thread overview]
Message-ID: <20260513150042.10939-1-sozdayvek@gmail.com> (raw)

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

             reply	other threads:[~2026-05-13 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 15:00 Stepan Ionichev [this message]
2026-05-13 20:37 ` ad7768-1: GPIO reset path delays do not match the datasheet Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260513150042.10939-1-sozdayvek@gmail.com \
    --to=sozdayvek@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox