Message ID | 20230816115151.501736-7-bryan.odonoghue@linaro.org |
---|---|
State | Accepted |
Commit | 25defdca4d902b338c05bc01a1de1064a6d3b7f3 |
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
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 { + remote-endpoint = <&usb_1_role_switch_out>; + }; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi index c79173504a3fd..733de2fd5e753 100644 --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi @@ -3780,6 +3780,10 @@ usb_1_dwc3: usb@a600000 { snps,dis_enblslpm_quirk; phys = <&usb_1_hsphy>, <&usb_1_ssphy>; phy-names = "usb2-phy", "usb3-phy"; + + port { + usb_1_role_switch_out: endpoint {}; + }; }; };
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(-)