summaryrefslogtreecommitdiffstats
path: root/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
blob: 5846a11f0e848fc059446a47b57ff732b45e9f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
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
351
352
353
354
355
356
357
358
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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
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
697
698
699
700
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
736
737
738
739
740
741
742
743
744
745
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
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
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
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Google Gru-scarlet board device tree source
 *
 * Copyright 2018 Google, Inc
 */

#include "rk3399-gru.dtsi"

/{
	chassis-type = "tablet";

	/* Power tree */

	/* ppvar_sys children, sorted by name */
	pp1250_s3: pp1250-s3 {
		compatible = "regulator-fixed";
		regulator-name = "pp1250_s3";

		/* EC turns on w/ pp1250_s3_en; always on for AP */
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <1250000>;
		regulator-max-microvolt = <1250000>;

		vin-supply = <&ppvar_sys>;
	};

	pp1250_cam: pp1250-dvdd {
		compatible = "regulator-fixed";
		regulator-name = "pp1250_dvdd";
		pinctrl-names = "default";
		pinctrl-0 = <&pp1250_cam_en>;

		enable-active-high;
		gpio = <&gpio2 4 GPIO_ACTIVE_HIGH>;

		/* 740us delay from gpio output high to pp1250 stable,
		 * rounding up to 1ms for safety.
		 */
		startup-delay-us = <1000>;
		vin-supply = <&pp1250_s3>;
	};

	pp900_s0: pp900-s0 {
		compatible = "regulator-fixed";
		regulator-name = "pp900_s0";

		/* EC turns on w/ pp900_s0_en; always on for AP */
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <900000>;
		regulator-max-microvolt = <900000>;

		vin-supply = <&ppvar_sys>;
	};

	ppvarn_lcd: ppvarn-lcd {
		compatible = "regulator-fixed";
		regulator-name = "ppvarn_lcd";
		pinctrl-names = "default";
		pinctrl-0 = <&ppvarn_lcd_en>;

		enable-active-high;
		gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
		vin-supply = <&ppvar_sys>;
	};

	ppvarp_lcd: ppvarp-lcd {
		compatible = "regulator-fixed";
		regulator-name = "ppvarp_lcd";
		pinctrl-names = "default";
		pinctrl-0 = <&ppvarp_lcd_en>;

		enable-active-high;
		gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>;
		vin-supply = <&ppvar_sys>;
	};

	/* pp1800 children, sorted by name */
	pp900_s3: pp900-s3 {
		compatible = "regulator-fixed";
		regulator-name = "pp900_s3";

		/* EC turns on w/ pp900_s3_en; always on for AP */
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <900000>;
		regulator-max-microvolt = <900000>;

		vin-supply = <&pp1800>;
	};

	/* EC turns on pp1800_s3_en */
	pp1800_s3: pp1800 {
	};

	/* pp3300 children, sorted by name */
	pp2800_cam: pp2800-avdd {
		compatible = "regulator-fixed";
		regulator-name = "pp2800_avdd";
		pinctrl-names = "default";
		pinctrl-0 = <&pp2800_cam_en>;

		enable-active-high;
		gpio = <&gpio2 24 GPIO_ACTIVE_HIGH>;
		startup-delay-us = <100>;
		vin-supply = <&pp3300>;
	};

	/* EC turns on pp3300_s0_en */
	pp3300_s0: pp3300 {
	};

	/* EC turns on pp3300_s3_en */
	pp3300_s3: pp3300 {
	};

	/*
	 * See b/66922012
	 *
	 * This is a hack to make sure the Bluetooth part of the QCA6174A
	 * is reset at boot by toggling BT_EN. At boot BT_EN is first set
	 * to low when the bt_3v3 regulator is registered (in disabled
	 * state). The fake regulator is configured as a supply of the
	 * wlan_3v3 regulator below. When wlan_3v3 is enabled early in
	 * the boot process it also enables its supply regulator bt_3v3,
	 * which changes BT_EN to high.
	 */
	bt_3v3: bt-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "bt_3v3";
		pinctrl-names = "default";
		pinctrl-0 = <&bt_en_1v8_l>;

		enable-active-high;
		gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
		vin-supply = <&pp3300_s3>;
	};

	wlan_3v3: wlan-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "wlan_3v3";
		pinctrl-names = "default";
		pinctrl-0 = <&wlan_pd_1v8_l>;

		/*
		 * The WL_EN pin is driven low when the regulator is
		 * registered, and transitions to high when the PCIe bus
		 * is powered up.
		 */
		enable-active-high;
		gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;

		/*
		 * Require minimum 10ms from power-on (e.g., PD#) to init PCIe.
		 * TODO (b/64444991): how long to assert PD#?
		 */
		regulator-enable-ramp-delay = <10000>;
		/* See bt_3v3 hack above */
		vin-supply = <&bt_3v3>;
	};

	backlight: backlight {
		compatible = "pwm-backlight";
		enable-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&bl_en>;
		pwms = <&pwm1 0 1000000 0>;
	};

	dmic: dmic {
		compatible = "dmic-codec";
		dmicen-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&dmic_en>;
		wakeup-delay-ms = <250>;
	};

	gpio_keys: gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pen_eject_odl>;

		switch-pen-insert {
			label = "Pen Insert";
			/* Insert = low, eject = high */
			gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
			linux,code = <SW_PEN_INSERTED>;
			linux,input-type = <EV_SW>;
			wakeup-source;
		};
	};
};

