Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: single: add low power mode support

For some silicons, the pin configuration register can control
the output of the pin when the pad including the pin enter
low power mode.
For example, the pin can be "Drive 1", "Drive 0", "Float" when
the pad including the pin enter low power mode.
It is very useful when you want to control the power leakeage
when the SOC enter low power mode, and can save more power for
the low power mode.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Chao Xie and committed by
Linus Walleij
4bd75477 b81e57e6

+10
+7
Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
··· 63 63 /* input, enable bits, disable bits, mask */ 64 64 pinctrl-single,input-schmitt-enable = <0x30 0x40 0 0x70>; 65 65 66 + - pinctrl-single,low-power-mode : array of value that are used to configure 67 + low power mode of this pin. For some silicons, the low power mode will 68 + control the output of the pin when the pad including the pin enter low 69 + power mode. 70 + /* low power mode value, mask */ 71 + pinctrl-single,low-power-mode = <0x288 0x388>; 72 + 66 73 - pinctrl-single,gpio-range : list of value that are used to configure a GPIO 67 74 range. They're value of subnode phandle, pin base in pinctrl device, pin 68 75 number in this range, GPIO function value of this GPIO range.
+3
drivers/pinctrl/pinctrl-single.c
··· 662 662 break; 663 663 case PIN_CONFIG_DRIVE_STRENGTH: 664 664 case PIN_CONFIG_SLEW_RATE: 665 + case PIN_CONFIG_LOW_POWER_MODE: 665 666 default: 666 667 *config = data; 667 668 break; ··· 700 699 case PIN_CONFIG_INPUT_SCHMITT: 701 700 case PIN_CONFIG_DRIVE_STRENGTH: 702 701 case PIN_CONFIG_SLEW_RATE: 702 + case PIN_CONFIG_LOW_POWER_MODE: 703 703 shift = ffs(func->conf[i].mask) - 1; 704 704 data &= ~func->conf[i].mask; 705 705 data |= (arg << shift) & func->conf[i].mask; ··· 1103 1101 { "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, }, 1104 1102 { "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, }, 1105 1103 { "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, }, 1104 + { "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, }, 1106 1105 }; 1107 1106 struct pcs_conf_type prop4[] = { 1108 1107 { "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },