mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Jules Maselbas <jmaselbas@kalray.eu>
Cc: Sascha Hauer <sha@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH] gpiolib: fix gpio-hog functionality
Date: Thu, 1 Jun 2023 19:13:15 +0200	[thread overview]
Message-ID: <20230601171315.4ck3kdwybpaiezmh@pengutronix.de> (raw)
In-Reply-To: <ZHjCvPyB21Y2AWw+@tellis.lin.mbt.kalray.eu>

On 23-06-01, Jules Maselbas wrote:
> On Thu, Jun 01, 2023 at 04:32:09PM +0200, Sascha Hauer wrote:
> > On Thu, Jun 01, 2023 at 04:25:06PM +0200, Marco Felsch wrote:
> > > This reverts commit 3641d381e63321016e3bf09504852a6b2a2f879b.
> > > 
> > > Since the of_xlate support the gpio-hog support is broken because the
> > > 'gpio' property used to specify the gpio-hog pin does not contain any
> > > phandle. Due to the fact that of_xlate was never implemented the easiest
> > > way to fix the gpio-hog functionality is to revert the commit.
> > 
> > 3641d381e63321016e3bf09504852a6b2a2f879b was introduced for sunxi. As
> > Jules is currently working on sunxi support this is likely needed soon,
> > so what's the second easiest way?
> I am not very familiar with the gpio-hog concept, what I understand is:
> 
> "gpio-hog" are a description of gpios config to be initialized early on.
> The main difference with classic gpio is the omission of the phandle of
> the gpio controller (since gpio-hog are expected to be a child node of
> gpio controller). Correct me if I am wrong.

Correct hogs are used if you have a static gpio e.g. a power-switch
which is never turned off.

> In this case the current version of of_hog_gpio fails since it calls
> of_parse_phandle_with_args which expect the gpio to start with the controller
> phandle.

Correct.

> My best guess would be to rework of_hog_gpio to not use of_parse_phandle_with_args
> and probably not gpio_of_xlate

This would be a partly revert of your commit.

> This sounds easier than a sync of barebox gpio code with linux.

You don't need to sync the complete code, let me check if I can prepare
a patch which adds the of_xlate support and is a bit more in sync with
the kernel. If this is not possible I go with the partly revert.

Regards,
  Marco



  reply	other threads:[~2023-06-01 17:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 14:25 Marco Felsch
2023-06-01 14:32 ` Sascha Hauer
2023-06-01 14:38   ` Marco Felsch
2023-06-01 15:28     ` Jules Maselbas
2023-06-01 15:50       ` Marco Felsch
2023-06-01 16:09   ` Jules Maselbas
2023-06-01 17:13     ` Marco Felsch [this message]
2023-06-02  7:54       ` Marco Felsch
2023-06-02  8:02         ` Jules Maselbas
2023-06-01 15:42 ` Johannes Zink

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=20230601171315.4ck3kdwybpaiezmh@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jmaselbas@kalray.eu \
    --cc=sha@pengutronix.de \
    /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