/* pp900_s0 aliases */
pp900_ddrpll_ap: &pp900_s0 {
};
pp900_pcie: &pp900_s0 {
};
pp900_usb: &pp900_s0 {
};

/* pp900_s3 aliases */
pp900_emmcpll: &pp900_s3 {
};

/* EC turns on; alias for pp1800_s0 */
pp1800_pcie: &pp1800_s0 {
};

/* On scarlet PPVAR(big_cpu, lit_cpu, gpu) need to adjust voltage ranges */
&ppvar_bigcpu {
	ctrl-voltage-range = <800074 1299226>;
	regulator-min-microvolt = <800074>;
	regulator-max-microvolt = <1299226>;
};

&ppvar_bigcpu_pwm {
	/* On scarlet ppvar big cpu use pwm3 */
	pwms = <&pwm3 0 3337 0>;
	regulator-min-microvolt = <800074>;
	regulator-max-microvolt = <1299226>;
};

&ppvar_litcpu {
	ctrl-voltage-range = <802122 1199620>;
	regulator-min-microvolt = <802122>;
	regulator-max-microvolt = <1199620>;
};

&ppvar_litcpu_pwm {
	regulator-min-microvolt = <802122>;
	regulator-max-microvolt = <1199620>;
};

&ppvar_gpu {
	ctrl-voltage-range = <799600 1099600>;
	regulator-min-microvolt = <799600>;
	regulator-max-microvolt = <1099600>;
};

&ppvar_gpu_pwm {
	regulator-min-microvolt = <799600>;
	regulator-max-microvolt = <1099600>;
};

&ppvar_sd_card_io {
	states = <1800000 0x0>, <3300000 0x1>;
	regulator-max-microvolt = <3300000>;
};

&pp3000_sd_slot {
	vin-supply = <&pp3300>;
};

ap_i2c_dig: &i2c2 {
	status = "okay";

	clock-frequency = <400000>;

	/* These are relatively safe rise/fall times. */
	i2c-scl-falling-time-ns = <50>;
	i2c-scl-rising-time-ns = <300>;

	digitizer: digitizer@9 {
		compatible = "hid-over-i2c";
		reg = <0x9>;
		interrupt-parent = <&gpio1>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
		hid-descr-addr = <0x1>;
		pinctrl-names = "default";
		pinctrl-0 = <&pen_int_odl &pen_reset_l>;
	};
};

&ap_i2c_ts {
	touchscreen: touchscreen@10 {
		compatible = "elan,ekth3500";
		reg = <0x10>;
		interrupt-parent = <&gpio1>;
		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&touch_int_l &touch_reset_l>;
		reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
	};
};

camera: &i2c7 {
	status = "okay";

	clock-frequency = <400000>;

	/* These are relatively safe rise/fall times; TODO: measure */
	i2c-scl-falling-time-ns = <50>;
	i2c-scl-rising-time-ns = <300>;

	/* 24M mclk is shared between world and user cameras */
	pinctrl-0 = <&i2c7_xfer &test_clkout1>;

	/* Rear-facing camera */
	wcam: camera@36 {
		compatible = "ovti,ov5695";
		reg = <0x36>;
		pinctrl-names = "default";
		pinctrl-0 = <&wcam_rst>;

		clocks = <&cru SCLK_TESTCLKOUT1>;
		clock-names = "xvclk";

		avdd-supply = <&pp2800_cam>;
		dvdd-supply = <&pp1250_cam>;
		dovdd-supply = <&pp1800_s0>;
		reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;

		port {
			wcam_out: endpoint {
				remote-endpoint = <&mipi_in_wcam>;
				data-lanes = <1 2>;
			};
		};
	};

	/* Front-facing camera */
	ucam: camera@3c {
		compatible = "ovti,ov2685";
		reg = <0x3c>;
		pinctrl-names = "default";
		pinctrl-0 = <&ucam_rst>;

		clocks = <&cru SCLK_TESTCLKOUT1>;
		clock-names = "xvclk";

		avdd-supply = <&pp2800_cam>;
		dovdd-supply = <&pp1800_s0>;
		dvdd-supply = <&pp1800_s0>;
		reset-gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;

		port {
			ucam_out: endpoint {
				remote-endpoint = <&mipi_in_ucam>;
				data-lanes = <1>;
			};
		};
	};
};

