Skip to content

Commit 0b6d8f9

Browse files
right-0903ij-intel
authored andcommitted
arm64: dts: qcom: gaokun3: Add Embedded Controller node
The Embedded Controller in the Huawei Matebook E Go is accessible on &i2c15 and provides battery and adapter status, port orientation status, as well as HPD event notifications for two USB Type-C port, etc. Add the EC to the device tree and describe the relationship among the type-c connectors, role switches, orientation switches and the QMP combo PHY. Signed-off-by: Pengyu Luo <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 7636f09 commit 0b6d8f9

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed

arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
aliases {
3030
i2c4 = &i2c4;
31+
i2c15 = &i2c15;
3132
serial1 = &uart2;
3233
};
3334

@@ -216,6 +217,40 @@
216217
};
217218
};
218219

220+
usb0-sbu-mux {
221+
compatible = "pericom,pi3usb102", "gpio-sbu-mux";
222+
223+
select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>;
224+
225+
pinctrl-0 = <&usb0_sbu_default>;
226+
pinctrl-names = "default";
227+
228+
orientation-switch;
229+
230+
port {
231+
usb0_sbu_mux: endpoint {
232+
remote-endpoint = <&ucsi0_sbu>;
233+
};
234+
};
235+
};
236+
237+
usb1-sbu-mux {
238+
compatible = "pericom,pi3usb102", "gpio-sbu-mux";
239+
240+
select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
241+
242+
pinctrl-0 = <&usb1_sbu_default>;
243+
pinctrl-names = "default";
244+
245+
orientation-switch;
246+
247+
port {
248+
usb1_sbu_mux: endpoint {
249+
remote-endpoint = <&ucsi1_sbu>;
250+
};
251+
};
252+
};
253+
219254
wcn6855-pmu {
220255
compatible = "qcom,wcn6855-pmu";
221256

@@ -584,6 +619,97 @@
584619

585620
};
586621

622+
&i2c15 {
623+
clock-frequency = <400000>;
624+
625+
pinctrl-0 = <&i2c15_default>;
626+
pinctrl-names = "default";
627+
628+
status = "okay";
629+
630+
embedded-controller@38 {
631+
compatible = "huawei,gaokun3-ec";
632+
reg = <0x38>;
633+
634+
interrupts-extended = <&tlmm 107 IRQ_TYPE_LEVEL_LOW>;
635+
636+
#address-cells = <1>;
637+
#size-cells = <0>;
638+
639+
connector@0 {
640+
compatible = "usb-c-connector";
641+
reg = <0>;
642+
power-role = "dual";
643+
data-role = "dual";
644+
645+
ports {
646+
#address-cells = <1>;
647+
#size-cells = <0>;
648+
649+
port@0 {
650+
reg = <0>;
651+
652+
ucsi0_hs_in: endpoint {
653+
remote-endpoint = <&usb_0_dwc3_hs>;
654+
};
655+
};
656+
657+
port@1 {
658+
reg = <1>;
659+
660+
ucsi0_ss_in: endpoint {
661+
remote-endpoint = <&usb_0_qmpphy_out>;
662+
};
663+
};
664+
665+
port@2 {
666+
reg = <2>;
667+
668+
ucsi0_sbu: endpoint {
669+
remote-endpoint = <&usb0_sbu_mux>;
670+
};
671+
};
672+
};
673+
};
674+
675+
connector@1 {
676+
compatible = "usb-c-connector";
677+
reg = <1>;
678+
power-role = "dual";
679+
data-role = "dual";
680+
681+
ports {
682+
#address-cells = <1>;
683+
#size-cells = <0>;
684+
685+
port@0 {
686+
reg = <0>;
687+
688+
ucsi1_hs_in: endpoint {
689+
remote-endpoint = <&usb_1_dwc3_hs>;
690+
};
691+
};
692+
693+
port@1 {
694+
reg = <1>;
695+
696+
ucsi1_ss_in: endpoint {
697+
remote-endpoint = <&usb_1_qmpphy_out>;
698+
};
699+
};
700+
701+
port@2 {
702+
reg = <2>;
703+
704+
ucsi1_sbu: endpoint {
705+
remote-endpoint = <&usb1_sbu_mux>;
706+
};
707+
};
708+
};
709+
};
710+
};
711+
};
712+
587713
&mdss0 {
588714
status = "okay";
589715
};
@@ -1004,6 +1130,10 @@
10041130
dr_mode = "host";
10051131
};
10061132

1133+
&usb_0_dwc3_hs {
1134+
remote-endpoint = <&ucsi0_hs_in>;
1135+
};
1136+
10071137
&usb_0_hsphy {
10081138
vdda-pll-supply = <&vreg_l9d>;
10091139
vdda18-supply = <&vreg_l1c>;
@@ -1025,6 +1155,10 @@
10251155
remote-endpoint = <&mdss0_dp0_out>;
10261156
};
10271157

1158+
&usb_0_qmpphy_out {
1159+
remote-endpoint = <&ucsi0_ss_in>;
1160+
};
1161+
10281162
&usb_1 {
10291163
status = "okay";
10301164
};
@@ -1033,6 +1167,10 @@
10331167
dr_mode = "host";
10341168
};
10351169

1170+
&usb_1_dwc3_hs {
1171+
remote-endpoint = <&ucsi1_hs_in>;
1172+
};
1173+
10361174
&usb_1_hsphy {
10371175
vdda-pll-supply = <&vreg_l4b>;
10381176
vdda18-supply = <&vreg_l1c>;
@@ -1054,6 +1192,10 @@
10541192
remote-endpoint = <&mdss0_dp1_out>;
10551193
};
10561194

1195+
&usb_1_qmpphy_out {
1196+
remote-endpoint = <&ucsi1_ss_in>;
1197+
};
1198+
10571199
&usb_2 {
10581200
status = "okay";
10591201
};
@@ -1177,6 +1319,13 @@
11771319
bias-disable;
11781320
};
11791321

1322+
i2c15_default: i2c15-default-state {
1323+
pins = "gpio36", "gpio37";
1324+
function = "qup15";
1325+
drive-strength = <2>;
1326+
bias-pull-up;
1327+
};
1328+
11801329
mode_pin_active: mode-pin-state {
11811330
pins = "gpio26";
11821331
function = "gpio";
@@ -1301,6 +1450,20 @@
13011450
};
13021451
};
13031452

1453+
usb0_sbu_default: usb0-sbu-state {
1454+
pins = "gpio164";
1455+
function = "gpio";
1456+
drive-strength = <16>;
1457+
bias-disable;
1458+
};
1459+
1460+
usb1_sbu_default: usb1-sbu-state {
1461+
pins = "gpio47";
1462+
function = "gpio";
1463+
drive-strength = <16>;
1464+
bias-disable;
1465+
};
1466+
13041467
wcd_default: wcd-default-state {
13051468
reset-pins {
13061469
pins = "gpio106";

0 commit comments

Comments
 (0)