target: socfpga: Add Altera SoCFPGA support
[openwrt/svn-archive/archive.git] / target / linux / socfpga / patches-4.4 / 0005-ARM-socfpga-Add-support-for-HPS-KEYs-SWs-on-SoCKit.patch
1 From a953c0800246e99c9b449bd9ec0b26682a82700c Mon Sep 17 00:00:00 2001
2 From: Marek Vasut <marex@denx.de>
3 Date: Tue, 23 Jun 2015 00:41:08 +0200
4 Subject: [PATCH 5/5] ARM: socfpga: Add support for HPS KEYs/SWs on SoCKit
5
6 Add support for the keys and flip-switches on the SoCFPGA SoCkit board.
7
8 Signed-off-by: Marek Vasut <marex@denx.de>
9 Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
10 ---
11 arch/arm/boot/dts/socfpga_cyclone5_sockit.dts | 62 ++++++++++++++++++++++++++-
12 1 file changed, 61 insertions(+), 1 deletion(-)
13
14 diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
15 index 1461690..02e22f5 100644
16 --- a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
17 +++ b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
18 @@ -67,6 +67,62 @@
19 };
20 };
21
22 + gpio-keys {
23 + compatible = "gpio-keys";
24 +
25 + hps_sw0 {
26 + label = "hps_sw0";
27 + gpios = <&portc 20 0>; /* HPS_GPI7 */
28 + linux,input-type = <5>; /* EV_SW */
29 + linux,code = <0x0>; /* SW_LID */
30 + };
31 +
32 + hps_sw1 {
33 + label = "hps_sw1";
34 + gpios = <&portc 19 0>; /* HPS_GPI6 */
35 + linux,input-type = <5>; /* EV_SW */
36 + linux,code = <0x5>; /* SW_DOCK */
37 + };
38 +
39 + hps_sw2 {
40 + label = "hps_sw2";
41 + gpios = <&portc 18 0>; /* HPS_GPI5 */
42 + linux,input-type = <5>; /* EV_SW */
43 + linux,code = <0xa>; /* SW_KEYPAD_SLIDE */
44 + };
45 +
46 + hps_sw3 {
47 + label = "hps_sw3";
48 + gpios = <&portc 17 0>; /* HPS_GPI4 */
49 + linux,input-type = <5>; /* EV_SW */
50 + linux,code = <0xc>; /* SW_ROTATE_LOCK */
51 + };
52 +
53 + hps_hkey0 {
54 + label = "hps_hkey0";
55 + gpios = <&portc 21 1>; /* HPS_GPI8 */
56 + linux,code = <187>; /* KEY_F17 */
57 + };
58 +
59 + hps_hkey1 {
60 + label = "hps_hkey1";
61 + gpios = <&portc 22 1>; /* HPS_GPI9 */
62 + linux,code = <188>; /* KEY_F18 */
63 + };
64 +
65 + hps_hkey2 {
66 + label = "hps_hkey2";
67 + gpios = <&portc 23 1>; /* HPS_GPI10 */
68 + linux,code = <189>; /* KEY_F19 */
69 + };
70 +
71 + hps_hkey3 {
72 + label = "hps_hkey3";
73 + gpios = <&portc 24 1>; /* HPS_GPI11 */
74 + linux,code = <190>; /* KEY_F20 */
75 + };
76 + };
77 +
78 regulator_3_3v: vcc3p3-regulator {
79 compatible = "regulator-fixed";
80 regulator-name = "VCC3P3";
81 @@ -89,11 +145,15 @@
82 rxc-skew-ps = <2000>;
83 };
84
85 +&gpio0 { /* GPIO 0..29 */
86 + status = "okay";
87 +};
88 +
89 &gpio1 { /* GPIO 30..57 */
90 status = "okay";
91 };
92
93 -&gpio2 {
94 +&gpio2 { /* GPIO 58..66 (HLGPI 0..13 at offset 13) */
95 status = "okay";
96 };
97
98 --
99 2.7.0
100