1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0 OR MIT
2*f126890aSEmmanuel Vadot/*
3*f126890aSEmmanuel Vadot * Copyright 2019 Ondrej Jirman <megous@megous.com>
4*f126890aSEmmanuel Vadot */
5*f126890aSEmmanuel Vadot
6*f126890aSEmmanuel Vadot/dts-v1/;
7*f126890aSEmmanuel Vadot#include "sun5i-a13.dtsi"
8*f126890aSEmmanuel Vadot#include "sunxi-common-regulators.dtsi"
9*f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
10*f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h>
11*f126890aSEmmanuel Vadot#include <dt-bindings/interrupt-controller/irq.h>
12*f126890aSEmmanuel Vadot#include <dt-bindings/pwm/pwm.h>
13*f126890aSEmmanuel Vadot
14*f126890aSEmmanuel Vadot/ {
15*f126890aSEmmanuel Vadot	model = "PocketBook Touch Lux 3";
16*f126890aSEmmanuel Vadot	compatible = "pocketbook,touch-lux-3", "allwinner,sun5i-a13";
17*f126890aSEmmanuel Vadot
18*f126890aSEmmanuel Vadot	aliases {
19*f126890aSEmmanuel Vadot		serial0 = &uart1;
20*f126890aSEmmanuel Vadot		i2c0 = &i2c0;
21*f126890aSEmmanuel Vadot		i2c1 = &i2c1;
22*f126890aSEmmanuel Vadot		i2c2 = &i2c2;
23*f126890aSEmmanuel Vadot	};
24*f126890aSEmmanuel Vadot
25*f126890aSEmmanuel Vadot	backlight {
26*f126890aSEmmanuel Vadot		compatible = "pwm-backlight";
27*f126890aSEmmanuel Vadot		pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
28*f126890aSEmmanuel Vadot		enable-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
29*f126890aSEmmanuel Vadot		brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
30*f126890aSEmmanuel Vadot		default-brightness-level = <8>;
31*f126890aSEmmanuel Vadot		power-supply = <&reg_vcc3v3>;
32*f126890aSEmmanuel Vadot	};
33*f126890aSEmmanuel Vadot
34*f126890aSEmmanuel Vadot	chosen {
35*f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
36*f126890aSEmmanuel Vadot	};
37*f126890aSEmmanuel Vadot
38*f126890aSEmmanuel Vadot	leds {
39*f126890aSEmmanuel Vadot		compatible = "gpio-leds";
40*f126890aSEmmanuel Vadot
41*f126890aSEmmanuel Vadot		led {
42*f126890aSEmmanuel Vadot			gpios = <&pio 4 8 GPIO_ACTIVE_LOW>; /* PE8 */
43*f126890aSEmmanuel Vadot			default-state = "on";
44*f126890aSEmmanuel Vadot		};
45*f126890aSEmmanuel Vadot	};
46*f126890aSEmmanuel Vadot
47*f126890aSEmmanuel Vadot	gpio-keys {
48*f126890aSEmmanuel Vadot		compatible = "gpio-keys";
49*f126890aSEmmanuel Vadot		autorepeat;
50*f126890aSEmmanuel Vadot		label = "GPIO Keys";
51*f126890aSEmmanuel Vadot
52*f126890aSEmmanuel Vadot		key-right {
53*f126890aSEmmanuel Vadot			label = "Right";
54*f126890aSEmmanuel Vadot			linux,code = <KEY_RIGHT>;
55*f126890aSEmmanuel Vadot			gpios = <&pio 6 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG9 */
56*f126890aSEmmanuel Vadot		};
57*f126890aSEmmanuel Vadot
58*f126890aSEmmanuel Vadot		key-left {
59*f126890aSEmmanuel Vadot			label = "Left";
60*f126890aSEmmanuel Vadot			linux,code = <KEY_LEFT>;
61*f126890aSEmmanuel Vadot			gpios = <&pio 6 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG10 */
62*f126890aSEmmanuel Vadot		};
63*f126890aSEmmanuel Vadot	};
64*f126890aSEmmanuel Vadot
65*f126890aSEmmanuel Vadot	reg_1v8: regulator-1v8 {
66*f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
67*f126890aSEmmanuel Vadot		regulator-name = "vdd-1v8-nor-ctp";
68*f126890aSEmmanuel Vadot		regulator-min-microvolt = <1800000>;
69*f126890aSEmmanuel Vadot		regulator-max-microvolt = <1800000>;
70*f126890aSEmmanuel Vadot		gpio = <&pio 2 15 GPIO_ACTIVE_HIGH>;
71*f126890aSEmmanuel Vadot		enable-active-high;
72*f126890aSEmmanuel Vadot	};
73*f126890aSEmmanuel Vadot
74*f126890aSEmmanuel Vadot	reg_1v8_nor: regulator-nor {
75*f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
76*f126890aSEmmanuel Vadot		regulator-name = "vdd-nor";
77*f126890aSEmmanuel Vadot		regulator-min-microvolt = <1800000>;
78*f126890aSEmmanuel Vadot		regulator-max-microvolt = <1800000>;
79*f126890aSEmmanuel Vadot		gpio = <&pio 2 14 GPIO_ACTIVE_HIGH>;
80*f126890aSEmmanuel Vadot		enable-active-high;
81*f126890aSEmmanuel Vadot		vin-supply = <&reg_1v8>;
82*f126890aSEmmanuel Vadot		regulator-always-on;
83*f126890aSEmmanuel Vadot	};
84*f126890aSEmmanuel Vadot
85*f126890aSEmmanuel Vadot	reg_1v8_ctp: regulator-ctp {
86*f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
87*f126890aSEmmanuel Vadot		regulator-name = "vdd-ctp";
88*f126890aSEmmanuel Vadot		regulator-min-microvolt = <1800000>;
89*f126890aSEmmanuel Vadot		regulator-max-microvolt = <1800000>;
90*f126890aSEmmanuel Vadot		gpio = <&pio 2 13 GPIO_ACTIVE_HIGH>;
91*f126890aSEmmanuel Vadot		enable-active-high;
92*f126890aSEmmanuel Vadot		vin-supply = <&reg_1v8>;
93*f126890aSEmmanuel Vadot	};
94*f126890aSEmmanuel Vadot
95*f126890aSEmmanuel Vadot	reg_3v3_mmc0: regulator-mmc0 {
96*f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
97*f126890aSEmmanuel Vadot		regulator-name = "vdd-mmc0";
98*f126890aSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
99*f126890aSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
100*f126890aSEmmanuel Vadot		gpio = <&pio 4 4 GPIO_ACTIVE_LOW>; /* PE4 */
101*f126890aSEmmanuel Vadot		vin-supply = <&reg_vcc3v3>;
102*f126890aSEmmanuel Vadot	};
103*f126890aSEmmanuel Vadot};
104*f126890aSEmmanuel Vadot
105*f126890aSEmmanuel Vadot&cpu0 {
106*f126890aSEmmanuel Vadot	cpu-supply = <&reg_dcdc2>;
107*f126890aSEmmanuel Vadot};
108*f126890aSEmmanuel Vadot
109*f126890aSEmmanuel Vadot&ehci0 {
110*f126890aSEmmanuel Vadot	status = "okay";
111*f126890aSEmmanuel Vadot};
112*f126890aSEmmanuel Vadot
113*f126890aSEmmanuel Vadot&i2c0 {
114*f126890aSEmmanuel Vadot	status = "okay";
115*f126890aSEmmanuel Vadot
116*f126890aSEmmanuel Vadot	axp209: pmic@34 {
117*f126890aSEmmanuel Vadot		reg = <0x34>;
118*f126890aSEmmanuel Vadot		interrupts = <0>;
119*f126890aSEmmanuel Vadot	};
120*f126890aSEmmanuel Vadot};
121*f126890aSEmmanuel Vadot
122*f126890aSEmmanuel Vadot#include "axp209.dtsi"
123*f126890aSEmmanuel Vadot
124*f126890aSEmmanuel Vadot&i2c1 {
125*f126890aSEmmanuel Vadot	status = "okay";
126*f126890aSEmmanuel Vadot
127*f126890aSEmmanuel Vadot	pcf8563: rtc@51 {
128*f126890aSEmmanuel Vadot		compatible = "nxp,pcf8563";
129*f126890aSEmmanuel Vadot		reg = <0x51>;
130*f126890aSEmmanuel Vadot	};
131*f126890aSEmmanuel Vadot};
132*f126890aSEmmanuel Vadot
133*f126890aSEmmanuel Vadot&i2c2 {
134*f126890aSEmmanuel Vadot	status = "okay";
135*f126890aSEmmanuel Vadot
136*f126890aSEmmanuel Vadot	/* Touchpanel is connected here. */
137*f126890aSEmmanuel Vadot};
138*f126890aSEmmanuel Vadot
139*f126890aSEmmanuel Vadot&lradc {
140*f126890aSEmmanuel Vadot	vref-supply = <&reg_ldo2>;
141*f126890aSEmmanuel Vadot	status = "okay";
142*f126890aSEmmanuel Vadot
143*f126890aSEmmanuel Vadot	button-200 {
144*f126890aSEmmanuel Vadot		label = "Home";
145*f126890aSEmmanuel Vadot		linux,code = <KEY_HOME>;
146*f126890aSEmmanuel Vadot		channel = <0>;
147*f126890aSEmmanuel Vadot		voltage = <200000>;
148*f126890aSEmmanuel Vadot	};
149*f126890aSEmmanuel Vadot
150*f126890aSEmmanuel Vadot	button-400 {
151*f126890aSEmmanuel Vadot		label = "Menu";
152*f126890aSEmmanuel Vadot		linux,code = <KEY_MENU>;
153*f126890aSEmmanuel Vadot		channel = <0>;
154*f126890aSEmmanuel Vadot		voltage = <400000>;
155*f126890aSEmmanuel Vadot	};
156*f126890aSEmmanuel Vadot};
157*f126890aSEmmanuel Vadot
158*f126890aSEmmanuel Vadot&mmc0 {
159*f126890aSEmmanuel Vadot	vmmc-supply = <&reg_3v3_mmc0>;
160*f126890aSEmmanuel Vadot	bus-width = <4>;
161*f126890aSEmmanuel Vadot	cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
162*f126890aSEmmanuel Vadot	status = "okay";
163*f126890aSEmmanuel Vadot};
164*f126890aSEmmanuel Vadot
165*f126890aSEmmanuel Vadot&mmc2 {
166*f126890aSEmmanuel Vadot	pinctrl-names = "default";
167*f126890aSEmmanuel Vadot	pinctrl-0 = <&mmc2_4bit_pc_pins>;
168*f126890aSEmmanuel Vadot	vmmc-supply = <&reg_vcc3v3>;
169*f126890aSEmmanuel Vadot	bus-width = <4>;
170*f126890aSEmmanuel Vadot	non-removable;
171*f126890aSEmmanuel Vadot	status = "okay";
172*f126890aSEmmanuel Vadot};
173*f126890aSEmmanuel Vadot
174*f126890aSEmmanuel Vadot&ohci0 {
175*f126890aSEmmanuel Vadot	status = "okay";
176*f126890aSEmmanuel Vadot};
177*f126890aSEmmanuel Vadot
178*f126890aSEmmanuel Vadot&otg_sram {
179*f126890aSEmmanuel Vadot	status = "okay";
180*f126890aSEmmanuel Vadot};
181*f126890aSEmmanuel Vadot
182*f126890aSEmmanuel Vadot&pwm {
183*f126890aSEmmanuel Vadot	pinctrl-names = "default";
184*f126890aSEmmanuel Vadot	pinctrl-0 = <&pwm0_pin>;
185*f126890aSEmmanuel Vadot	status = "okay";
186*f126890aSEmmanuel Vadot};
187*f126890aSEmmanuel Vadot
188*f126890aSEmmanuel Vadot&reg_dcdc2 {
189*f126890aSEmmanuel Vadot	regulator-always-on;
190*f126890aSEmmanuel Vadot	regulator-min-microvolt = <1000000>;
191*f126890aSEmmanuel Vadot	regulator-max-microvolt = <1400000>;
192*f126890aSEmmanuel Vadot	regulator-name = "vdd-cpu";
193*f126890aSEmmanuel Vadot};
194*f126890aSEmmanuel Vadot
195*f126890aSEmmanuel Vadot&reg_dcdc3 {
196*f126890aSEmmanuel Vadot	regulator-always-on;
197*f126890aSEmmanuel Vadot	regulator-min-microvolt = <1200000>;
198*f126890aSEmmanuel Vadot	regulator-max-microvolt = <1200000>;
199*f126890aSEmmanuel Vadot	regulator-name = "vdd-int-pll";
200*f126890aSEmmanuel Vadot};
201*f126890aSEmmanuel Vadot
202*f126890aSEmmanuel Vadot&reg_ldo1 {
203*f126890aSEmmanuel Vadot	regulator-name = "vdd-rtc";
204*f126890aSEmmanuel Vadot};
205*f126890aSEmmanuel Vadot
206*f126890aSEmmanuel Vadot&reg_ldo2 {
207*f126890aSEmmanuel Vadot	regulator-always-on;
208*f126890aSEmmanuel Vadot	regulator-min-microvolt = <3000000>;
209*f126890aSEmmanuel Vadot	regulator-max-microvolt = <3000000>;
210*f126890aSEmmanuel Vadot	regulator-name = "avcc";
211*f126890aSEmmanuel Vadot};
212*f126890aSEmmanuel Vadot
213*f126890aSEmmanuel Vadot&reg_ldo3 {
214*f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
215*f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
216*f126890aSEmmanuel Vadot	regulator-name = "vcc-wifi";
217*f126890aSEmmanuel Vadot	/* We need this otherwise the LDO3 would overload */
218*f126890aSEmmanuel Vadot	regulator-soft-start;
219*f126890aSEmmanuel Vadot	regulator-ramp-delay = <1600>;
220*f126890aSEmmanuel Vadot};
221*f126890aSEmmanuel Vadot
222*f126890aSEmmanuel Vadot&spi2 {
223*f126890aSEmmanuel Vadot	pinctrl-names = "default";
224*f126890aSEmmanuel Vadot	pinctrl-0 = <&spi2_pe_pins>, <&spi2_cs0_pe_pin>;
225*f126890aSEmmanuel Vadot	status = "okay";
226*f126890aSEmmanuel Vadot
227*f126890aSEmmanuel Vadot	epd_flash: flash@0 {
228*f126890aSEmmanuel Vadot		#address-cells = <1>;
229*f126890aSEmmanuel Vadot		#size-cells = <1>;
230*f126890aSEmmanuel Vadot		compatible = "macronix,mx25u4033", "jedec,spi-nor";
231*f126890aSEmmanuel Vadot		reg = <0>;
232*f126890aSEmmanuel Vadot		spi-max-frequency = <4000000>;
233*f126890aSEmmanuel Vadot	};
234*f126890aSEmmanuel Vadot};
235*f126890aSEmmanuel Vadot
236*f126890aSEmmanuel Vadot&uart1 {
237*f126890aSEmmanuel Vadot	pinctrl-names = "default";
238*f126890aSEmmanuel Vadot	pinctrl-0 = <&uart1_pg_pins>;
239*f126890aSEmmanuel Vadot	status = "okay";
240*f126890aSEmmanuel Vadot};
241*f126890aSEmmanuel Vadot
242*f126890aSEmmanuel Vadot&usb_otg {
243*f126890aSEmmanuel Vadot	dr_mode = "peripheral";
244*f126890aSEmmanuel Vadot	status = "okay";
245*f126890aSEmmanuel Vadot};
246*f126890aSEmmanuel Vadot
247*f126890aSEmmanuel Vadot&battery_power_supply {
248*f126890aSEmmanuel Vadot	status = "okay";
249*f126890aSEmmanuel Vadot};
250*f126890aSEmmanuel Vadot
251*f126890aSEmmanuel Vadot&usb_power_supply {
252*f126890aSEmmanuel Vadot	status = "okay";
253*f126890aSEmmanuel Vadot};
254*f126890aSEmmanuel Vadot
255*f126890aSEmmanuel Vadot&usbphy {
256*f126890aSEmmanuel Vadot	usb1_vbus-supply = <&reg_ldo3>;
257*f126890aSEmmanuel Vadot	status = "okay";
258*f126890aSEmmanuel Vadot};
259