From: Alexandre Courbot <gnurou@gmail.com>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>
Subject: Re: gpio_request() vs __gpio_get()
Date: Mon, 9 Mar 2015 18:21:41 +0900 [thread overview]
Message-ID: <CAAVeFu+87Y8H_ftg9cV2gBQdeZmP8qLW86AFKCp6X7-G2=guEA@mail.gmail.com> (raw)
In-Reply-To: <CAKi4VAKQ1b0ouxXTxPczZQbPSWCnwnu3tgozWok=xdGDy7AsBg@mail.gmail.com>
Hi,
On Mon, Mar 9, 2015 at 5:14 AM, Lucas De Marchi
<lucas.de.marchi@gmail.com> wrote:
> I was looking at drivers/leds/ in how it interacts with gpiolib. I see
> that there's a new gpiod_* API.
> "git grep gpio_request -- drivers/leds/" reveals quite a number of
> users of gpio_request() and gpio_request_one().
>
> Am I right that these are going to be ported to the new gpiod_* API?
> If yes, what would be the equivalent calls? I thought it would be one
> of the __gpiod_get() functions, but these would invariably fail if I
> passed dev == NULL which is my case.
Any new code should use the gpiod API. gpio_* are considered
deprecated and unsafe, and users are encouraged to switch to gpiod
(which is not always easy if they use GPIOs in unconventional ways).
With gpiod, GPIO descriptors are obtained using one of the
gpiod_get*() functions (do not call __gpiod_get directly) and must be
assigned to the device and function using either Device Tree, ACPI, or
platform tables. See Documentation/gpio/board.txt for how GPIOs are
assigned, and Documentation/gpio/consumer.txt for how to use the gpiod
API.
next prev parent reply other threads:[~2015-03-09 9:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-08 20:14 gpio_request() vs __gpio_get() Lucas De Marchi
2015-03-09 9:21 ` Alexandre Courbot [this message]
2015-03-09 12:45 ` Lucas De Marchi
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+87Y8H_ftg9cV2gBQdeZmP8qLW86AFKCp6X7-G2=guEA@mail.gmail.com' \
--to=gnurou@gmail.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=lucas.de.marchi@gmail.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;
as well as URLs for NNTP newsgroup(s).