diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/gpio.h | 10 | ||||
| -rw-r--r-- | include/linux/pinctrl/pinctrl.h | 3 | ||||
| -rw-r--r-- | include/linux/platform_data/pinctrl-adi2.h | 40 |
3 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 552e3f46e4a3..b8d0e53a802f 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -80,6 +80,7 @@ static inline int irq_to_gpio(unsigned int irq) | |||
| 80 | #include <linux/types.h> | 80 | #include <linux/types.h> |
| 81 | #include <linux/errno.h> | 81 | #include <linux/errno.h> |
| 82 | #include <linux/bug.h> | 82 | #include <linux/bug.h> |
| 83 | #include <linux/pinctrl/pinctrl.h> | ||
| 83 | 84 | ||
| 84 | struct device; | 85 | struct device; |
| 85 | struct gpio_chip; | 86 | struct gpio_chip; |
| @@ -220,6 +221,15 @@ gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | |||
| 220 | return -EINVAL; | 221 | return -EINVAL; |
| 221 | } | 222 | } |
| 222 | 223 | ||
| 224 | static inline int | ||
| 225 | gpiochip_add_pingroup_range(struct gpio_chip *chip, | ||
| 226 | struct pinctrl_dev *pctldev, | ||
| 227 | unsigned int gpio_offset, const char *pin_group) | ||
| 228 | { | ||
| 229 | WARN_ON(1); | ||
| 230 | return -EINVAL; | ||
| 231 | } | ||
| 232 | |||
| 223 | static inline void | 233 | static inline void |
| 224 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | 234 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) |
| 225 | { | 235 | { |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 5979147d2bda..fefb88663975 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -144,6 +144,9 @@ extern struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname, | |||
| 144 | extern struct pinctrl_gpio_range * | 144 | extern struct pinctrl_gpio_range * |
| 145 | pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, | 145 | pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, |
| 146 | unsigned int pin); | 146 | unsigned int pin); |
| 147 | extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, | ||
| 148 | const char *pin_group, const unsigned **pins, | ||
| 149 | unsigned *num_pins); | ||
| 147 | 150 | ||
| 148 | #ifdef CONFIG_OF | 151 | #ifdef CONFIG_OF |
| 149 | extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); | 152 | extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); |
diff --git a/include/linux/platform_data/pinctrl-adi2.h b/include/linux/platform_data/pinctrl-adi2.h new file mode 100644 index 000000000000..8f91300617ec --- /dev/null +++ b/include/linux/platform_data/pinctrl-adi2.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* | ||
| 2 | * Pinctrl Driver for ADI GPIO2 controller | ||
| 3 | * | ||
| 4 | * Copyright 2007-2013 Analog Devices Inc. | ||
| 5 | * | ||
| 6 | * Licensed under the GPLv2 or later | ||
| 7 | */ | ||
| 8 | |||
| 9 | |||
| 10 | #ifndef PINCTRL_ADI2_H | ||
| 11 | #define PINCTRL_ADI2_H | ||
| 12 | |||
| 13 | #include <linux/io.h> | ||
| 14 | #include <linux/platform_device.h> | ||
| 15 | |||
| 16 | /** | ||
| 17 | * struct adi_pinctrl_gpio_platform_data - Pinctrl gpio platform data | ||
| 18 | * for ADI GPIO2 device. | ||
| 19 | * | ||
| 20 | * @port_gpio_base: Optional global GPIO index of the GPIO bank. | ||
| 21 | * 0 means driver decides. | ||
| 22 | * @port_pin_base: Pin index of the pin controller device. | ||
| 23 | * @port_width: PIN number of the GPIO bank device | ||
| 24 | * @pint_id: GPIO PINT device id that this GPIO bank should map to. | ||
| 25 | * @pint_assign: The 32-bit GPIO PINT registers can be divided into 2 parts. A | ||
| 26 | * GPIO bank can be mapped into either low 16 bits[0] or high 16 | ||
| 27 | * bits[1] of each PINT register. | ||
| 28 | * @pint_map: GIOP bank mapping code in PINT device | ||
| 29 | */ | ||
| 30 | struct adi_pinctrl_gpio_platform_data { | ||
| 31 | unsigned int port_gpio_base; | ||
| 32 | unsigned int port_pin_base; | ||
| 33 | unsigned int port_width; | ||
| 34 | u8 pinctrl_id; | ||
| 35 | u8 pint_id; | ||
| 36 | bool pint_assign; | ||
| 37 | u8 pint_map; | ||
| 38 | }; | ||
| 39 | |||
| 40 | #endif | ||
