Merge remote-tracking branches 'asoc/topic/cs47l24', 'asoc/topic/cx20442', 'asoc...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / sun6i-a31s-primo81.dts
1 /*
2  * Copyright 2014 Siarhei Siamashka <siarhei.siamashka@gmail.com>
3  * Copyright 2015 Karsten Merker <merker@debian.org>
4  * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
5  *
6  * This file is dual-licensed: you can use it either under the terms
7  * of the GPL or the X11 license, at your option. Note that this dual
8  * licensing only applies to this file, and not this project as a
9  * whole.
10  *
11  *  a) This file is free software; you can redistribute it and/or
12  *     modify it under the terms of the GNU General Public License as
13  *     published by the Free Software Foundation; either version 2 of the
14  *     License, or (at your option) any later version.
15  *
16  *     This file is distributed in the hope that it will be useful,
17  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *     GNU General Public License for more details.
20  *
21  * Or, alternatively,
22  *
23  *  b) Permission is hereby granted, free of charge, to any person
24  *     obtaining a copy of this software and associated documentation
25  *     files (the "Software"), to deal in the Software without
26  *     restriction, including without limitation the rights to use,
27  *     copy, modify, merge, publish, distribute, sublicense, and/or
28  *     sell copies of the Software, and to permit persons to whom the
29  *     Software is furnished to do so, subject to the following
30  *     conditions:
31  *
32  *     The above copyright notice and this permission notice shall be
33  *     included in all copies or substantial portions of the Software.
34  *
35  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42  *     OTHER DEALINGS IN THE SOFTWARE.
43  */
44
45 /dts-v1/;
46 #include "sun6i-a31s.dtsi"
47 #include "sunxi-common-regulators.dtsi"
48
49 #include <dt-bindings/gpio/gpio.h>
50 #include <dt-bindings/input/input.h>
51
52 / {
53         model = "MSI Primo81 tablet";
54         compatible = "msi,primo81", "allwinner,sun6i-a31s";
55
56         hdmi-connector {
57                 compatible = "hdmi-connector";
58                 type = "c";
59
60                 port {
61                         hdmi_con_in: endpoint {
62                                 remote-endpoint = <&hdmi_out_con>;
63                         };
64                 };
65         };
66 };
67
68 &cpu0 {
69         cpu-supply = <&reg_dcdc3>;
70 };
71
72 &de {
73         status = "okay";
74 };
75
76 &ehci0 {
77         /* rtl8188etv wifi is connected here */
78         status = "okay";
79 };
80
81 &hdmi {
82         status = "okay";
83 };
84
85 &hdmi_out {
86         hdmi_out_con: endpoint {
87                 remote-endpoint = <&hdmi_con_in>;
88         };
89 };
90
91 &i2c0 {
92         /* pull-ups and device VDDIO use AXP221 DLDO3 */
93         pinctrl-names = "default";
94         pinctrl-0 = <&i2c0_pins_a>;
95         status = "failed";
96 };
97
98 &i2c1 {
99         pinctrl-names = "default";
100         pinctrl-0 = <&i2c1_pins_a>;
101         status = "okay";
102
103         ctp@5d {
104                 pinctrl-names = "default";
105                 pinctrl-0 = <&gt911_int_primo81>;
106                 compatible = "goodix,gt911";
107                 reg = <0x5d>;
108                 interrupt-parent = <&pio>;
109                 interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */
110                 touchscreen-swapped-x-y;
111         };
112 };
113
114 &i2c2 {
115         pinctrl-names = "default";
116         pinctrl-0 = <&i2c2_pins_a>;
117         status = "okay";
118
119         accelerometer@1c {
120                 pinctrl-names = "default";
121                 pinctrl-0 = <&mma8452_int_primo81>;
122                 compatible = "fsl,mma8452";
123                 reg = <0x1c>;
124                 interrupt-parent = <&pio>;
125                 interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */
126                 #io-channel-cells = <1>;
127         };
128 };
129
130 &lradc {
131         vref-supply = <&reg_aldo3>;
132         status = "okay";
133
134         button@158 {
135                 label = "Volume Up";
136                 linux,code = <KEY_VOLUMEUP>;
137                 channel = <0>;
138                 voltage = <158730>;
139         };
140
141         button@349 {
142                 label = "Volume Down";
143                 linux,code = <KEY_VOLUMEDOWN>;
144                 channel = <0>;
145                 voltage = <349206>;
146         };
147 };
148
149 &mmc0 {
150         pinctrl-names = "default";
151         pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>;
152         vmmc-supply = <&reg_dcdc1>;
153         bus-width = <4>;
154         cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
155         cd-inverted;
156         status = "okay";
157 };
158
159 &pio {
160         gt911_int_primo81: gt911_int_pin@0 {
161                 pins = "PA3";
162                 function = "gpio_in";
163         };
164
165         mma8452_int_primo81: mma8452_int_pin@0 {
166                 pins = "PA9";
167                 function = "gpio_in";
168                 bias-pull-up;
169         };
170
171         mmc0_cd_pin_primo81: mmc0_cd_pin@0 {
172                 pins = "PA8";
173                 function = "gpio_in";
174                 bias-pull-up;
175         };
176 };
177
178 &p2wi {
179         status = "okay";
180
181         axp22x: pmic@68 {
182                 compatible = "x-powers,axp221";
183                 reg = <0x68>;
184                 interrupt-parent = <&nmi_intc>;
185                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
186                 x-powers,drive-vbus-en;
187         };
188 };
189
190 #include "axp22x.dtsi"
191
192 &battery_power_supply {
193         status = "okay";
194 };
195
196 &reg_aldo3 {
197         regulator-always-on;
198         regulator-min-microvolt = <2700000>;
199         regulator-max-microvolt = <3300000>;
200         regulator-name = "avcc";
201 };
202
203 &reg_dc1sw {
204         regulator-name = "vcc-lcd";
205 };
206
207 &reg_dc5ldo {
208         regulator-min-microvolt = <700000>;
209         regulator-max-microvolt = <1320000>;
210         regulator-name = "vdd-cpus"; /* This is an educated guess */
211 };
212
213 &reg_dcdc1 {
214         regulator-always-on;
215         regulator-min-microvolt = <3000000>;
216         regulator-max-microvolt = <3000000>;
217         regulator-name = "vcc-3v0";
218 };
219
220 &reg_dcdc2 {
221         regulator-min-microvolt = <700000>;
222         regulator-max-microvolt = <1320000>;
223         regulator-name = "vdd-gpu";
224 };
225
226 &reg_dcdc3 {
227         regulator-always-on;
228         regulator-min-microvolt = <700000>;
229         regulator-max-microvolt = <1320000>;
230         regulator-name = "vdd-cpu";
231 };
232
233 &reg_dcdc4 {
234         regulator-always-on;
235         regulator-min-microvolt = <700000>;
236         regulator-max-microvolt = <1320000>;
237         regulator-name = "vdd-sys-dll";
238 };
239
240 &reg_dcdc5 {
241         regulator-always-on;
242         regulator-min-microvolt = <1500000>;
243         regulator-max-microvolt = <1500000>;
244         regulator-name = "vcc-dram";
245 };
246
247 &reg_dldo1 {
248         regulator-min-microvolt = <3300000>;
249         regulator-max-microvolt = <3300000>;
250         regulator-name = "vcc-wifi";
251 };
252
253 &reg_dldo3 {
254         regulator-min-microvolt = <2800000>;
255         regulator-max-microvolt = <2800000>;
256         regulator-name = "vddio-csi";
257 };
258
259 &reg_drivevbus {
260         regulator-name = "usb0-vbus";
261         status = "okay";
262 };
263
264 &reg_eldo3 {
265         regulator-min-microvolt = <1080000>;
266         regulator-max-microvolt = <1320000>;
267         regulator-name = "vdd-mipi-bridge";
268 };
269
270 &simplefb_lcd {
271         vcc-lcd-supply = <&reg_dc1sw>;
272         vdd-mipi-bridge-supply = <&reg_eldo3>;
273 };
274
275 &usb_otg {
276         dr_mode = "otg";
277         status = "okay";
278 };
279
280 &usb_power_supply {
281         status = "okay";
282 };
283
284 &usbphy {
285         usb0_id_det-gpio = <&pio 0 15 GPIO_ACTIVE_HIGH>; /* PA15 */
286         usb0_vbus_power-supply = <&usb_power_supply>;
287         usb0_vbus-supply = <&reg_drivevbus>;
288         usb1_vbus-supply = <&reg_dldo1>;
289         status = "okay";
290 };