imx8mq-librem5.dtsi 35.8 KB
Newer Older
1
2
3
4
5
6
7
8
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2018-2020 Purism SPC
 */

/dts-v1/;

#include "dt-bindings/input/input.h"
9
#include <dt-bindings/interrupt-controller/irq.h>
10
#include "dt-bindings/leds/common.h"
11
12
#include "dt-bindings/pwm/pwm.h"
#include "dt-bindings/usb/pd.h"
13
#include "dt-bindings/rfkill/rfkill.h"
14
15
16
17
18
19
20
21
22
#include "imx8mq.dtsi"

/ {
	model = "Purism Librem 5";
	compatible = "purism,librem5", "fsl,imx8mq";

	backlight_dsi: backlight-dsi {
		compatible = "led-backlight";
		leds = <&led_backlight>;
23
24
		brightness-levels = <255>;
		default-brightness-level = <190>;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
	};

	pmic_osc: clock-pmic {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <32768>;
		clock-output-names = "pmic_osc";
	};

	chosen {
		stdout-path = &uart1;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
41
		pinctrl-0 = <&pinctrl_keys>;
42
43
44
45
46

		vol-down {
			label = "VOL_DOWN";
			gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEDOWN>;
47
			wakeup-source;
48
49
50
51
52
53
54
55
56
		};

		vol-up {
			label = "VOL_UP";
			gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
		};
	};

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
	pwmleds {
		compatible = "pwm-leds";

		blue {
			label = "blue:status";
			max-brightness = <248>;
			pwms = <&pwm2 0 50000>;
		};

		green {
			label = "green:status";
			max-brightness = <248>;
			pwms = <&pwm4 0 50000>;
		};

		red {
			label = "red:status";
			max-brightness = <248>;
			pwms = <&pwm3 0 50000>;
		};
	};

79
80
81
	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
82
		pinctrl-0 = <&pinctrl_hub_nreset>,
83
84
85
			<&pinctrl_sd_pwr>, <&pinctrl_charger>
			, <&pinctrl_smc>,
			<&pinctrl_gnss>,
86
			<&pinctrl_wwan_pwr>,
87
			<&pinctrl_wwan>;
88
89
90
91
92
93
94

		chg-en {
			label = "chg_en";
			gpios = <&gpio3 2 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

95
96
97
		flash-strobe {
			label = "flash_strobe";
			gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
98
			default-state = "off";
99
			linux,default-trigger = "flash";
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
		};

		hub-nreset {
			label = "hub_nreset";
			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};

		sd-en {
			label = "sd_en";
			gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};

		gnss-nreset {
			label = "gnss_nreset";
			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};

		smc-en {
			label = "smc_en";
			gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		wwan-en {
			label = "wwan_en";
			gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};

		wwan-nreset {
			label = "wwan_nreset";
			gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};

		wwan-disable {
			label = "wwan_disable";
			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		wwan-dis2 {
			label = "wwan_dis2";
			gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};
	};

151
	reg_audio_pwr_en: regulator-audio-pwr-en {
152
153
154
155
156
157
158
159
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_audiopwr>;
		regulator-name = "AUDIO_PWR_EN";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
		enable-active-high;
160
		regulator-always-on;
161
162
	};

163
164
165
166
167
168
169
170
	reg_aud_1v8: regulator-audio-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "AUD_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&reg_audio_pwr_en>;
	};

171
172
173
174
175
176
177
178
179
180
181
	reg_camera_pwr_en: regulator-camera-pwr-en {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_camera_pwr>;
		regulator-name = "CAMERA_PWR_EN";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
	reg_gnss: regulator-gnss {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gnsspwr>;
		regulator-name = "GNSS";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio3 12 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	reg_hub: regulator-hub {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_hub_pwr>;
		regulator-name = "HUB";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

204
205
206
207
208
209
210
211
212
213
214
215
216
217
	reg_lcd_1v8: regulator-lcd-1v8 {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsien>;
		regulator-name = "LCD_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&reg_vdd_1v8>;
		gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		/* Otherwise i2c3 is not functional */
		regulator-always-on;
	};

218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
	reg_lcd_3v4: regulator-lcd-3v4 {
		compatible = "regulator-fixed";
		regulator-name = "LCD_3V4";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsibiasen>;
		vin-supply = <&reg_vsys_3v4>;
		gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	reg_vdd_sen: regulator-vdd-sen {
		compatible = "regulator-fixed";
		regulator-name = "VDD_SEN";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

235
236
237
238
239
240
241
242
	reg_vdd_1v8: regulator-vdd-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "VDD_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&buck7_reg>;
	};

243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
	reg_vdd_3v3: regulator-vdd-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "VDD_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	reg_vsys_3v4: regulator-vsys-3v4 {
		compatible = "regulator-fixed";
		regulator-name = "VSYS_3V4";
		regulator-min-microvolt = <3400000>;
		regulator-max-microvolt = <3400000>;
		regulator-always-on;
	};

	reg_wifi_3v3: regulator-wifi-3v3 {
		compatible = "regulator-fixed";
260
261
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_wifi_pwr>;
262
263
264
		regulator-name = "3V3_WIFI";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
265
266
267
268
		gpio = <&gpio3 10 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		vin-supply = <&reg_vdd_3v3>;
		regulator-always-on;
269
270
	};

271
272
273
274
275
276
277
278
279
280
281
	rfkill-hks {
		compatible = "rfkill-hks";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_hsw>;

		mic-hks {
			gpios = <&gpio4 1 GPIO_ACTIVE_LOW>;
			name = "mic-hks";
			type = <RFKILL_MIC>;
		};

282
283
284
285
286
287
		camera-hks {
			gpios = <&gpio4 1 GPIO_ACTIVE_LOW>;
			name = "camera-hks";
			type = <RFKILL_CAMERA>;
		};

288
289
290
291
292
293
294
295
296
297
298
299
300
		wlan-hks {
			gpios = <&gpio4 10 GPIO_ACTIVE_LOW>;
			name = "wlan-hks";
			type = <RFKILL_WLAN>;
		};

		wwan-hks {
			gpios = <&gpio4 0 GPIO_ACTIVE_LOW>;
			name = "wwan-hks";
			type = <RFKILL_WWAN>;
		};
	};

301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
	sound {
		compatible = "simple-audio-card";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_hp>;
		simple-audio-card,name = "Librem 5";
		simple-audio-card,format = "i2s";
		simple-audio-card,widgets =
			"Headphone", "Headphones",
			"Microphone", "Headset Mic",
			"Microphone", "Digital Mic",
			"Speaker", "Speaker";
		simple-audio-card,routing =
			"Headphones", "HPOUTL",
			"Headphones", "HPOUTR",
			"Speaker", "SPKOUTL",
			"Speaker", "SPKOUTR",
			"Headset Mic", "MICBIAS",
			"IN3R", "Headset Mic",
			"DMICDAT", "Digital Mic";
		simple-audio-card,hp-det-gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;

		simple-audio-card,cpu {
			sound-dai = <&sai2>;
		};

		simple-audio-card,codec {
			sound-dai = <&codec>;
			clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
			frame-master;
			bitclock-master;
		};
	};

	sound-wwan {
		compatible = "simple-audio-card";
		simple-audio-card,name = "Modem";
		simple-audio-card,format = "i2s";

		simple-audio-card,cpu {
			sound-dai = <&sai6>;
			frame-inversion;
		};

		simple-audio-card,codec {
			sound-dai = <&bm818_codec>;
			frame-master;
			bitclock-master;
		};
	};

351
352
353
354
355
356
357
358
	usdhc2_pwrseq: pwrseq {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_bt>, <&pinctrl_wifi_disable>;

		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio3 25 GPIO_ACTIVE_HIGH>, <&gpio4 29 GPIO_ACTIVE_HIGH>;
	};

359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
	bm818_codec: sound-wwan-codec {
		compatible = "broadmobi,bm818", "option,gtm601";
		#sound-dai-cells = <0>;
	};

	vibrator {
		compatible = "pwm-vibrator";
		pwms = <&pwm1 0 1000000000 0>;
		pwm-names = "enable";
		vcc-supply = <&reg_vdd_3v3>;
	};
};

&A53_0 {
	cpu-supply = <&buck2_reg>;
};

&A53_1 {
	cpu-supply = <&buck2_reg>;
};

&A53_2 {
	cpu-supply = <&buck2_reg>;
};

&A53_3 {
	cpu-supply = <&buck2_reg>;
};

388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
&csi1_bridge {
	fsl,mipi-mode;
	status = "okay";

	port {
		csi1_ep: endpoint {
			remote-endpoint = <&csi1_mipi_ep>;
		};
	};
};

&csi2_bridge {
	fsl,mipi-mode;
	status = "okay";

	port {
		csi2_ep: endpoint {
			remote-endpoint = <&csi2_mipi_ep>;
		};
	};
};

410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
&ddrc {
	operating-points-v2 = <&ddrc_opp_table>;

	ddrc_opp_table: ddrc-opp-table {
		compatible = "operating-points-v2";

		opp-25M {
			opp-hz = /bits/ 64 <25000000>;
		};

		opp-100M {
			opp-hz = /bits/ 64 <100000000>;
		};

		opp-800M {
			opp-hz = /bits/ 64 <800000000>;
		};
	};
};

&dphy {
	status = "okay";
};

&ecspi1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1>;
	cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	nor_flash: flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <1000000>;
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "protected0";
			reg = <0x0 0x30000>;
			read-only;
		};

		partition@30000 {
			label = "protected1";
			reg = <0x30000 0x10000>;
			read-only;
		};

		partition@40000 {
			label = "rw";
			reg = <0x40000 0x1C0000>;
		};
465
466
467
468
469
470
471
	};
};

&gpio1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pmic_5v>;

472
	pmic-5v-hog {
473
		gpio-hog;
474
		gpios = <1 GPIO_ACTIVE_HIGH>;
475
		input;
476
		lane-mapping = "pmic-5v";
477
478
479
480
	};
};