&cdn_dp {
	extcon = <&usbc_extcon0>;
	phys = <&tcphy0_dp>;
};

&cpu_alert0 {
	temperature = <66000>;
};

&cpu_alert1 {
	temperature = <71000>;
};

&cros_ec {
	interrupt-parent = <&gpio1>;
	interrupts = <18 IRQ_TYPE_LEVEL_LOW>;
};

&cru {
	assigned-clocks =
		<&cru PLL_GPLL>, <&cru PLL_CPLL>,
		<&cru PLL_NPLL>,
		<&cru ACLK_PERIHP>, <&cru HCLK_PERIHP>,
		<&cru PCLK_PERIHP>,
		<&cru ACLK_PERILP0>, <&cru HCLK_PERILP0>,
		<&cru PCLK_PERILP0>, <&cru ACLK_CCI>,
		<&cru HCLK_PERILP1>, <&cru PCLK_PERILP1>,
		<&cru ACLK_VIO>,
		<&cru ACLK_GIC_PRE>,
		<&cru PCLK_DDR>,
		<&cru ACLK_HDCP>,
		<&cru ACLK_VDU>;
	assigned-clock-rates =
		<600000000>, <1600000000>,
		<1000000000>,
		<150000000>, <75000000>,
		<37500000>,
		<100000000>, <100000000>,
		<50000000>, <800000000>,
		<100000000>, <50000000>,
		<400000000>,
		<200000000>,
		<200000000>,
		<400000000>,
		<400000000>;
};

/* The center supply is fixed to .9V on scarlet */
&dmc {
	center-supply = <&pp900_s0>;
};

/* We don't need .925 V for 928 MHz on scarlet */
&dmc_opp_table {
	opp03 {
		opp-microvolt = <900000>;
	};
};

&gpio0 {
	gpio-line-names = /* GPIO0 A 0-7 */
			  "CLK_32K_AP",
			  "EC_IN_RW_OD",
			  "SPK_PA_EN",
			  "WLAN_PERST_1V8_L",
			  "WLAN_PD_1V8_L",
			  "WLAN_RF_KILL_1V8_L",
			  "BIGCPU_DVS_PWM",
			  "SD_CD_L_JTAG_EN",

			  /* GPIO0 B 0-5 */
			  "BT_EN_BT_RF_KILL_1V8_L",
			  "PMUIO2_33_18_L_PP3300_S0_EN",
			  "TOUCH_RESET_L",
			  "AP_EC_WARM_RESET_REQ",
			  "PEN_RESET_L",
			  /*
			   * AP_FLASH_WP_L is crossystem ABI. Schematics call
			   * it AP_FLASH_WP_R_ODL.
			   */
			  "AP_FLASH_WP_L";
};

&gpio1 {
	gpio-line-names = /* GPIO1 A 0-7 */
			  "PEN_INT_ODL",
			  "PEN_EJECT_ODL",
			  "BT_HOST_WAKE_1V8_L",
			  "WLAN_HOST_WAKE_1V8_L",
			  "TOUCH_INT_ODL",
			  "AP_EC_S3_S0_L",
			  "AP_EC_OVERTEMP",
			  "AP_SPI_FLASH_MISO",

			  /* GPIO1 B 0-7 */
			  "AP_SPI_FLASH_MOSI_R",
			  "AP_SPI_FLASH_CLK_R",
			  "AP_SPI_FLASH_CS_L_R",
			  "SD_CARD_DET_ODL",
			  "",
			  "AP_EXPANSION_IO1",
			  "AP_EXPANSION_IO2",
			  "AP_I2C_DISP_SDA",

			  /* GPIO1 C 0-7 */
			  "AP_I2C_DISP_SCL",
			  "H1_INT_ODL",
			  "EC_AP_INT_ODL",
			  "LITCPU_DVS_PWM",
			  "AP_I2C_AUDIO_SDA",
			  "AP_I2C_AUDIO_SCL",
			  "AP_EXPANSION_IO3",
			  "HEADSET_INT_ODL",

			  /* GPIO1 D0 */
			  "AP_EXPANSION_IO4";
};

