aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-03-17 20:56:17 -0400
committerLinus Walleij <linus.walleij@linaro.org>2015-03-19 04:45:54 -0400
commit964cb341882f920a1a1043864178f22def3193e4 (patch)
treed59a49475e7c5a869f1c5be1c7a673e254847aff
parent7e9603638ac69696be5bcc2614365c1e8cc892dd (diff)
gpio: move pincontrol calls to <linux/gpio/driver.h>
These functions do not belong in <asm-generic/gpio.h> since the split into separate GPIO headers under <linux/gpio/*>. Move them to <linux/gpio/driver.h> as is apropriate. Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--include/asm-generic/gpio.h48
-rw-r--r--include/linux/gpio/driver.h48
2 files changed, 48 insertions, 48 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 383ade1a211b..9bb0d11729c9 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -5,7 +5,6 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/errno.h> 6#include <linux/errno.h>
7#include <linux/of.h> 7#include <linux/of.h>
8#include <linux/pinctrl/pinctrl.h>
9 8
10#ifdef CONFIG_GPIOLIB 9#ifdef CONFIG_GPIOLIB
11 10
@@ -139,53 +138,6 @@ static inline void gpio_unexport(unsigned gpio)
139 gpiod_unexport(gpio_to_desc(gpio)); 138 gpiod_unexport(gpio_to_desc(gpio));
140} 139}
141 140
142#ifdef CONFIG_PINCTRL
143
144/**
145 * struct gpio_pin_range - pin range controlled by a gpio chip
146 * @head: list for maintaining set of pin ranges, used internally
147 * @pctldev: pinctrl device which handles corresponding pins
148 * @range: actual range of pins controlled by a gpio controller
149 */
150
151struct gpio_pin_range {
152 struct list_head node;
153 struct pinctrl_dev *pctldev;
154 struct pinctrl_gpio_range range;
155};
156
157int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
158 unsigned int gpio_offset, unsigned int pin_offset,
159 unsigned int npins);
160int gpiochip_add_pingroup_range(struct gpio_chip *chip,
161 struct pinctrl_dev *pctldev,
162 unsigned int gpio_offset, const char *pin_group);
163void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
164
165#else
166
167static inline int
168gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
169 unsigned int gpio_offset, unsigned int pin_offset,
170 unsigned int npins)
171{
172 return 0;
173}
174static inline int
175gpiochip_add_pingroup_range(struct gpio_chip *chip,
176 struct pinctrl_dev *pctldev,
177 unsigned int gpio_offset, const char *pin_group)
178{
179 return 0;
180}
181
182static inline void
183gpiochip_remove_pin_ranges(struct gpio_chip *chip)
184{
185}
186
187#endif /* CONFIG_PINCTRL */
188
189#else /* !CONFIG_GPIOLIB */ 141#else /* !CONFIG_GPIOLIB */
190 142
191static inline bool gpio_is_valid(int number) 143static inline bool gpio_is_valid(int number)
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index c497c62889d1..f1b36593ec9f 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -6,6 +6,7 @@
6#include <linux/irq.h> 6#include <linux/irq.h>
7#include <linux/irqchip/chained_irq.h> 7#include <linux/irqchip/chained_irq.h>
8#include <linux/irqdomain.h> 8#include <linux/irqdomain.h>
9#include <linux/pinctrl/pinctrl.h>
9 10
10struct device; 11struct device;
11struct gpio_desc; 12struct gpio_desc;
@@ -173,6 +174,53 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
173 174
174#endif /* CONFIG_GPIOLIB_IRQCHIP */ 175#endif /* CONFIG_GPIOLIB_IRQCHIP */
175 176
177#ifdef CONFIG_PINCTRL
178
179/**
180 * struct gpio_pin_range - pin range controlled by a gpio chip
181 * @head: list for maintaining set of pin ranges, used internally
182 * @pctldev: pinctrl device which handles corresponding pins
183 * @range: actual range of pins controlled by a gpio controller
184 */
185
186struct gpio_pin_range {
187 struct list_head node;
188 struct pinctrl_dev *pctldev;
189 struct pinctrl_gpio_range range;
190};
191
192int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
193 unsigned int gpio_offset, unsigned int pin_offset,
194 unsigned int npins);
195int gpiochip_add_pingroup_range(struct gpio_chip *chip,
196 struct pinctrl_dev *pctldev,
197 unsigned int gpio_offset, const char *pin_group);
198void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
199
200#else
201
202static inline int
203gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
204 unsigned int gpio_offset, unsigned int pin_offset,
205 unsigned int npins)
206{
207 return 0;
208}
209static inline int
210gpiochip_add_pingroup_range(struct gpio_chip *chip,
211 struct pinctrl_dev *pctldev,
212 unsigned int gpio_offset, const char *pin_group)
213{
214 return 0;
215}
216
217static inline void
218gpiochip_remove_pin_ranges(struct gpio_chip *chip)
219{
220}
221
222#endif /* CONFIG_PINCTRL */
223
176struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum, 224struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum,
177 const char *label); 225 const char *label);
178void gpiochip_free_own_desc(struct gpio_desc *desc); 226void gpiochip_free_own_desc(struct gpio_desc *desc);