]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
gpiolib: export descriptor-based GPIO interface
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 17 Oct 2013 17:21:36 +0000 (10:21 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Sat, 19 Oct 2013 21:24:45 +0000 (23:24 +0200)
commit79a9becda8940deb2274b5aa4577c86d52ee7ecb
tree2e10b344abcf76446ff97855d280fe9b7fb34ef0
parentb41fb43911b4cb864812adec88d028cc6219f23e
gpiolib: export descriptor-based GPIO interface

This patch exports the gpiod_* family of API functions, a safer
alternative to the legacy GPIO interface. Differences between the gpiod
and legacy gpio APIs are:

- gpio works with integers, whereas gpiod operates on opaque handlers
  which cannot be forged or used before proper acquisition
- gpiod get/set functions are aware of the active low state of a GPIO
- gpio consumers should now include <linux/gpio/consumer.h> to access
  the new interface, whereas chips drivers will use
  <linux/gpio/driver.h>

The legacy gpio API is now built as inline functions on top of gpiod.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c
include/asm-generic/gpio.h
include/linux/gpio.h
include/linux/gpio/consumer.h [new file with mode: 0644]
include/linux/gpio/driver.h [new file with mode: 0644]