From 4bffa7c5eaf04644cfb220253e7779934eafa543 Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Wed, 22 Nov 2017 17:43:09 +0800 Subject: [PATCH] phy: rockchip-inno-usb2: turn off differential receiver in suspend mode Turn off differential receiver in suspend mode to save power Change-Id: Idd9b4c2d7d9d78915c94946ced99737683a2ce91 Signed-off-by: Meng Dongyang Signed-off-by: Frank Wang --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 1d7e415b3e55..16537da2d7b8 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1797,6 +1797,18 @@ disable_clks: return ret; } +static int rk312x_usb2phy_tuning(struct rockchip_usb2phy *rphy) +{ + int ret; + + /* Turn off differential receiver in suspend mode */ + ret = regmap_write(rphy->grf, 0x298, 0x00040000); + if (ret) + return ret; + + return 0; +} + static int rk3366_usb2phy_tuning(struct rockchip_usb2phy *rphy) { unsigned int open_pre_emphasize = 0xffff851f; @@ -1970,6 +1982,7 @@ static const struct rockchip_usb2phy_cfg rk312x_phy_cfgs[] = { { .reg = 0x17c, .num_ports = 2, + .phy_tuning = rk312x_usb2phy_tuning, .clkout_ctl = { 0x0190, 15, 15, 1, 0 }, .port_cfgs = { [USB2PHY_PORT_OTG] = {