From: Brad Kelley <brad@bradkelley.org>
To: Richard Fitzgerald <rf@opensource.cirrus.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Brad Kelley <spambake@bradkelley.org>
Cc: david.rhodes@cirrus.com, lgirdwood@gmail.com, broonie@kernel.org,
perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
patches@opensource.cirrus.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Correct a typo which inverted the reset GPIO pin sequence.
Date: Fri, 12 Dec 2025 07:44:21 -0800 [thread overview]
Message-ID: <f93147a6-0357-44d8-97ef-9cefd666629a@bradkelley.org> (raw)
In-Reply-To: <9bcc59d6-027a-4b66-af81-2f69c84c3efd@opensource.cirrus.com>
On 12/11/2025 2:19 AM, Richard Fitzgerald wrote:
> Actually this patch looks incorrect and will break things.
> The 2nd argument to gpiod_direction_output() is the initial state of
> the GPIO. The kerneldoc for the function says "The initial value of the
> output must be specified as the logical value of the GPIO"
>
> So the original code is correct: first we assert it (logical state 1)
> then below it is deasserted (logical state 0).
>
> The problem is that originally the code set the raw signal level
> (0 to reset, 1 to not-reset) but now that it uses gpiod you must
> add the ACTIVE_LOW flag to the gpio definition if its electrical
> signal level is inverse of its logical level.
>
> See the code in gpiod_direction_output_nonotify() in
> drivers/gpio/gpiolib.c, which inverts the value if FLAG_ACTIVE_LOW
> is set.
Thanks to both of you for the explanations and patience. That all
makes sense and I appreciate the guidance.
This my first patch. I think I need to send a withdrawal email.
The problem for my use seems to be in the superaudioboard overlay
which sets the GPIO_ACTIVE_HIGH flag. A quick compile of the
edited dts file fixes the problem. I changed the line to this:
reset-gpio = <&gpio 26 1>; /* Pin 26, active low */
but maybe there's an updated method.
I'll do some more research and testing and submit a new patch to
the proper maintainers for that overlay.
Thanks again,
Brad
next prev parent reply other threads:[~2025-12-12 15:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-11 5:16 Brad Kelley
2025-12-11 9:39 ` Charles Keepax
2025-12-11 10:02 ` Charles Keepax
2025-12-11 10:19 ` Richard Fitzgerald
2025-12-12 15:44 ` Brad Kelley [this message]
2025-12-12 16:03 ` Charles Keepax
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=f93147a6-0357-44d8-97ef-9cefd666629a@bradkelley.org \
--to=brad@bradkelley.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=david.rhodes@cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.com \
--cc=spambake@bradkelley.org \
--cc=tiwai@suse.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®