&iomuxc {
481
482
483
484
485
486
487
488
489
490
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_hog>;

	pinctrl_hog: hoggrp {
		fsl,pins = <
			/* CLKO2 for cameras on both CSI1 and CSI2 */
			MX8MQ_IOMUXC_GPIO1_IO15_CCMSRCGPCMIX_CLKO2      0x1f
		>;
	};

491
492
493
494
495
496
497
498
499
500
501
502
503
504
	pinctrl_audiopwr: audiopwrgrp {
		fsl,pins = <
			/* AUDIO_POWER_EN_3V3 */
			MX8MQ_IOMUXC_GPIO1_IO04_GPIO1_IO4	0x83
		>;
	};

	pinctrl_bl: blgrp {
		fsl,pins = <
			/* BACKLINGE_EN */
			MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14	0x83
		>;
	};

505
506
507
	pinctrl_bt: btgrp {
		fsl,pins = <
			/* BT_REG_ON */
508
			MX8MQ_IOMUXC_SAI5_MCLK_GPIO3_IO25	0x83
509
510
511
512
513
514
515
		>;
	};

	pinctrl_charger: chargergrp {
		fsl,pins = <
			/* CHG_EN */
			MX8MQ_IOMUXC_NAND_CE1_B_GPIO3_IO2	0x3
516
517
518
519
520
		>;
	};

	pinctrl_otg: otggrp {
		fsl,pins = <
521
522
523
524
525
			/* CHG_OTG_OUT_EN */
			MX8MQ_IOMUXC_NAND_CE3_B_GPIO3_IO4	0x3
		>;
	};

526
527
528
	pinctrl_charger_in: chargeringrp {
		fsl,pins = <
			/* CHRG_INT */
529
			MX8MQ_IOMUXC_NAND_CE2_B_GPIO3_IO3	0x80
530
531
532
533
534
			/* CHG_STATUS_B */
			MX8MQ_IOMUXC_NAND_ALE_GPIO3_IO0		0x80
		>;
	};

535
536
537
538
539
540
541
	pinctrl_camera_pwr: camerapwrgrp {
		fsl,pins = <
			/* CAMERA_PWR_EN_3V3 */
			MX8MQ_IOMUXC_GPIO1_IO00_GPIO1_IO0	0x83
		>;
	};

542
	pinctrl_csi1: csi1grp {
543
544
545
		fsl,pins = <
			/* CSI1_NRST */
			MX8MQ_IOMUXC_ENET_RXC_GPIO1_IO25	0x83
546
547
548
549
550
		>;
	};

	pinctrl_csi2: csi2grp {
		fsl,pins = <
551
552
553
554
555
			/* CSI2_NRST */
			MX8MQ_IOMUXC_ENET_RD0_GPIO1_IO26	0x83
		>;
	};

556
557
558
559
560
561
562
563
564
565
566
567
568
569
	pinctrl_dsibiasen: dsibiasengrp {
		fsl,pins = <
			/* DSI_BIAS_EN */
			MX8MQ_IOMUXC_ENET_TD1_GPIO1_IO20	0x83
		>;
	};

	pinctrl_dsien: dsiengrp {
		fsl,pins = <
			/* DSI_EN_3V3 */
			MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5	0x83
		>;
	};

570
571
572
573
574
575
576
577
578
579
580
	pinctrl_dsirst: dsirstgrp {
		fsl,pins = <
			/* DSI_RST */
			MX8MQ_IOMUXC_ENET_RD3_GPIO1_IO29	0x83
			/* DSI_TE */
			MX8MQ_IOMUXC_ENET_RD2_GPIO1_IO28	0x83
			/* TP_RST */
			MX8MQ_IOMUXC_ENET_RX_CTL_GPIO1_IO24	0x83
		>;
	};

581
	pinctrl_ecspi1: spi1grp {
582
583
584
585
586
587
588
589
		fsl,pins = <
			MX8MQ_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI	0x83
			MX8MQ_IOMUXC_ECSPI1_MISO_ECSPI1_MISO	0x83
			MX8MQ_IOMUXC_ECSPI1_SS0_GPIO5_IO9	0x19
			MX8MQ_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK	0x83
		>;
	};

590
591
592
593
594
595
596
597
598
	pinctrl_flash: flashgrp {
		fsl,pins = <
			/* FLASH_STROBE */
			MX8MQ_IOMUXC_ENET_TD0_GPIO1_IO21	0x83
			/* FLASH_EN */
			MX8MQ_IOMUXC_ENET_TXC_GPIO1_IO23	0x83
		>;
	};

599
600
601
602
603
604
605
	pinctrl_gauge: gaugegrp {
		fsl,pins = <
			/* BAT_LOW */
			MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20	0x80
		>;
	};

606
607
608
609
610
611
612
	pinctrl_gnss: gnssgrp {
		fsl,pins = <
			/* GPS_RST */
			MX8MQ_IOMUXC_GPIO1_IO08_GPIO1_IO8	0x83
		>;
	};

613
614
615
616
617
618
619
	pinctrl_gnsspwr: gnsspwrgrp {
		fsl,pins = <
			/* GPS3V3_EN */
			MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12	0x83
		>;
	};

620
621
622
623
624
625
626
627
	/* unused */
	pinctrl_hall: hallgrp {
		fsl,pins = <
			/* HALL */
			MX8MQ_IOMUXC_ENET_TD3_GPIO1_IO18	0x80
		>;
	};

628
629
630
631
632
633
634
635
636
637
638
639
640
641
	pinctrl_haptic: hapticgrp {
		fsl,pins = <
			/* MOTO */
			MX8MQ_IOMUXC_SPDIF_EXT_CLK_PWM1_OUT	0x83
		>;
	};

	pinctrl_hp: hpgrp {
		fsl,pins = <
			/* HEADPHONE_DET_1V8 */
			MX8MQ_IOMUXC_NAND_DATA03_GPIO3_IO9	0x180
		>;
	};

642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
	pinctrl_hsw: hswgrp {
		fsl,pins = <
			/* HSW_WIFI_STATE */
			MX8MQ_IOMUXC_SAI1_TXFS_GPIO4_IO10	0x180
			/* HSW_CA_STATE */
			MX8MQ_IOMUXC_SAI1_RXC_GPIO4_IO1		0x180
			/* HSW_4G_STATE */
			MX8MQ_IOMUXC_SAI1_RXFS_GPIO4_IO0	0x180
		>;
	};

	pinctrl_hub_nreset: hubnresetgrp {
		fsl,pins = <
			/* HUB_nRESET */
			MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12	0x83
		>;
	};

660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
	pinctrl_hub_pwr: hubpwrgrp {
		fsl,pins = <
			/* HUB_PWR_3V3_EN */
			MX8MQ_IOMUXC_GPIO1_IO14_GPIO1_IO14	0x83
		>;
	};

	pinctrl_i2c1: i2c1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL		0x40000026
			MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA		0x40000026
		>;
	};

	pinctrl_i2c2: i2c2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C2_SCL_I2C2_SCL		0x40000026
			MX8MQ_IOMUXC_I2C2_SDA_I2C2_SDA		0x40000026
		>;
	};

	pinctrl_i2c3: i2c3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL		0x40000026
			MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA		0x40000026
		>;
	};

	pinctrl_i2c4: i2c4grp {
		fsl,pins = <
			MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL		0x40000026
			MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA		0x40000026
		>;
	};

	pinctrl_keys: keysgrp {
		fsl,pins = <
697
698
699
700
			/* 4G_WAKE */
			MX8MQ_IOMUXC_NAND_RE_B_GPIO3_IO15	0x80
			/* PWR_KEY */
			MX8MQ_IOMUXC_NAND_CLE_GPIO3_IO5		0x01C0
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
			/* VOL- */
			MX8MQ_IOMUXC_ENET_MDIO_GPIO1_IO17	0x01C0
			/* VOL+ */
			MX8MQ_IOMUXC_ENET_MDC_GPIO1_IO16	0x01C0
		>;
	};

	pinctrl_led_b: ledbgrp {
		fsl,pins = <
			/* LED_B */
			MX8MQ_IOMUXC_GPIO1_IO13_PWM2_OUT	0x06
		>;
	};

	pinctrl_led_g: ledggrp {
		fsl,pins = <
			/* LED_G */
			MX8MQ_IOMUXC_SAI3_MCLK_PWM4_OUT		0x06
		>;
	};

	pinctrl_led_r: ledrgrp {
		fsl,pins = <
			/* LED_R */
			MX8MQ_IOMUXC_SPDIF_TX_PWM3_OUT		0x06
		>;
	};

	pinctrl_mag: maggrp {
		fsl,pins = <
			/* INT_MAG */
			MX8MQ_IOMUXC_SAI5_RXD1_GPIO3_IO22	0x80
		>;
	};

