Commit 6606bc9d authored by Baolin Wang's avatar Baolin Wang Committed by Linus Walleij

pinctrl: Add sleep related state to indicate sleep related configs

In some scenarios, we should set some pins as input/output/pullup/pulldown
when the specified system goes into deep sleep mode, then when the system
goes into deep sleep mode, these pins will be set automatically by hardware.

That means some pins are not controlled by any specific driver in the OS, but
need to be controlled when entering sleep mode. Thus we introduce one sleep
state config into pinconf-generic for users to configure.
Signed-off-by: default avatarBaolin Wang <baolin.wang@spreadtrum.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent ca8febe8
...@@ -268,6 +268,8 @@ output-enable - enable output on a pin without actively driving it ...@@ -268,6 +268,8 @@ output-enable - enable output on a pin without actively driving it
(such as enabling an output buffer) (such as enabling an output buffer)
output-low - set the pin to output mode with low level output-low - set the pin to output mode with low level
output-high - set the pin to output mode with high level output-high - set the pin to output mode with high level
sleep-hardware-state - indicate this is sleep related state which will be programmed
into the registers for the sleep state.
slew-rate - set the slew rate slew-rate - set the slew rate
For example: For example:
......
...@@ -47,6 +47,7 @@ static const struct pin_config_item conf_items[] = { ...@@ -47,6 +47,7 @@ static const struct pin_config_item conf_items[] = {
PCONFDUMP(PIN_CONFIG_OUTPUT_ENABLE, "output enabled", NULL, false), PCONFDUMP(PIN_CONFIG_OUTPUT_ENABLE, "output enabled", NULL, false),
PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true), PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true),
PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true),
PCONFDUMP(PIN_CONFIG_SLEEP_HARDWARE_STATE, "sleep hardware state", NULL, false),
PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true),
}; };
...@@ -178,6 +179,7 @@ static const struct pinconf_generic_params dt_params[] = { ...@@ -178,6 +179,7 @@ static const struct pinconf_generic_params dt_params[] = {
{ "output-high", PIN_CONFIG_OUTPUT, 1, }, { "output-high", PIN_CONFIG_OUTPUT, 1, },
{ "output-low", PIN_CONFIG_OUTPUT, 0, }, { "output-low", PIN_CONFIG_OUTPUT, 0, },
{ "power-source", PIN_CONFIG_POWER_SOURCE, 0 }, { "power-source", PIN_CONFIG_POWER_SOURCE, 0 },
{ "sleep-hardware-state", PIN_CONFIG_SLEEP_HARDWARE_STATE, 0 },
{ "slew-rate", PIN_CONFIG_SLEW_RATE, 0 }, { "slew-rate", PIN_CONFIG_SLEW_RATE, 0 },
}; };
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
* @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
* supplies, the argument to this parameter (on a custom format) tells * supplies, the argument to this parameter (on a custom format) tells
* the driver which alternative power source to use. * the driver which alternative power source to use.
* @PIN_CONFIG_SLEEP_HARDWARE_STATE: indicate this is sleep related state.
* @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
* this parameter (on a custom format) tells the driver which alternative * this parameter (on a custom format) tells the driver which alternative
* slew rate to use. * slew rate to use.
...@@ -114,6 +115,7 @@ enum pin_config_param { ...@@ -114,6 +115,7 @@ enum pin_config_param {
PIN_CONFIG_OUTPUT_ENABLE, PIN_CONFIG_OUTPUT_ENABLE,
PIN_CONFIG_OUTPUT, PIN_CONFIG_OUTPUT,
PIN_CONFIG_POWER_SOURCE, PIN_CONFIG_POWER_SOURCE,
PIN_CONFIG_SLEEP_HARDWARE_STATE,
PIN_CONFIG_SLEW_RATE, PIN_CONFIG_SLEW_RATE,
PIN_CONFIG_END = 0x7F, PIN_CONFIG_END = 0x7F,
PIN_CONFIG_MAX = 0xFF, PIN_CONFIG_MAX = 0xFF,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment