summaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2013-02-03 01:29:30 +0900
committerGrant Likely <grant.likely@secretlab.ca>2013-02-11 22:21:28 +0000
commit6c0b4e6c85d085bd92966bc2b8da73e2d7f35929 (patch)
treec04b9c20083445195cade9fbcd11265632585525 /include/asm-generic
parent372e722ea4dd4ca11c3d04845e11cbc15f32144c (diff)
downloadlinux-3.10-6c0b4e6c85d085bd92966bc2b8da73e2d7f35929.tar.gz
linux-3.10-6c0b4e6c85d085bd92966bc2b8da73e2d7f35929.tar.bz2
linux-3.10-6c0b4e6c85d085bd92966bc2b8da73e2d7f35929.zip
gpiolib: let gpio_chip reference its descriptors
Add a pointer to the gpio_chip structure that references the array of GPIO descriptors belonging to the chip, and update gpiolib code to use this pointer instead of the global gpio_desc[] array. This is another step towards the removal of the gpio_desc[] global array. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.orh> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/gpio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index b562f95cdc2..bde646995d1 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -47,6 +47,7 @@ struct gpio;
struct seq_file;
struct module;
struct device_node;
+struct gpio_desc;
/**
* struct gpio_chip - abstract a GPIO controller
@@ -76,6 +77,7 @@ struct device_node;
* negative during registration, requests dynamic ID allocation.
* @ngpio: the number of GPIOs handled by this controller; the last GPIO
* handled is (base + ngpio - 1).
+ * @desc: array of ngpio descriptors. Private.
* @can_sleep: flag must be set iff get()/set() methods sleep, as they
* must while accessing GPIO expander chips over I2C or SPI
* @names: if set, must be an array of strings to use as alternative
@@ -126,6 +128,7 @@ struct gpio_chip {
struct gpio_chip *chip);
int base;
u16 ngpio;
+ struct gpio_desc *desc;
const char *const *names;
unsigned can_sleep:1;
unsigned exported:1;