736
737
738
739
740
741
742
743
744
745
	/* unused */
	pinctrl_nfc: nfcgrp {
		fsl,pins = <
			/* NFC_EN */
			MX8MQ_IOMUXC_SAI3_RXFS_GPIO4_IO28	0x83
			/* NFC_IRQ */
			MX8MQ_IOMUXC_SAI1_TXC_GPIO4_IO11	0x80
		>;
	};

746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
	pinctrl_pmic: pmicgrp {
		fsl,pins = <
			/* PMIC_NINT */
			MX8MQ_IOMUXC_GPIO1_IO07_GPIO1_IO7	0x80
		>;
	};

	pinctrl_pmic_5v: pmic5vgrp {
		fsl,pins = <
			/* PMIC_5V */
			MX8MQ_IOMUXC_GPIO1_IO01_GPIO1_IO1	0x80
		>;
	};

	pinctrl_prox: proxgrp {
		fsl,pins = <
			/* INT_LIGHT */
			MX8MQ_IOMUXC_NAND_DATA01_GPIO3_IO7	0x80
		>;
	};

	pinctrl_rtc: rtcgrp {
		fsl,pins = <
			/* RTC_INT */
			MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9	0x80
		>;
	};

	pinctrl_sai2: sai2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC	0xd6
			MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK	0xd6
			MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK	0xd6
		>;
	};

