xref: /linux/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts (revision eaa744b1c101a33fba5978866defc8a7e87f8d79)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Lenovo Yoga C630
4 *
5 * Copyright (c) 2019, Linaro Ltd.
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/gpio-keys.h>
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
14#include <dt-bindings/sound/qcom,q6afe.h>
15#include <dt-bindings/sound/qcom,q6asm.h>
16#include "sdm850.dtsi"
17#include "pm8998.dtsi"
18
19/ {
20	model = "Lenovo Yoga C630";
21	compatible = "lenovo,yoga-c630", "qcom,sdm845";
22	chassis-type = "convertible";
23
24	aliases {
25		hsuart0 = &uart6;
26	};
27
28	gpio-keys {
29		compatible = "gpio-keys";
30
31		pinctrl-names = "default";
32		pinctrl-0 = <&lid_pin_active>, <&mode_pin_active>;
33
34		lid {
35			gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>;
36			linux,input-type = <EV_SW>;
37			linux,code = <SW_LID>;
38			wakeup-source;
39			wakeup-event-action = <EV_ACT_DEASSERTED>;
40		};
41
42		mode {
43			gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
44			linux,input-type = <EV_SW>;
45			linux,code = <SW_TABLET_MODE>;
46		};
47	};
48
49	panel {
50		compatible = "boe,nv133fhm-n61";
51		no-hpd;
52
53		ports {
54			port {
55				panel_in_edp: endpoint {
56					remote-endpoint = <&sn65dsi86_out>;
57				};
58			};
59		};
60	};
61
62	sn65dsi86_refclk: sn65dsi86-refclk {
63		compatible = "fixed-clock";
64		#clock-cells = <0>;
65
66		clock-frequency = <19200000>;
67	};
68};
69
70&adsp_pas {
71	firmware-name = "qcom/LENOVO/81JL/qcadsp850.mbn";
72	status = "okay";
73};
74
75&apps_rsc {
76	pm8998-rpmh-regulators {
77		compatible = "qcom,pm8998-rpmh-regulators";
78		qcom,pmic-id = "a";
79
80		vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
81		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
82
83		vreg_s2a_1p125: smps2 {
84		};
85
86		vreg_s3a_1p35: smps3 {
87			regulator-min-microvolt = <1352000>;
88			regulator-max-microvolt = <1352000>;
89			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
90		};
91
92		vreg_s4a_1p8: smps4 {
93			regulator-min-microvolt = <1800000>;
94			regulator-max-microvolt = <1800000>;
95			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
96		};
97
98		vreg_s5a_2p04: smps5 {
99			regulator-min-microvolt = <2040000>;
100			regulator-max-microvolt = <2040000>;
101			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
102		};
103
104		vreg_s7a_1p025: smps7 {
105		};
106
107		vdd_qusb_hs0:
108		vdda_hp_pcie_core:
109		vdda_mipi_csi0_0p9:
110		vdda_mipi_csi1_0p9:
111		vdda_mipi_csi2_0p9:
112		vdda_mipi_dsi0_pll:
113		vdda_mipi_dsi1_pll:
114		vdda_qlink_lv:
115		vdda_qlink_lv_ck:
116		vdda_qrefs_0p875:
117		vdda_pcie_core:
118		vdda_pll_cc_ebi01:
119		vdda_pll_cc_ebi23:
120		vdda_sp_sensor:
121		vdda_ufs1_core:
122		vdda_ufs2_core:
123		vdda_usb1_ss_core:
124		vdda_usb2_ss_core:
125		vreg_l1a_0p875: ldo1 {
126			regulator-min-microvolt = <880000>;
127			regulator-max-microvolt = <880000>;
128			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
129		};
130
131		vddpx_10:
132		vreg_l2a_1p2: ldo2 {
133			regulator-min-microvolt = <1200000>;
134			regulator-max-microvolt = <1200000>;
135			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
136			regulator-always-on;
137		};
138
139		vreg_l3a_1p0: ldo3 {
140		};
141
142		vdd_wcss_cx:
143		vdd_wcss_mx:
144		vdda_wcss_pll:
145		vreg_l5a_0p8: ldo5 {
146			regulator-min-microvolt = <800000>;
147			regulator-max-microvolt = <800000>;
148			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
149		};
150
151		vddpx_13:
152		vreg_l6a_1p8: ldo6 {
153			regulator-min-microvolt = <1800000>;
154			regulator-max-microvolt = <1800000>;
155			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
156		};
157
158		vreg_l7a_1p8: ldo7 {
159			regulator-min-microvolt = <1800000>;
160			regulator-max-microvolt = <1800000>;
161			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
162		};
163
164		vreg_l8a_1p2: ldo8 {
165		};
166
167		vreg_l9a_1p8: ldo9 {
168		};
169
170		vreg_l10a_1p8: ldo10 {
171		};
172
173		vreg_l11a_1p0: ldo11 {
174		};
175
176		vdd_qfprom:
177		vdd_qfprom_sp:
178		vdda_apc1_cs_1p8:
179		vdda_gfx_cs_1p8:
180		vdda_qrefs_1p8:
181		vdda_qusb_hs0_1p8:
182		vddpx_11:
183		vreg_l12a_1p8: ldo12 {
184			regulator-min-microvolt = <1800000>;
185			regulator-max-microvolt = <1800000>;
186			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
187		};
188
189		vddpx_2:
190		vreg_l13a_2p95: ldo13 {
191		};
192
193		vreg_l14a_1p88: ldo14 {
194			regulator-min-microvolt = <1880000>;
195			regulator-max-microvolt = <1880000>;
196			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
197			regulator-always-on;
198		};
199
200		vreg_l15a_1p8: ldo15 {
201		};
202
203		vreg_l16a_2p7: ldo16 {
204		};
205
206		vreg_l17a_1p3: ldo17 {
207			regulator-min-microvolt = <1304000>;
208			regulator-max-microvolt = <1304000>;
209			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
210		};
211
212		vreg_l18a_2p7: ldo18 {
213		};
214
215		vreg_l19a_3p0: ldo19 {
216			regulator-min-microvolt = <3100000>;
217			regulator-max-microvolt = <3108000>;
218			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
219		};
220
221		vreg_l20a_2p95: ldo20 {
222			regulator-min-microvolt = <2960000>;
223			regulator-max-microvolt = <2960000>;
224			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
225		};
226
227		vreg_l21a_2p95: ldo21 {
228		};
229
230		vreg_l22a_2p85: ldo22 {
231		};
232
233		vreg_l23a_3p3: ldo23 {
234			regulator-min-microvolt = <3300000>;
235			regulator-max-microvolt = <3312000>;
236			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
237		};
238
239		vdda_qusb_hs0_3p1:
240		vreg_l24a_3p075: ldo24 {
241			regulator-min-microvolt = <3075000>;
242			regulator-max-microvolt = <3083000>;
243			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
244		};
245
246		vreg_l25a_3p3: ldo25 {
247			regulator-min-microvolt = <3104000>;
248			regulator-max-microvolt = <3112000>;
249			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
250		};
251
252		vdda_hp_pcie_1p2:
253		vdda_hv_ebi0:
254		vdda_hv_ebi1:
255		vdda_hv_ebi2:
256		vdda_hv_ebi3:
257		vdda_mipi_csi_1p25:
258		vdda_mipi_dsi0_1p2:
259		vdda_mipi_dsi1_1p2:
260		vdda_pcie_1p2:
261		vdda_ufs1_1p2:
262		vdda_ufs2_1p2:
263		vdda_usb1_ss_1p2:
264		vdda_usb2_ss_1p2:
265		vreg_l26a_1p2: ldo26 {
266			regulator-min-microvolt = <1200000>;
267			regulator-max-microvolt = <1208000>;
268			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
269		};
270
271		vreg_l28a_3p0: ldo28 {
272		};
273
274		vreg_lvs1a_1p8: lvs1 {
275		};
276
277		vreg_lvs2a_1p8: lvs2 {
278		};
279	};
280};
281
282&cdsp_pas {
283	firmware-name = "qcom/LENOVO/81JL/qccdsp850.mbn";
284	status = "okay";
285};
286
287&dsi0 {
288	status = "okay";
289	vdda-supply = <&vreg_l26a_1p2>;
290
291	ports {
292		port@1 {
293			endpoint {
294				remote-endpoint = <&sn65dsi86_in_a>;
295				data-lanes = <0 1 2 3>;
296			};
297		};
298	};
299};
300
301&dsi0_phy {
302	status = "okay";
303	vdds-supply = <&vreg_l1a_0p875>;
304};
305
306&gcc {
307	protected-clocks = <GCC_QSPI_CORE_CLK>,
308			   <GCC_QSPI_CORE_CLK_SRC>,
309			   <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
310			   <GCC_LPASS_Q6_AXI_CLK>,
311			   <GCC_LPASS_SWAY_CLK>;
312};
313
314&gpu {
315	zap-shader {
316		memory-region = <&gpu_mem>;
317		firmware-name = "qcom/LENOVO/81JL/qcdxkmsuc850.mbn";
318	};
319};
320
321&i2c1 {
322	status = "okay";
323	clock-frequency = <400000>;
324};
325
326&i2c3 {
327	status = "okay";
328	clock-frequency = <400000>;
329	/* Overwrite pinctrl-0 from sdm845.dtsi */
330	pinctrl-0 = <&qup_i2c3_default &i2c3_hid_active>;
331
332	tsel: hid@15 {
333		compatible = "hid-over-i2c";
334		reg = <0x15>;
335		hid-descr-addr = <0x1>;
336
337		interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
338	};
339
340	tsc2: hid@2c {
341		compatible = "hid-over-i2c";
342		reg = <0x2c>;
343		hid-descr-addr = <0x20>;
344
345		interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
346	};
347};
348
349&i2c5 {
350	status = "okay";
351	clock-frequency = <400000>;
352
353	tsc1: hid@10 {
354		compatible = "hid-over-i2c";
355		reg = <0x10>;
356		hid-descr-addr = <0x1>;
357
358		interrupts-extended = <&tlmm 125 IRQ_TYPE_LEVEL_LOW>;
359
360		pinctrl-names = "default";
361		pinctrl-0 = <&i2c5_hid_active>;
362	};
363};
364
365&i2c10 {
366	status = "okay";
367	clock-frequency = <400000>;
368
369	sn65dsi86: bridge@2c {
370		compatible = "ti,sn65dsi86";
371		reg = <0x2c>;
372		pinctrl-names = "default";
373		pinctrl-0 = <&sn65dsi86_pin_active>;
374
375		enable-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
376
377		vpll-supply = <&vreg_l14a_1p88>;
378		vccio-supply = <&vreg_l14a_1p88>;
379
380		clocks = <&sn65dsi86_refclk>;
381		clock-names = "refclk";
382
383		no-hpd;
384
385		ports {
386			#address-cells = <1>;
387			#size-cells = <0>;
388
389			port@0 {
390				reg = <0>;
391				sn65dsi86_in_a: endpoint {
392					remote-endpoint = <&dsi0_out>;
393				};
394			};
395
396			port@1 {
397				reg = <1>;
398				sn65dsi86_out: endpoint {
399					remote-endpoint = <&panel_in_edp>;
400				};
401			};
402		};
403	};
404};
405
406&i2c11 {
407	status = "okay";
408	clock-frequency = <400000>;
409
410	ecsh: hid@5c {
411		compatible = "hid-over-i2c";
412		reg = <0x5c>;
413		hid-descr-addr = <0x1>;
414
415		interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>;
416
417		pinctrl-names = "default";
418		pinctrl-0 = <&i2c11_hid_active>;
419	};
420};
421
422&ipa {
423	status = "okay";
424	memory-region = <&ipa_fw_mem>;
425};
426
427&mdss {
428	status = "okay";
429};
430
431&mdss_mdp {
432	status = "okay";
433};
434
435&mss_pil {
436	firmware-name = "qcom/LENOVO/81JL/qcdsp1v2850.mbn", "qcom/LENOVO/81JL/qcdsp2850.mbn";
437};
438
439&qup_i2c10_default {
440	pinconf {
441		pins = "gpio55", "gpio56";
442		drive-strength = <2>;
443		bias-disable;
444	};
445};
446
447&qup_i2c12_default {
448	drive-strength = <2>;
449	bias-disable;
450};
451
452&qup_uart6_default {
453	pinmux {
454		 pins = "gpio45", "gpio46", "gpio47", "gpio48";
455		 function = "qup6";
456	};
457
458	cts {
459		pins = "gpio45";
460		bias-pull-down;
461	};
462
463	rts-tx {
464		pins = "gpio46", "gpio47";
465		drive-strength = <2>;
466		bias-disable;
467	};
468
469	rx {
470		pins = "gpio48";
471		bias-pull-up;
472	};
473};
474
475&qupv3_id_0 {
476	status = "okay";
477};
478
479&qupv3_id_1 {
480	status = "okay";
481};
482
483&q6asmdai {
484	dai@0 {
485		reg = <0>;
486	};
487
488	dai@1 {
489		reg = <1>;
490	};
491};
492
493&sound {
494	compatible = "qcom,db845c-sndcard";
495	model = "Lenovo-YOGA-C630-13Q50";
496
497	audio-routing =
498		"RX_BIAS", "MCLK",
499		"AMIC2", "MIC BIAS2",
500		"SpkrLeft IN", "SPK1 OUT",
501		"SpkrRight IN", "SPK2 OUT",
502		"MM_DL1",  "MultiMedia1 Playback",
503		"MultiMedia2 Capture", "MM_UL2";
504
505	mm1-dai-link {
506		link-name = "MultiMedia1";
507		cpu {
508			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
509		};
510	};
511
512	mm2-dai-link {
513		link-name = "MultiMedia2";
514		cpu {
515			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
516		};
517	};
518
519	slim-dai-link {
520		link-name = "SLIM Playback";
521		cpu {
522			sound-dai = <&q6afedai SLIMBUS_0_RX>;
523		};
524
525		platform {
526			sound-dai = <&q6routing>;
527		};
528
529		codec {
530			sound-dai =  <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
531		};
532	};
533
534	slimcap-dai-link {
535		link-name = "SLIM Capture";
536		cpu {
537			sound-dai = <&q6afedai SLIMBUS_0_TX>;
538		};
539
540		platform {
541			sound-dai = <&q6routing>;
542		};
543
544		codec {
545			sound-dai = <&wcd9340 1>;
546		};
547	};
548};
549
550&tlmm {
551	gpio-reserved-ranges = <0 4>, <81 4>;
552
553	sn65dsi86_pin_active: sn65dsi86-enable {
554		pins = "gpio96";
555		drive-strength = <2>;
556		bias-disable;
557	};
558
559	i2c3_hid_active: i2c2-hid-active {
560		pins = "gpio37";
561		function = "gpio";
562
563		input-enable;
564		bias-pull-up;
565		drive-strength = <2>;
566	};
567
568	i2c5_hid_active: i2c5-hid-active {
569		pins = "gpio125";
570		function = "gpio";
571
572		input-enable;
573		bias-pull-up;
574		drive-strength = <2>;
575	};
576
577	i2c11_hid_active: i2c11-hid-active {
578		pins = "gpio92";
579		function = "gpio";
580
581		input-enable;
582		bias-pull-up;
583		drive-strength = <2>;
584	};
585
586	wcd_intr_default: wcd_intr_default {
587		pins = "gpio54";
588		function = "gpio";
589
590		input-enable;
591		bias-pull-down;
592		drive-strength = <2>;
593	};
594
595	lid_pin_active: lid-pin {
596		pins = "gpio124";
597		function = "gpio";
598
599		input-enable;
600		bias-disable;
601	};
602
603	mode_pin_active: mode-pin {
604		pins = "gpio95";
605		function = "gpio";
606
607		input-enable;
608		bias-disable;
609	};
610};
611
612&uart6 {
613	status = "okay";
614
615	bluetooth {
616		compatible = "qcom,wcn3990-bt";
617
618		vddio-supply = <&vreg_s4a_1p8>;
619		vddxo-supply = <&vreg_l7a_1p8>;
620		vddrf-supply = <&vreg_l17a_1p3>;
621		vddch0-supply = <&vreg_l25a_3p3>;
622		vddch1-supply = <&vreg_l23a_3p3>;
623		max-speed = <3200000>;
624	};
625};
626
627&ufs_mem_hc {
628	status = "okay";
629
630	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
631
632	vcc-supply = <&vreg_l20a_2p95>;
633	vcc-max-microamp = <600000>;
634};
635
636&ufs_mem_phy {
637	status = "okay";
638
639	vdda-phy-supply = <&vdda_ufs1_core>;
640	vdda-pll-supply = <&vdda_ufs1_1p2>;
641};
642
643&usb_1 {
644	status = "okay";
645};
646
647&usb_1_dwc3 {
648	dr_mode = "host";
649};
650
651&usb_1_hsphy {
652	status = "okay";
653
654	vdd-supply = <&vdda_usb1_ss_core>;
655	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
656	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
657
658	qcom,imp-res-offset-value = <8>;
659	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
660	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
661	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
662};
663
664&usb_1_qmpphy {
665	status = "okay";
666
667	vdda-phy-supply = <&vdda_usb1_ss_1p2>;
668	vdda-pll-supply = <&vdda_usb1_ss_core>;
669};
670
671&usb_2 {
672	status = "okay";
673};
674
675&usb_2_dwc3 {
676	dr_mode = "host";
677};
678
679&usb_2_hsphy {
680	status = "okay";
681
682	vdd-supply = <&vdda_usb2_ss_core>;
683	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
684	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
685
686	qcom,imp-res-offset-value = <8>;
687	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
688};
689
690&usb_2_qmpphy {
691	status = "okay";
692
693	vdda-phy-supply = <&vdda_usb2_ss_1p2>;
694	vdda-pll-supply = <&vdda_usb2_ss_core>;
695};
696
697&wcd9340{
698	pinctrl-0 = <&wcd_intr_default>;
699	pinctrl-names = "default";
700	clock-names = "extclk";
701	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
702	reset-gpios = <&tlmm 64 0>;
703	vdd-buck-supply = <&vreg_s4a_1p8>;
704	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
705	vdd-tx-supply = <&vreg_s4a_1p8>;
706	vdd-rx-supply = <&vreg_s4a_1p8>;
707	vdd-io-supply = <&vreg_s4a_1p8>;
708
709	swm: swm@c85 {
710		left_spkr: wsa8810-left{
711			compatible = "sdw10217211000";
712			reg = <0 3>;
713			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
714			#thermal-sensor-cells = <0>;
715			sound-name-prefix = "SpkrLeft";
716			#sound-dai-cells = <0>;
717		};
718
719		right_spkr: wsa8810-right{
720			compatible = "sdw10217211000";
721			powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>;
722			reg = <0 4>;
723			#thermal-sensor-cells = <0>;
724			sound-name-prefix = "SpkrRight";
725			#sound-dai-cells = <0>;
726		};
727	};
728};
729
730&wifi {
731	status = "okay";
732
733	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
734	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
735	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
736	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
737	vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
738
739	qcom,snoc-host-cap-8bit-quirk;
740};
741