diff options
author | Sherman Yin <syin@broadcom.com> | 2013-12-11 13:37:17 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-12-16 04:55:03 -0500 |
commit | 8ba3f4d00078e7a49c60c0bd6298f29402c3a0a0 (patch) | |
tree | d4c5a00b8d5835506ff811620a5ae793e10a200a | |
parent | b31d100e9225d013b7b9b4162a2bd3c6724954bd (diff) |
pinctrl: Adds slew-rate, input-enable/disable
This commit adds slew-rate and input-enable/disable support for pinconf
-generic.
Signed-off-by: Sherman Yin <syin@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt | 3 | ||||
-rw-r--r-- | drivers/pinctrl/pinconf-generic.c | 4 | ||||
-rw-r--r-- | include/linux/pinctrl/pinconf-generic.h | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index 1958ca9f9e5c..4414163e76d2 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt | |||
@@ -151,6 +151,8 @@ drive-push-pull - drive actively high and low | |||
151 | drive-open-drain - drive with open drain | 151 | drive-open-drain - drive with open drain |
152 | drive-open-source - drive with open source | 152 | drive-open-source - drive with open source |
153 | drive-strength - sink or source at most X mA | 153 | drive-strength - sink or source at most X mA |
154 | input-enable - enable input on pin (no effect on output) | ||
155 | input-disable - disable input on pin (no effect on output) | ||
154 | input-schmitt-enable - enable schmitt-trigger mode | 156 | input-schmitt-enable - enable schmitt-trigger mode |
155 | input-schmitt-disable - disable schmitt-trigger mode | 157 | input-schmitt-disable - disable schmitt-trigger mode |
156 | input-debounce - debounce mode with debound time X | 158 | input-debounce - debounce mode with debound time X |
@@ -158,6 +160,7 @@ low-power-enable - enable low power mode | |||
158 | low-power-disable - disable low power mode | 160 | low-power-disable - disable low power mode |
159 | output-low - set the pin to output mode with low level | 161 | output-low - set the pin to output mode with low level |
160 | output-high - set the pin to output mode with high level | 162 | output-high - set the pin to output mode with high level |
163 | slew-rate - set the slew rate | ||
161 | 164 | ||
162 | Some of the generic properties take arguments. For those that do, the | 165 | Some of the generic properties take arguments. For those that do, the |
163 | arguments are described below. | 166 | arguments are described below. |
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 55a0ebe830ac..3d9a999fb699 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c | |||
@@ -48,6 +48,7 @@ static struct pin_config_item conf_items[] = { | |||
48 | PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL), | 48 | PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL), |
49 | PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL), | 49 | PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL), |
50 | PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA"), | 50 | PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA"), |
51 | PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL), | ||
51 | PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL), | 52 | PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL), |
52 | PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL), | 53 | PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL), |
53 | PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec"), | 54 | PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec"), |
@@ -160,6 +161,8 @@ static struct pinconf_generic_dt_params dt_params[] = { | |||
160 | { "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 }, | 161 | { "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 }, |
161 | { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 }, | 162 | { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 }, |
162 | { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 }, | 163 | { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 }, |
164 | { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 }, | ||
165 | { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 }, | ||
163 | { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 }, | 166 | { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 }, |
164 | { "input-schmitt-disable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 }, | 167 | { "input-schmitt-disable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 }, |
165 | { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 }, | 168 | { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 }, |
@@ -167,6 +170,7 @@ static struct pinconf_generic_dt_params dt_params[] = { | |||
167 | { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 }, | 170 | { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 }, |
168 | { "output-low", PIN_CONFIG_OUTPUT, 0, }, | 171 | { "output-low", PIN_CONFIG_OUTPUT, 0, }, |
169 | { "output-high", PIN_CONFIG_OUTPUT, 1, }, | 172 | { "output-high", PIN_CONFIG_OUTPUT, 1, }, |
173 | { "slew-rate", PIN_CONFIG_SLEW_RATE, 0}, | ||
170 | }; | 174 | }; |
171 | 175 | ||
172 | /** | 176 | /** |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index 282309d7c4dc..a15f10727eb8 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
@@ -61,6 +61,9 @@ | |||
61 | * argument is ignored. | 61 | * argument is ignored. |
62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current | 62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current |
63 | * passed as argument. The argument is in mA. | 63 | * passed as argument. The argument is in mA. |
64 | * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not | ||
65 | * affect the pin's ability to drive output. 1 enables input, 0 disables | ||
66 | * input. | ||
64 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. | 67 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. |
65 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, | 68 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, |
66 | * schmitt-trigger mode is disabled. | 69 | * schmitt-trigger mode is disabled. |
@@ -101,6 +104,7 @@ enum pin_config_param { | |||
101 | PIN_CONFIG_DRIVE_OPEN_DRAIN, | 104 | PIN_CONFIG_DRIVE_OPEN_DRAIN, |
102 | PIN_CONFIG_DRIVE_OPEN_SOURCE, | 105 | PIN_CONFIG_DRIVE_OPEN_SOURCE, |
103 | PIN_CONFIG_DRIVE_STRENGTH, | 106 | PIN_CONFIG_DRIVE_STRENGTH, |
107 | PIN_CONFIG_INPUT_ENABLE, | ||
104 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, | 108 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, |
105 | PIN_CONFIG_INPUT_SCHMITT, | 109 | PIN_CONFIG_INPUT_SCHMITT, |
106 | PIN_CONFIG_INPUT_DEBOUNCE, | 110 | PIN_CONFIG_INPUT_DEBOUNCE, |