aboutsummaryrefslogtreecommitdiff
path: root/include/linux/gpio/consumer.h
AgeCommit message (Collapse)AuthorFilesLines
2014-03-14Merge tag 'v3.14-rc6' into develLinus Walleij1-2/+2
Linux 3.14-rc6
2014-02-12gpiolib: add gpiochip_get_desc() driver functionAlexandre Courbot1-8/+0
Some drivers dealing with a gpio_chip might need to act on its descriptors directly; one example is pinctrl drivers that need to lock a GPIO for being used as IRQ using gpiod_lock_as_irq(). This patch exports a gpiochip_get_desc() function that returns the GPIO descriptor at the requested index. It also sweeps the gpio_to_chip() function out of the consumer interface since any holder of a gpio_chip reference can manipulate its GPIOs way beyond what a consumer should be allowed to do. As a result, gpio_chip is not visible anymore to simple GPIO consumers. Signed-off-by: Alexandre Courbot <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Reviewed-by: Jean-Jacques Hiblot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2014-02-07gpio: make gpiod_direction_output take a logical valuePhilipp Zabel1-0/+7
The documentation was not clear about whether gpio_direction_output should take a logical value or the physical level on the output line, i.e. whether the ACTIVE_LOW status would be taken into account. This converts gpiod_direction_output to use the logical level and adds a new gpiod_direction_output_raw for the raw value. Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2014-02-06gpio: consumer.h: Move forward declarations outside #ifdefLars-Peter Clausen1-2/+2
Make sure that the forward declared structs in gpio/consumer.h are also visible on the else branch of the CONFIG_GPIOLIB #ifdef. Fixes the following warnings and their associated errors when CONFIG_GPIOLIB is not selected: include/linux/gpio/consumer.h:67:14: warning: 'struct device' declared inside parameter list include/linux/gpio/consumer.h:67:14: warning: its scope is only this definition or declaration, which is probably not what you want [...] Signed-off-by: Lars-Peter Clausen <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-10-19gpiolib: add gpiod_get() and gpiod_put() functionsAlexandre Courbot1-0/+15
Add gpiod_get(), gpiod_get_index() and gpiod_put() functions that provide safer management of GPIOs. These functions put the GPIO framework in line with the conventions of other frameworks in the kernel, and help ensure every GPIO is declared properly and valid while it is used. Signed-off-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-10-19gpiolib: export descriptor-based GPIO interfaceAlexandre Courbot1-0/+238
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]>