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>
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>
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>
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>
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>
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>