Skip to content

Commit f5e17cf

Browse files
committed
rockchip64-6.19: mekotronics-r58x-4g: add fusb302
- works as far as I can tell - both orientations - also wired DP, but can't test (I've no USB-DP hw)
1 parent 7ef9f60 commit f5e17cf

1 file changed

Lines changed: 83 additions & 3 deletions

File tree

patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@
104104
vcc5v0_otg: vcc5v0-otg-regulator {
105105
compatible = "regulator-fixed";
106106
regulator-name = "vcc5v0_otg";
107-
regulator-boot-on;
108-
regulator-always-on;
109107
regulator-min-microvolt = <5000000>;
110108
regulator-max-microvolt = <5000000>;
111109
enable-active-high;
@@ -403,6 +401,57 @@
403401
&i2c6 {
404402
status = "okay";
405403

404+
usbc0: usb-typec@22 {
405+
compatible = "fcs,fusb302";
406+
reg = <0x22>;
407+
interrupt-parent = <&gpio3>;
408+
interrupts = <RK_PC7 IRQ_TYPE_LEVEL_LOW>;
409+
pinctrl-names = "default";
410+
pinctrl-0 = <&usbc0_int>;
411+
vbus-supply = <&vcc5v0_otg>;
412+
status = "okay";
413+
414+
connector {
415+
compatible = "usb-c-connector";
416+
data-role = "dual";
417+
label = "USB-C";
418+
op-sink-microwatt = <1000000>;
419+
/* fusb302 supports PD Rev 2.0 Ver 1.2 */
420+
pd-revision = /bits/ 8 <0x2 0x0 0x1 0x2>;
421+
power-role = "dual";
422+
sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
423+
source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
424+
try-power-role = "source";
425+
typec-power-opmode = "1.5A";
426+
427+
ports {
428+
#address-cells = <1>;
429+
#size-cells = <0>;
430+
431+
port@0 {
432+
reg = <0>;
433+
usbc0_hs: endpoint {
434+
remote-endpoint = <&usb_host0_xhci_drd_sw>;
435+
};
436+
};
437+
438+
port@1 {
439+
reg = <1>;
440+
usbc0_ss: endpoint {
441+
remote-endpoint = <&usbdp_phy0_typec_ss>;
442+
};
443+
};
444+
445+
port@2 {
446+
reg = <2>;
447+
usbc0_sbu: endpoint {
448+
remote-endpoint = <&usbdp_phy0_typec_sbu>;
449+
};
450+
};
451+
};
452+
};
453+
};
454+
406455
hym8563: rtc@51 {
407456
compatible = "haoyu,hym8563";
408457
reg = <0x51>;
@@ -572,7 +621,7 @@
572621
};
573622

574623
usb-typec {
575-
usbc0_int: usbc0-int { // @TODO missing fusb302
624+
usbc0_int: usbc0-int {
576625
rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
577626
};
578627

@@ -982,6 +1031,29 @@
9821031
};
9831032
};
9841033

1034+
&usbdp_phy0 {
1035+
mode-switch;
1036+
orientation-switch;
1037+
sbu1-dc-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
1038+
sbu2-dc-gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
1039+
status = "okay";
1040+
1041+
port {
1042+
#address-cells = <1>;
1043+
#size-cells = <0>;
1044+
1045+
usbdp_phy0_typec_ss: endpoint@0 {
1046+
reg = <0>;
1047+
remote-endpoint = <&usbc0_ss>;
1048+
};
1049+
1050+
usbdp_phy0_typec_sbu: endpoint@1 {
1051+
reg = <1>;
1052+
remote-endpoint = <&usbc0_sbu>;
1053+
};
1054+
};
1055+
};
1056+
9851057
&usbdp_phy1 {
9861058
rockchip,dp-lane-mux = <0 1 2 3>;
9871059
status = "okay";
@@ -1000,7 +1072,15 @@
10001072
maximum-speed = "high-speed";
10011073
phys = <&u2phy0_otg>;
10021074
phy-names = "usb2-phy";
1075+
1076+
usb-role-switch;
10031077
status = "okay";
1078+
1079+
port {
1080+
usb_host0_xhci_drd_sw: endpoint {
1081+
remote-endpoint = <&usbc0_hs>;
1082+
};
1083+
};
10041084
};
10051085

10061086
&u2phy1 { // for usbdp_phy1 which is also usb_host1_xhci

0 commit comments

Comments
 (0)