1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device tree for the Tolino Vison ebook reader
4 *
5 * Name on mainboard is: 37NB-E60Q30+4A3
6 * Serials start with: 6032
7 *
8 * Copyright 2023 Andreas Kemnade
9 */
10
11/dts-v1/;
12
13#include <dt-bindings/leds/common.h>
14#include <dt-bindings/input/input.h>
15#include <dt-bindings/gpio/gpio.h>
16#include "imx6sl.dtsi"
17
18/ {
19	model = "Tolino Vision";
20	compatible = "kobo,tolino-vision", "fsl,imx6sl";
21
22	aliases {
23		mmc0 = &usdhc4;
24		mmc1 = &usdhc2;
25	};
26
27	backlight {
28		compatible = "pwm-backlight";
29		pwms = <&ec 0 50000>;
30		power-supply = <&backlight_regulator>;
31	};
32
33	backlight_regulator: regulator-backlight {
34		compatible = "regulator-fixed";
35		pinctrl-names = "default";
36		pinctrl-0 = <&pinctrl_backlight_power>;
37		regulator-name = "backlight";
38		gpio = <&gpio2 10 GPIO_ACTIVE_HIGH>;
39		enable-active-high;
40	};
41
42	chosen {
43		stdout-path = &uart1;
44	};
45
46	gpio_keys: gpio-keys {
47		compatible = "gpio-keys";
48		pinctrl-names = "default";
49		pinctrl-0 = <&pinctrl_gpio_keys>;
50
51		key-cover {
52			/* magnetic sensor in the corner next to the uSD slot */
53			label = "Cover";
54			gpios = <&gpio5 12 GPIO_ACTIVE_LOW>;
55			linux,code = <SW_LID>;
56			linux,input-type = <EV_SW>;
57			wakeup-source;
58		};
59
60		key-fl {
61			label = "Frontlight";
62			gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;
63			linux,code = <KEY_BRIGHTNESS_CYCLE>;
64		};
65
66		key-power {
67			label = "Power";
68			gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
69			linux,code = <KEY_POWER>;
70			wakeup-source;
71		};
72	};
73
74	leds: leds {
75		compatible = "gpio-leds";
76		pinctrl-names = "default";
77		pinctrl-0 = <&pinctrl_leds>;
78
79		led-0 {
80			/* LED on home button */
81			color = <LED_COLOR_ID_WHITE>;
82			function = LED_FUNCTION_STATUS;
83			gpios = <&gpio5 10 GPIO_ACTIVE_LOW>;
84		};
85
86		led-1 {
87			/* LED on power button */
88			color = <LED_COLOR_ID_WHITE>;
89			function = LED_FUNCTION_POWER;
90			gpios = <&gpio5 7 GPIO_ACTIVE_LOW>;
91			linux,default-trigger = "timer";
92		};
93	};
94
95	memory@80000000 {
96		device_type = "memory";
97		reg = <0x80000000 0x20000000>;
98	};
99
100	reg_wifi: regulator-wifi {
101		compatible = "regulator-fixed";
102		pinctrl-names = "default";
103		pinctrl-0 = <&pinctrl_wifi_power>;
104		regulator-name = "SD3_SPWR";
105		regulator-min-microvolt = <3000000>;
106		regulator-max-microvolt = <3000000>;
107		gpio = <&gpio4 29 GPIO_ACTIVE_LOW>;
108	};
109
110
111	wifi_pwrseq: wifi_pwrseq {
112		compatible = "mmc-pwrseq-simple";
113		pinctrl-names = "default";
114		pinctrl-0 = <&pinctrl_wifi_reset>;
115		post-power-on-delay-ms = <20>;
116		reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
117	};
118};
119
120&i2c1 {
121	pinctrl-names = "default","sleep";
122	pinctrl-0 = <&pinctrl_i2c1>;
123	pinctrl-1 = <&pinctrl_i2c1_sleep>;
124	status = "okay";
125
126	touchscreen@15 {
127		compatible = "elan,ektf2132";
128		reg = <0x15>;
129		pinctrl-names = "default";
130		pinctrl-0 = <&pinctrl_ts>;
131		power-gpios = <&gpio5 13 GPIO_ACTIVE_HIGH>;
132		interrupts-extended = <&gpio5 6 IRQ_TYPE_EDGE_FALLING>;
133	};
134
135	accelerometer@1d {
136		compatible = "fsl,mma8652";
137		reg = <0x1d>;
138	};
139};
140
141&i2c2 {
142	pinctrl-names = "default","sleep";
143	pinctrl-0 = <&pinctrl_i2c2>;
144	pinctrl-1 = <&pinctrl_i2c2_sleep>;
145	clock-frequency = <100000>;
146	status = "okay";
147};
148
149&i2c3 {
150	pinctrl-names = "default";
151	pinctrl-0 = <&pinctrl_i2c3>;
152	clock-frequency = <100000>;
153	status = "okay";
154
155	ec: embedded-controller@43 {
156		compatible = "netronix,ntxec";
157		reg = <0x43>;
158		#pwm-cells = <2>;
159		pinctrl-names = "default";
160		pinctrl-0 = <&pinctrl_ec>;
161		interrupts-extended = <&gpio5 11 IRQ_TYPE_EDGE_FALLING>;
162		system-power-controller;
163	};
164};
165
166&snvs_rtc {
167	/*
168	 * We are using the RTC in the PMIC, but this one is not disabled
169	 * in imx6sl.dtsi.
170	 */
171	status = "disabled";
172};
173
174&uart1 {
175	/* J4 */
176	pinctrl-names = "default";
177	pinctrl-0 = <&pinctrl_uart1>;
178	status = "okay";
179};
180
181&uart4 {
182	/* J9 */
183	pinctrl-names = "default";
184	pinctrl-0 = <&pinctrl_uart4>;
185	status = "okay";
186};
187
188&usdhc2 {
189	pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
190	pinctrl-0 = <&pinctrl_usdhc2>;
191	pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
192	pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
193	pinctrl-3 = <&pinctrl_usdhc2_sleep>;
194	cd-gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
195	status = "okay";
196
197	/* removable uSD card */
198};
199
200&usdhc3 {
201	pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
202	pinctrl-0 = <&pinctrl_usdhc3>;
203	pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
204	pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
205	pinctrl-3 = <&pinctrl_usdhc3_sleep>;
206	vmmc-supply = <&reg_wifi>;
207	mmc-pwrseq = <&wifi_pwrseq>;
208	cap-power-off-card;
209	non-removable;
210	status = "okay";
211
212	/* CyberTan WC121 (BCM43362) SDIO WiFi */
213};
214
215&usdhc4 {
216	pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
217	pinctrl-0 = <&pinctrl_usdhc4>;
218	pinctrl-1 = <&pinctrl_usdhc4_100mhz>;
219	pinctrl-2 = <&pinctrl_usdhc4_200mhz>;
220	pinctrl-3 = <&pinctrl_usdhc4_sleep>;
221	bus-width = <8>;
222	no-1-8-v;
223	non-removable;
224	status = "okay";
225
226	/* internal eMMC */
227};
228
229&usbotg1 {
230	pinctrl-names = "default";
231	disable-over-current;
232	srp-disable;
233	hnp-disable;
234	adp-disable;
235	status = "okay";
236};
237
238&iomuxc {
239	pinctrl_backlight_power: backlight-powergrp {
240		fsl,pins = <
241			MX6SL_PAD_EPDC_PWRCTRL3__GPIO2_IO10 0x10059
242		>;
243	};
244
245	pinctrl_ec: ecgrp {
246		fsl,pins = <
247			MX6SL_PAD_SD1_DAT0__GPIO5_IO11  0x17000
248		>;
249	};
250
251	pinctrl_gpio_keys: gpio-keysgrp {
252		fsl,pins = <
253			MX6SL_PAD_SD1_DAT1__GPIO5_IO08  0x110B0
254			MX6SL_PAD_SD1_DAT4__GPIO5_IO12  0x110B0
255			MX6SL_PAD_KEY_COL1__GPIO3_IO26  0x11030
256		>;
257	};
258
259	pinctrl_i2c1: i2c1grp {
260		fsl,pins = <
261			MX6SL_PAD_I2C1_SCL__I2C1_SCL	 0x4001f8b1
262			MX6SL_PAD_I2C1_SDA__I2C1_SDA	 0x4001f8b1
263		>;
264	};
265
266	pinctrl_i2c1_sleep: i2c1-sleepgrp {
267		fsl,pins = <
268			MX6SL_PAD_I2C1_SCL__I2C1_SCL	 0x400108b1
269			MX6SL_PAD_I2C1_SDA__I2C1_SDA	 0x400108b1
270		>;
271	};
272
273	pinctrl_i2c2: i2c2grp {
274		fsl,pins = <
275			MX6SL_PAD_I2C2_SCL__I2C2_SCL	 0x4001f8b1
276			MX6SL_PAD_I2C2_SDA__I2C2_SDA	 0x4001f8b1
277		>;
278	};
279
280	pinctrl_i2c2_sleep: i2c2-sleepgrp {
281		fsl,pins = <
282			MX6SL_PAD_I2C2_SCL__I2C2_SCL	 0x400108b1
283			MX6SL_PAD_I2C2_SDA__I2C2_SDA	 0x400108b1
284		>;
285	};
286
287	pinctrl_i2c3: i2c3grp {
288		fsl,pins = <
289			MX6SL_PAD_REF_CLK_24M__I2C3_SCL  0x4001f8b1
290			MX6SL_PAD_REF_CLK_32K__I2C3_SDA  0x4001f8b1
291		>;
292	};
293
294	pinctrl_leds: ledsgrp {
295		fsl,pins = <
296			MX6SL_PAD_SD1_DAT6__GPIO5_IO07    0x17059
297			MX6SL_PAD_SD1_DAT7__GPIO5_IO10    0x17059
298			MX6SL_PAD_EPDC_SDCE2__GPIO1_IO29  0x17059
299		>;
300	};
301
302	pinctrl_ts: tsgrp {
303		fsl,pins = <
304			MX6SL_PAD_SD1_DAT2__GPIO5_IO13	0x110B0
305			MX6SL_PAD_SD1_DAT3__GPIO5_IO06	0x1B0B1
306		>;
307	};
308
309	pinctrl_uart1: uart1grp {
310		fsl,pins = <
311			MX6SL_PAD_UART1_TXD__UART1_TX_DATA 0x1b0b1
312			MX6SL_PAD_UART1_RXD__UART1_RX_DATA 0x1b0b1
313		>;
314	};
315
316	pinctrl_uart4: uart4grp {
317		fsl,pins = <
318			MX6SL_PAD_KEY_ROW6__UART4_TX_DATA 0x1b0b1
319			MX6SL_PAD_KEY_COL6__UART4_RX_DATA 0x1b0b1
320		>;
321	};
322
323	pinctrl_usbotg1: usbotg1grp {
324		fsl,pins = <
325			MX6SL_PAD_EPDC_PWRCOM__USB_OTG1_ID 0x17059
326		>;
327	};
328
329	pinctrl_usdhc2: usdhc2grp {
330		fsl,pins = <
331			MX6SL_PAD_SD2_CMD__SD2_CMD		0x17059
332			MX6SL_PAD_SD2_CLK__SD2_CLK		0x13059
333			MX6SL_PAD_SD2_DAT0__SD2_DATA0		0x17059
334			MX6SL_PAD_SD2_DAT1__SD2_DATA1		0x17059
335			MX6SL_PAD_SD2_DAT2__SD2_DATA2		0x17059
336			MX6SL_PAD_SD2_DAT3__SD2_DATA3		0x17059
337			MX6SL_PAD_SD2_DAT4__GPIO5_IO02		0x1b0b1
338		>;
339	};
340
341	pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
342		fsl,pins = <
343			MX6SL_PAD_SD2_CMD__SD2_CMD		0x170b9
344			MX6SL_PAD_SD2_CLK__SD2_CLK		0x130b9
345			MX6SL_PAD_SD2_DAT0__SD2_DATA0		0x170b9
346			MX6SL_PAD_SD2_DAT1__SD2_DATA1		0x170b9
347			MX6SL_PAD_SD2_DAT2__SD2_DATA2		0x170b9
348			MX6SL_PAD_SD2_DAT3__SD2_DATA3		0x170b9
349		>;
350	};
351
352	pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
353		fsl,pins = <
354			MX6SL_PAD_SD2_CMD__SD2_CMD		0x170f9
355			MX6SL_PAD_SD2_CLK__SD2_CLK		0x130f9
356			MX6SL_PAD_SD2_DAT0__SD2_DATA0		0x170f9
357			MX6SL_PAD_SD2_DAT1__SD2_DATA1		0x170f9
358			MX6SL_PAD_SD2_DAT2__SD2_DATA2		0x170f9
359			MX6SL_PAD_SD2_DAT3__SD2_DATA3		0x170f9
360		>;
361	};
362
363	pinctrl_usdhc2_sleep: usdhc2-sleepgrp {
364		fsl,pins = <
365			MX6SL_PAD_SD2_CMD__GPIO5_IO04		0x100f9
366			MX6SL_PAD_SD2_CLK__GPIO5_IO05		0x100f9
367			MX6SL_PAD_SD2_DAT0__GPIO5_IO01		0x100f9
368			MX6SL_PAD_SD2_DAT1__GPIO4_IO30		0x100f9
369			MX6SL_PAD_SD2_DAT2__GPIO5_IO03		0x100f9
370			MX6SL_PAD_SD2_DAT3__GPIO4_IO28		0x100f9
371		>;
372	};
373
374	pinctrl_usdhc3: usdhc3grp {
375		fsl,pins = <
376			MX6SL_PAD_SD3_CMD__SD3_CMD	0x11059
377			MX6SL_PAD_SD3_CLK__SD3_CLK	0x11059
378			MX6SL_PAD_SD3_DAT0__SD3_DATA0	0x11059
379			MX6SL_PAD_SD3_DAT1__SD3_DATA1	0x11059
380			MX6SL_PAD_SD3_DAT2__SD3_DATA2	0x11059
381			MX6SL_PAD_SD3_DAT3__SD3_DATA3	0x11059
382		>;
383	};
384
385	pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
386		fsl,pins = <
387			MX6SL_PAD_SD3_CMD__SD3_CMD	0x170b9
388			MX6SL_PAD_SD3_CLK__SD3_CLK	0x170b9
389			MX6SL_PAD_SD3_DAT0__SD3_DATA0	0x170b9
390			MX6SL_PAD_SD3_DAT1__SD3_DATA1	0x170b9
391			MX6SL_PAD_SD3_DAT2__SD3_DATA2	0x170b9
392			MX6SL_PAD_SD3_DAT3__SD3_DATA3	0x170b9
393		>;
394	};
395
396	pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
397		fsl,pins = <
398			MX6SL_PAD_SD3_CMD__SD3_CMD	0x170f9
399			MX6SL_PAD_SD3_CLK__SD3_CLK	0x170f9
400			MX6SL_PAD_SD3_DAT0__SD3_DATA0	0x170f9
401			MX6SL_PAD_SD3_DAT1__SD3_DATA1	0x170f9
402			MX6SL_PAD_SD3_DAT2__SD3_DATA2	0x170f9
403			MX6SL_PAD_SD3_DAT3__SD3_DATA3	0x170f9
404		>;
405	};
406
407	pinctrl_usdhc3_sleep: usdhc3-sleepgrp {
408		fsl,pins = <
409			MX6SL_PAD_SD3_CMD__GPIO5_IO21	0x100c1
410			MX6SL_PAD_SD3_CLK__GPIO5_IO18	0x100c1
411			MX6SL_PAD_SD3_DAT0__GPIO5_IO19	0x100c1
412			MX6SL_PAD_SD3_DAT1__GPIO5_IO20	0x100c1
413			MX6SL_PAD_SD3_DAT2__GPIO5_IO16	0x100c1
414			MX6SL_PAD_SD3_DAT3__GPIO5_IO17	0x100c1
415		>;
416	};
417
418	pinctrl_usdhc4: usdhc4grp {
419		fsl,pins = <
420			MX6SL_PAD_FEC_TX_CLK__SD4_CMD		0x17059
421			MX6SL_PAD_FEC_MDIO__SD4_CLK		0x13059
422			MX6SL_PAD_FEC_RX_ER__SD4_DATA0		0x17059
423			MX6SL_PAD_FEC_CRS_DV__SD4_DATA1		0x17059
424			MX6SL_PAD_FEC_RXD1__SD4_DATA2		0x17059
425			MX6SL_PAD_FEC_TXD0__SD4_DATA3		0x17059
426			MX6SL_PAD_FEC_MDC__SD4_DATA4		0x17059
427			MX6SL_PAD_FEC_RXD0__SD4_DATA5		0x17059
428			MX6SL_PAD_FEC_TX_EN__SD4_DATA6		0x17059
429			MX6SL_PAD_FEC_TXD1__SD4_DATA7		0x17059
430			MX6SL_PAD_FEC_REF_CLK__SD4_RESET	0x17068
431		>;
432	};
433
434	pinctrl_usdhc4_100mhz: usdhc4-100mhzgrp {
435		fsl,pins = <
436			MX6SL_PAD_FEC_TX_CLK__SD4_CMD		0x170b9
437			MX6SL_PAD_FEC_MDIO__SD4_CLK		0x130b9
438			MX6SL_PAD_FEC_RX_ER__SD4_DATA0		0x170b9
439			MX6SL_PAD_FEC_CRS_DV__SD4_DATA1		0x170b9
440			MX6SL_PAD_FEC_RXD1__SD4_DATA2		0x170b9
441			MX6SL_PAD_FEC_TXD0__SD4_DATA3		0x170b9
442			MX6SL_PAD_FEC_MDC__SD4_DATA4		0x170b9
443			MX6SL_PAD_FEC_RXD0__SD4_DATA5		0x170b9
444			MX6SL_PAD_FEC_TX_EN__SD4_DATA6		0x170b9
445			MX6SL_PAD_FEC_TXD1__SD4_DATA7		0x170b9
446		>;
447	};
448
449	pinctrl_usdhc4_200mhz: usdhc4-200mhzgrp {
450		fsl,pins = <
451			MX6SL_PAD_FEC_TX_CLK__SD4_CMD		0x170f9
452			MX6SL_PAD_FEC_MDIO__SD4_CLK		0x130f9
453			MX6SL_PAD_FEC_RX_ER__SD4_DATA0		0x170f9
454			MX6SL_PAD_FEC_CRS_DV__SD4_DATA1		0x170f9
455			MX6SL_PAD_FEC_RXD1__SD4_DATA2		0x170f9
456			MX6SL_PAD_FEC_TXD0__SD4_DATA3		0x170f9
457			MX6SL_PAD_FEC_MDC__SD4_DATA4		0x170f9
458			MX6SL_PAD_FEC_RXD0__SD4_DATA5		0x170f9
459			MX6SL_PAD_FEC_TX_EN__SD4_DATA6		0x170f9
460			MX6SL_PAD_FEC_TXD1__SD4_DATA7		0x170f9
461		>;
462	};
463
464	pinctrl_usdhc4_sleep: usdhc4-sleepgrp {
465		fsl,pins = <
466			MX6SL_PAD_FEC_TX_CLK__GPIO4_IO21	0x100c1
467			MX6SL_PAD_FEC_MDIO__GPIO4_IO20		0x100c1
468			MX6SL_PAD_FEC_RX_ER__GPIO4_IO19		0x100c1
469			MX6SL_PAD_FEC_CRS_DV__GPIO4_IO25	0x100c1
470			MX6SL_PAD_FEC_RXD1__GPIO4_IO18		0x100c1
471			MX6SL_PAD_FEC_TXD0__GPIO4_IO24		0x100c1
472			MX6SL_PAD_FEC_MDC__GPIO4_IO23		0x100c1
473			MX6SL_PAD_FEC_RXD0__GPIO4_IO17		0x100c1
474			MX6SL_PAD_FEC_TX_EN__GPIO4_IO22		0x100c1
475			MX6SL_PAD_FEC_TXD1__GPIO4_IO16		0x100c1
476		>;
477	};
478
479	pinctrl_wifi_power: wifi-powergrp {
480		fsl,pins = <
481			MX6SL_PAD_SD2_DAT6__GPIO4_IO29	0x10059	/* WIFI_3V3_ON */
482		>;
483	};
484
485	pinctrl_wifi_reset: wifi-resetgrp {
486		fsl,pins = <
487			MX6SL_PAD_SD2_DAT7__GPIO5_IO00	0x10059	/* WIFI_RST */
488		>;
489	};
490};
491