784
785
786
787
788
789
790
791
792
793
	/* unused */
	pinctrl_sai3: sai3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI3_TXD_SAI3_TX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI3_TXC_SAI3_TX_BCLK	0xd6
			MX8MQ_IOMUXC_SAI3_RXD_SAI3_RX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC	0xd6
		>;
	};

794
795
796
797
798
799
800
801
802
	pinctrl_sai6: sai6grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SAI1_RXD5_SAI6_RX_DATA0	0xd6
			MX8MQ_IOMUXC_SAI1_RXD6_SAI6_RX_SYNC	0xd6
			MX8MQ_IOMUXC_SAI1_TXD4_SAI6_RX_BCLK	0xd6
			MX8MQ_IOMUXC_SAI1_TXD5_SAI6_TX_DATA0	0xd6
		>;
	};

803
804
805
806
807
808
809
810
811
812
813
814
815
816
	pinctrl_sd_pwr: sdpwrgrp {
		fsl,pins = <
			/* TF_PWR_3V3_EN */
			MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3	0x83
		>;
	};

	pinctrl_smc: smcgrp {
		fsl,pins = <
			/* SMC_PWR_3V3_EN (smrt crd) */
			MX8MQ_IOMUXC_GPIO1_IO06_GPIO1_IO6	0x83
		>;
	};

817
818
819
820
821
822
823
	pinctrl_tcpc: tcpcgrp {
		fsl,pins = <
			/* TCPC_INT */
			MX8MQ_IOMUXC_GPIO1_IO10_GPIO1_IO10	0x01C0
		>;
	};

824
825
826
827
828
829
830
	pinctrl_touch: touchgrp {
		fsl,pins = <
			/* TP_INT */
			MX8MQ_IOMUXC_ENET_RD1_GPIO1_IO27	0x80
		>;
	};