&gpio2 {
	gpio-line-names = /* GPIO2 A 0-7 */
			  "AP_I2C_PEN_SDA",
			  "AP_I2C_PEN_SCL",
			  "SD_IO_PWR_EN",
			  "UCAM_RST_L",
			  "PP1250_CAM_EN",
			  "WCAM_RST_L",
			  "AP_EXPANSION_IO5",
			  "AP_I2C_CAM_SDA",

			  /* GPIO2 B 0-7 */
			  "AP_I2C_CAM_SCL",
			  "AP_H1_SPI_MISO",
			  "AP_H1_SPI_MOSI",
			  "AP_H1_SPI_CLK",
			  "AP_H1_SPI_CS_L",
			  "",
			  "",
			  "",

			  /* GPIO2 C 0-7 */
			  "UART_EXPANSION_TX_AP_RX",
			  "UART_AP_TX_EXPANSION_RX",
			  "UART_EXPANSION_RTS_AP_CTS",
			  "UART_AP_RTS_EXPANSION_CTS",
			  "AP_SPI_EC_MISO",
			  "AP_SPI_EC_MOSI",
			  "AP_SPI_EC_CLK",
			  "AP_SPI_EC_CS_L",

			  /* GPIO2 D 0-4 */
			  "PP2800_CAM_EN",
			  "CLK_24M_CAM",
			  "WLAN_PCIE_CLKREQ_1V8_L",
			  "",
			  "SD_PWR_3000_1800_L";
};

&gpio3 {
	gpio-line-names = /* GPIO3 A 0-7 */
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",

			  /* GPIO3 B 0-7 */
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",

			  /* GPIO3 C 0-7 */
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",

			  /* GPIO3 D 0-7 */
			  "I2S0_SCLK",
			  "I2S0_LRCK_RX",
			  "I2S0_LRCK_TX",
			  "I2S0_SDI_0",
			  "STRAP_LCDBIAS_L",
			  "STRAP_FEATURE_1",
			  "STRAP_FEATURE_2",
			  "I2S0_SDO_0";
};

&gpio4 {
	gpio-line-names = /* GPIO4 A 0-7 */
			  "I2S_MCLK",
			  "AP_I2C_EXPANSION_SDA",
			  "AP_I2C_EXPANSION_SCL",
			  "DMIC_EN",
			  "",
			  "",
			  "",
			  "",

			  /* GPIO4 B 0-7 */
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",

			  /* GPIO4 C 0-7 */
			  "AP_I2C_TS_SDA",
			  "AP_I2C_TS_SCL",
			  "GPU_DVS_PWM",
			  "UART_DBG_TX_AP_RX",
			  "UART_AP_TX_DBG_RX",
			  "BL_EN",
			  "BL_PWM",
			  "",

			  /* GPIO4 D 0-5 */
			  "",
			  "DISPLAY_RST_L",
			  "",
			  "PPVARP_LCD_EN",
			  "PPVARN_LCD_EN",
			  "SD_SLOT_PWR_EN";
};

&i2c_tunnel {
	google,remote-bus = <0>;
};

&io_domains {
	bt656-supply = <&pp1800_s0>;		/* APIO2_VDD;  2a 2b */
	audio-supply = <&pp1800_s0>;		/* APIO5_VDD;  3d 4a */
	gpio1830-supply = <&pp1800_s0>;		/* APIO4_VDD;  4c 4d */
};

&isp0 {
	status = "okay";

	ports {
		port@0 {
			mipi_in_wcam: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&wcam_out>;
				data-lanes = <1 2>;
			};

			mipi_in_ucam: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&ucam_out>;
				data-lanes = <1>;
			};
		};
	};
};

&isp0_mmu {
	status = "okay";
};

&max98357a {
	sdmode-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
};

&mipi_dphy_rx0 {
	status = "okay";
};

&mipi_dsi {
	status = "okay";
	clock-master;

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

			mipi_out_panel: endpoint {
				remote-endpoint = <&mipi_in_panel>;
			};
		};
	};

	mipi_panel: panel@0 {
		/* 2 different panels are used, compatibles are in dts files */
		reg = <0>;
		backlight = <&backlight>;
		enable-gpios = <&gpio4 25 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&display_rst_l>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				mipi_in_panel: endpoint {
					remote-endpoint = <&mipi_out_panel>;
				};
			};

			port@1 {
				reg = <1>;

				mipi1_in_panel: endpoint@1 {
					remote-endpoint = <&mipi1_out_panel>;
				};
			};
		};
	};
};

