Skip to content

Commit

Permalink
rock-5b-plus: add type-c controller stuff
Browse files Browse the repository at this point in the history
based on the rock 5 ITX dts
  • Loading branch information
fridtjof authored and igorpecovnik committed Nov 18, 2024
1 parent 2a653f1 commit 923c194
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions patch/kernel/archive/rockchip-rk3588-6.12/dt/rk3588-rock-5b-plus.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/soc/rockchip,vop2.h>
#include <dt-bindings/usb/pd.h>
#include "rk3588.dtsi"

/ {
Expand Down Expand Up @@ -264,6 +265,77 @@
};
};

&i2c4 {
status = "okay";

pinctrl-names = "default";
pinctrl-0 = <&i2c4m1_xfer>;

usbc0: fusb302@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio3>;
interrupts = <RK_PB4 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&usbc0_int>;
vbus-supply = <&vbus5v0_typec>;
status = "okay";

usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
op-sink-microwatt = <1000000>;
sink-pdos =
<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
PDO_FIXED(9000, 3000, PDO_FIXED_USB_COMM)
PDO_FIXED(12000, 3000, PDO_FIXED_USB_COMM)>;

source-pdos =
<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;

altmodes {
displayport {
svid = /bits/ 16 <0xff01>;
vdo = <0xffffffff>;
};
};

ports {
#address-cells = <1>;
#size-cells = <0>;

// TODO this still does not work right. kind of poking in the dark right now though..
port@0 {
reg = <0>;

usbc0_orien_sw: endpoint {
remote-endpoint = <&usbdp_phy0_orientation_switch>;
};
};

port@1 {
reg = <0>;

usbc0_role_sw: endpoint {
remote-endpoint = <&dwc3_0_role_switch>;
};
};

port@2 {
reg = <1>;

dp_altmode_mux: endpoint {
remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
};
};
};
};
};
};

&i2c6 {
status = "okay";

Expand Down Expand Up @@ -426,6 +498,10 @@
};

usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>;
};

vbus5v0_typec_en: vbus5v0-typec-en {
rockchip,pins = <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
};
Expand Down Expand Up @@ -886,6 +962,24 @@

&usbdp_phy0 {
status = "okay";

mode-switch;
orientation-switch;

port {
#address-cells = <1>;
#size-cells = <0>;

usbdp_phy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};

usbdp_phy0_dp_altmode_mux: endpoint@1 {
reg = <1>;
remote-endpoint = <&dp_altmode_mux>;
};
};
};

&usbdp_phy1 {
Expand All @@ -901,7 +995,18 @@
};

&usb_host0_xhci {
usb-role-switch;
status = "okay";

port {
#address-cells = <1>;
#size-cells = <0>;

dwc3_0_role_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_role_sw>;
};
};
};

&usb_host1_ehci {
Expand Down

0 comments on commit 923c194

Please sign in to comment.