linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Tobias Diedrich <ranma+kernel@tdiedrich.de>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] gpio / ACPI: Add label to the gpio request
Date: Mon, 15 Jun 2015 11:29:04 +0900	[thread overview]
Message-ID: <CAAVeFu+dfc3vH73_uhwDftrd0OEYrX0ZiqK1MSAqsCcpKpzRTw@mail.gmail.com> (raw)
In-Reply-To: <20150614220057.GC29802@yumi.tdiedrich.de>

On Mon, Jun 15, 2015 at 7:00 AM, Tobias Diedrich
<ranma+kernel@tdiedrich.de> wrote:
> In leds-gpio.c create_gpio_led only the legacy path propagates the label
> by passing it into devm_gpio_request_one. Similarily gpio_keys_polled.c
> also neglects to propagate the name to the gpio subsystem.
>
> On the newer devicetree/acpi path the label is lost as far as the GPIO
> subsystem goes (it is only retained as name in struct gpio_led.
>
> Amend devm_get_gpiod_from_child to take an additonal (optional) label
> argument and propagate it so it will show up in /sys/kernel/debug/gpio.
>
> So instead of:
>
> GPIOs 288-511, platform/PRP0001:00, AMD SBX00:
>  gpio-475 (?                   ) in  hi
>  gpio-477 (?                   ) out hi
>  gpio-478 (?                   ) out lo
>  gpio-479 (?                   ) out hi
>
> we get the much nicer output:
>
> GPIOs 288-511, platform/PRP0001:00, AMD SBX00:
>  gpio-475 (switch1             ) in  hi
>  gpio-477 (led1                ) out hi
>  gpio-478 (led2                ) out lo
>  gpio-479 (led3                ) out hi

We want to reuse higher-level information (like the con_id) as much as
possible to generate labels, but in the case of
devm_get_gpiod_from_child() there is no such information available
anyway, so why not.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>

Generally speaking this label thing is almost useless, we should now
be able to trace which device requested a GPIO and for what purpose
and provide that complete information in debugfs.

  reply	other threads:[~2015-06-15  2:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 22:00 [PATCH v2] gpio / ACPI: Add label to the gpio request Tobias Diedrich
2015-06-15  2:29 ` Alexandre Courbot [this message]
2015-06-30  6:32   ` Linus Walleij
2015-06-30 10:03     ` Andy Shevchenko
2015-06-15 15:34 ` Mika Westerberg

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=CAAVeFu+dfc3vH73_uhwDftrd0OEYrX0ZiqK1MSAqsCcpKpzRTw@mail.gmail.com \
    --to=gnurou@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=ranma+kernel@tdiedrich.de \
    --cc=rjw@rjwysocki.net \
    /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).