ARM: ux500: move GPIO key configuration to device tree
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 15 Nov 2013 12:43:02 +0000 (13:43 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 26 Nov 2013 20:01:56 +0000 (21:01 +0100)
This moves over the configuration of the GPIO keys (used for
proximity sensor and Hall effect sensor) from the static pin
configuration file to the device tree. As part of the exercise,
implement the GPIO keys properly in a per-UIB file as this
setup actually differs with each UIB.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/boot/dts/ste-href-stuib.dtsi
arch/arm/boot/dts/ste-href-tvk1281618.dtsi
arch/arm/boot/dts/ste-href.dtsi
arch/arm/boot/dts/ste-hrefv60plus.dtsi
arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
arch/arm/mach-ux500/board-mop500-pins.c

index 76704ec0ffcc89bf3fd0d7e90726c6cc1502807b..1c3574435ea81fe6f275aff7244c6fd828cd99d0 100644 (file)
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               vdd-supply = <&ab8500_ldo_aux1_reg>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&prox_stuib_mode>, <&hall_stuib_mode>;
+
+               button@139 {
+                       /* Proximity sensor */
+                       gpios = <&gpio6 25 0x4>;
+                       linux,code = <11>; /* SW_FRONT_PROXIMITY */
+                       label = "SFH7741 Proximity Sensor";
+               };
+               button@145 {
+                       /* Hall sensor */
+                       gpios = <&gpio4 17 0x4>;
+                       linux,code = <0>; /* SW_LID */
+                       label = "HED54XXU11 Hall Effect Sensor";
+               };
+       };
+
        soc {
                i2c@80004000 {
                        stmpe1601: stmpe1601@40 {
                                rohm,flip-y;
                        };
                };
+
+               pinctrl {
+                       prox {
+                               prox_stuib_mode: prox_stuib {
+                                       stuib_cfg {
+                                               ste,pins = "GPIO217_AH12";
+                                               ste,config = <&gpio_in_pu>;
+                                       };
+                               };
+                       };
+                       hall {
+                               hall_stuib_mode: stuib_tvk {
+                                       stuib_cfg {
+                                               ste,pins = "GPIO145_C13";
+                                               ste,config = <&gpio_in_pu>;
+                                       };
+                               };
+                       };
+               };
        };
 };
index 3f31f9206fb36ca1cc0802378961cd409846c977..c40565320978e78f71c7d798476ba2b9b4a62689 100644 (file)
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               vdd-supply = <&ab8500_ldo_aux1_reg>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&prox_tvk_mode>, <&hall_tvk_mode>;
+
+               button@139 {
+                       /* Proximity sensor */
+                       gpios = <&gpio6 25 0x4>;
+                       linux,code = <11>; /* SW_FRONT_PROXIMITY */
+                       label = "SFH7741 Proximity Sensor";
+               };
+               button@145 {
+                       /* Hall sensor */
+                       gpios = <&gpio4 17 0x4>;
+                       linux,code = <0>; /* SW_LID */
+                       label = "HED54XXU11 Hall Effect Sensor";
+               };
+       };
+
        soc {
                /* Add Synaptics touch screen, TC35893 keypad etc here */
                i2c@80004000 {
                                        };
                                };
                        };
+                       prox {
+                               prox_tvk_mode: prox_tvk {
+                                       tvk_cfg {
+                                               ste,pins = "GPIO217_AH12";
+                                               ste,config = <&gpio_in_pu>;
+                                       };
+                               };
+                       };
+                       hall {
+                               hall_tvk_mode: hall_tvk {
+                                       tvk_cfg {
+                                               ste,pins = "GPIO145_C13";
+                                               ste,config = <&gpio_in_pu>;
+                                       };
+                               };
+                       };
                };
        };
 };
index 56772c3ebb281525a4cd39eaff0f47597c52c08d..e28242173d18fae01ace4ddad502306d540a405b 100644 (file)
                reg = <0x00000000 0x20000000>;
        };
 
-       gpio_keys {
-               compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               button@1 {
-                       linux,code = <11>;
-                       label = "SFH7741 Proximity Sensor";
-               };
-       };
-
        soc {
                usb_per5@a03e0000 {
                        pinctrl-names = "default", "sleep";
index 452f00c4f7c01f2c1f6b375a7368491f76998c53..6e0105d2f4619ce17819ba48af772558a35e293f 100644 (file)
        model = "ST-Ericsson HREF (v60+) platform with Device Tree";
        compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500";
 
-       gpio_keys {
-               button@1 {
-                       gpios = <&gpio5 25 0x4>;
-               };
-       };
-
        soc {
                // External Micro SD slot
                sdi0_per1@80126000 {
index ee143b0a5baa571b943dd9f51bf6e321c9959397..e6f22b266420d0be0ead75fe81e500ac427b8d11 100644 (file)
                ste,input = <INPUT_PULLUP>;
        };
 
+       gpio_in_pd: gpio_input_pull_down {
+               ste,gpio = <GPIOMODE_ENABLED>;
+               ste,input = <INPUT_PULLDOWN>;
+       };
+
        gpio_out_lo: gpio_output_low {
                ste,gpio = <GPIOMODE_ENABLED>;
                ste,output = <OUTPUT_LOW>;
index 257c97a214a55b86cffac976742310e6804fa2aa..4535702a8e3f8d082f7548fdbd181b2b7037139e 100644 (file)
@@ -382,14 +382,6 @@ static struct pinctrl_map __initdata hrefv60_pinmap[] = {
        /* Accelerometer interrupt lines */
        DB8500_PIN_HOG("GPIO82_C1", gpio_in_pu), /* ACC_INT1 */
        DB8500_PIN_HOG("GPIO83_D3", gpio_in_pu), /* ACC_INT2 */
-       /*
-        * Runtime stuff
-        * Pull up/down of some sensor GPIO pins, for proximity, HAL sensor
-        * etc.
-        */
-       DB8500_PIN("GPIO217_AH12", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"),
-       DB8500_PIN("GPIO145_C13", gpio_in_pd_slpm_gpio_nopull, "gpio-keys.0"),
-       DB8500_PIN("GPIO139_C9", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"),
 };
 
 static struct pinctrl_map __initdata u9500_pinmap[] = {
This page took 0.030983 seconds and 5 git commands to generate.