diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-generic/gpio.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 20ca7663975f..23410147555f 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -212,6 +212,43 @@ extern void gpio_unexport(unsigned gpio); | |||
| 212 | 212 | ||
| 213 | #endif /* CONFIG_GPIO_SYSFS */ | 213 | #endif /* CONFIG_GPIO_SYSFS */ |
| 214 | 214 | ||
| 215 | #ifdef CONFIG_PINCTRL | ||
| 216 | |||
| 217 | /** | ||
| 218 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
| 219 | * @head: list for maintaining set of pin ranges, used internally | ||
| 220 | * @pctldev: pinctrl device which handles corresponding pins | ||
| 221 | * @range: actual range of pins controlled by a gpio controller | ||
| 222 | */ | ||
| 223 | |||
| 224 | struct gpio_pin_range { | ||
| 225 | struct list_head node; | ||
| 226 | struct pinctrl_dev *pctldev; | ||
| 227 | struct pinctrl_gpio_range range; | ||
| 228 | }; | ||
| 229 | |||
| 230 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 231 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 232 | unsigned int npins); | ||
| 233 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
| 234 | |||
| 235 | #else | ||
| 236 | |||
| 237 | static inline int | ||
| 238 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 239 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 240 | unsigned int npins) | ||
| 241 | { | ||
| 242 | return 0; | ||
| 243 | } | ||
| 244 | |||
| 245 | static inline void | ||
| 246 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
| 247 | { | ||
| 248 | } | ||
| 249 | |||
| 250 | #endif /* CONFIG_PINCTRL */ | ||
| 251 | |||
| 215 | #else /* !CONFIG_GPIOLIB */ | 252 | #else /* !CONFIG_GPIOLIB */ |
| 216 | 253 | ||
| 217 | static inline bool gpio_is_valid(int number) | 254 | static inline bool gpio_is_valid(int number) |
| @@ -270,41 +307,4 @@ static inline void gpio_unexport(unsigned gpio) | |||
| 270 | } | 307 | } |
| 271 | #endif /* CONFIG_GPIO_SYSFS */ | 308 | #endif /* CONFIG_GPIO_SYSFS */ |
| 272 | 309 | ||
| 273 | #ifdef CONFIG_PINCTRL | ||
| 274 | |||
| 275 | /** | ||
| 276 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
| 277 | * @head: list for maintaining set of pin ranges, used internally | ||
| 278 | * @pctldev: pinctrl device which handles corresponding pins | ||
| 279 | * @range: actual range of pins controlled by a gpio controller | ||
| 280 | */ | ||
| 281 | |||
| 282 | struct gpio_pin_range { | ||
| 283 | struct list_head node; | ||
| 284 | struct pinctrl_dev *pctldev; | ||
| 285 | struct pinctrl_gpio_range range; | ||
| 286 | }; | ||
| 287 | |||
| 288 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 289 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 290 | unsigned int npins); | ||
| 291 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
| 292 | |||
| 293 | #else | ||
| 294 | |||
| 295 | static inline int | ||
| 296 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 297 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 298 | unsigned int npins) | ||
| 299 | { | ||
| 300 | return 0; | ||
| 301 | } | ||
| 302 | |||
| 303 | static inline void | ||
| 304 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
| 305 | { | ||
| 306 | } | ||
| 307 | |||
| 308 | #endif /* CONFIG_PINCTRL */ | ||
| 309 | |||
| 310 | #endif /* _ASM_GENERIC_GPIO_H */ | 310 | #endif /* _ASM_GENERIC_GPIO_H */ |
