1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2023 Andreas Kemnade
4 */
5/dts-v1/;
6
7#include <dt-bindings/input/input.h>
8#include "omap4460.dtsi"
9
10/ {
11	model = "Epson Moverio BT-200";
12	compatible = "epson,embt2ws", "ti,omap4460", "ti,omap4";
13
14	memory@80000000 {
15		device_type = "memory";
16		reg = <0x80000000 0x40000000>; /* 1024M */
17	};
18
19	backlight-left {
20		compatible = "pwm-backlight";
21		pwms = <&twl_pwm 1 7812500>;
22		power-supply = <&unknown_supply>;
23	};
24
25	backlight-right {
26		compatible = "pwm-backlight";
27		pwms = <&twl_pwm 0 7812500>;
28		power-supply = <&unknown_supply>;
29	};
30
31	chosen {
32		stdout-path = &uart3;
33	};
34
35	gpio-keys {
36		compatible = "gpio-keys";
37		pinctrl-names = "default";
38		pinctrl-0 = <&gpio_keys_pins>;
39
40		key-lock {
41			label = "Lock";
42			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
43			linux,code = <SW_ROTATE_LOCK>; /* SW_TOUCHPAD_LOCK */
44			linux,input-type = <EV_SW>;
45		};
46	};
47
48	unknown_supply: unknown-supply {
49		compatible = "regulator-fixed";
50		regulator-name = "unknown";
51	};
52
53       /* regulator for wl12xx on sdio2 */
54	wl12xx_vmmc: wl12xx-vmmc {
55		pinctrl-names = "default";
56		pinctrl-0 = <&wl12xx_gpio>;
57		compatible = "regulator-fixed";
58		regulator-name = "vwl1271";
59		regulator-min-microvolt = <1800000>;
60		regulator-max-microvolt = <1800000>;
61		gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>;
62		startup-delay-us = <70000>;
63		enable-active-high;
64	};
65};
66
67&i2c1 {
68	pinctrl-names = "default";
69	pinctrl-0 = <&i2c1_pins>;
70
71	clock-frequency = <400000>;
72
73	twl: pmic@48 {
74		compatible = "ti,twl6032";
75		reg = <0x48>;
76		/* IRQ# = 7 */
77		interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_1N cascaded to gic */
78		interrupt-controller;
79		#interrupt-cells = <1>;
80
81		rtc {
82			compatible = "ti,twl4030-rtc";
83			interrupts = <11>;
84		};
85
86		ldo2: regulator-ldo2 {
87			compatible = "ti,twl6032-ldo2";
88			regulator-min-microvolt = <1000000>;
89			regulator-max-microvolt = <3000000>;
90		};
91
92		ldo4: regulator-ldo4 {
93			compatible = "ti,twl6032-ldo4";
94			regulator-min-microvolt = <1200000>;
95			regulator-max-microvolt = <2800000>;
96		};
97
98		ldo3: regulator-ldo3 {
99			compatible = "ti,twl6032-ldo3";
100			regulator-min-microvolt = <1000000>;
101			regulator-max-microvolt = <3000000>;
102		};
103
104		ldo5: regulator-ldo5 {
105			compatible = "ti,twl6032-ldo5";
106			regulator-min-microvolt = <1200000>;
107			regulator-max-microvolt = <3000000>;
108			ti,retain-on-reset;
109		};
110
111		ldo1: regulator-ldo1 {
112			compatible = "ti,twl6032-ldo1";
113			regulator-min-microvolt = <1800000>;
114			regulator-max-microvolt = <2500000>;
115		};
116
117		ldo7: regulator-ldo7 {
118			compatible = "ti,twl6032-ldo7";
119			regulator-min-microvolt = <1200000>;
120			regulator-max-microvolt = <2900000>;
121		};
122
123		ldoln: regulator-ldoln {
124			compatible = "ti,twl6032-ldoln";
125			regulator-always-on;
126		};
127
128		ldo6: regulator-ldo6 {
129			compatible = "ti,twl6032-ldo6";
130			regulator-always-on;
131		};
132
133		ldousb: regulator-ldousb {
134			compatible = "ti,twl6032-ldousb";
135			regulator-always-on;
136		};
137
138		vio: regulator-vio {
139			compatible = "ti,twl6032-vio";
140			regulator-always-on;
141		};
142
143		twl_usb_comparator: usb-comparator {
144			compatible = "ti,twl6030-usb";
145			interrupts = <4>, <10>;
146		};
147
148		twl_pwm: pwm {
149			/* provides two PWMs (id 0, 1 for PWM1 and PWM2) */
150			compatible = "ti,twl6030-pwm";
151			#pwm-cells = <2>;
152		};
153
154		twl_pwmled: pwmled {
155			/* provides one PWM (id 0 for Charging indicator LED) */
156			compatible = "ti,twl6030-pwmled";
157			#pwm-cells = <2>;
158		};
159
160		gpadc {
161			compatible = "ti,twl6032-gpadc";
162			interrupts = <3>;
163			#io-channel-cells = <1>;
164		};
165
166	};
167};
168
169#include "twl6030_omap4.dtsi"
170
171&twl_usb_comparator {
172	usb-supply = <&ldousb>;
173};
174
175
176&i2c2 {
177	pinctrl-names = "default";
178	pinctrl-0 = <&i2c2_pins>;
179
180	clock-frequency = <200000>;
181
182	/* at head/glasses */
183	mpu9150h: imu@68 {
184		compatible = "invensense,mpu9150";
185		reg = <0x68>;
186
187		pinctrl-names = "default";
188		pinctrl-0 = <&mpu9150h_pins>;
189		interrupt-parent = <&gpio2>;
190		interrupt = <19 IRQ_TYPE_LEVEL_HIGH>;
191
192		i2c-gate {
193			#address-cells = <1>;
194			#size-cells = <0>;
195			magnetometer@c {
196				compatible = "asahi-kasei,ak8975";
197				reg = <0x0c>;
198			};
199		};
200	};
201};
202
203&i2c3 {
204	pinctrl-names = "default";
205	pinctrl-0 = <&i2c3_pins>;
206
207	clock-frequency = <100000>;
208
209	/* TODO: BD2606MVV at 0x66 */
210};
211
212&i2c4 {
213	pinctrl-names = "default";
214	pinctrl-0 = <&i2c4_pins>;
215
216	clock-frequency = <360000>;
217
218	/* TODO: KXTI9 at 0xf */
219
220	tlv320aic3x: codec@18 {
221		compatible = "ti,tlv320aic3x";
222		reg = <0x18>;
223		pinctrl-names = "default";
224		pinctrl-0 = <&tlv320aic3x_pins>;
225		#sound-dai-cells = <0>;
226
227		reset-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
228	};
229
230	/* TODO: mpu9150 at control unit, seems to require quirks */
231};
232
233&keypad {
234	pinctrl-names = "default";
235	pinctrl-0 = <&keypad_pins>;
236	keypad,num-rows = <2>;
237	keypad,num-columns = <3>;
238	linux,keymap = <MATRIX_KEY(0, 0, KEY_MENU)
239			MATRIX_KEY(0, 1, KEY_HOME)
240			MATRIX_KEY(0, 2, KEY_BACK)
241			MATRIX_KEY(1, 0, KEY_ESC)
242			MATRIX_KEY(1, 1, KEY_VOLUMEDOWN)
243			MATRIX_KEY(1, 2, KEY_VOLUMEUP)>;
244	linux,input-no-autorepeat;
245};
246
247&mcbsp2 {
248	#sound-dai-cells = <0>;
249	pinctrl-names = "default";
250	pinctrl-0 = <&mcbsp2_pins>;
251	status = "okay";
252};
253
254
255&mmc1 {
256	/* sdcard */
257	vmmc-supply = <&ldo5>;
258	broken-cd;
259	bus-width = <4>;
260};
261
262&mmc2 {
263	/* emmc */
264	vmmc-supply = <&ldo2>;
265	bus-width = <8>;
266};
267
268&mmc3 {
269	pinctrl-names = "default";
270	pinctrl-0 = <&wl12xx_pins>;
271	vmmc-supply = <&wl12xx_vmmc>;
272	interrupts-extended = <&wakeupgen GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH
273			       &omap4_pmx_core 0x12e>;
274	non-removable;
275	bus-width = <4>;
276	cap-power-off-card;
277
278	#address-cells = <1>;
279	#size-cells = <0>;
280	wlcore: wlcore@2 {
281		compatible = "ti,wl1283";
282		reg = <2>;
283		interrupts-extended = <&gpio1 23 IRQ_TYPE_LEVEL_HIGH>;
284		interrupt-names = "irq";
285		ref-clock-frequency = <26000000>;
286		tcxo-clock-frequency = <26000000>;
287	};
288};
289
290&mmc4 {
291	status = "disabled";
292};
293
294&mmc5 {
295	status = "disabled";
296};
297
298&omap4_pmx_core {
299	bt_pins: pinmux-bt-pins {
300		pinctrl-single,pins = <
301			OMAP4_IOPAD(0x1ca, PIN_OUTPUT | MUX_MODE3) /* gpio25 */
302		>;
303	};
304
305	gpio_keys_pins: pinmux-gpio-key-pins {
306		pinctrl-single,pins = <
307			OMAP4_IOPAD(0x56, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio35 */
308		>;
309	};
310
311	i2c1_pins: pinmux-i2c1-pins {
312		pinctrl-single,pins = <
313			   OMAP4_IOPAD(0x122, PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c1_scl */
314			   OMAP4_IOPAD(0x124, PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c1_sda */
315		>;
316	};
317
318	i2c2_pins: pinmux-i2c2-pins {
319		pinctrl-single,pins = <
320			OMAP4_IOPAD(0x126, PIN_INPUT | MUX_MODE0)	/* i2c2_scl */
321			OMAP4_IOPAD(0x128, PIN_INPUT | MUX_MODE0)	/* i2c2_sda */
322		>;
323	};
324
325	i2c3_pins: pinmux-i2c3-pins {
326		pinctrl-single,pins = <
327			OMAP4_IOPAD(0x12a, PIN_INPUT | MUX_MODE0)	/* i2c3_scl */
328			OMAP4_IOPAD(0x12c, PIN_INPUT | MUX_MODE0)	/* i2c3_sda */
329		>;
330	};
331
332	i2c4_pins: pinmux-i2c4-pins {
333		pinctrl-single,pins = <
334			OMAP4_IOPAD(0x12e, PIN_INPUT | MUX_MODE0)	/* i2c4_scl */
335			OMAP4_IOPAD(0x130, PIN_INPUT | MUX_MODE0)	/* i2c4_sda */
336		>;
337	};
338
339	keypad_pins: pinmux-keypad-pins {
340		pinctrl-single,pins = <
341			/* kpd_row0 */
342			OMAP4_IOPAD(0x0050, PIN_INPUT_PULLUP | MUX_MODE1)
343			/* kpd_row1 */
344			OMAP4_IOPAD(0x0052, PIN_INPUT_PULLUP | MUX_MODE1)
345			/* kpd_row2 */
346			OMAP4_IOPAD(0x0054, PIN_INPUT_PULLUP | MUX_MODE1)
347			/* kpd_col0 */
348			OMAP4_IOPAD(0x0058, PIN_OUTPUT | MUX_MODE1)
349			/* kpd_col1 */
350			OMAP4_IOPAD(0x005a, PIN_OUTPUT | MUX_MODE1)
351			/* kpd_col2 */
352			OMAP4_IOPAD(0x005c, PIN_OUTPUT | MUX_MODE1)
353		>;
354	};
355
356	mcbsp2_pins: pinmux-mcbsp2-pins {
357		pinctrl-single,pins = <
358			OMAP4_IOPAD(0x0f6, PIN_INPUT | MUX_MODE0)       /* abe_mcbsp2_clkx */
359			OMAP4_IOPAD(0x0f8, PIN_INPUT | MUX_MODE0)       /* abe_mcbsp2_dr */
360			OMAP4_IOPAD(0x0fa, PIN_OUTPUT | MUX_MODE0)      /* abe_mcbsp2_dx */
361			OMAP4_IOPAD(0x0fc, PIN_INPUT | MUX_MODE0)       /* abe_mcbsp2_fsx */
362		>;
363	};
364
365	mpu9150h_pins: pinmux-mpu9150h-pins {
366		pinctrl-single,pins = <
367			OMAP4_IOPAD(0x76, PIN_INPUT_PULLUP | MUX_MODE3)
368		>;
369	};
370
371	tlv320aic3x_pins: pinmux-tlv320aic3x-pins {
372		pinctrl-single,pins = <
373			OMAP4_IOPAD(0x7e, PIN_OUTPUT | MUX_MODE3)
374		>;
375	};
376
377	uart2_pins: pinmux-uart2-pins {
378		pinctrl-single,pins = <
379			OMAP4_IOPAD(0x118, PIN_INPUT_PULLUP | MUX_MODE0) /* uart2_cts.uart2_cts */
380			OMAP4_IOPAD(0x11a, PIN_OUTPUT | MUX_MODE0)	 /* uart2_rts.uart2_rts */
381			OMAP4_IOPAD(0x11c, PIN_INPUT_PULLUP | MUX_MODE0) /* uart2_rx.uart2_rx */
382			OMAP4_IOPAD(0x11e, PIN_OUTPUT | MUX_MODE0)	 /* uart2_tx.uart2_tx */
383		>;
384	};
385
386	uart3_pins: pinmux-uart3-pins {
387		pinctrl-single,pins = <
388			OMAP4_IOPAD(0x144, PIN_INPUT | MUX_MODE0)  /* uart3_rx_irrx */
389			OMAP4_IOPAD(0x146, PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx */
390		>;
391	};
392
393	usb_otg_hs_pins: pinmux-usb-otg-hs-pins {
394		 pinctrl-single,pins = <
395			 OMAP4_IOPAD(0x194, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* usba0_otg_ce */
396			 OMAP4_IOPAD(0x196, PIN_INPUT | MUX_MODE0)	     /* usba0_otg_dp */
397			 OMAP4_IOPAD(0x198, PIN_INPUT | MUX_MODE0)	     /* usba0_otg_dm */
398		 >;
399	};
400
401	wl12xx_pins: pinmux-wl12xx-pins {
402		pinctrl-single,pins = <
403			OMAP4_IOPAD(0x1c6, PIN_INPUT | MUX_MODE3) /* gpio_23 / IRQ */
404			OMAP4_IOPAD(0x16c, PIN_INPUT_PULLUP | MUX_MODE2) /* sdmmc3_dat2 */
405			OMAP4_IOPAD(0x16e, PIN_INPUT_PULLUP | MUX_MODE2) /* sdmmc3_dat1 */
406			OMAP4_IOPAD(0x170, PIN_INPUT_PULLUP | MUX_MODE2) /* sdmmc3_dat0 */
407			OMAP4_IOPAD(0x172, PIN_INPUT_PULLUP | MUX_MODE2) /* sdmmc3_dat3 */
408			OMAP4_IOPAD(0x174, PIN_INPUT_PULLUP | MUX_MODE2) /* sdmmc3_cmd */
409			OMAP4_IOPAD(0x176, PIN_INPUT_PULLUP | MUX_MODE2) /* sdmmc3_clk */
410		>;
411	};
412
413	wl12xx_gpio: pinmux-wl12xx-gpio {
414		pinctrl-single,pins = <
415			OMAP4_IOPAD(0x1c8, PIN_OUTPUT | MUX_MODE3)  /* gpio_24 / WLAN_EN */
416		>;
417	};
418};
419
420&uart2 {
421	pinctrl-names = "default";
422	pinctrl-0 = <&uart2_pins &bt_pins>;
423	interrupts-extended = <&wakeupgen GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH
424			       &omap4_pmx_core OMAP4_UART2_RX>;
425
426	/*
427	 * BT + GPS in WL1283 in WG7500 requiring CLK32KAUDIO of pmic
428	 * which does not have a driver
429	 */
430};
431
432&uart3 {
433	pinctrl-names = "default";
434	pinctrl-0 = <&uart3_pins>;
435	interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH
436			       &omap4_pmx_core OMAP4_UART3_RX>;
437};
438
439&usb_otg_hs {
440	pinctrl-names = "default";
441	pinctrl-0 = <&usb_otg_hs_pins>;
442
443	interface-type = <1>;
444	mode = <3>;
445	power = <50>;
446};
447
448&usbhshost {
449	status = "disabled";
450};
451