ARM: dts: socfpga: Add support for HPS KEYs/SWs on SoCKit
authorMarek Vasut <marex@denx.de>
Sat, 19 Mar 2016 23:57:46 +0000 (23:57 +0000)
committerDinh Nguyen <dinguyen@kernel.org>
Mon, 11 Apr 2016 19:02:32 +0000 (14:02 -0500)
Add support for the keys and flip-switches on the SoCFPGA SoCkit board.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts

index 146169016f0c1d7e340f64ed65005f6c0153d532..02e22f554ef0742a2e7fba39779b7230ed4fb037 100644 (file)
                };
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               hps_sw0 {
+                       label = "hps_sw0";
+                       gpios = <&portc 20 0>;  /* HPS_GPI7 */
+                       linux,input-type = <5>; /* EV_SW */
+                       linux,code = <0x0>;     /* SW_LID */
+               };
+
+               hps_sw1 {
+                       label = "hps_sw1";
+                       gpios = <&portc 19 0>;  /* HPS_GPI6 */
+                       linux,input-type = <5>; /* EV_SW */
+                       linux,code = <0x5>;     /* SW_DOCK */
+               };
+
+               hps_sw2 {
+                       label = "hps_sw2";
+                       gpios = <&portc 18 0>;  /* HPS_GPI5 */
+                       linux,input-type = <5>; /* EV_SW */
+                       linux,code = <0xa>;     /* SW_KEYPAD_SLIDE */
+               };
+
+               hps_sw3 {
+                       label = "hps_sw3";
+                       gpios = <&portc 17 0>;  /* HPS_GPI4 */
+                       linux,input-type = <5>; /* EV_SW */
+                       linux,code = <0xc>;     /* SW_ROTATE_LOCK */
+               };
+
+               hps_hkey0 {
+                       label = "hps_hkey0";
+                       gpios = <&portc 21 1>;  /* HPS_GPI8 */
+                       linux,code = <187>;     /* KEY_F17 */
+               };
+
+               hps_hkey1 {
+                       label = "hps_hkey1";
+                       gpios = <&portc 22 1>;  /* HPS_GPI9 */
+                       linux,code = <188>;     /* KEY_F18 */
+               };
+
+               hps_hkey2 {
+                       label = "hps_hkey2";
+                       gpios = <&portc 23 1>;  /* HPS_GPI10 */
+                       linux,code = <189>;     /* KEY_F19 */
+               };
+
+               hps_hkey3 {
+                       label = "hps_hkey3";
+                       gpios = <&portc 24 1>;  /* HPS_GPI11 */
+                       linux,code = <190>;     /* KEY_F20 */
+               };
+       };
+
        regulator_3_3v: vcc3p3-regulator {
                compatible = "regulator-fixed";
                regulator-name = "VCC3P3";
        rxc-skew-ps = <2000>;
 };
 
+&gpio0 {       /* GPIO 0..29 */
+       status = "okay";
+};
+
 &gpio1 {       /* GPIO 30..57 */
        status = "okay";
 };
 
-&gpio2 {
+&gpio2 {       /* GPIO 58..66 (HLGPI 0..13 at offset 13) */
        status = "okay";
 };