diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2013-02-02 11:29:30 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2013-02-11 17:21:28 -0500 |
commit | 6c0b4e6c85d085bd92966bc2b8da73e2d7f35929 (patch) | |
tree | c04b9c20083445195cade9fbcd11265632585525 /include/asm-generic/gpio.h | |
parent | 372e722ea4dd4ca11c3d04845e11cbc15f32144c (diff) |
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/gpio.h')
-rw-r--r-- | include/asm-generic/gpio.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index b562f95cdc2f..bde646995d10 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -47,6 +47,7 @@ struct gpio; | |||
47 | struct seq_file; | 47 | struct seq_file; |
48 | struct module; | 48 | struct module; |
49 | struct device_node; | 49 | struct device_node; |
50 | struct gpio_desc; | ||
50 | 51 | ||
51 | /** | 52 | /** |
52 | * struct gpio_chip - abstract a GPIO controller | 53 | * struct gpio_chip - abstract a GPIO controller |
@@ -76,6 +77,7 @@ struct device_node; | |||
76 | * negative during registration, requests dynamic ID allocation. | 77 | * negative during registration, requests dynamic ID allocation. |
77 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | 78 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO |
78 | * handled is (base + ngpio - 1). | 79 | * handled is (base + ngpio - 1). |
80 | * @desc: array of ngpio descriptors. Private. | ||
79 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | 81 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they |
80 | * must while accessing GPIO expander chips over I2C or SPI | 82 | * must while accessing GPIO expander chips over I2C or SPI |
81 | * @names: if set, must be an array of strings to use as alternative | 83 | * @names: if set, must be an array of strings to use as alternative |
@@ -126,6 +128,7 @@ struct gpio_chip { | |||
126 | struct gpio_chip *chip); | 128 | struct gpio_chip *chip); |
127 | int base; | 129 | int base; |
128 | u16 ngpio; | 130 | u16 ngpio; |
131 | struct gpio_desc *desc; | ||
129 | const char *const *names; | 132 | const char *const *names; |
130 | unsigned can_sleep:1; | 133 | unsigned can_sleep:1; |
131 | unsigned exported:1; | 134 | unsigned exported:1; |