diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-03-17 20:56:17 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-03-19 04:45:54 -0400 |
commit | 964cb341882f920a1a1043864178f22def3193e4 (patch) | |
tree | d59a49475e7c5a869f1c5be1c7a673e254847aff | |
parent | 7e9603638ac69696be5bcc2614365c1e8cc892dd (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.h | 48 | ||||
-rw-r--r-- | include/linux/gpio/driver.h | 48 |
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 | |||
151 | struct gpio_pin_range { | ||
152 | struct list_head node; | ||
153 | struct pinctrl_dev *pctldev; | ||
154 | struct pinctrl_gpio_range range; | ||
155 | }; | ||
156 | |||
157 | int 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); | ||
160 | int gpiochip_add_pingroup_range(struct gpio_chip *chip, | ||
161 | struct pinctrl_dev *pctldev, | ||
162 | unsigned int gpio_offset, const char *pin_group); | ||
163 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
164 | |||
165 | #else | ||
166 | |||
167 | static inline int | ||
168 | gpiochip_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 | } | ||
174 | static inline int | ||
175 | gpiochip_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 | |||
182 | static inline void | ||
183 | gpiochip_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 | ||
191 | static inline bool gpio_is_valid(int number) | 143 | static 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 | ||
10 | struct device; | 11 | struct device; |
11 | struct gpio_desc; | 12 | struct 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 | |||
186 | struct gpio_pin_range { | ||
187 | struct list_head node; | ||
188 | struct pinctrl_dev *pctldev; | ||
189 | struct pinctrl_gpio_range range; | ||
190 | }; | ||
191 | |||
192 | int 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); | ||
195 | int gpiochip_add_pingroup_range(struct gpio_chip *chip, | ||
196 | struct pinctrl_dev *pctldev, | ||
197 | unsigned int gpio_offset, const char *pin_group); | ||
198 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
199 | |||
200 | #else | ||
201 | |||
202 | static inline int | ||
203 | gpiochip_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 | } | ||
209 | static inline int | ||
210 | gpiochip_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 | |||
217 | static inline void | ||
218 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
219 | { | ||
220 | } | ||
221 | |||
222 | #endif /* CONFIG_PINCTRL */ | ||
223 | |||
176 | struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum, | 224 | struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum, |
177 | const char *label); | 225 | const char *label); |
178 | void gpiochip_free_own_desc(struct gpio_desc *desc); | 226 | void gpiochip_free_own_desc(struct gpio_desc *desc); |