summaryrefslogtreecommitdiffstats
path: root/include/gpio.h
Commit message (Collapse)AuthorAgeFilesLines
* gpiolib: Introduce gpio_find_by_label()Andrey Smirnov2018-10-291-0/+6
| | | | | | | | Introduce gpio_find_by_label() in order to allow manipulating GPIOs by the labels assigned to them via DT or board/driver code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: fix missing includes for bool and struct list_headRoland Hieber2018-08-091-0/+3
| | | | | Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: move active state function stubs to GPIOLIBLucas Stach2017-07-101-5/+6
| | | | | | | | Those are only implemented by GPIOLIB, not by GENERIC_GPIO. Fixes like failure on old platforms, that aren't converted to gpiolib, yet. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* gpiolib: Add code to support "active low" GPIOsAndrey Smirnov2017-06-061-0/+25
| | | | | | | | | | | | | So far this particular aspect of various DT-bindings has been handled on a per-driver basis. With this change, hopefully, we'll have a single place to handle necessary logic inversions and eventually would be able to migrate existing users as well as avoiding adding redundant code to new drivers. Cc: cphealy@gmail.com Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: Drop asm-generic/gpio.hSascha Hauer2015-08-201-1/+22
| | | | | | | | | | Since we no longer have custom gpio function prototypes we can drop the prototypes from asm-generic/gpio.h can add them to include/gpio.h instead. While at it add static inline dummy wrappers for !CONFIG_GENERIC_GPIO so that code using gpios can compile without gpio support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: move gpio_is_valid to include/gpio.hSascha Hauer2014-11-281-0/+11
| | | | | | | | No architectue implements its own gpio_is_valid() function, so move the only existing implementation to include/gpio.h where it's available for all users. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: import gpio_request_array() from linux 3.7Antony Pavlov2013-11-221-0/+39
| | | | | | | | | | | | | | | | | | | | | | | Also import related functions gpio_request_one() and gpio_free_array(). This commit imports code from linux 3.7 as the more recent linux kernel versions use gpiolib descriptors, see this commit for details: commit 372e722ea4dd4ca11c3d04845e11cbc15f32144c Author: Alexandre Courbot <acourbot@nvidia.com> Date: Sun Feb 3 01:29:29 2013 +0900 gpiolib: use descriptors internally Make sure gpiolib works internally with descriptors and (chip, offset) pairs instead of using the global integer namespace. This prepares the ground for the removal of the global gpio_desc[] array and the introduction of the descriptor-based GPIO API. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: unify gpio direction macros names with Linux kernelAntony Pavlov2013-11-221-2/+2
| | | | | | | | See linux.git/include/linux/gpio.h and linux.git/Documentation/gpio.txt for details. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: add get_direction callbackSebastian Hesselbarth2013-11-111-0/+4
| | | | | | | | | At least for debugging purposes it is helpful to determine the current direction for a given GPIO. Add a callback to gpiochip, to allow to get it. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: fix typosAntony Pavlov2013-05-121-1/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add Generic GPIO driverAlexander Shiyan2013-03-111-0/+1
| | | | | | | | This patch adds generic memory-mapped GPIO controller support. Code taken from Linux Kernel and adopted for barebox. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: add gpio_request and gpio_free supportJean-Christophe PLAGNIOL-VILLARD2012-12-221-0/+7
| | | | | | | | | as today if no request or free provided do not complain if the gpio is not request auto requested at first use Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add gpiolib supportSascha Hauer2012-09-041-1/+26
| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
* gpio: add static inlines for gpio_request/gpio_freeSascha Hauer2012-07-251-0/+13
| | | | | | | | Some drivers use gpio_request/gpio_free. Currently no architecture has code behind these functions. Provide static inline functions for these and remvoe the at91 specific inline functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* GPIO supportSascha Hauer2008-10-271-0/+1
adopted Linux gpio code. Implemented for at91sam9. No gpiolib support yet. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>