831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
	pinctrl_typec: typecgrp {
		fsl,pins = <
			/* TYPEC_MUX_EN */
			MX8MQ_IOMUXC_GPIO1_IO11_GPIO1_IO11	0x83
		>;
	};

	pinctrl_uart1: uart1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX	0x49
			MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX	0x49
		>;
	};

	pinctrl_uart2: uart2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX	0x49
			MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX	0x49
		>;
	};

	pinctrl_uart3: uart3grp {
		fsl,pins = <
			MX8MQ_IOMUXC_UART3_RXD_UART3_DCE_RX	0x49
			MX8MQ_IOMUXC_UART3_TXD_UART3_DCE_TX	0x49
		>;
	};

	pinctrl_uart4: uart4grp {
		fsl,pins = <
			MX8MQ_IOMUXC_ECSPI2_SCLK_UART4_DCE_RX		0x49
			MX8MQ_IOMUXC_ECSPI2_MOSI_UART4_DCE_TX		0x49
			MX8MQ_IOMUXC_ECSPI2_MISO_UART4_DCE_CTS_B	0x49
			MX8MQ_IOMUXC_ECSPI2_SS0_UART4_DCE_RTS_B		0x49
		>;
	};

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x83
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xc3
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xc3
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xc3
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xc3
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xc3
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xc3
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xc3
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xc3
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xc3
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x83
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x8d
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xcd
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xcd
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xcd
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xcd
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xcd
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xcd
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xcd
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xcd
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xcd
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x8d
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK			0x9f
			MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD			0xdf
			MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0		0xdf
			MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1		0xdf
			MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2		0xdf
			MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3		0xdf
			MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4		0xdf
			MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5		0xdf
			MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6		0xdf
			MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7		0xdf
			MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE		0x9f
			MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B		0xc1
		>;
	};

	pinctrl_usdhc2: usdhc2grp {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x80
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x83
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xc3
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xc3
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xc3
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xc3
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xc3
			MX8MQ_IOMUXC_SD2_RESET_B_USDHC2_RESET_B 0xc1
		>;
	};

	pinctrl_usdhc2_100mhz: usdhc2grp100mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x80
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x8d
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcd
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcd
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcd
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcd
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcd
			MX8MQ_IOMUXC_SD2_RESET_B_USDHC2_RESET_B 0xc1
		>;
	};

	pinctrl_usdhc2_200mhz: usdhc2grp200mhz {
		fsl,pins = <
			MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12	0x80
			MX8MQ_IOMUXC_SD2_CLK_USDHC2_CLK		0x9f
			MX8MQ_IOMUXC_SD2_CMD_USDHC2_CMD		0xcf
			MX8MQ_IOMUXC_SD2_DATA0_USDHC2_DATA0	0xcf
			MX8MQ_IOMUXC_SD2_DATA1_USDHC2_DATA1	0xcf
			MX8MQ_IOMUXC_SD2_DATA2_USDHC2_DATA2	0xcf
			MX8MQ_IOMUXC_SD2_DATA3_USDHC2_DATA3	0xcf
			MX8MQ_IOMUXC_SD2_RESET_B_USDHC2_RESET_B 0xc1
		>;
	};

958
959
960
961
962
963
964
965
	/* unused */
	pinctrl_wifi: wifigrp {
		fsl,pins = <
			/* SDIO_WAKE (WiFi) */
			MX8MQ_IOMUXC_SD2_WP_GPIO2_IO20		0x80
		>;
	};

966
967
968
969
970
971
972
	pinctrl_wifi_disable: wifidisablegrp {
		fsl,pins = <
			/* WIFI_REG_ON */
			MX8MQ_IOMUXC_SAI3_RXC_GPIO4_IO29	0x83
		>;
	};

973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
	pinctrl_wwan: wwangrp {
		fsl,pins = <
			/* 4G_RESET# */
			MX8MQ_IOMUXC_NAND_CE0_B_GPIO3_IO1	0x83
			/* 4G_W_DISABLE */
			MX8MQ_IOMUXC_NAND_READY_B_GPIO3_IO16	0x83
			/* 4G_W_DIS2 */
			MX8MQ_IOMUXC_NAND_DATA07_GPIO3_IO13	0x83
		>;
	};

	pinctrl_wwan_pwr: wwanpwrgrp {
		fsl,pins = <
			/* 4G_PWR_EN */
			MX8MQ_IOMUXC_NAND_WP_B_GPIO3_IO18	0x83
		>;
	};

	/* unused */
	pinctrl_usb: usbgrp {
		fsl,pins = <
			/* HUB_RESET */
			MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12	0x83
			/* CHG_USB_DSEL */
			MX8MQ_IOMUXC_SAI5_RXFS_GPIO3_IO19	0x80
		>;
	};

	pinctrl_wifi_pwr: wifipwrgrp {
		fsl,pins = <
			/* WIFI3V3_EN */
			MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10	0x83
		>;
	};

1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
	pinctrl_wdog: wdoggrp {
		fsl,pins = <
			/* nWDOG */
			MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x1f
		>;
	};
};

