All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [PATCH v6 3/3] gpio: search for gpio label if gpio is not found through bank name
Date: Tue, 21 Jul 2020 15:18:56 +0200	[thread overview]
Message-ID: <d71e803f-ff16-b88e-c78a-a9873ad6bf56@xilinx.com> (raw)
In-Reply-To: <4af17601-f95f-c5a4-5a24-1c84c3581fd3@denx.de>



On 21. 07. 20 8:40, Heiko Schocher wrote:
> Hi Michal,
> 
> Am 20.07.2020 um 10:30 schrieb Michal Simek:
>> Hi Heiko,
>>
>> p? 22. 5. 2020 v 11:10 odes?latel Heiko Schocher <hs@denx.de> napsal:
>>>
>>> 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>
>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>> 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
>>> =>
>>
>> I spotted this patch and I am curious if you have thought about also
>> supporting gpio-line-names.
> 
> Yes, that would be a good extension!
> 
> searching for "gpio-line-names" in u-boot source shows only an entry in
> 
> ./doc/device-tree-bindings/gpio/gpio.txt
> 
> and some DTS files in arch/arm
> 
> but no driver code, which handles the property, so there is some
> work to do.
> 
> Currently I have no project (and time) to give this a chance...
> 
> But if the code, which handle "gpio-line-names" saves the name in
> "struct gpio_dev_priv name", DM_GPIO_LOOKUP_LABEL based code should
> work with it.

I have sent a patch for it. Please take a look.

Thanks,
Michal

      reply	other threads:[~2020-07-21 13:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  9:08 [PATCH v6 0/3] gpio: add possibility to search for gpio label name Heiko Schocher
2020-05-22  9:08 ` [PATCH v6 1/3] gpio-uclass.c: save the GPIOD flags also in the gpio descriptor Heiko Schocher
2020-05-22 23:13   ` Simon Glass
2020-06-30 16:19   ` Walter Lozano
2020-07-01 15:24     ` Walter Lozano
2020-07-05 21:58   ` Tom Rini
2020-05-22  9:08 ` [PATCH v6 2/3] sandbox, test: add test for GPIO_HOG function Heiko Schocher
2020-07-05 21:58   ` Tom Rini
2020-05-22  9:08 ` [PATCH v6 3/3] gpio: search for gpio label if gpio is not found through bank name Heiko Schocher
2020-07-08  3:03   ` Tom Rini
2020-07-20  8:30   ` Michal Simek
2020-07-21  6:40     ` Heiko Schocher
2020-07-21 13:18       ` Michal Simek [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=d71e803f-ff16-b88e-c78a-a9873ad6bf56@xilinx.com \
    --to=michal.simek@xilinx.com \
    --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.