diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 14:48:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 14:48:03 -0400 |
commit | 3dbde57ad941c55345fd7fac0ee3f70f204b02d8 (patch) | |
tree | 237c6de64d05da3f61b9ac1724e37a5c1f014b71 /include | |
parent | a6e6d863cf68bba886acfe47dbdc8f245cce588f (diff) | |
parent | 2207a4e1ca6a1bb126360b6d0c236af6664532f2 (diff) |
Merge tag 'pinctrl-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control changes from Linus Walleij:
- A large slew of improvements of the Genric pin configuration support,
and deployment in four different platforms: Rockchip, Super-H PFC,
ABx500 and TZ1090. Support BIAS_BUS_HOLD, get device tree parsing
and debugfs support into shape.
- We also have device tree support with generic naming conventions for
the generic pin configuration.
- Delete the unused and confusing direct pinconf API. Now state
transitions is *the* way to control pins and multiplexing.
- New drivers for Rockchip, TZ1090, and TZ1090 PDC.
- Two pin control states related to power management are now handled in
the device core: "sleep" and "idle", removing a lot of boilerplate
code in drivers. We do not yet know if this is the final word for
pin PM, but it already make things a lot easier to handle.
- Handle sparse GPIO ranges passing a list of disparate pins, and
utilize these in the new BayTrail (x86 Atom SoC) driver.
- Make the sunxi (AllWinner) driver handle external interrupts.
- Make it possible for pinctrl-single to handle the case where several
pins are managed by a single register, and augment it to handle sleep
modes.
- Cleanups and improvements for the abx500 drivers.
- Move Sirf pin control drivers to their own directory, support
save/restore of context and add support for the SiRFatlas6 SoC.
- PMU muxing for the Dove pinctrl driver.
- Finalization and support for VF610 in the i.MX6 pinctrl driver.
- Smoothen out various Exynos rough edges.
- Generic cleanups of various kinds.
* tag 'pinctrl-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (82 commits)
pinctrl: vt8500: wmt: remove redundant dev_err call in wmt_pinctrl_probe()
pinctrl: remove bindings for pinconf options needing more thought
pinctrl: remove slew-rate parameter from tz1090
pinctrl: set unit for debounce time pinconfig to usec
pinctrl: more clarifications for generic pull configs
pinctrl: rip out the direct pinconf API
pinctrl-tz1090-pdc: add TZ1090 PDC pinctrl driver
pinctrl-tz1090: add TZ1090 pinctrl driver
pinctrl: samsung: Staticize drvdata_list
pinctrl: rockchip: Add missing irq_gc_unlock() call before return error
pinctrl: abx500: rework error path
pinctrl: abx500: suppress hardcoded value
pinctrl: abx500: factorize code
pinctrl: abx500: fix abx500_gpio_get()
pinctrl: abx500: fix abx500_pin_config_set()
pinctrl: abx500: Add device tree support
sh-pfc: Guard DT parsing with #ifdef CONFIG_OF
pinctrl: add Intel BayTrail GPIO/pinctrl support
pinctrl: fix pinconf_ops::pin_config_dbg_parse_modify kerneldoc
pinctrl: Staticize local symbols
...
Conflicts:
drivers/net/ethernet/ti/davinci_mdio.c
drivers/pinctrl/Makefile
Diffstat (limited to 'include')
-rw-r--r-- | include/dt-bindings/pinctrl/rockchip.h | 32 | ||||
-rw-r--r-- | include/linux/pinctrl/consumer.h | 77 | ||||
-rw-r--r-- | include/linux/pinctrl/devinfo.h | 4 | ||||
-rw-r--r-- | include/linux/pinctrl/pinconf-generic.h | 25 | ||||
-rw-r--r-- | include/linux/pinctrl/pinconf.h | 2 | ||||
-rw-r--r-- | include/linux/pinctrl/pinctrl.h | 4 |
6 files changed, 94 insertions, 50 deletions
diff --git a/include/dt-bindings/pinctrl/rockchip.h b/include/dt-bindings/pinctrl/rockchip.h new file mode 100644 index 000000000000..cd5788be82ce --- /dev/null +++ b/include/dt-bindings/pinctrl/rockchip.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Header providing constants for Rockchip pinctrl bindings. | ||
3 | * | ||
4 | * Copyright (c) 2013 MundoReader S.L. | ||
5 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | #ifndef __DT_BINDINGS_ROCKCHIP_PINCTRL_H__ | ||
19 | #define __DT_BINDINGS_ROCKCHIP_PINCTRL_H__ | ||
20 | |||
21 | #define RK_GPIO0 0 | ||
22 | #define RK_GPIO1 1 | ||
23 | #define RK_GPIO2 2 | ||
24 | #define RK_GPIO3 3 | ||
25 | #define RK_GPIO4 4 | ||
26 | #define RK_GPIO6 6 | ||
27 | |||
28 | #define RK_FUNC_GPIO 0 | ||
29 | #define RK_FUNC_1 1 | ||
30 | #define RK_FUNC_2 2 | ||
31 | |||
32 | #endif | ||
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); | |||
40 | extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev); | 40 | extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev); |
41 | extern void devm_pinctrl_put(struct pinctrl *p); | 41 | extern void devm_pinctrl_put(struct pinctrl *p); |
42 | 42 | ||
43 | #ifdef CONFIG_PM | ||
44 | extern int pinctrl_pm_select_default_state(struct device *dev); | ||
45 | extern int pinctrl_pm_select_sleep_state(struct device *dev); | ||
46 | extern int pinctrl_pm_select_idle_state(struct device *dev); | ||
47 | #else | ||
48 | static inline int pinctrl_pm_select_default_state(struct device *dev) | ||
49 | { | ||
50 | return 0; | ||
51 | } | ||
52 | static inline int pinctrl_pm_select_sleep_state(struct device *dev) | ||
53 | { | ||
54 | return 0; | ||
55 | } | ||
56 | static 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 | ||
45 | static inline int pinctrl_request_gpio(unsigned gpio) | 64 | static 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 | ||
114 | static inline int pinctrl_pm_select_default_state(struct device *dev) | ||
115 | { | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static inline int pinctrl_pm_select_sleep_state(struct device *dev) | ||
120 | { | ||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | static 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 | ||
97 | static inline struct pinctrl * __must_check pinctrl_get_select( | 131 | static 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 | |||
163 | extern int pin_config_get(const char *dev_name, const char *name, | ||
164 | unsigned long *config); | ||
165 | extern int pin_config_set(const char *dev_name, const char *name, | ||
166 | unsigned long config); | ||
167 | extern int pin_config_group_get(const char *dev_name, | ||
168 | const char *pin_group, | ||
169 | unsigned long *config); | ||
170 | extern int pin_config_group_set(const char *dev_name, | ||
171 | const char *pin_group, | ||
172 | unsigned long config); | ||
173 | |||
174 | #else | ||
175 | |||
176 | static inline int pin_config_get(const char *dev_name, const char *name, | ||
177 | unsigned long *config) | ||
178 | { | ||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static inline int pin_config_set(const char *dev_name, const char *name, | ||
183 | unsigned long config) | ||
184 | { | ||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | static 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 | |||
195 | static 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 @@ | |||
28 | struct dev_pin_info { | 28 | struct 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 | ||
33 | extern int pinctrl_bind_pins(struct device *dev); | 37 | extern 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 @@ | |||
78 | enum pin_config_param { | 91 | enum 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 | }; |