linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@codeconstruct.com.au>
To: Nikita Shubin <nikita.shubin@maquefel.me>, Joel Stanley <joel@jms.id.au>
Cc: linux-gpio@vger.kernel.org
Subject: Re: Question about ASPEED GPIO value/direction set order
Date: Thu, 13 Mar 2025 16:51:49 +1030	[thread overview]
Message-ID: <4878ed9cfd9ff20550cf0d9d8933ec993f4b288c.camel@codeconstruct.com.au> (raw)
In-Reply-To: <3cd0fe0ff42a751fd0738dacf16badcaa8ff51fb.camel@maquefel.me>

Hi Nikita,

On Tue, 2025-03-11 at 15:40 +0300, Nikita Shubin wrote:
> Hi Joel and Andrew !
> 
> I am observing "strange" behaviour when pin direction is set AFTER
> the
> value itself:
> 
> ```
> aspeed_gpio_dir_out:
> 
> __aspeed_gpio_set(gc, offset, val);
> gpio->config->llops->reg_bit_set(gpio, offset, reg_dir, 1);
> ```
> 
> Is this as intended ?

Yes; you tend to set the value only when using the GPIO for output, and
by setting the value before setting the direction, we avoid the
potential value glitch which occurs under the opposite order.

Andrew


  reply	other threads:[~2025-03-13  6:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 12:40 Question about ASPEED GPIO value/direction set order Nikita Shubin
2025-03-13  6:21 ` Andrew Jeffery [this message]
2025-03-13  7:39   ` Nikita Shubin
2025-03-18  0:48     ` Andrew Jeffery

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=4878ed9cfd9ff20550cf0d9d8933ec993f4b288c.camel@codeconstruct.com.au \
    --to=andrew@codeconstruct.com.au \
    --cc=joel@jms.id.au \
    --cc=linux-gpio@vger.kernel.org \
    --cc=nikita.shubin@maquefel.me \
    /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 NNTP newsgroup(s).