&i2c1 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	typec_pd: usb-pd@3f {
		compatible = "ti,tps6598x";
		reg = <0x3f>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_typec>, <&pinctrl_tcpc>;
		interrupt-parent = <&gpio1>;
		interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
1029
		interrupt-names = "irq";
1030
1031

		connector {
1032
1033
1034
1035
			compatible = "usb-c-connector";
			label = "USB-C";
			data-role = "dual";

1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				port@0 {
					reg = <0>;

					usb_con_hs: endpoint {
						remote-endpoint = <&typec_hs>;
					};
				};

				port@1 {
					reg = <1>;

					usb_con_ss: endpoint {
						remote-endpoint = <&typec_ss>;
					};
				};
			};
		};
	};

	pmic: pmic@4b {
		compatible = "rohm,bd71837";
		reg = <0x4b>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pmic>;
		clocks = <&pmic_osc>;
		clock-names = "osc";
		clock-output-names = "pmic_clk";
		interrupt-parent = <&gpio1>;
1068
		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
1069
1070
1071
1072
		rohm,reset-snvs-powered;

		regulators {
			buck1_reg: BUCK1 {
1073
				regulator-name = "buck1";
1074
1075
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
1076
				regulator-boot-on;
1077
1078
1079
1080
1081
1082
1083
1084
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <900000>;
				rohm,dvs-idle-voltage = <850000>;
				rohm,dvs-suspend-voltage = <800000>;
				regulator-always-on;
			};

			buck2_reg: BUCK2 {
1085
				regulator-name = "buck2";
1086
1087
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
1088
				regulator-boot-on;
1089
1090
1091
1092
1093
1094
1095
				regulator-ramp-delay = <1250>;
				rohm,dvs-run-voltage = <1000000>;
				rohm,dvs-idle-voltage = <900000>;
				regulator-always-on;
			};

			buck3_reg: BUCK3 {
1096
				regulator-name = "buck3";
1097
1098
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
1099
				regulator-boot-on;
1100
1101
1102
1103
				rohm,dvs-run-voltage = <900000>;
			};

			buck4_reg: BUCK4 {
1104
				regulator-name = "buck4";
1105
1106
1107
1108
1109
1110
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1300000>;
				rohm,dvs-run-voltage = <1000000>;
			};

			buck5_reg: BUCK5 {
1111
				regulator-name = "buck5";
1112
1113
				regulator-min-microvolt = <700000>;
				regulator-max-microvolt = <1350000>;
1114
				regulator-boot-on;
1115
1116
1117
1118
				regulator-always-on;
			};

			buck6_reg: BUCK6 {
1119
				regulator-name = "buck6";
1120
1121
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
1122
				regulator-boot-on;
1123
1124
1125
1126
				regulator-always-on;
			};

			buck7_reg: BUCK7 {
1127
				regulator-name = "buck7";
1128
1129
				regulator-min-microvolt = <1605000>;
				regulator-max-microvolt = <1995000>;
1130
				regulator-boot-on;
1131
1132
1133
1134
				regulator-always-on;
			};

			buck8_reg: BUCK8 {
1135
				regulator-name = "buck8";
1136
1137
				regulator-min-microvolt = <800000>;
				regulator-max-microvolt = <1400000>;
1138
				regulator-boot-on;
1139
1140
1141
1142
				regulator-always-on;
			};

			ldo1_reg: LDO1 {
1143
				regulator-name = "ldo1";
1144
1145
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3300000>;
1146
				regulator-boot-on;
1147
1148
1149
1150
1151
				/* leave on for snvs power button */
				regulator-always-on;
			};

			ldo2_reg: LDO2 {
1152
				regulator-name = "ldo2";
1153
1154
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
1155
				regulator-boot-on;
1156
1157
1158
1159
1160
				/* leave on for snvs power button */
				regulator-always-on;
			};

			ldo3_reg: LDO3 {
1161
				regulator-name = "ldo3";
1162
1163
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
1164
				regulator-boot-on;
1165
1166
1167
1168
				regulator-always-on;
			};

			ldo4_reg: LDO4 {
1169
				regulator-name = "ldo4";
1170
1171
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
1172
				regulator-boot-on;
1173
1174
1175
1176
1177
				regulator-always-on;
			};

			ldo5_reg: LDO5 {
				/* VDD_PHY_0V9 - MIPI and HDMI domains */
1178
				regulator-name = "ldo5";
1179
1180
1181
1182
1183
1184
1185
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			ldo6_reg: LDO6 {
				/* VDD_PHY_0V9 - MIPI, HDMI and USB domains */
1186
				regulator-name = "ldo6";
1187
1188
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
1189
				regulator-boot-on;
1190
1191
1192
1193
1194
				regulator-always-on;
			};

			ldo7_reg: LDO7 {
				/* VDD_PHY_3V3 - USB domain */
1195
				regulator-name = "ldo7";
1196
1197
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
1198
				regulator-boot-on;
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
				regulator-always-on;
			};
		};
	};

	rtc@68 {
		compatible = "microcrystal,rv4162";
		reg = <0x68>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_rtc>;
		interrupt-parent = <&gpio1>;
		interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
	};
};

&i2c2 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c2>;
	status = "okay";

	magnetometer@1e	{
		compatible = "st,lsm9ds1-magn";
		reg = <0x1e>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mag>;
		interrupt-parent = <&gpio3>;
		interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
		vdd-supply = <&reg_vdd_sen>;
		vddio-supply = <&reg_vdd_1v8>;
	};

	regulator@3e {
		compatible = "tps65132";
		reg = <0x3e>;

1235
		reg_lcd_avdd: outp {
1236
1237
1238
1239
			regulator-name = "LCD_AVDD";
			vin-supply = <&reg_lcd_3v4>;
		};

1240
		reg_lcd_avee: outn {
1241
1242
1243
1244
1245
			regulator-name = "LCD_AVEE";
			vin-supply = <&reg_lcd_3v4>;
		};
	};

1246
	flash@53 {
1247
1248
1249
		compatible = "ti,lm3560";
		pinctrl-0 = <&pinctrl_flash>;
		pinctrl-names = "default";
1250
1251
		#address-cells = <1>;
		#size-cells = <0>;
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
		reg = <0x53>;
		enable-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
		/* TODO */
		//strobe-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
		vin-supply = <&reg_vsys_3v4>;
		torch: led@0 {
			reg = <1>;
			function = LED_FUNCTION_TORCH;
			color = <LED_COLOR_ID_WHITE>;
			led-max-microamp = <93750>;
			flash-max-microamp = <875000>;
			flash-max-timeout-us = <1024000>;
1264
1265
1266
		};
	};

1267
	proximity: prox@60 {
1268
		compatible = "vishay,vcnl4040", "vishay,vcnl4200";
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
		reg = <0x60>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_prox>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
	};

	accel_gyro: accel-gyro@6a	{
		compatible = "st,lsm9ds1-imu";
		reg = <0x6a>;
		vdd-supply = <&reg_vdd_sen>;
		vddio-supply = <&reg_vdd_1v8>;
	};
};

