@@ -1438,6 +1438,8 @@
rockchip,grf = <&grf>;
rockchip,typec-conn-dir = <0xe580 0 16>;
rockchip,usb3tousb2-en = <0xe580 3 19>;
+ rockchip,usb3-host-disable = <0x2434 0 16>;
+ rockchip,usb3-host-port = <0x2434 12 28>;
rockchip,external-psm = <0xe588 14 30>;
rockchip,pipe-status = <0xe5c0 0 0>;
rockchip,uphy-dp-sel = <0x6268 19 19>;
@@ -1468,6 +1470,8 @@
rockchip,grf = <&grf>;
rockchip,typec-conn-dir = <0xe58c 0 16>;
rockchip,usb3tousb2-en = <0xe58c 3 19>;
+ rockchip,usb3-host-disable = <0x2444 0 16>;
+ rockchip,usb3-host-port = <0x2444 12 28>;
rockchip,external-psm = <0xe594 14 30>;
rockchip,pipe-status = <0xe5c0 16 16>;
rockchip,uphy-dp-sel = <0x6268 3 19>;
@@ -358,6 +358,8 @@ struct usb3phy_reg {
struct rockchip_usb3phy_port_cfg {
struct usb3phy_reg typec_conn_dir;
struct usb3phy_reg usb3tousb2_en;
+ struct usb3phy_reg usb3_host_disable;
+ struct usb3phy_reg usb3_host_port;
struct usb3phy_reg external_psm;
struct usb3phy_reg pipe_status;
struct usb3phy_reg uphy_dp_sel;
@@ -853,6 +855,9 @@ static int rockchip_usb3_phy_power_on(struct phy *phy)
regmap_read(tcphy->grf_regs, reg->offset, &val);
if (!(val & BIT(reg->enable_bit))) {
tcphy->mode |= new_mode & (MODE_DFP_USB | MODE_UFP_USB);
+ /* enable usb3 host */
+ property_enable(tcphy, &cfg->usb3_host_disable, 0);
+ property_enable(tcphy, &cfg->usb3_host_port, 1);
goto unlock_ret;
}
usleep_range(10, 20);
@@ -1023,6 +1028,16 @@ static int tcphy_parse_dt(struct rockchip_typec_phy *tcphy,
if (ret)
return ret;
+ ret = tcphy_get_param(dev, &cfg->usb3_host_disable,
+ "rockchip,usb3-host-disable");
+ if (ret)
+ return ret;
+
+ ret = tcphy_get_param(dev, &cfg->usb3_host_port,
+ "rockchip,usb3-host-port");
+ if (ret)
+ return ret;
+
ret = tcphy_get_param(dev, &cfg->external_psm,
"rockchip,external-psm");
if (ret)