&mipi_dsi1 {
	status = "okay";

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

			mipi1_out_panel: endpoint {
				remote-endpoint = <&mipi1_in_panel>;
			};
		};
	};
};

&pcie0 {
	ep-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;

	/* PERST# asserted in S3 */
	pcie-reset-suspend = <1>;

	vpcie3v3-supply = <&wlan_3v3>;
	vpcie1v8-supply = <&pp1800_pcie>;
};

&sdmmc {
	cd-gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
};

&sound {
	rockchip,codec = <&max98357a &dmic &codec &cdn_dp>;
};

&spi2 {
	status = "okay";

	tpm@0 {
		compatible = "google,cr50";
		reg = <0>;
		interrupt-parent = <&gpio1>;
		interrupts = <17 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&h1_int_od_l>;
		spi-max-frequency = <800000>;
	};
};

&usb_host0_ohci {
	#address-cells = <1>;
	#size-cells = <0>;

	qca_bt: bluetooth@1 {
		compatible = "usbcf3,e300", "usb4ca,301a";
		reg = <1>;
		pinctrl-names = "default";
		pinctrl-0 = <&bt_host_wake_l>;
		interrupt-parent = <&gpio1>;
		interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-names = "wakeup";
	};
};

/* PINCTRL OVERRIDES */
&ap_fw_wp {
	rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
};

&bl_en {
	rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
};

&bt_host_wake_l {
	rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
};

&ec_ap_int_l {
	rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
};

&headset_int_l {
	rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
};

&i2s0_8ch_bus {
	rockchip,pins =
		<3 RK_PD0 1 &pcfg_pull_none_6ma>,
		<3 RK_PD1 1 &pcfg_pull_none_6ma>,
		<3 RK_PD2 1 &pcfg_pull_none_6ma>,
		<3 RK_PD3 1 &pcfg_pull_none_6ma>,
		<3 RK_PD7 1 &pcfg_pull_none_6ma>,
		<4 RK_PA0 1 &pcfg_pull_none_6ma>;
};

&i2s0_8ch_bus_bclk_off {
	rockchip,pins =
		<3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none_6ma>,
		<3 RK_PD1 1 &pcfg_pull_none_6ma>,
		<3 RK_PD2 1 &pcfg_pull_none_6ma>,
		<3 RK_PD3 1 &pcfg_pull_none_6ma>,
		<3 RK_PD7 1 &pcfg_pull_none_6ma>,
		<4 RK_PA0 1 &pcfg_pull_none_6ma>;
};

/* there is no external pull up, so need to set this pin pull up */
&sdmmc_cd_pin {
	rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>;
};

&sd_pwr_1800_sel {
	rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
};

&sdmode_en {
	rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_down>;
};

&touch_reset_l {
	rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>;
};

&touch_int_l {
	rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
};

&pinctrl {
	pinctrl-0 = <
		&ap_pwroff	/* AP will auto-assert this when in S3 */
		&clk_32k	/* This pin is always 32k on gru boards */
		&wlan_rf_kill_1v8_l
	>;

	pcfg_pull_none_6ma: pcfg-pull-none-6ma {
		bias-disable;
		drive-strength = <6>;
	};

	camera {
		pp1250_cam_en: pp1250-dvdd {
			rockchip,pins = <2 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		pp2800_cam_en: pp2800-avdd {
			rockchip,pins = <2 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		ucam_rst: ucam_rst {
			rockchip,pins = <2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		wcam_rst: wcam_rst {
			rockchip,pins = <2 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	digitizer {
		pen_int_odl: pen-int-odl {
			rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		pen_reset_l: pen-reset-l {
			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	discrete-regulators {
		display_rst_l: display-rst-l {
			rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_down>;
		};

		ppvarp_lcd_en: ppvarp-lcd-en {
			rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		ppvarn_lcd_en: ppvarn-lcd-en {
			rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	dmic {
		dmic_en: dmic-en {
			rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	pen {
		pen_eject_odl: pen-eject-odl {
			rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	tpm {
		h1_int_od_l: h1-int-od-l {
			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};
};

&wifi {
	bt_en_1v8_l: bt-en-1v8-l {
		rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
	};

	wlan_pd_1v8_l: wlan-pd-1v8-l {
		rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
	};

	/* Default pull-up, but just to be clear */
	wlan_rf_kill_1v8_l: wlan-rf-kill-1v8-l {
		rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
	};

	wifi_perst_l: wifi-perst-l {
		rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
	};

	wlan_host_wake_l: wlan-host-wake-l {
		rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
	};
};