Message ID | 20241227171353.404432-6-mitltlatltl@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | platform: arm64: Huawei Matebook E Go embedded controller | expand |
On 27.12.2024 6:13 PM, Pengyu Luo wrote: > The Embedded Controller in the Huawei Matebook E Go (s8280xp) > 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 ports, orientation switches and the QMP combo PHY. > > Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com> > --- > .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 139 ++++++++++++++++++ > 1 file changed, 139 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts > index 09b95f89e..09ca9a560 100644 > --- a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts > @@ -28,6 +28,7 @@ / { > > aliases { > i2c4 = &i2c4; > + i2c15 = &i2c15; > serial1 = &uart2; > }; > > @@ -216,6 +217,40 @@ map1 { > }; > }; > > + usb0-sbu-mux { > + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; > + > + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&usb0_sbu_default>; Please preserve this order: property-n property-names > + > + orientation-switch; This > + > + port { > + usb0_sbu_mux: endpoint { > + remote-endpoint = <&ucsi0_sbu>; And this section have incorrect whitespacing (one tab too many, make sure you set your tab width to 8 spaces) Same for usb1-sbu-mux [...] > + i2c15_default: i2c15-default-state { > + pins = "gpio36", "gpio37"; > + function = "qup15"; > + drive-strength = <2>; > + bias-pull-up; > + }; > + > mode_pin_active: mode-pin-state { > pins = "gpio26"; > function = "gpio"; > @@ -1301,6 +1426,20 @@ tx-pins { > }; > }; > > + usb0_sbu_default: usb0-sbu-state { > + pins = "gpio164"; > + function = "gpio"; > + bias-disable; > + drive-strength = <16>; > + }; > + > + usb1_sbu_default: usb1-sbu-state { > + pins = "gpio47"; > + function = "gpio"; > + bias-disable; > + drive-strength = <16>; > + }; Similarly, please keep drive-strength above bias for consistency lgtm otherwise Konrad
On Mon, Dec 30, 2024 at 10:53 PM Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> wrote: > On 27.12.2024 6:13 PM, Pengyu Luo wrote: > > The Embedded Controller in the Huawei Matebook E Go (s8280xp) > > 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 ports, orientation switches and the QMP combo PHY. > > > > Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com> > > --- > > .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 139 ++++++++++++++++++ > > 1 file changed, 139 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts > > index 09b95f89e..09ca9a560 100644 > > --- a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts > > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts > > @@ -28,6 +28,7 @@ / { > > > > aliases { > > i2c4 = &i2c4; > > + i2c15 = &i2c15; > > serial1 = &uart2; > > }; > > > > @@ -216,6 +217,40 @@ map1 { > > }; > > }; > > > > + usb0-sbu-mux { > > + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; > > + > > + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; > > + > > + pinctrl-names = "default"; > > + pinctrl-0 = <&usb0_sbu_default>; > > Please preserve this order: > > property-n > property-names > > > + > > + orientation-switch; > > This > > > + > > + port { > > + usb0_sbu_mux: endpoint { > > + remote-endpoint = <&ucsi0_sbu>; > > And this section have incorrect whitespacing (one tab too many, make > sure you set your tab width to 8 spaces) > > Same for usb1-sbu-mux > > [...] > > > + i2c15_default: i2c15-default-state { > > + pins = "gpio36", "gpio37"; > > + function = "qup15"; > > + drive-strength = <2>; > > + bias-pull-up; > > + }; > > + > > mode_pin_active: mode-pin-state { > > pins = "gpio26"; > > function = "gpio"; > > @@ -1301,6 +1426,20 @@ tx-pins { > > }; > > }; > > > > + usb0_sbu_default: usb0-sbu-state { > > + pins = "gpio164"; > > + function = "gpio"; > > + bias-disable; > > + drive-strength = <16>; > > + }; > > + > > + usb1_sbu_default: usb1-sbu-state { > > + pins = "gpio47"; > > + function = "gpio"; > > + bias-disable; > > + drive-strength = <16>; > > + }; > > Similarly, please keep drive-strength above bias for consistency > > lgtm otherwise > Totaly agree, I was in a hurry, I will fix it in v2. Best wishes, Pengyu
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts index 09b95f89e..09ca9a560 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts @@ -28,6 +28,7 @@ / { aliases { i2c4 = &i2c4; + i2c15 = &i2c15; serial1 = &uart2; }; @@ -216,6 +217,40 @@ map1 { }; }; + usb0-sbu-mux { + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; + + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&usb0_sbu_default>; + + orientation-switch; + + port { + usb0_sbu_mux: endpoint { + remote-endpoint = <&ucsi0_sbu>; + }; + }; + }; + + usb1-sbu-mux { + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; + + select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&usb1_sbu_default>; + + orientation-switch; + + port { + usb1_sbu_mux: endpoint { + remote-endpoint = <&ucsi1_sbu>; + }; + }; + }; + wcn6855-pmu { compatible = "qcom,wcn6855-pmu"; @@ -584,6 +619,81 @@ touchscreen@4f { }; +&i2c15 { + clock-frequency = <400000>; + + pinctrl-0 = <&i2c15_default>; + pinctrl-names = "default"; + + status = "okay"; + + embedded-controller@38 { + compatible = "huawei,sc8280xp-gaokun-ec", "huawei,gaokun-ec"; + reg = <0x38>; + + interrupts-extended = <&tlmm 107 IRQ_TYPE_LEVEL_LOW>; + + #address-cells = <1>; + #size-cells = <0>; + + connector@0 { + compatible = "usb-c-connector"; + reg = <0>; + power-role = "dual"; + data-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + ucsi0_ss_in: endpoint { + remote-endpoint = <&usb_0_qmpphy_out>; + }; + }; + + port@1 { + reg = <1>; + + ucsi0_sbu: endpoint { + remote-endpoint = <&usb0_sbu_mux>; + }; + }; + }; + }; + + connector@1 { + compatible = "usb-c-connector"; + reg = <1>; + power-role = "dual"; + data-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + ucsi1_ss_in: endpoint { + remote-endpoint = <&usb_1_qmpphy_out>; + }; + }; + + port@1 { + reg = <1>; + + ucsi1_sbu: endpoint { + remote-endpoint = <&usb1_sbu_mux>; + }; + }; + }; + }; + }; +}; + &mdss0 { status = "okay"; }; @@ -1025,6 +1135,10 @@ &usb_0_qmpphy_dp_in { remote-endpoint = <&mdss0_dp0_out>; }; +&usb_0_qmpphy_out { + remote-endpoint = <&ucsi0_ss_in>; +}; + &usb_1 { status = "okay"; }; @@ -1054,6 +1168,10 @@ &usb_1_qmpphy_dp_in { remote-endpoint = <&mdss0_dp1_out>; }; +&usb_1_qmpphy_out { + remote-endpoint = <&ucsi1_ss_in>; +}; + &usb_2 { status = "okay"; }; @@ -1177,6 +1295,13 @@ i2c4_default: i2c4-default-state { bias-disable; }; + i2c15_default: i2c15-default-state { + pins = "gpio36", "gpio37"; + function = "qup15"; + drive-strength = <2>; + bias-pull-up; + }; + mode_pin_active: mode-pin-state { pins = "gpio26"; function = "gpio"; @@ -1301,6 +1426,20 @@ tx-pins { }; }; + usb0_sbu_default: usb0-sbu-state { + pins = "gpio164"; + function = "gpio"; + bias-disable; + drive-strength = <16>; + }; + + usb1_sbu_default: usb1-sbu-state { + pins = "gpio47"; + function = "gpio"; + bias-disable; + drive-strength = <16>; + }; + wcd_default: wcd-default-state { reset-pins { pins = "gpio106";
The Embedded Controller in the Huawei Matebook E Go (s8280xp) 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 ports, orientation switches and the QMP combo PHY. Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com> --- .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+)