ARM: dts: exynos: Add initial pin configuration for exynos3250-rinato
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 31 Mar 2016 02:47:57 +0000 (11:47 +0900)
committerKrzysztof Kozlowski <k.kozlowski@samsung.com>
Fri, 1 Apr 2016 00:20:44 +0000 (09:20 +0900)
This patch adds initial pin configuration using pinctrl subsystem
to reduce leakage power-consumption of gpio pins in normal state.
All pins included in this patch are NC (not connected) pin.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
arch/arm/boot/dts/exynos3250-pinctrl.dtsi
arch/arm/boot/dts/exynos3250-rinato.dts

index 5ab81c39e2c9ca8bcd21e1cb14559e2e0166837a..ecf79386e891ba9298cc1a64b1d98d44e1c83e55 100644 (file)
 #define PIN_PULL_DOWN          1
 #define PIN_PULL_UP            3
 
+#define PIN_DRV_LV1            0
+#define PIN_DRV_LV2            2
+#define PIN_DRV_LV3            1
+#define PIN_DRV_LV4            3
+
 #define PIN_PDN_OUT0           0
 #define PIN_PDN_OUT1           1
 #define PIN_PDN_INPUT          2
 #define PIN_PDN_PREV           3
 
+#define PIN_IN(_pin, _pull, _drv)                      \
+       _pin {                                          \
+               samsung,pins = #_pin;                   \
+               samsung,pin-function = <0>;             \
+               samsung,pin-pud = <PIN_PULL_ ##_pull>;  \
+               samsung,pin-drv = <PIN_DRV_ ##_drv>;    \
+       }
+
+#define PIN_OUT(_pin, _drv)                            \
+       _pin {                                          \
+               samsung,pins = #_pin;                   \
+               samsung,pin-function = <1>;             \
+               samsung,pin-pud = <0>;                  \
+               samsung,pin-drv = <PIN_DRV_ ##_drv>;    \
+       }
+
+#define PIN_OUT_SET(_pin, _val, _drv)                  \
+       _pin {                                          \
+               samsung,pins = #_pin;                   \
+               samsung,pin-function = <1>;             \
+               samsung,pin-pud = <0>;                  \
+               samsung,pin-drv = <PIN_DRV_ ##_drv>;    \
+               samsung,pin-val = <_val>;               \
+       }
+
+#define PIN_CFG(_pin, _sel, _pull, _drv)               \
+       _pin {                                          \
+               samsung,pins = #_pin;                   \
+               samsung,pin-function = <_sel>;          \
+               samsung,pin-pud = <PIN_PULL_ ##_pull>;  \
+               samsung,pin-drv = <PIN_DRV_ ##_drv>;    \
+       }
+
 #define PIN_SLP(_pin, _mode, _pull)                            \
        _pin {                                                  \
                samsung,pins = #_pin;                           \
index 1f102f3a1ab1117fd6dae8974878ca4188d03de7..31eb09bae0a2f9b10f7cd7b6f984d7a8ef57916d 100644 (file)
 
 &pinctrl_0 {
        pinctrl-names = "default";
-       pinctrl-0 = <&sleep0>;
+       pinctrl-0 = <&initial0 &sleep0>;
+
+       initial0: initial-state {
+               PIN_IN(gpa1-4, DOWN, LV1);
+               PIN_IN(gpa1-5, DOWN, LV1);
+
+               PIN_IN(gpc0-0, DOWN, LV1);
+               PIN_IN(gpc0-1, DOWN, LV1);
+               PIN_IN(gpc0-2, DOWN, LV1);
+               PIN_IN(gpc0-3, DOWN, LV1);
+               PIN_IN(gpc0-4, DOWN, LV1);
+
+               PIN_IN(gpd0-0, DOWN, LV1);
+               PIN_IN(gpd0-1, DOWN, LV1);
+       };
 
        sleep0: sleep-state {
                PIN_SLP(gpa0-0, INPUT, DOWN);
 
 &pinctrl_1 {
        pinctrl-names = "default";
-       pinctrl-0 = <&sleep1>;
+       pinctrl-0 = <&initial1 &sleep1>;
+
+       initial1: initial-state {
+               PIN_IN(gpe0-6, DOWN, LV1);
+               PIN_IN(gpe0-7, DOWN, LV1);
+
+               PIN_IN(gpe1-0, DOWN, LV1);
+               PIN_IN(gpe1-3, DOWN, LV1);
+               PIN_IN(gpe1-4, DOWN, LV1);
+               PIN_IN(gpe1-5, DOWN, LV1);
+               PIN_IN(gpe1-6, DOWN, LV1);
+
+               PIN_IN(gpk2-0, DOWN, LV1);
+               PIN_IN(gpk2-1, DOWN, LV1);
+               PIN_IN(gpk2-2, DOWN, LV1);
+               PIN_IN(gpk2-3, DOWN, LV1);
+               PIN_IN(gpk2-4, DOWN, LV1);
+               PIN_IN(gpk2-5, DOWN, LV1);
+               PIN_IN(gpk2-6, DOWN, LV1);
+
+               PIN_IN(gpm0-0, DOWN, LV1);
+               PIN_IN(gpm0-1, DOWN, LV1);
+               PIN_IN(gpm0-2, DOWN, LV1);
+               PIN_IN(gpm0-3, DOWN, LV1);
+               PIN_IN(gpm0-4, DOWN, LV1);
+               PIN_IN(gpm0-5, DOWN, LV1);
+               PIN_IN(gpm0-6, DOWN, LV1);
+               PIN_IN(gpm0-7, DOWN, LV1);
+
+               PIN_IN(gpm1-0, DOWN, LV1);
+               PIN_IN(gpm1-1, DOWN, LV1);
+               PIN_IN(gpm1-2, DOWN, LV1);
+               PIN_IN(gpm1-3, DOWN, LV1);
+               PIN_IN(gpm1-4, DOWN, LV1);
+               PIN_IN(gpm1-5, DOWN, LV1);
+               PIN_IN(gpm1-6, DOWN, LV1);
+
+               PIN_IN(gpm2-0, DOWN, LV1);
+               PIN_IN(gpm2-1, DOWN, LV1);
+
+               PIN_IN(gpm3-0, DOWN, LV1);
+               PIN_IN(gpm3-1, DOWN, LV1);
+               PIN_IN(gpm3-2, DOWN, LV1);
+               PIN_IN(gpm3-3, DOWN, LV1);
+               PIN_IN(gpm3-4, DOWN, LV1);
+
+               PIN_IN(gpm4-1, DOWN, LV1);
+               PIN_IN(gpm4-2, DOWN, LV1);
+               PIN_IN(gpm4-3, DOWN, LV1);
+               PIN_IN(gpm4-4, DOWN, LV1);
+               PIN_IN(gpm4-5, DOWN, LV1);
+               PIN_IN(gpm4-6, DOWN, LV1);
+               PIN_IN(gpm4-7, DOWN, LV1);
+       };
 
        sleep1: sleep-state {
                PIN_SLP(gpe0-0, PREV, NONE);