Re: gpio_request() vs __gpio_get()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Mar 9, 2015 at 5:14 AM, Lucas De Marchi
<lucas.de.marchi@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux