Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Vincent Fazio <vfazio@gmail.com>
To: linux-gpio@vger.kernel.org
Subject: [question] Does gpiod_set_value have a "guarantee"?
Date: Mon, 18 Mar 2024 12:12:53 -0500	[thread overview]
Message-ID: <CAOrEah4J2U6eoyJrUar62y48GsiR8NahJpodkv-V80RRQxQJrQ@mail.gmail.com> (raw)

Is there any implicit or expected guarantee that after having returned from
gpiod_set_value that the GPIO will reflect the new value externally?

Some drivers that leverage GPIO to emulate buses, like i2c-gpio, may be relying
on this to be true in order to make a "stable" clock.

I was glancing at https://github.com/raspberrypi/linux/issues/5554 where
someone ran into an issue and it looks like, at least on the RPi 4 platform,
that there may need to be some "flush" mechanism to guarantee that a GPIO has
been written out.

If it's the responsibility of gpio_chip->set to do this, then I'm guessing the
pinctrl driver may need to be updated, but that does incur a performance hit
for every GPIO write.

If it's up to the bus emulator to do this, short of sampling the pin, should
there be some API or mechanism to assist with flushing writes out? Is there
already a mechanism to do this?

Thanks,
-Vincent

             reply	other threads:[~2024-03-18 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 17:12 Vincent Fazio [this message]
2024-04-16 21:02 ` [question] Does gpiod_set_value have a "guarantee"? Bartosz Golaszewski

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=CAOrEah4J2U6eoyJrUar62y48GsiR8NahJpodkv-V80RRQxQJrQ@mail.gmail.com \
    --to=vfazio@gmail.com \
    --cc=linux-gpio@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).