diff options
author | William Wu <william.wu@rock-chips.com> | 2018-03-26 19:32:37 +0800 |
---|---|---|
committer | William Wu <william.wu@rock-chips.com> | 2018-03-26 20:09:02 +0800 |
commit | 893c85ad3221a07e887af4f7277d1e172ef51d8f (patch) | |
tree | 6a353629d7265d6fd22e9d16a5a93ebb8eb4f968 | |
parent | b1ee4d8307dab6f7dbfb62cadec4c4e2f61a0755 (diff) |
phy: rockchip-inno-usb2: open pre-emphasize for rk3308/rk3328
Open pre-emphasize in non-chirp state for rk3308 and
rk3328 usb otg and host ports to increase HS slew rate.
Change-Id: I16435d67b9994cef0fd5e6edbae00c41cc02c48b
Signed-off-by: William Wu <william.wu@rock-chips.com>
-rw-r--r-- | drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index a428e06aba69..66624b1e9b84 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1822,6 +1822,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; @@ -1831,11 +1853,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; @@ -2161,6 +2185,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] = { |