diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index a2eef9b0bebe..111ce6f534cb 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1873,6 +1873,28 @@ static int rk312x_usb2phy_tuning(struct rockchip_usb2phy *rphy) return 0; } +static int rk3308_usb2phy_tuning(struct rockchip_usb2phy *rphy) +{ + int ret; + + /* Open pre-emphasize in non-chirp state for otg port */ + ret = regmap_write(rphy->grf, 0x0, 0x00070004); + if (ret) + return ret; + + /* Open pre-emphasize in non-chirp state for host port */ + ret = regmap_write(rphy->grf, 0x30, 0x00070004); + if (ret) + return ret; + + /* Turn off differential receiver in suspend mode */ + ret = regmap_write(rphy->grf, 0x18, 0x00040000); + if (ret) + return ret; + + return 0; +} + static int rk3328_usb2phy_tuning(struct rockchip_usb2phy *rphy) { int ret; @@ -1882,11 +1904,13 @@ static int rk3328_usb2phy_tuning(struct rockchip_usb2phy *rphy) if (ret) return ret; - /* - * Open HS pre-emphasize function to increase - * HS slew rate for host port - */ - ret = regmap_write(rphy->grf, 0x30, 0xffff851d); + /* Open pre-emphasize in non-chirp state for otg port */ + ret = regmap_write(rphy->grf, 0x0, 0x00070004); + if (ret) + return ret; + + /* Open pre-emphasize in non-chirp state for host port */ + ret = regmap_write(rphy->grf, 0x30, 0x00070004); if (ret) return ret; @@ -2211,6 +2235,7 @@ static const struct rockchip_usb2phy_cfg rk3308_phy_cfgs[] = { { .reg = 0x100, .num_ports = 2, + .phy_tuning = rk3308_usb2phy_tuning, .clkout_ctl = { 0x0108, 4, 4, 1, 0 }, .port_cfgs = { [USB2PHY_PORT_OTG] = {