aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pinctrl/consumer.h77
-rw-r--r--include/linux/pinctrl/devinfo.h4
-rw-r--r--include/linux/pinctrl/pinconf-generic.h25
-rw-r--r--include/linux/pinctrl/pinconf.h2
-rw-r--r--include/linux/pinctrl/pinctrl.h4
5 files changed, 62 insertions, 50 deletions
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h
index 4aad3cea69ae..18eccefea06e 100644
--- a/include/linux/pinctrl/consumer.h
+++ b/include/linux/pinctrl/consumer.h
@@ -40,6 +40,25 @@ extern int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s);
40extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev); 40extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev);
41extern void devm_pinctrl_put(struct pinctrl *p); 41extern void devm_pinctrl_put(struct pinctrl *p);
42 42
43#ifdef CONFIG_PM
44extern int pinctrl_pm_select_default_state(struct device *dev);
45extern int pinctrl_pm_select_sleep_state(struct device *dev);
46extern int pinctrl_pm_select_idle_state(struct device *dev);
47#else
48static inline int pinctrl_pm_select_default_state(struct device *dev)
49{
50 return 0;
51}
52static inline int pinctrl_pm_select_sleep_state(struct device *dev)
53{
54 return 0;
55}
56static inline int pinctrl_pm_select_idle_state(struct device *dev)
57{
58 return 0;
59}
60#endif
61
43#else /* !CONFIG_PINCTRL */ 62#else /* !CONFIG_PINCTRL */
44 63
45static inline int pinctrl_request_gpio(unsigned gpio) 64static inline int pinctrl_request_gpio(unsigned gpio)
@@ -92,6 +111,21 @@ static inline void devm_pinctrl_put(struct pinctrl *p)
92{ 111{
93} 112}
94 113
114static inline int pinctrl_pm_select_default_state(struct device *dev)
115{
116 return 0;
117}
118
119static inline int pinctrl_pm_select_sleep_state(struct device *dev)
120{
121 return 0;
122}
123
124static inline int pinctrl_pm_select_idle_state(struct device *dev)
125{
126 return 0;
127}
128
95#endif /* CONFIG_PINCTRL */ 129#endif /* CONFIG_PINCTRL */
96 130
97static inline struct pinctrl * __must_check pinctrl_get_select( 131static inline struct pinctrl * __must_check pinctrl_get_select(
@@ -158,47 +192,4 @@ static inline struct pinctrl * __must_check devm_pinctrl_get_select_default(
158 return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT); 192 return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT);
159} 193}
160 194
161#ifdef CONFIG_PINCONF
162
163extern int pin_config_get(const char *dev_name, const char *name,
164 unsigned long *config);
165extern int pin_config_set(const char *dev_name, const char *name,
166 unsigned long config);
167extern int pin_config_group_get(const char *dev_name,
168 const char *pin_group,
169 unsigned long *config);
170extern int pin_config_group_set(const char *dev_name,
171 const char *pin_group,
172 unsigned long config);
173
174#else
175
176static inline int pin_config_get(const char *dev_name, const char *name,
177 unsigned long *config)
178{
179 return 0;
180}
181
182static inline int pin_config_set(const char *dev_name, const char *name,
183 unsigned long config)
184{
185 return 0;
186}
187
188static inline int pin_config_group_get(const char *dev_name,
189 const char *pin_group,
190 unsigned long *config)
191{
192 return 0;
193}
194
195static inline int pin_config_group_set(const char *dev_name,
196 const char *pin_group,
197 unsigned long config)
198{
199 return 0;
200}
201
202#endif
203
204#endif /* __LINUX_PINCTRL_CONSUMER_H */ 195#endif /* __LINUX_PINCTRL_CONSUMER_H */
diff --git a/include/linux/pinctrl/devinfo.h b/include/linux/pinctrl/devinfo.h
index 6e5f8a985ea7..281cb91ddcf5 100644
--- a/include/linux/pinctrl/devinfo.h
+++ b/include/linux/pinctrl/devinfo.h
@@ -28,6 +28,10 @@
28struct dev_pin_info { 28struct dev_pin_info {
29 struct pinctrl *p; 29 struct pinctrl *p;
30 struct pinctrl_state *default_state; 30 struct pinctrl_state *default_state;
31#ifdef CONFIG_PM
32 struct pinctrl_state *sleep_state;
33 struct pinctrl_state *idle_state;
34#endif
31}; 35};
32 36
33extern int pinctrl_bind_pins(struct device *dev); 37extern int pinctrl_bind_pins(struct device *dev);
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index 6aa238096622..bf7e989abcb5 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -29,12 +29,25 @@
29 * if for example some other pin is going to drive the signal connected 29 * if for example some other pin is going to drive the signal connected
30 * to it for a while. Pins used for input are usually always high 30 * to it for a while. Pins used for input are usually always high
31 * impedance. 31 * impedance.
32 * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
33 * weakly drives the last value on a tristate bus, also known as a "bus
34 * holder", "bus keeper" or "repeater". This allows another device on the
35 * bus to change the value by driving the bus high or low and switching to
36 * tristate. The argument is ignored.
32 * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high 37 * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
33 * impedance to VDD). If the argument is != 0 pull-up is enabled, 38 * impedance to VDD). If the argument is != 0 pull-up is enabled,
34 * if it is 0, pull-up is disabled. 39 * if it is 0, pull-up is total, i.e. the pin is connected to VDD.
35 * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high 40 * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
36 * impedance to GROUND). If the argument is != 0 pull-down is enabled, 41 * impedance to GROUND). If the argument is != 0 pull-down is enabled,
37 * if it is 0, pull-down is disabled. 42 * if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
43 * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based
44 * on embedded knowledge of the controller hardware, like current mux
45 * function. The pull direction and possibly strength too will normally
46 * be decided completely inside the hardware block and not be readable
47 * from the kernel side.
48 * If the argument is != 0 pull up/down is enabled, if it is 0, the
49 * configuration is ignored. The proper way to disable it is to use
50 * @PIN_CONFIG_BIAS_DISABLE.
38 * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and 51 * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and
39 * low, this is the most typical case and is typically achieved with two 52 * low, this is the most typical case and is typically achieved with two
40 * active transistors on the output. Setting this config will enable 53 * active transistors on the output. Setting this config will enable
@@ -57,14 +70,14 @@
57 * setting pins to this mode. 70 * setting pins to this mode.
58 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, 71 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
59 * which means it will wait for signals to settle when reading inputs. The 72 * which means it will wait for signals to settle when reading inputs. The
60 * argument gives the debounce time on a custom format. Setting the 73 * argument gives the debounce time in usecs. Setting the
61 * argument to zero turns debouncing off. 74 * argument to zero turns debouncing off.
62 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power 75 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
63 * supplies, the argument to this parameter (on a custom format) tells 76 * supplies, the argument to this parameter (on a custom format) tells
64 * the driver which alternative power source to use. 77 * the driver which alternative power source to use.
65 * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to 78 * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
66 * this parameter (on a custom format) tells the driver which alternative 79 * this parameter (on a custom format) tells the driver which alternative
67 * slew rate to use. 80 * slew rate to use.
68 * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power 81 * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power
69 * operation, if several modes of operation are supported these can be 82 * operation, if several modes of operation are supported these can be
70 * passed in the argument on a custom form, else just use argument 1 83 * passed in the argument on a custom form, else just use argument 1
@@ -78,8 +91,10 @@
78enum pin_config_param { 91enum pin_config_param {
79 PIN_CONFIG_BIAS_DISABLE, 92 PIN_CONFIG_BIAS_DISABLE,
80 PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 93 PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
94 PIN_CONFIG_BIAS_BUS_HOLD,
81 PIN_CONFIG_BIAS_PULL_UP, 95 PIN_CONFIG_BIAS_PULL_UP,
82 PIN_CONFIG_BIAS_PULL_DOWN, 96 PIN_CONFIG_BIAS_PULL_DOWN,
97 PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
83 PIN_CONFIG_DRIVE_PUSH_PULL, 98 PIN_CONFIG_DRIVE_PUSH_PULL,
84 PIN_CONFIG_DRIVE_OPEN_DRAIN, 99 PIN_CONFIG_DRIVE_OPEN_DRAIN,
85 PIN_CONFIG_DRIVE_OPEN_SOURCE, 100 PIN_CONFIG_DRIVE_OPEN_SOURCE,
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h
index 1ad4f31ef6b8..f6998692bdc9 100644
--- a/include/linux/pinctrl/pinconf.h
+++ b/include/linux/pinctrl/pinconf.h
@@ -30,7 +30,7 @@ struct seq_file;
30 * @pin_config_set: configure an individual pin 30 * @pin_config_set: configure an individual pin
31 * @pin_config_group_get: get configurations for an entire pin group 31 * @pin_config_group_get: get configurations for an entire pin group
32 * @pin_config_group_set: configure all pins in a group 32 * @pin_config_group_set: configure all pins in a group
33 * @pin_config_group_dbg_set: optional debugfs to modify a pin configuration 33 * @pin_config_dbg_parse_modify: optional debugfs to modify a pin configuration
34 * @pin_config_dbg_show: optional debugfs display hook that will provide 34 * @pin_config_dbg_show: optional debugfs display hook that will provide
35 * per-device info for a certain pin in debugfs 35 * per-device info for a certain pin in debugfs
36 * @pin_config_group_dbg_show: optional debugfs display hook that will provide 36 * @pin_config_group_dbg_show: optional debugfs display hook that will provide
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 2c2a9e8d8578..5979147d2bda 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -49,7 +49,8 @@ struct pinctrl_pin_desc {
49 * @name: a name for the chip in this range 49 * @name: a name for the chip in this range
50 * @id: an ID number for the chip in this range 50 * @id: an ID number for the chip in this range
51 * @base: base offset of the GPIO range 51 * @base: base offset of the GPIO range
52 * @pin_base: base pin number of the GPIO range 52 * @pin_base: base pin number of the GPIO range if pins == NULL
53 * @pins: enumeration of pins in GPIO range or NULL
53 * @npins: number of pins in the GPIO range, including the base number 54 * @npins: number of pins in the GPIO range, including the base number
54 * @gc: an optional pointer to a gpio_chip 55 * @gc: an optional pointer to a gpio_chip
55 */ 56 */
@@ -59,6 +60,7 @@ struct pinctrl_gpio_range {
59 unsigned int id; 60 unsigned int id;
60 unsigned int base; 61 unsigned int base;
61 unsigned int pin_base; 62 unsigned int pin_base;
63 unsigned const *pins;
62 unsigned int npins; 64 unsigned int npins;
63 struct gpio_chip *gc; 65 struct gpio_chip *gc;
64}; 66};