1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright 2019 Andreas Kemnade
4 * based on works
5 * Copyright 2016 Freescale Semiconductor, Inc.
6 * and
7 * Copyright (C) 2014 Ricoh Electronic Devices Co., Ltd
8 *
9 * Netronix E60K02 board common.
10 * This board is equipped with different SoCs and
11 * found in ebook-readers like the Kobo Clara HD (with i.MX6SLL) and
12 * the Tolino Shine 3 (with i.MX6SL)
13 */
14#include <dt-bindings/input/input.h>
15
16/ {
17
18	chosen {
19		stdout-path = &uart1;
20	};
21
22	gpio_keys: gpio-keys {
23		compatible = "gpio-keys";
24
25		key-power {
26			label = "Power";
27			gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
28			linux,code = <KEY_POWER>;
29			wakeup-source;
30		};
31
32		key-cover {
33			label = "Cover";
34			gpios = <&gpio5 12 GPIO_ACTIVE_LOW>;
35			linux,code = <SW_LID>;
36			linux,input-type = <EV_SW>;
37			wakeup-source;
38		};
39	};
40
41	leds: leds {
42		compatible = "gpio-leds";
43
44		led {
45			label = "e60k02:white:on";
46			gpios = <&gpio5 7 GPIO_ACTIVE_LOW>;
47			linux,default-trigger = "timer";
48		};
49	};
50
51	memory@80000000 {
52		device_type = "memory";
53		reg = <0x80000000 0x20000000>;
54	};
55
56	reg_wifi: regulator-wifi {
57		compatible = "regulator-fixed";
58		regulator-name = "SD3_SPWR";
59		regulator-min-microvolt = <3000000>;
60		regulator-max-microvolt = <3000000>;
61		gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
62		enable-active-high;
63	};
64
65	wifi_pwrseq: wifi_pwrseq {
66		compatible = "mmc-pwrseq-simple";
67		post-power-on-delay-ms = <20>;
68		reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
69	};
70};
71
72
73&i2c1 {
74	clock-frequency = <100000>;
75	status = "okay";
76
77	lm3630a: backlight@36 {
78		reg = <0x36>;
79		compatible = "ti,lm3630a";
80		enable-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
81
82		#address-cells = <1>;
83		#size-cells = <0>;
84
85		led@0 {
86			reg = <0>;
87			led-sources = <0>;
88			label = "backlight_warm";
89			default-brightness = <0>;
90			max-brightness = <255>;
91		};
92
93		led@1 {
94			reg = <1>;
95			led-sources = <1>;
96			label = "backlight_cold";
97			default-brightness = <0>;
98			max-brightness = <255>;
99		};
100	};
101};
102
103&i2c2 {
104	clock-frequency = <100000>;
105	status = "okay";
106
107	touchscreen@24 {
108		compatible = "cypress,tt21000";
109		reg = <0x24>;
110		pinctrl-names = "default";
111		pinctrl-0 = <&pinctrl_cyttsp5_gpio>;
112		interrupt-parent = <&gpio5>;
113		interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
114		reset-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
115		vdd-supply = <&ldo5_reg>;
116	};
117
118	/* TODO: TPS65185 PMIC for E Ink at 0x68 */
119
120};
121
122&i2c3 {
123	clock-frequency = <100000>;
124	status = "okay";
125
126	ricoh619: pmic@32 {
127		compatible = "ricoh,rc5t619";
128		reg = <0x32>;
129		interrupt-parent = <&gpio5>;
130		interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
131		system-power-controller;
132
133		regulators {
134			dcdc1_reg: DCDC1 {
135				regulator-name = "DCDC1";
136				regulator-min-microvolt = <300000>;
137				regulator-max-microvolt = <1875000>;
138				regulator-always-on;
139				regulator-boot-on;
140
141				regulator-state-mem {
142					regulator-on-in-suspend;
143					regulator-suspend-max-microvolt = <900000>;
144					regulator-suspend-min-microvolt = <900000>;
145				};
146			};
147
148			/* Core3_3V3 */
149			dcdc2_reg: DCDC2 {
150				regulator-name = "DCDC2";
151				regulator-always-on;
152				regulator-boot-on;
153
154				regulator-state-mem {
155					regulator-on-in-suspend;
156					regulator-suspend-max-microvolt = <3300000>;
157					regulator-suspend-min-microvolt = <3300000>;
158				};
159			};
160
161			dcdc3_reg: DCDC3 {
162				regulator-name = "DCDC3";
163				regulator-min-microvolt = <300000>;
164				regulator-max-microvolt = <1875000>;
165				regulator-always-on;
166				regulator-boot-on;
167
168				regulator-state-mem {
169					regulator-on-in-suspend;
170					regulator-suspend-max-microvolt = <1140000>;
171					regulator-suspend-min-microvolt = <1140000>;
172				};
173			};
174
175			/* Core4_1V2 */
176			dcdc4_reg: DCDC4 {
177				regulator-name = "DCDC4";
178				regulator-min-microvolt = <1200000>;
179				regulator-max-microvolt = <1200000>;
180				regulator-always-on;
181				regulator-boot-on;
182
183				regulator-state-mem {
184					regulator-on-in-suspend;
185					regulator-suspend-max-microvolt = <1140000>;
186					regulator-suspend-min-microvolt = <1140000>;
187				};
188			};
189
190			/* Core4_1V8 */
191			dcdc5_reg: DCDC5 {
192				regulator-name = "DCDC5";
193				regulator-min-microvolt = <1800000>;
194				regulator-max-microvolt = <1800000>;
195				regulator-always-on;
196				regulator-boot-on;
197
198				regulator-state-mem {
199					regulator-on-in-suspend;
200					regulator-suspend-max-microvolt = <1700000>;
201					regulator-suspend-min-microvolt = <1700000>;
202				};
203			};
204
205			/* IR_3V3 */
206			ldo1_reg: LDO1  {
207				regulator-name = "LDO1";
208				regulator-boot-on;
209			};
210
211			/* Core1_3V3 */
212			ldo2_reg: LDO2  {
213				regulator-name = "LDO2";
214				regulator-always-on;
215				regulator-boot-on;
216
217				regulator-state-mem {
218					regulator-on-in-suspend;
219					regulator-suspend-max-microvolt = <3000000>;
220					regulator-suspend-min-microvolt = <3000000>;
221				};
222			};
223
224			/* Core5_1V2 */
225			ldo3_reg: LDO3  {
226				regulator-name = "LDO3";
227				regulator-always-on;
228				regulator-boot-on;
229			};
230
231			ldo4_reg: LDO4 {
232				regulator-name = "LDO4";
233				regulator-boot-on;
234			};
235
236			/* SPD_3V3 */
237			ldo5_reg: LDO5 {
238				regulator-name = "LDO5";
239				regulator-always-on;
240				regulator-boot-on;
241			};
242
243			/* DDR_0V6 */
244			ldo6_reg: LDO6 {
245				regulator-name = "LDO6";
246				regulator-always-on;
247				regulator-boot-on;
248			};
249
250			/* VDD_PWM */
251			ldo7_reg: LDO7 {
252				regulator-name = "LDO7";
253				regulator-always-on;
254				regulator-boot-on;
255			};
256
257			/* ldo_1v8 */
258			ldo8_reg: LDO8 {
259				regulator-name = "LDO8";
260				regulator-min-microvolt = <1800000>;
261				regulator-max-microvolt = <1800000>;
262				regulator-always-on;
263				regulator-boot-on;
264			};
265
266			ldo9_reg: LDO9 {
267				regulator-name = "LDO9";
268				regulator-boot-on;
269			};
270
271			ldo10_reg: LDO10 {
272				regulator-name = "LDO10";
273				regulator-boot-on;
274			};
275
276			ldortc1_reg: LDORTC1  {
277				regulator-name = "LDORTC1";
278				regulator-boot-on;
279			};
280		};
281	};
282};
283
284&snvs_rtc {
285	/* we are using the rtc in the pmic, not disabled in imx6sll.dtsi */
286	status = "disabled";
287};
288
289&uart1 {
290	/* J4, through-hole */
291	status = "okay";
292};
293
294&uart4 {
295	/* TP198, next to J4, SMD pads */
296	status = "okay";
297};
298
299&usdhc2 {
300	non-removable;
301	status = "okay";
302};
303
304&usdhc3 {
305	vmmc-supply = <&reg_wifi>;
306	mmc-pwrseq = <&wifi_pwrseq>;
307	cap-power-off-card;
308	non-removable;
309	status = "okay";
310};
311
312&usbotg1 {
313	pinctrl-names = "default";
314	disable-over-current;
315	srp-disable;
316	hnp-disable;
317	adp-disable;
318	status = "okay";
319};
320