Message ID | 20230816115151.501736-1-bryan.odonoghue@linaro.org |
---|---|
Headers | show |
Series | Add Qualcomm PMIC TPCM support | expand |
On 16.08.2023 13:51, Bryan O'Donoghue wrote: > Switch on usb-role-switching for usb_1 via TCPM. We need to declare > usb-role-switch in &usb_1 and associate with the remote-endpoint in TCPM > which provides the necessary signal. > > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > --- > arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 19 ++++++++++++++++++- > arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 ++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts > index 55389f8903b5c..3e34f4e2af14a 100644 > --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts > +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts > @@ -1269,7 +1269,12 @@ &usb_1 { > }; > > &usb_1_dwc3 { > - dr_mode = "peripheral"; > + dr_mode = "otg"; > + usb-role-switch; > +}; > + > +&usb_1_role_switch_out { > + remote-endpoint = <&pm8150b_role_switch_in>; > }; > > &usb_1_hsphy { > @@ -1358,5 +1363,17 @@ connector { > PDO_FIXED_DUAL_ROLE | > PDO_FIXED_USB_COMM | > PDO_FIXED_DATA_SWAP)>; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + port@0 { > + reg = <0>; > + pm8150b_role_switch_in: endpoint { I'd rather this be moved to the pmic dt as well, under the tcpm definition Konrad
On 16.08.2023 13:51, Bryan O'Donoghue wrote: > Type-C port management functionality lives inside of the PMIC block on > pm8150b. > > The Type-C port management logic controls orientation detection, vbus/vconn > sense and to send/receive Type-C Power Domain messages. > > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > --- > arch/arm64/boot/dts/qcom/pm8150b.dtsi | 40 +++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/pm8150b.dtsi b/arch/arm64/boot/dts/qcom/pm8150b.dtsi > index 66752cc063d60..136e5f96a3d53 100644 > --- a/arch/arm64/boot/dts/qcom/pm8150b.dtsi > +++ b/arch/arm64/boot/dts/qcom/pm8150b.dtsi > @@ -59,6 +59,46 @@ pm8150b_vbus: usb-vbus-regulator@1100 { > reg = <0x1100>; > }; > > + pm8150b_typec: typec@1500 { > + compatible = "qcom,pm8150b-typec"; > + status = "disabled"; status last Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad
On 16.08.2023 13:51, Bryan O'Donoghue wrote: > Switch on USB orientation-switching for usb_1_qmp via TCPM. Detecting the > orientation switch is required to get the PHY to reset and bring-up the PHY > with the CC lines set to the appropriate lane. > > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > --- > arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 12 ++++++++++++ > arch/arm64/boot/dts/qcom/sm8250.dtsi | 1 + > 2 files changed, 13 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts > index 3e34f4e2af14a..b878d765f8c42 100644 > --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts > +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts > @@ -1290,6 +1290,11 @@ &usb_1_qmpphy { > > vdda-phy-supply = <&vreg_l9a_1p2>; > vdda-pll-supply = <&vreg_l18a_0p92>; > + orientation-switch; > +}; > + > +&usb_1_qmpphy_out { > + remote-endpoint = <&pm8150b_typec_mux_in>; > }; > > &usb_2 { > @@ -1374,6 +1379,13 @@ pm8150b_role_switch_in: endpoint { > remote-endpoint = <&usb_1_role_switch_out>; > }; > }; > + > + port@1 { > + reg = <1>; > + pm8150b_typec_mux_in: endpoint { should also go to pmic dt Konrad
On Wed, 16 Aug 2023 12:51:44 +0100, Bryan O'Donoghue wrote: > V9: > > - Reuses glink ports {} definitions and locations per Bjorn's request > - Adds additional port @ 2 to 8250.dtsi as a result - Bjorn > - Drops logic in previous patch > "dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add input and output ports" > No longer required > - I've amended the names of the endpoints to match sc8280xp too - bod > > [...] Applied, thanks! [2/7] arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching commit: ea96b90a58cf5d2e91ac177f081118ff26b85c1d [3/7] arm64: dts: qcom: pm8150b: Add a TCPM description commit: 5a0539515cbfad30b3e08a00004ed0c86136add5 [4/7] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost commit: c627d7337aae4d83b4db621fdb9e8f638056dcee [5/7] arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM commit: 5b1b6da9d39d515395d85dc678ddac7ff1689438 [6/7] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 commit: 25defdca4d902b338c05bc01a1de1064a6d3b7f3 [7/7] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy commit: 45219a6b9497cb7713dd2bc221248ee1a7e9bb3d Best regards,