All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/2] gpio: search for gpio label if gpio is not found through bank name
Date: Mon, 3 Feb 2020 10:15:03 -0700	[thread overview]
Message-ID: <CAPnjgZ3_Lufzq7rXq_V0AhUW2v6Le-qkeBtbQO58QF0uJw8U6Q@mail.gmail.com> (raw)
In-Reply-To: <70831a9d-2065-caf8-ce24-8666534eaba5@denx.de>

Hi Heiko,

On Sun, 2 Feb 2020 at 22:26, Heiko Schocher <hs@denx.de> wrote:
>
> Hello Simon,
>
> Am 03.02.2020 um 01:04 schrieb Simon Glass:
> > On Sat, 1 Feb 2020 at 01:03, Heiko Schocher <hs@denx.de> wrote:
> >>
> >> dm_gpio_lookup_name() searches for a gpio through
> >> the bank name. But we have also gpio labels, and it
> >> makes sense to search for a gpio also in the labels
> >> we have defined, if no gpio is found through the
> >> bank name definition.
> >>
> >> This is useful for example if you have a wp pin on
> >> different gpios on different board versions.
> >>
> >> If dm_gpio_lookup_name() searches also for the gpio labels,
> >> you can give the gpio an unique label name and search
> >> for this label, and do not need to differ between
> >> board revisions.
> >>
> >> Signed-off-by: Heiko Schocher <hs@denx.de>
> >> ---
> >>
> >> Example on the aristainetos board:
> >>
> >> => gpio clear wp_spi_nor.gpio-hog
> >> gpio: pin wp_spi_nor.gpio-hog (gpio 47) value is 0
> >> =>
> >>
> >> before this patch, you need to know where your
> >> pin is:
> >>
> >> => gpio clear GPIO2_15
> >> gpio: pin GPIO2_15 (gpio 47) value is 0
> >> =>
> >>
> >> travis build:
> >>
> >> Changes in v2:
> >> - add comment from Simon Glass
> >>    move code into seperate function dm_gpio_lookup_label()
> >>    add test if dm_gpio_lookup_label() works
> >>
> >>   drivers/gpio/gpio-uclass.c | 38 ++++++++++++++++++++++++++++++++++++++
> >>   test/dm/gpio.c             |  7 +++++++
> >>   2 files changed, 45 insertions(+)
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > I wonder if this should be a Kconfig so we can disable it by default in SPL?
>
> Hmm.. maybe a good idea for boards which have code size restrictions.
> On the other hand, on such boards DM/DTS is most likely no option?

The overhead of DM in SPL is pretty small, particularly if you use of-platdata.

>
> But it should be easy to add this into a Kconfig option, proposal
>
> DM_GPIO_LOOKUP_LABEL ?
>
> default: n for SPL and U-Boot ?

I'd suggest y for U-Boot and n for SPL

Regards,
Simon

      reply	other threads:[~2020-02-03 17:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-01  8:02 [PATCH v2 0/2] gpio: add possibility to search for gpio label name Heiko Schocher
2020-02-01  8:02 ` [PATCH v2 1/2] sandbox, test: add test for GPIO_HOG function Heiko Schocher
2020-02-03  0:04   ` Simon Glass
2020-02-01  8:02 ` [PATCH v2 2/2] gpio: search for gpio label if gpio is not found through bank name Heiko Schocher
2020-02-03  0:04   ` Simon Glass
2020-02-03  5:25     ` Heiko Schocher
2020-02-03 17:15       ` Simon Glass [this message]

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=CAPnjgZ3_Lufzq7rXq_V0AhUW2v6Le-qkeBtbQO58QF0uJw8U6Q@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.