&i2c3 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c3>;
	status = "okay";

	codec: audio-codec@1a {
		compatible = "wlf,wm8962";
		reg = <0x1a>;
		clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
		assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
		assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
		assigned-clock-rates = <24576000>;
		#sound-dai-cells = <0>;
		mic-cfg = <0x200>;
		DCVDD-supply = <&reg_aud_1v8>;
		DBVDD-supply = <&reg_aud_1v8>;
		AVDD-supply = <&reg_aud_1v8>;
		CPVDD-supply = <&reg_aud_1v8>;
		MICVDD-supply = <&reg_aud_1v8>;
		PLLVDD-supply = <&reg_aud_1v8>;
		SPKVDD1-supply = <&reg_vsys_3v4>;
		SPKVDD2-supply = <&reg_vsys_3v4>;
		gpio-cfg = <
			0x0000 /* n/c */
			0x0001 /* gpio2, 1: default */
			0x0013 /* gpio3, 2: dmicclk */
			0x0000 /* n/c, 3: default */
			0x8014 /* gpio5, 4: dmic_dat */
			0x0000 /* gpio6, 5: default */
		>;
	};

1317
	camera_front: camera@20 {
1318
		compatible = "hynix,hi846";
1319
		reg = <0x20>;
1320
1321
1322
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi1>;
		clocks = <&clk IMX8MQ_CLK_CLKO2>;
1323
		reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
1324
1325
1326
		vddio-supply = <&reg_camera_pwr_en>;
		vdda-supply = <&reg_camera_pwr_en>;
		vddd-supply = <&reg_camera_pwr_en>;
1327
		status = "okay";
1328

1329
1330
		port {
			camera1_ep: endpoint {
1331
				data-lanes = <1 2>;
1332
1333
1334
				remote-endpoint = <&mipi1_sensor_ep>;
			};
		};
1335
1336
	};

1337
1338
1339
1340
1341
1342
1343
1344
1345
	backlight@36 {
		compatible = "ti,lm36922";
		reg = <0x36>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_bl>;
		#address-cells = <1>;
		#size-cells = <0>;
		enable-gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
		vled-supply = <&reg_vsys_3v4>;
1346
		ti,brightness-mapping-exponential;
1347
1348
1349
1350
		ti,ovp-microvolt = <25000000>;

		led_backlight: led@0 {
			reg = <0>;
1351
			label = "white:backlight_cluster";
1352
1353
1354
1355
1356
1357
1358
1359
			linux,default-trigger = "backlight";
			led-max-microamp = <20000>;
		};
	};

	touchscreen@38 {
		compatible = "edt,edt-ft5506";
		reg = <0x38>;
1360
1361
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_touch>;
1362
1363
1364
1365
		interrupt-parent = <&gpio1>;
		interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
		touchscreen-size-x = <720>;
		touchscreen-size-y = <1440>;
1366
		vcc-supply = <&reg_lcd_1v8>;
1367
1368
1369
1370
1371
1372
1373
1374
1375
	};
};

&i2c4 {
	clock-frequency = <387000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c4>;
	status = "okay";

1376
1377
	/* Dongwoon DW9714A - Voice Coil Motor for 13MP Camera */
	vcm@c {
1378
		compatible = "dongwoon,dw9714";
1379
		reg = <0x0c>;
1380
		vcc-supply = <&reg_camera_pwr_en>;
1381
		status = "okay";
1382
1383
1384
	};

	/* Samsung S5K3L6XX - 13MP Rear-Facing Camera */
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
	camera_back: camera2@2d {
		compatible = "samsung,s5k3l6xx";
		reg = <0x2d>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi2>;
		clocks = <&clk IMX8MQ_CLK_CLKO2>;
		clock-names = "mclk";
		rstn-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
		//stdbyn-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
		/* analog power 2,8V */
		//vdda-supply = <&gpio1 0 GPIO_ACTIVE_LOW>;
		/* VDDD digital power 1,05V */
		//vddreg-supply
		/* I/O power supply 1,8V */
		vddio-supply = <&reg_camera_pwr_en>;
		status = "okay";
		port {
			camera2_ep: endpoint {
1403
				data-lanes = <1 2>;
1404
1405
1406
				remote-endpoint = <&mipi2_sensor_ep>;
			};
		};
1407
1408
	};

1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
	bat: fuel-gauge@36 {
		compatible = "maxim,max17055";
		reg = <0x36>;
		interrupt-parent = <&gpio3>;
		interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gauge>;
		maxim,over-heat-temp = <700>;
		maxim,over-volt = <4500>;
		maxim,rsns-microohm = <5000>;
1419
		maxim,termination-current = <160000>;
1420
		maxim,vchg-4V2;
1421
1422
1423
1424
1425
1426
	};

	bq25895: charger@6a {
		compatible = "ti,bq25895", "ti,bq25890";
		reg = <0x6a>;
		pinctrl-names = "default";
1427
		pinctrl-0 = <&pinctrl_charger_in>, <&pinctrl_otg>;
1428
1429
1430
		interrupt-parent = <&gpio3>;
		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
		phys = <&usb3_phy0>;
1431
1432
1433
		ti,battery-regulation-voltage = <4208000>; /* uV */
		ti,termination-current = <128000>;  /* uA */
		ti,precharge-current = <128000>; /* uA */
1434
1435
		ti,minimum-sys-voltage = <3700000>; /* uV */
		ti,boost-voltage = <5000000>; /* uV */
1436
		ti,boost-max-current = <1500000>; /* uA */
1437
1438
		ti,use-vinmin-threshold = <1>; /* enable VINDPM */
		ti,vinmin-threshold = <3900000>; /* uV */
1439
		ti,auto_dpdm_disable;
1440
		monitored-battery = <&bat>;
1441
		power-supplies = <&typec_pd>;
1442
		otg-gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
1443
1444
1445
	};
};

1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
&lcdif {
	status = "okay";
};

