aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h10
-rw-r--r--include/dt-bindings/pinctrl/at91.h2
-rw-r--r--include/linux/gpio.h10
-rw-r--r--include/linux/pinctrl/pinctrl.h3
-rw-r--r--include/linux/platform_data/pinctrl-adi2.h40
5 files changed, 64 insertions, 1 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index bde646995d10..523f40525535 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -228,6 +228,9 @@ struct gpio_pin_range {
228int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, 228int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
229 unsigned int gpio_offset, unsigned int pin_offset, 229 unsigned int gpio_offset, unsigned int pin_offset,
230 unsigned int npins); 230 unsigned int npins);
231int gpiochip_add_pingroup_range(struct gpio_chip *chip,
232 struct pinctrl_dev *pctldev,
233 unsigned int gpio_offset, const char *pin_group);
231void gpiochip_remove_pin_ranges(struct gpio_chip *chip); 234void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
232 235
233#else 236#else
@@ -239,6 +242,13 @@ gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
239{ 242{
240 return 0; 243 return 0;
241} 244}
245static inline int
246gpiochip_add_pingroup_range(struct gpio_chip *chip,
247 struct pinctrl_dev *pctldev,
248 unsigned int gpio_offset, const char *pin_group)
249{
250 return 0;
251}
242 252
243static inline void 253static inline void
244gpiochip_remove_pin_ranges(struct gpio_chip *chip) 254gpiochip_remove_pin_ranges(struct gpio_chip *chip)
diff --git a/include/dt-bindings/pinctrl/at91.h b/include/dt-bindings/pinctrl/at91.h
index d7988b4d8af9..0fee6ff77ffc 100644
--- a/include/dt-bindings/pinctrl/at91.h
+++ b/include/dt-bindings/pinctrl/at91.h
@@ -16,7 +16,7 @@
16#define AT91_PINCTRL_PULL_DOWN (1 << 3) 16#define AT91_PINCTRL_PULL_DOWN (1 << 3)
17#define AT91_PINCTRL_DIS_SCHMIT (1 << 4) 17#define AT91_PINCTRL_DIS_SCHMIT (1 << 4)
18#define AT91_PINCTRL_DEBOUNCE (1 << 16) 18#define AT91_PINCTRL_DEBOUNCE (1 << 16)
19#define AT91_PINCTRL_DEBOUNCE_VA(x) (x << 17) 19#define AT91_PINCTRL_DEBOUNCE_VAL(x) (x << 17)
20 20
21#define AT91_PINCTRL_PULL_UP_DEGLITCH (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DEGLITCH) 21#define AT91_PINCTRL_PULL_UP_DEGLITCH (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DEGLITCH)
22 22
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
84struct device; 85struct device;
85struct gpio_chip; 86struct 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
224static inline int
225gpiochip_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
223static inline void 233static inline void
224gpiochip_remove_pin_ranges(struct gpio_chip *chip) 234gpiochip_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,
144extern struct pinctrl_gpio_range * 144extern struct pinctrl_gpio_range *
145pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, 145pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev,
146 unsigned int pin); 146 unsigned int pin);
147extern 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
149extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); 152extern 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 */
30struct 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