OSDN Git Service

arm64: dts: rockchip: Properly define the type C connector on rk3399-orangepi
authorAlexis Ballier <aballier@gentoo.org>
Thu, 22 Oct 2020 11:35:32 +0000 (13:35 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 30 Nov 2020 13:34:01 +0000 (14:34 +0100)
Tested:
- USB3 Gigabit adapter
- USB2 mass storage

The wiring is the same as the pinebook pro according to the schematics,
thus this patch is heavily based on its dts.

Signed-off-by: Alexis Ballier <aballier@gentoo.org>
Cc: devicetree@vger.kernel.org
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20201022113532.18470-1-aballier@gentoo.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts

index 6163ae8..ad7c4d0 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "dt-bindings/pwm/pwm.h"
 #include "dt-bindings/input/input.h"
+#include "dt-bindings/usb/pd.h"
 #include "rk3399.dtsi"
 #include "rk3399-opp.dtsi"
 
                pinctrl-names = "default";
                pinctrl-0 = <&chg_cc_int_l>;
                vbus-supply = <&vbus_typec>;
+
+               typec_con: connector {
+                       compatible = "usb-c-connector";
+                       data-role = "host";
+                       label = "USB-C";
+                       op-sink-microwatt = <1000000>;
+                       power-role = "dual";
+                       sink-pdos =
+                               <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
+                       source-pdos =
+                               <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
+                       try-power-role = "sink";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       typec_hs: endpoint {
+                                               remote-endpoint = <&u2phy0_typec_hs>;
+                                       };
+                               };
+                               port@1 {
+                                       reg = <1>;
+                                       typec_ss: endpoint {
+                                               remote-endpoint = <&tcphy0_typec_ss>;
+                                       };
+                               };
+                               port@2 {
+                                       reg = <2>;
+                                       typec_dp: endpoint {
+                                               remote-endpoint = <&tcphy0_typec_dp>;
+                                       };
+                               };
+                       };
+               };
        };
 };
 
        status = "okay";
 };
 
+&tcphy0_dp {
+       port {
+               tcphy0_typec_dp: endpoint {
+                       remote-endpoint = <&typec_dp>;
+               };
+       };
+};
+
+&tcphy0_usb3 {
+       port {
+               tcphy0_typec_ss: endpoint {
+                       remote-endpoint = <&typec_ss>;
+               };
+       };
+};
+
 &tcphy1 {
        status = "okay";
 };
                phy-supply = <&vcc5v0_host>;
                status = "okay";
        };
+
+       port {
+               u2phy0_typec_hs: endpoint {
+                       remote-endpoint = <&typec_hs>;
+               };
+       };
 };
 
 &u2phy1 {
 
 &usbdrd_dwc3_0 {
        status = "okay";
-       dr_mode = "otg";
+       dr_mode = "host";
 };
 
 &usbdrd3_1 {