sunxi: add initial 3.18 support
[openwrt/staging/chunkeey.git] / target / linux / sunxi / patches-3.18 / 112-dt-sun5i-add-lradc.patch
1 From 3bf1194692f3a275e0776d3c0b6f17826cc01baa Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Wed, 1 Jan 2014 19:50:33 +0100
4 Subject: [PATCH] ARM: dts: sun5i: Add lradc node
5
6 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 ---
8 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 45 ++++++++++++++++++++++--
9 arch/arm/boot/dts/sun5i-a10s.dtsi | 7 ++++
10 arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 45 ++++++++++++++++++++++--
11 arch/arm/boot/dts/sun5i-a13.dtsi | 7 ++++
12 4 files changed, 100 insertions(+), 4 deletions(-)
13
14 diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
15 index ea9519d..0b82d20 100644
16 --- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
17 +++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
18 @@ -12,8 +12,9 @@
19 */
20
21 /dts-v1/;
22 -/include/ "sun5i-a10s.dtsi"
23 -/include/ "sunxi-common-regulators.dtsi"
24 +#include "sun5i-a10s.dtsi"
25 +#include "sunxi-common-regulators.dtsi"
26 +#include <dt-bindings/input/input.h>
27
28 / {
29 model = "Olimex A10s-Olinuxino Micro";
30 @@ -98,6 +99,46 @@
31 };
32 };
33
34 + lradc: lradc@01c22800 {
35 + vref-supply = <&reg_vcc3v0>;
36 + status = "okay";
37 +
38 + button@191 {
39 + label = "Volume Up";
40 + linux,code = <KEY_VOLUMEUP>;
41 + channel = <0>;
42 + voltage = <191274>;
43 + };
44 +
45 + button@392 {
46 + label = "Volume Down";
47 + linux,code = <KEY_VOLUMEDOWN>;
48 + channel = <0>;
49 + voltage = <392644>;
50 + };
51 +
52 + button@601 {
53 + label = "Menu";
54 + linux,code = <KEY_MENU>;
55 + channel = <0>;
56 + voltage = <601151>;
57 + };
58 +
59 + button@795 {
60 + label = "Enter";
61 + linux,code = <KEY_ENTER>;
62 + channel = <0>;
63 + voltage = <795090>;
64 + };
65 +
66 + button@987 {
67 + label = "Home";
68 + linux,code = <KEY_HOMEPAGE>;
69 + channel = <0>;
70 + voltage = <987387>;
71 + };
72 + };
73 +
74 uart0: serial@01c28000 {
75 pinctrl-names = "default";
76 pinctrl-0 = <&uart0_pins_a>;
77 diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
78 index 531272c..7c6c883 100644
79 --- a/arch/arm/boot/dts/sun5i-a10s.dtsi
80 +++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
81 @@ -520,6 +520,13 @@
82 reg = <0x01c20c90 0x10>;
83 };
84
85 + lradc: lradc@01c22800 {
86 + compatible = "allwinner,sun4i-a10-lradc-keys";
87 + reg = <0x01c22800 0x100>;
88 + interrupts = <31>;
89 + status = "disabled";
90 + };
91 +
92 sid: eeprom@01c23800 {
93 compatible = "allwinner,sun4i-a10-sid";
94 reg = <0x01c23800 0x10>;
95 diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
96 index 429994e..b4ec8eb 100644
97 --- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
98 +++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
99 @@ -12,8 +12,9 @@
100 */
101
102 /dts-v1/;
103 -/include/ "sun5i-a13.dtsi"
104 -/include/ "sunxi-common-regulators.dtsi"
105 +#include "sun5i-a13.dtsi"
106 +#include "sunxi-common-regulators.dtsi"
107 +#include <dt-bindings/input/input.h>
108
109 / {
110 model = "Olimex A13-Olinuxino";
111 @@ -66,6 +67,46 @@
112 };
113 };
114
115 + lradc: lradc@01c22800 {
116 + vref-supply = <&reg_vcc3v0>;
117 + status = "okay";
118 +
119 + button@191 {
120 + label = "Volume Up";
121 + linux,code = <KEY_VOLUMEUP>;
122 + channel = <0>;
123 + voltage = <191274>;
124 + };
125 +
126 + button@392 {
127 + label = "Volume Down";
128 + linux,code = <KEY_VOLUMEDOWN>;
129 + channel = <0>;
130 + voltage = <392644>;
131 + };
132 +
133 + button@601 {
134 + label = "Menu";
135 + linux,code = <KEY_MENU>;
136 + channel = <0>;
137 + voltage = <601151>;
138 + };
139 +
140 + button@795 {
141 + label = "Enter";
142 + linux,code = <KEY_ENTER>;
143 + channel = <0>;
144 + voltage = <795090>;
145 + };
146 +
147 + button@987 {
148 + label = "Home";
149 + linux,code = <KEY_HOMEPAGE>;
150 + channel = <0>;
151 + voltage = <987387>;
152 + };
153 + };
154 +
155 uart1: serial@01c28400 {
156 pinctrl-names = "default";
157 pinctrl-0 = <&uart1_pins_b>;
158 diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
159 index b131068..aa0482c 100644
160 --- a/arch/arm/boot/dts/sun5i-a13.dtsi
161 +++ b/arch/arm/boot/dts/sun5i-a13.dtsi
162 @@ -468,6 +468,13 @@
163 reg = <0x01c20c90 0x10>;
164 };
165
166 + lradc: lradc@01c22800 {
167 + compatible = "allwinner,sun4i-a10-lradc-keys";
168 + reg = <0x01c22800 0x100>;
169 + interrupts = <31>;
170 + status = "disabled";
171 + };
172 +
173 sid: eeprom@01c23800 {
174 compatible = "allwinner,sun4i-a10-sid";
175 reg = <0x01c23800 0x10>;