1// SPDX-License-Identifier: GPL-2.0-only
2/dts-v1/;
3
4#include <dt-bindings/input/input.h>
5#include "omap443x.dtsi"
6#include "motorola-cpcap-mapphone.dtsi"
7
8/ {
9	chosen {
10		stdout-path = &uart3;
11	};
12
13	aliases {
14		display0 = &lcd0;
15		display1 = &hdmi0;
16	};
17
18	/*
19	 * We seem to have only 1021 MB accessible, 1021 - 1022 is locked,
20	 * then 1023 - 1024 seems to contain mbm.
21	 */
22	memory {
23		device_type = "memory";
24		reg = <0x80000000 0x3fd00000>;	/* 1021 MB */
25	};
26
27	/* Poweroff GPIO probably connected to CPCAP */
28	gpio-poweroff {
29		compatible = "gpio-poweroff";
30		pinctrl-0 = <&poweroff_gpio>;
31		pinctrl-names = "default";
32		gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;	/* gpio50 */
33	};
34
35	hdmi0: connector {
36		compatible = "hdmi-connector";
37		pinctrl-0 = <&hdmi_hpd_gpio>;
38		pinctrl-names = "default";
39		label = "hdmi";
40		type = "d";
41
42		hpd-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;	/* gpio63 */
43
44		port {
45			hdmi_connector_in: endpoint {
46				remote-endpoint = <&hdmi_out>;
47			};
48		};
49	};
50
51	/*
52	 * HDMI 5V regulator probably sourced from battery. Let's keep
53	 * keep this as always enabled for HDMI to work until we've
54	 * figured what the encoder chip is.
55	 */
56	hdmi_regulator: regulator-hdmi {
57		compatible = "regulator-fixed";
58		regulator-name = "hdmi";
59		regulator-min-microvolt = <5000000>;
60		regulator-max-microvolt = <5000000>;
61		gpio = <&gpio2 27 GPIO_ACTIVE_HIGH>;	/* gpio59 */
62		enable-active-high;
63		regulator-always-on;
64	};
65
66	/* FS USB Host PHY on port 1 for mdm6600 */
67	fsusb1_phy: usb-phy@1 {
68		compatible = "motorola,mapphone-mdm6600";
69		pinctrl-0 = <&usb_mdm6600_pins>;
70		pinctrl-names = "default";
71		enable-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;     /* gpio_95 */
72		power-gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;	/* gpio_54 */
73		reset-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;	/* gpio_49 */
74		/* mode: gpio_148 gpio_149 */
75		motorola,mode-gpios = <&gpio5 20 GPIO_ACTIVE_HIGH>,
76				      <&gpio5 21 GPIO_ACTIVE_HIGH>;
77		/* cmd: gpio_103 gpio_104 gpio_142 */
78		motorola,cmd-gpios = <&gpio4 7 GPIO_ACTIVE_HIGH>,
79				     <&gpio4 8 GPIO_ACTIVE_HIGH>,
80				     <&gpio5 14 GPIO_ACTIVE_HIGH>;
81		/* status: gpio_52 gpio_53 gpio_55 */
82		motorola,status-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>,
83					<&gpio2 21 GPIO_ACTIVE_HIGH>,
84					<&gpio2 23 GPIO_ACTIVE_HIGH>;
85		#phy-cells = <0>;
86	};
87
88	/* HS USB host TLL nop-phy on port 2 for w3glte */
89	hsusb2_phy: usb-phy@2 {
90		compatible = "usb-nop-xceiv";
91		#phy-cells = <0>;
92	};
93
94	/* LCD regulator from sw5 source */
95	lcd_regulator: regulator-lcd {
96		compatible = "regulator-fixed";
97		regulator-name = "lcd";
98		regulator-min-microvolt = <5050000>;
99		regulator-max-microvolt = <5050000>;
100		gpio = <&gpio4 0 GPIO_ACTIVE_HIGH>;	/* gpio96 */
101		enable-active-high;
102		vin-supply = <&sw5>;
103	};
104
105	/* This is probably coming straight from the battery.. */
106	wl12xx_vmmc: regulator-wl12xx {
107		compatible = "regulator-fixed";
108		regulator-name = "vwl1271";
109		regulator-min-microvolt = <1650000>;
110		regulator-max-microvolt = <1650000>;
111		gpio = <&gpio3 30 GPIO_ACTIVE_HIGH>;	/* gpio94 */
112		startup-delay-us = <70000>;
113		enable-active-high;
114	};
115
116	gpio_keys {
117		compatible = "gpio-keys";
118
119		volume_down {
120			label = "Volume Down";
121			gpios = <&gpio5 26 GPIO_ACTIVE_LOW>; /* gpio154 */
122			linux,code = <KEY_VOLUMEDOWN>;
123			linux,can-disable;
124			/* Value above 7.95ms for no GPIO hardware debounce */
125			debounce-interval = <10>;
126		};
127
128		slider {
129			label = "Keypad Slide";
130			gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>; /* gpio122 */
131			linux,input-type = <EV_SW>;
132			linux,code = <SW_KEYPAD_SLIDE>;
133			linux,can-disable;
134			/* Value above 7.95ms for no GPIO hardware debounce */
135			debounce-interval = <10>;
136		};
137	};
138
139	soundcard {
140		compatible = "audio-graph-card";
141		label = "Droid 4 Audio";
142
143		widgets =
144			"Speaker", "Earpiece",
145			"Speaker", "Loudspeaker",
146			"Headphone", "Headphone Jack",
147			"Microphone", "Internal Mic";
148
149		routing =
150			"Earpiece", "EP",
151			"Loudspeaker", "SPKR",
152			"Headphone Jack", "HSL",
153			"Headphone Jack", "HSR",
154			"MICR", "Internal Mic";
155
156		dais = <&mcbsp2_port>, <&mcbsp3_port>;
157	};
158
159	pwm8: dmtimer-pwm-8 {
160		pinctrl-names = "default";
161		pinctrl-0 = <&vibrator_direction_pin>;
162
163		compatible = "ti,omap-dmtimer-pwm";
164		#pwm-cells = <3>;
165		ti,timers = <&timer8>;
166		ti,clock-source = <0x01>;
167	};
168
169	pwm9: dmtimer-pwm-9 {
170		pinctrl-names = "default";
171		pinctrl-0 = <&vibrator_enable_pin>;
172
173		compatible = "ti,omap-dmtimer-pwm";
174		#pwm-cells = <3>;
175		ti,timers = <&timer9>;
176		ti,clock-source = <0x01>;
177	};
178
179	vibrator {
180		compatible = "pwm-vibrator";
181		pwms = <&pwm9 0 10000000 0>, <&pwm8 0 10000000 0>;
182		pwm-names = "enable", "direction";
183		direction-duty-cycle-ns = <10000000>;
184	};
185
186	backlight: backlight {
187		compatible = "led-backlight";
188
189		leds = <&backlight_led>;
190		brightness-levels = <31 63 95 127 159 191 223 255>;
191		default-brightness-level = <6>;
192	};
193};
194
195&dss {
196	status = "okay";
197};
198
199&dsi1 {
200	status = "okay";
201	vdd-supply = <&vcsi>;
202
203	port {
204		dsi1_out_ep: endpoint {
205			remote-endpoint = <&lcd0_in>;
206			lanes = <0 1 2 3 4 5>;
207		};
208	};
209
210	lcd0: display {
211		compatible = "panel-dsi-cm";
212		label = "lcd0";
213		vddi-supply = <&lcd_regulator>;
214		reset-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;	/* gpio101 */
215
216		backlight = <&backlight>;
217
218		width-mm = <50>;
219		height-mm = <89>;
220
221		panel-timing {
222			clock-frequency = <0>;		/* Calculated by dsi */
223
224			hback-porch = <2>;
225			hactive = <540>;
226			hfront-porch = <0>;
227			hsync-len = <2>;
228
229			vback-porch = <1>;
230			vactive = <960>;
231			vfront-porch = <0>;
232			vsync-len = <1>;
233
234			hsync-active = <0>;
235			vsync-active = <0>;
236			de-active = <1>;
237			pixelclk-active = <1>;
238		};
239
240		port {
241			lcd0_in: endpoint {
242				remote-endpoint = <&dsi1_out_ep>;
243			};
244		};
245	};
246};
247
248&hdmi {
249	status = "okay";
250	pinctrl-0 = <&dss_hdmi_pins>;
251	pinctrl-names = "default";
252	vdda-supply = <&vdac>;
253
254	port {
255		hdmi_out: endpoint {
256			remote-endpoint = <&hdmi_connector_in>;
257			lanes = <1 0 3 2 5 4 7 6>;
258		};
259	};
260};
261
262/* Battery NVRAM on 1-wire handled by w1_ds250x driver */
263&hdqw1w {
264	pinctrl-0 = <&hdq_pins>;
265	pinctrl-names = "default";
266	ti,mode = "1w";
267};
268
269&i2c1 {
270	tmp105@48 {
271		compatible = "ti,tmp105";
272		reg = <0x48>;
273		pinctrl-0 = <&tmp105_irq>;
274		pinctrl-names = "default";
275		/* kpd_row0.gpio_178 */
276		interrupts-extended = <&gpio6 18 IRQ_TYPE_EDGE_FALLING
277				       &omap4_pmx_core 0x14e>;
278		interrupt-names = "irq", "wakeup";
279		wakeup-source;
280	};
281};
282
283&keypad {
284	keypad,num-rows = <8>;
285	keypad,num-columns = <8>;
286	linux,keymap = <
287
288	/* Row 1 */
289	MATRIX_KEY(0, 2, KEY_1)
290	MATRIX_KEY(0, 6, KEY_2)
291	MATRIX_KEY(2, 3, KEY_3)
292	MATRIX_KEY(0, 7, KEY_4)
293	MATRIX_KEY(0, 4, KEY_5)
294	MATRIX_KEY(5, 5, KEY_6)
295	MATRIX_KEY(0, 1, KEY_7)
296	MATRIX_KEY(0, 5, KEY_8)
297	MATRIX_KEY(0, 0, KEY_9)
298	MATRIX_KEY(1, 6, KEY_0)
299
300	/* Row 2 */
301	MATRIX_KEY(3, 4, KEY_APOSTROPHE)
302	MATRIX_KEY(7, 6, KEY_Q)
303	MATRIX_KEY(7, 7, KEY_W)
304	MATRIX_KEY(7, 2, KEY_E)
305	MATRIX_KEY(1, 0, KEY_R)
306	MATRIX_KEY(4, 4, KEY_T)
307	MATRIX_KEY(1, 2, KEY_Y)
308	MATRIX_KEY(6, 7, KEY_U)
309	MATRIX_KEY(2, 2, KEY_I)
310	MATRIX_KEY(5, 6, KEY_O)
311	MATRIX_KEY(3, 7, KEY_P)
312	MATRIX_KEY(6, 5, KEY_BACKSPACE)
313
314	/* Row 3 */
315	MATRIX_KEY(5, 4, KEY_TAB)
316	MATRIX_KEY(5, 7, KEY_A)
317	MATRIX_KEY(2, 7, KEY_S)
318	MATRIX_KEY(7, 0, KEY_D)
319	MATRIX_KEY(2, 6, KEY_F)
320	MATRIX_KEY(6, 2, KEY_G)
321	MATRIX_KEY(6, 6, KEY_H)
322	MATRIX_KEY(1, 4, KEY_J)
323	MATRIX_KEY(3, 1, KEY_K)
324	MATRIX_KEY(2, 1, KEY_L)
325	MATRIX_KEY(4, 6, KEY_ENTER)
326
327	/* Row 4 */
328	MATRIX_KEY(3, 6, KEY_LEFTSHIFT)		/* KEY_CAPSLOCK */
329	MATRIX_KEY(6, 1, KEY_Z)
330	MATRIX_KEY(7, 4, KEY_X)
331	MATRIX_KEY(5, 1, KEY_C)
332	MATRIX_KEY(1, 7, KEY_V)
333	MATRIX_KEY(2, 4, KEY_B)
334	MATRIX_KEY(4, 1, KEY_N)
335	MATRIX_KEY(1, 1, KEY_M)
336	MATRIX_KEY(3, 5, KEY_COMMA)
337	MATRIX_KEY(5, 2, KEY_DOT)
338	MATRIX_KEY(6, 3, KEY_UP)
339	MATRIX_KEY(7, 3, KEY_OK)
340
341	/* Row 5 */
342	MATRIX_KEY(2, 5, KEY_LEFTCTRL)		/* KEY_LEFTSHIFT */
343	MATRIX_KEY(4, 5, KEY_LEFTALT)		/* SYM */
344	MATRIX_KEY(6, 0, KEY_MINUS)
345	MATRIX_KEY(4, 7, KEY_EQUAL)
346	MATRIX_KEY(1, 5, KEY_SPACE)
347	MATRIX_KEY(3, 2, KEY_SLASH)
348	MATRIX_KEY(4, 3, KEY_LEFT)
349	MATRIX_KEY(5, 3, KEY_DOWN)
350	MATRIX_KEY(3, 3, KEY_RIGHT)
351
352	/* Side buttons, KEY_VOLUMEDOWN and KEY_PWER are on CPCAP? */
353	MATRIX_KEY(5, 0, KEY_VOLUMEUP)
354	>;
355};
356
357&mmc1 {
358	vmmc-supply = <&vwlan2>;
359	bus-width = <4>;
360	cd-gpios = <&gpio6 16 GPIO_ACTIVE_LOW>;	/* gpio176 */
361};
362
363&mmc2 {
364	vmmc-supply = <&vsdio>;
365	bus-width = <8>;
366	ti,non-removable;
367};
368
369&mmc3 {
370	pinctrl-names = "default";
371	pinctrl-0 = <&mmc3_pins>;
372	vmmc-supply = <&wl12xx_vmmc>;
373	/* uart2_tx.sdmmc3_dat1 pad as wakeirq */
374	interrupts-extended = <&wakeupgen GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH
375			       &omap4_pmx_core 0xde>;
376	interrupt-names = "irq", "wakeup";
377	non-removable;
378	bus-width = <4>;
379	cap-power-off-card;
380	keep-power-in-suspend;
381
382	#address-cells = <1>;
383	#size-cells = <0>;
384	wlcore: wlcore@2 {
385		compatible = "ti,wl1285", "ti,wl1283";
386		reg = <2>;
387		/* gpio_100 with gpmc_wait2 pad as wakeirq */
388		interrupts-extended = <&gpio4 4 IRQ_TYPE_LEVEL_HIGH>,
389				      <&omap4_pmx_core 0x4e>;
390		interrupt-names = "irq", "wakeup";
391		ref-clock-frequency = <26000000>;
392		tcxo-clock-frequency = <26000000>;
393	};
394};
395
396&i2c1 {
397	led-controller@38 {
398		compatible = "ti,lm3532";
399		#address-cells = <1>;
400		#size-cells = <0>;
401		reg = <0x38>;
402
403		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
404
405		ramp-up-us = <1024>;
406		ramp-down-us = <8193>;
407
408		backlight_led: led@0 {
409			reg = <0>;
410			led-sources = <2>;
411			ti,led-mode = <0>;
412			label = ":backlight";
413		};
414
415		led@1 {
416			reg = <1>;
417			led-sources = <1>;
418			ti,led-mode = <0>;
419			label = ":kbd_backlight";
420		};
421	};
422};
423
424&i2c2 {
425	touchscreen@4a {
426		compatible = "atmel,maxtouch";
427		reg = <0x4a>;
428		pinctrl-names = "default";
429		pinctrl-0 = <&touchscreen_pins>;
430
431		reset-gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>; /* gpio173 */
432
433		/* gpio_183 with sys_nirq2 pad as wakeup */
434		interrupts-extended = <&gpio6 23 IRQ_TYPE_LEVEL_LOW>,
435				      <&omap4_pmx_core 0x160>;
436		interrupt-names = "irq", "wakeup";
437		wakeup-source;
438	};
439
440	isl29030@44 {
441		compatible = "isil,isl29030";
442		reg = <0x44>;
443
444		pinctrl-names = "default";
445		pinctrl-0 = <&als_proximity_pins>;
446
447		interrupt-parent = <&gpio6>;
448		interrupts = <17 IRQ_TYPE_LEVEL_LOW>; /* gpio177 */
449	};
450};
451
452&omap4_pmx_core {
453
454	/* hdmi_hpd.gpio_63 */
455	hdmi_hpd_gpio: pinmux_hdmi_hpd_pins {
456		pinctrl-single,pins = <
457		OMAP4_IOPAD(0x098, PIN_INPUT | MUX_MODE3)
458		>;
459	};
460
461	hdq_pins: pinmux_hdq_pins {
462		pinctrl-single,pins = <
463		/* 0x4a100120 hdq_sio.hdq_sio aa27 */
464		OMAP4_IOPAD(0x120, PIN_INPUT | MUX_MODE0)
465		>;
466	};
467
468	/* hdmi_cec.hdmi_cec, hdmi_scl.hdmi_scl, hdmi_sda.hdmi_sda */
469	dss_hdmi_pins: pinmux_dss_hdmi_pins {
470		pinctrl-single,pins = <
471		OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0)
472		OMAP4_IOPAD(0x09c, PIN_INPUT | MUX_MODE0)
473		OMAP4_IOPAD(0x09e, PIN_INPUT | MUX_MODE0)
474		>;
475	};
476
477	/*
478	 * Android uses PIN_OFF_INPUT_PULLDOWN | PIN_INPUT_PULLUP | MUX_MODE3
479	 * for gpio_100, but the internal pull makes wlan flakey on some
480	 * devices. Off mode value should be tested if we have off mode working
481	 * later on.
482	 */
483	mmc3_pins: pinmux_mmc3_pins {
484		pinctrl-single,pins = <
485		/* 0x4a10008e gpmc_wait2.gpio_100 d23 */
486		OMAP4_IOPAD(0x08e, PIN_INPUT | MUX_MODE3)
487
488		/* 0x4a100102 abe_mcbsp1_dx.sdmmc3_dat2 ab25 */
489		OMAP4_IOPAD(0x102, PIN_INPUT_PULLUP | MUX_MODE1)
490
491		/* 0x4a100104 abe_mcbsp1_fsx.sdmmc3_dat3 ac27 */
492		OMAP4_IOPAD(0x104, PIN_INPUT_PULLUP | MUX_MODE1)
493
494		/* 0x4a100118 uart2_cts.sdmmc3_clk ab26 */
495		OMAP4_IOPAD(0x118, PIN_INPUT | MUX_MODE1)
496
497		/* 0x4a10011a uart2_rts.sdmmc3_cmd ab27 */
498		OMAP4_IOPAD(0x11a, PIN_INPUT_PULLUP | MUX_MODE1)
499
500		/* 0x4a10011c uart2_rx.sdmmc3_dat0 aa25 */
501		OMAP4_IOPAD(0x11c, PIN_INPUT_PULLUP | MUX_MODE1)
502
503		/* 0x4a10011e uart2_tx.sdmmc3_dat1 aa26 */
504		OMAP4_IOPAD(0x11e, PIN_INPUT_PULLUP | MUX_MODE1)
505		>;
506	};
507
508	/* gpmc_ncs0.gpio_50 */
509	poweroff_gpio: pinmux_poweroff_pins {
510		pinctrl-single,pins = <
511		OMAP4_IOPAD(0x074, PIN_OUTPUT_PULLUP | MUX_MODE3)
512		>;
513	};
514
515	/* kpd_row0.gpio_178 */
516	tmp105_irq: pinmux_tmp105_irq {
517		pinctrl-single,pins = <
518		OMAP4_IOPAD(0x18e, PIN_INPUT_PULLUP | MUX_MODE3)
519		>;
520	};
521
522	usb_gpio_mux_sel1: pinmux_usb_gpio_mux_sel1_pins {
523		/* gpio_60 */
524		pinctrl-single,pins = <
525		OMAP4_IOPAD(0x088, PIN_OUTPUT | MUX_MODE3)
526		>;
527	};
528
529	touchscreen_pins: pinmux_touchscreen_pins {
530		pinctrl-single,pins = <
531		OMAP4_IOPAD(0x180, PIN_OUTPUT | MUX_MODE3)
532		OMAP4_IOPAD(0x1a0, PIN_INPUT_PULLUP | MUX_MODE3)
533		>;
534	};
535
536	als_proximity_pins: pinmux_als_proximity_pins {
537		pinctrl-single,pins = <
538		OMAP4_IOPAD(0x18c, PIN_INPUT_PULLUP | MUX_MODE3)
539		>;
540	};
541
542	usb_mdm6600_pins: pinmux_usb_mdm6600_pins {
543		pinctrl-single,pins = <
544		/* enable 0x4a1000d8 usbb1_ulpitll_dat7.gpio_95 ag16 */
545		OMAP4_IOPAD(0x0d8, PIN_INPUT | MUX_MODE3)
546
547		/* power 0x4a10007c gpmc_nwp.gpio_54 c25 */
548		OMAP4_IOPAD(0x07c, PIN_OUTPUT | MUX_MODE3)
549
550		/* reset 0x4a100072 gpmc_a25.gpio_49 d20 */
551		OMAP4_IOPAD(0x072, PIN_OUTPUT | MUX_MODE3)
552
553		/* mode0/bpwake 0x4a10014e sdmmc5_dat1.gpio_148 af4 */
554		OMAP4_IOPAD(0x14e, PIN_OUTPUT | MUX_MODE3)
555
556		/* mode1/apwake 0x4a100150 sdmmc5_dat2.gpio_149 ag3 */
557		OMAP4_IOPAD(0x150, PIN_OFF_OUTPUT_LOW | PIN_INPUT | MUX_MODE3)
558
559		/* status0 0x4a10007e gpmc_clk.gpio_55 b22 */
560		OMAP4_IOPAD(0x07e, PIN_INPUT | MUX_MODE3)
561
562		/* status1 0x4a10007a gpmc_ncs3.gpio_53 c22 */
563		OMAP4_IOPAD(0x07a, PIN_INPUT | MUX_MODE3)
564
565		/* status2 0x4a100078 gpmc_ncs2.gpio_52 d21 */
566		OMAP4_IOPAD(0x078, PIN_INPUT | MUX_MODE3)
567
568		/* cmd0 0x4a100094 gpmc_ncs6.gpio_103 c24 */
569		OMAP4_IOPAD(0x094, PIN_OUTPUT | MUX_MODE3)
570
571		/* cmd1 0x4a100096 gpmc_ncs7.gpio_104 d24 */
572		OMAP4_IOPAD(0x096, PIN_OUTPUT | MUX_MODE3)
573
574		/* cmd2 0x4a100142 uart3_rts_sd.gpio_142 f28 */
575		OMAP4_IOPAD(0x142, PIN_OUTPUT | MUX_MODE3)
576		>;
577	};
578
579	usb_ulpi_pins: pinmux_usb_ulpi_pins {
580		pinctrl-single,pins = <
581		OMAP4_IOPAD(0x196, MUX_MODE7)
582		OMAP4_IOPAD(0x198, MUX_MODE7)
583		OMAP4_IOPAD(0x1b2, PIN_INPUT_PULLUP | MUX_MODE0)
584		OMAP4_IOPAD(0x1b4, PIN_INPUT_PULLUP | MUX_MODE0)
585		OMAP4_IOPAD(0x1b6, PIN_INPUT_PULLUP | MUX_MODE0)
586		OMAP4_IOPAD(0x1b8, PIN_INPUT_PULLUP | MUX_MODE0)
587		OMAP4_IOPAD(0x1ba, PIN_INPUT_PULLUP | MUX_MODE0)
588		OMAP4_IOPAD(0x1bc, PIN_INPUT_PULLUP | MUX_MODE0)
589		OMAP4_IOPAD(0x1be, PIN_INPUT_PULLUP | MUX_MODE0)
590		OMAP4_IOPAD(0x1c0, PIN_INPUT_PULLUP | MUX_MODE0)
591		OMAP4_IOPAD(0x1c2, PIN_INPUT_PULLUP | MUX_MODE0)
592		OMAP4_IOPAD(0x1c4, PIN_INPUT_PULLUP | MUX_MODE0)
593		OMAP4_IOPAD(0x1c6, PIN_INPUT_PULLUP | MUX_MODE0)
594		OMAP4_IOPAD(0x1c8, PIN_INPUT_PULLUP | MUX_MODE0)
595		>;
596	};
597
598	/* usb0_otg_dp and usb0_otg_dm */
599	usb_utmi_pins: pinmux_usb_utmi_pins {
600		pinctrl-single,pins = <
601		OMAP4_IOPAD(0x196, PIN_INPUT | MUX_MODE0)
602		OMAP4_IOPAD(0x198, PIN_INPUT | MUX_MODE0)
603		OMAP4_IOPAD(0x1b2, PIN_INPUT_PULLUP | MUX_MODE7)
604		OMAP4_IOPAD(0x1b4, PIN_INPUT_PULLUP | MUX_MODE7)
605		OMAP4_IOPAD(0x1b6, PIN_INPUT_PULLUP | MUX_MODE7)
606		OMAP4_IOPAD(0x1b8, PIN_INPUT_PULLUP | MUX_MODE7)
607		OMAP4_IOPAD(0x1ba, PIN_INPUT_PULLUP | MUX_MODE7)
608		OMAP4_IOPAD(0x1bc, PIN_INPUT_PULLUP | MUX_MODE7)
609		OMAP4_IOPAD(0x1be, PIN_INPUT_PULLUP | MUX_MODE7)
610		OMAP4_IOPAD(0x1c0, PIN_INPUT_PULLUP | MUX_MODE7)
611		OMAP4_IOPAD(0x1c2, PIN_INPUT_PULLUP | MUX_MODE7)
612		OMAP4_IOPAD(0x1c4, PIN_INPUT_PULLUP | MUX_MODE7)
613		OMAP4_IOPAD(0x1c6, PIN_INPUT_PULLUP | MUX_MODE7)
614		OMAP4_IOPAD(0x1c8, PIN_INPUT_PULLUP | MUX_MODE7)
615		>;
616	};
617
618	/*
619	 * Note that the v3.0.8 stock userspace dynamically remuxes uart1
620	 * rts pin probably for PM purposes to PIN_INPUT_PULLUP | MUX_MODE7
621	 * when not used. If needed, we can add rts pin remux later based
622	 * on power measurements.
623	 */
624	uart1_pins: pinmux_uart1_pins {
625		pinctrl-single,pins = <
626		/* 0x4a10013c mcspi1_cs2.uart1_cts ag23 */
627		OMAP4_IOPAD(0x13c, PIN_INPUT_PULLUP | MUX_MODE1)
628
629		/* 0x4a10013e mcspi1_cs3.uart1_rts ah23 */
630		OMAP4_IOPAD(0x13e, MUX_MODE1)
631
632		/* 0x4a100140 uart3_cts_rctx.uart1_tx f27 */
633		OMAP4_IOPAD(0x140, PIN_OUTPUT | MUX_MODE1)
634
635		/* 0x4a1001ca dpm_emu14.uart1_rx aa3 */
636		OMAP4_IOPAD(0x1ca, PIN_INPUT_PULLUP | MUX_MODE2)
637		>;
638	};
639
640	/* uart3_tx_irtx and uart3_rx_irrx */
641	uart3_pins: pinmux_uart3_pins {
642		pinctrl-single,pins = <
643		OMAP4_IOPAD(0x196, MUX_MODE7)
644		OMAP4_IOPAD(0x198, MUX_MODE7)
645		OMAP4_IOPAD(0x1b2, PIN_INPUT_PULLUP | MUX_MODE7)
646		OMAP4_IOPAD(0x1b4, PIN_INPUT_PULLUP | MUX_MODE7)
647		OMAP4_IOPAD(0x1b6, PIN_INPUT_PULLUP | MUX_MODE7)
648		OMAP4_IOPAD(0x1b8, PIN_INPUT_PULLUP | MUX_MODE7)
649		OMAP4_IOPAD(0x1ba, MUX_MODE2)
650		OMAP4_IOPAD(0x1bc, PIN_INPUT | MUX_MODE2)
651		OMAP4_IOPAD(0x1be, PIN_INPUT_PULLUP | MUX_MODE7)
652		OMAP4_IOPAD(0x1c0, PIN_INPUT_PULLUP | MUX_MODE7)
653		OMAP4_IOPAD(0x1c2, PIN_INPUT_PULLUP | MUX_MODE7)
654		OMAP4_IOPAD(0x1c4, PIN_INPUT_PULLUP | MUX_MODE7)
655		OMAP4_IOPAD(0x1c6, PIN_INPUT_PULLUP | MUX_MODE7)
656		OMAP4_IOPAD(0x1c8, PIN_INPUT_PULLUP | MUX_MODE7)
657		>;
658	};
659
660	uart4_pins: pinmux_uart4_pins {
661		pinctrl-single,pins = <
662		OMAP4_IOPAD(0x15c, PIN_INPUT | MUX_MODE0)		/* uart4_rx */
663		OMAP4_IOPAD(0x15e, PIN_OUTPUT | MUX_MODE0)		/* uart4_tx */
664		OMAP4_IOPAD(0x110, PIN_INPUT_PULLUP | MUX_MODE5)	/* uart4_cts */
665		OMAP4_IOPAD(0x112, PIN_OUTPUT_PULLUP | MUX_MODE5)	/* uart4_rts */
666		>;
667	};
668
669	mcbsp2_pins: pinmux_mcbsp2_pins {
670		pinctrl-single,pins = <
671		OMAP4_IOPAD(0x0f6, PIN_INPUT | MUX_MODE0)	/* abe_mcbsp2_clkx */
672		OMAP4_IOPAD(0x0f8, PIN_INPUT | MUX_MODE0)	/* abe_mcbsp2_dr */
673		OMAP4_IOPAD(0x0fa, PIN_OUTPUT | MUX_MODE0)	/* abe_mcbsp2_dx */
674		OMAP4_IOPAD(0x0fc, PIN_INPUT | MUX_MODE0)	/* abe_mcbsp2_fsx */
675		>;
676	};
677
678	mcbsp3_pins: pinmux_mcbsp3_pins {
679		pinctrl-single,pins = <
680		OMAP4_IOPAD(0x106, PIN_INPUT | MUX_MODE1)	/* abe_mcbsp3_dr */
681		OMAP4_IOPAD(0x108, PIN_OUTPUT | MUX_MODE1)	/* abe_mcbsp3_dx */
682		OMAP4_IOPAD(0x10a, PIN_INPUT | MUX_MODE1)	/* abe_mcbsp3_clkx */
683		OMAP4_IOPAD(0x10c, PIN_INPUT | MUX_MODE1)	/* abe_mcbsp3_fsx */
684		>;
685	};
686
687	vibrator_direction_pin: pinmux_vibrator_direction_pin {
688		pinctrl-single,pins = <
689		OMAP4_IOPAD(0x1ce, PIN_OUTPUT | MUX_MODE1)	/* dmtimer8_pwm_evt (gpio_27) */
690		>;
691	};
692
693	vibrator_enable_pin: pinmux_vibrator_enable_pin {
694		pinctrl-single,pins = <
695		OMAP4_IOPAD(0X1d0, PIN_OUTPUT | MUX_MODE1)	/* dmtimer9_pwm_evt (gpio_28) */
696		>;
697	};
698};
699
700&omap4_pmx_wkup {
701	usb_gpio_mux_sel2: pinmux_usb_gpio_mux_sel2_pins {
702		/* gpio_wk0 */
703		pinctrl-single,pins = <
704		OMAP4_IOPAD(0x040, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
705		>;
706	};
707};
708
709/* RNG is used by secure mode and not accessible */
710&rng_target {
711	status = "disabled";
712};
713
714/* Configure pwm clock source for timers 8 & 9 */
715&timer8 {
716	assigned-clocks = <&abe_clkctrl OMAP4_TIMER8_CLKCTRL 24>;
717	assigned-clock-parents = <&sys_clkin_ck>;
718};
719
720&timer9 {
721	assigned-clocks = <&l4_per_clkctrl OMAP4_TIMER9_CLKCTRL 24>;
722	assigned-clock-parents = <&sys_clkin_ck>;
723};
724
725/*
726 * The uart1 port is wired to mdm6600 with rts and cts. The modem uses gpio_149
727 * for wake-up events for both the USB PHY and the UART. We can use gpio_149
728 * pad as the shared wakeirq for the UART rather than the RX or CTS pad as we
729 * have gpio_149 trigger before the UART transfer starts.
730 */
731&uart1 {
732	pinctrl-names = "default";
733	pinctrl-0 = <&uart1_pins>;
734	interrupts-extended = <&wakeupgen GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH
735			       &omap4_pmx_core 0x110>;
736	uart-has-rtscts;
737	current-speed = <115200>;
738};
739
740&uart3 {
741	interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH
742			       &omap4_pmx_core 0x17c>;
743};
744
745&uart4 {
746	pinctrl-names = "default";
747	pinctrl-0 = <&uart4_pins>;
748
749	bluetooth {
750		compatible = "ti,wl1285-st";
751		enable-gpios = <&gpio6 14 GPIO_ACTIVE_HIGH>; /* gpio 174 */
752		max-speed = <3686400>;
753	};
754};
755
756&usbhsohci {
757	phys = <&fsusb1_phy>;
758	phy-names = "usb";
759};
760
761&usbhsehci {
762	phys = <&hsusb2_phy>;
763};
764
765&usbhshost {
766	port1-mode = "ohci-phy-4pin-dpdm";
767	port2-mode = "ehci-tll";
768};
769
770/* Internal UTMI+ PHY used for OTG, CPCAP ULPI PHY for detection and charger */
771&usb_otg_hs {
772	interface-type = <1>;
773	mode = <3>;
774
775	/*
776	 * Max 300 mA steps based on similar PMIC MC13783UG.pdf "Table 10-4.
777	 * VBUS Regulator Main Characteristics". Binding uses 2 mA units.
778	 */
779	power = <150>;
780};
781
782&i2c4 {
783	ak8975: magnetometer@c {
784		compatible = "asahi-kasei,ak8975";
785		reg = <0x0c>;
786
787		vdd-supply = <&vhvio>;
788
789		interrupt-parent = <&gpio6>;
790		interrupts = <15 IRQ_TYPE_EDGE_RISING>; /* gpio175 */
791
792		rotation-matrix = "-1", "0", "0",
793				  "0", "1", "0",
794				  "0", "0", "-1";
795
796	};
797
798	lis3dh: accelerometer@18 {
799		compatible = "st,lis3dh-accel";
800		reg = <0x18>;
801
802		vdd-supply = <&vhvio>;
803
804		interrupt-parent = <&gpio2>;
805		interrupts = <2 IRQ_TYPE_EDGE_BOTH>; /* gpio34 */
806
807		rotation-matrix = "0", "-1", "0",
808				  "1", "0", "0",
809				  "0", "0", "1";
810	};
811};
812
813&mcbsp2 {
814	#sound-dai-cells = <0>;
815	pinctrl-names = "default";
816	pinctrl-0 = <&mcbsp2_pins>;
817	status = "okay";
818
819	mcbsp2_port: port {
820		cpu_dai2: endpoint {
821			dai-format = "i2s";
822			remote-endpoint = <&cpcap_audio_codec0>;
823			frame-master = <&cpcap_audio_codec0>;
824			bitclock-master = <&cpcap_audio_codec0>;
825		};
826	};
827};
828
829&mcbsp3 {
830	#sound-dai-cells = <0>;
831	pinctrl-names = "default";
832	pinctrl-0 = <&mcbsp3_pins>;
833	status = "okay";
834
835	mcbsp3_port: port {
836		cpu_dai3: endpoint {
837			dai-format = "dsp_a";
838			frame-master = <&cpcap_audio_codec1>;
839			bitclock-master = <&cpcap_audio_codec1>;
840			remote-endpoint = <&cpcap_audio_codec1>;
841		};
842	};
843};
844
845&cpcap_audio_codec0 {
846	remote-endpoint = <&cpu_dai2>;
847};
848
849&cpcap_audio_codec1 {
850	remote-endpoint = <&cpu_dai3>;
851};
852