mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikhil Gautam <nikhilgtr@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	Joshua Crofts <joshua.crofts1@gmail.com>
Subject: Re: [PATCH v2] iio: ccs811: Deassert WAKE GPIO on error paths
Date: Sun, 18 Oct 2026 02:42:18 +0530	[thread overview]
Message-ID: <5d5812be-430d-47f3-9e08-287300284c62@gmail.com> (raw)
In-Reply-To: <20261017214659.5bbebc38@jic23-hlaptop>

Hi Jonathan,

Thanks for the review.

>> Ensure the WAKE GPIO is deasserted when status polling fails or
>> the data-ready timeout expires. Early returns could leave WAKE asserted,
>> preventing the sensor from returning to its low-power state and
>> potentially disrupting subsequent I2C transactions.
> I need more on this point to know whether we care if an error
> means we don't deassert the wake pin.
>
> Why would failing to go to sleep break future transactions?
> I'd kind of assume we'd awaken an already awake device (which sounds
> idempotent but maybe not?) and carry on from there?
>
> Jonathan

The relevant information is in the CCS811 datasheet (v1-06),
under “CCS811 – Pin Assignment” (page 4) and “Detailed Description” 
(page 7 onwards).

The datasheet specifies that nWAKE is active-low and should be asserted
before an I²C transaction and held low throughout it. It also describes
the sleep behavior: when nWAKE is deasserted, the device enters sleep
mode and ignores I²C requests. The timing specifications specify a 50 µs
wake-up time and a minimum 20 µs deassertion interval.

I agree that the datasheet does not explicitly state that leaving nWAKE
asserted after an error will cause subsequent transactions to fail.
My concern is primarily that an early return leaves the device awake
instead of restoring the intended low-power state.

I'll adjust the justification accordingly, rather than claiming that 
subsequent
transactions would necessarily be disrupted.

Thanks,
Nikhil

  reply	other threads:[~2026-10-17 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 12:30 Nikhil Gautam
2026-10-15 12:50 ` Joshua Crofts
2026-10-17 20:46 ` Jonathan Cameron
2026-10-17 21:12   ` Nikhil Gautam [this message]
2026-10-17 23:37     ` Jonathan Cameron

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=5d5812be-430d-47f3-9e08-287300284c62@gmail.com \
    --to=nikhilgtr@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --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

all inboxes | Powered by JetHome®