&mipi_dsi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	lcd_panel: panel@0 {
		compatible = "mantix,mlaf057we51-x";
		reg = <0>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsirst>;
		avdd-supply = <&reg_lcd_avdd>;
		avee-supply = <&reg_lcd_avee>;
		vddi-supply = <&reg_lcd_1v8>;
		backlight = <&backlight_dsi>;
		reset-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;

		port {
			panel_in: endpoint {
				remote-endpoint = <&mipi_dsi_out>;
			};
		};
	};

	ports {
		port@1 {
			reg = <1>;

			mipi_dsi_out: endpoint {
				remote-endpoint = <&panel_in>;
			};
		};
	};
};

1484
1485
1486
1487
&lcdif {
	status = "okay";
};

1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
&mipi_csi_1 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	port {
		#address-cells = <1>;
		#size-cells = <0>;
		mipi1_sensor_ep: endpoint@1 {
			reg = <1>;
			remote-endpoint = <&camera1_ep>;
1499
			data-lanes = <1 2>;
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
		};

		csi1_mipi_ep: endpoint@2 {
			reg = <2>;
			remote-endpoint = <&csi1_ep>;
		};
	};
};

&mipi_csi_2 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	port {
		#address-cells = <1>;
		#size-cells = <0>;
		mipi2_sensor_ep: endpoint@1 {
			reg = <1>;
			remote-endpoint = <&camera2_ep>;
1520
			data-lanes = <1 2>;
1521
1522
1523
1524
1525
1526
1527
1528
1529
		};

		csi2_mipi_ep: endpoint@2 {
			reg = <2>;
			remote-endpoint = <&csi2_ep>;
		};
	};
};

1530
1531
1532
1533
1534
1535
&mipi_dsi {
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;
	fsl,clock-drop-level = <1>;

1536
	lcd_panel: panel@0 {
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
		compatible = "mantix,mlaf057we51-x";
		reg = <0>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsirst>;
		avdd-supply = <&reg_lcd_avdd>;
		avee-supply = <&reg_lcd_avee>;
		vddi-supply = <&reg_lcd_1v8>;
		backlight = <&backlight_dsi>;
		reset-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
		mantix,tp-rstn-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
		port {
			panel_in: endpoint {
				remote-endpoint = <&mipi_dsi_out>;
			};
		};
	};

	ports {
		port@1 {
			reg = <1>;
			mipi_dsi_out: endpoint {
				remote-endpoint = <&panel_in>;
			};
		};
	};
};

1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
&pgc_gpu {
	power-supply = <&buck3_reg>;
};

&pgc_mipi {
	power-supply = <&ldo5_reg>;
};

&pgc_vpu {
	power-supply = <&buck4_reg>;
};

&pwm1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_haptic>;
	status = "okay";
};

&pwm2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_led_b>;
	status = "okay";
};

&pwm3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_led_g>;
	status = "okay";
};

&pwm4 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_led_r>;
	status = "okay";
};

&sai2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai2>;
	assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	status = "okay";
};

&sai6 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai6>;
	assigned-clocks = <&clk IMX8MQ_CLK_SAI6>;
	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	fsl,sai-synchronous-rx;
	status = "okay";
};

&snvs_pwrkey {
	status = "okay";
};

&snvs_rtc {
	status = "disabled";
};

&uart1 { /* console */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	status = "okay";
};

&uart2 { /* TPS - GPS - DEBUG */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart2>;
	status = "okay";

	gnss {
		compatible = "globaltop,pa6h";
		vcc-supply = <&reg_gnss>;
		current-speed = <9600>;
	};
};

&uart3 { /* SMC */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart3>;
	status = "okay";
};

&uart4 { /* BT */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart4>;
	uart-has-rtscts;
	status = "okay";
};

&usb3_phy0 {
	status = "okay";
};

&usb3_phy1 {
	vbus-supply = <&reg_hub>;
	status = "okay";
};

&usb_dwc3_0 {
	#address-cells = <1>;
	#size-cells = <0>;
	dr_mode = "otg";
	snps,dis_u3_susphy_quirk;
1672
1673
1674
1675
	hnp-disable;
	srp-disable;
	adp-disable;
	usb-role-switch;
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
	status = "okay";

	port@0 {
		reg = <0>;

		typec_hs: endpoint {
			remote-endpoint = <&usb_con_hs>;
		};
	};

	port@1 {
		reg = <1>;

		typec_ss: endpoint {
			remote-endpoint = <&usb_con_ss>;
		};
	};
};

&usb_dwc3_1 {
	dr_mode = "host";
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	/* Microchip USB2642 */
	hub@1 {
		compatible = "usb424,2640";
		reg = <1>;
		#address-cells = <1>;
		#size-cells = <0>;

		mass-storage@1 {
			compatible = "usb424,4041";
			reg = <1>;
		};
	};
};

&usdhc1 {
1716
1717
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
	assigned-clock-rates = <400000000>;
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
	bus-width = <8>;
	vmmc-supply = <&reg_vdd_3v3>;
	power-supply = <&reg_vdd_1v8>;
	non-removable;
	status = "okay";
};

&usdhc2 {
1730
1731
	assigned-clocks = <&clk IMX8MQ_CLK_USDHC2>;
	assigned-clock-rates = <200000000>;
1732
1733
1734
1735
1736
1737
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2>;
	pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
	bus-width = <4>;
	vmmc-supply = <&reg_wifi_3v3>;
1738
	mmc-pwrseq = <&usdhc2_pwrseq>;
1739
	post-power-on-delay-ms = <1000>;
1740
	max-frequency = <50000000>;
1741
	broken-cd;
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
	disable-wp;
	cap-sdio-irq;
	keep-power-in-suspend;
	wakeup-source;
	status = "okay";
};

&wdog1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdog>;
	fsl,ext-reset-output;
	status = "okay";
};