pinctrl: single: add low power mode support
authorChao Xie <chao.xie@marvell.com>
Tue, 28 Jan 2014 07:20:44 +0000 (15:20 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 10 Feb 2014 09:13:08 +0000 (10:13 +0100)
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>
Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
drivers/pinctrl/pinctrl-single.c

index bc0dfdfdb14860577483963c01979b3f8b18ffbd..66dcaa9efd7401916d3ec8cc9e03c9ebaff50a22 100644 (file)
@@ -63,6 +63,13 @@ Optional properties:
                /* input, enable bits, disable bits, mask */
                pinctrl-single,input-schmitt-enable = <0x30 0x40 0 0x70>;
 
+- pinctrl-single,low-power-mode : array of value that are used to configure
+  low power mode of this pin. For some silicons, the low power mode will
+  control the output of the pin when the pad including the pin enter low
+  power mode.
+               /* low power mode value, mask */
+               pinctrl-single,low-power-mode = <0x288 0x388>;
+
 - pinctrl-single,gpio-range : list of value that are used to configure a GPIO
   range. They're value of subnode phandle, pin base in pinctrl device, pin
   number in this range, GPIO function value of this GPIO range.
index de6459628b4fe9af7d7838975bdc6a92de042bca..81075f2a1d3f87d9ac9d2cf4d62edf94e21bf75f 100644 (file)
@@ -662,6 +662,7 @@ static int pcs_pinconf_get(struct pinctrl_dev *pctldev,
                        break;
                case PIN_CONFIG_DRIVE_STRENGTH:
                case PIN_CONFIG_SLEW_RATE:
+               case PIN_CONFIG_LOW_POWER_MODE:
                default:
                        *config = data;
                        break;
@@ -699,6 +700,7 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
                        case PIN_CONFIG_INPUT_SCHMITT:
                        case PIN_CONFIG_DRIVE_STRENGTH:
                        case PIN_CONFIG_SLEW_RATE:
+                       case PIN_CONFIG_LOW_POWER_MODE:
                                shift = ffs(func->conf[i].mask) - 1;
                                data &= ~func->conf[i].mask;
                                data |= (arg << shift) & func->conf[i].mask;
@@ -1101,6 +1103,7 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
                { "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
                { "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
                { "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
+               { "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, },
        };
        struct pcs_conf_type prop4[] = {
                { "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },