phy: phy-rockchip-naneng-usb2: fix bug of io read

Phy internal registers is read by APB bus. If you get phy registers
and APB data at the same time, you will get wrong data which is the
previous value of register. Therefore, pready_cnt must be set bigger
than rden_cnt.

Change-Id: I2e7e5544077170466bdaabc2f7d61f67a06b3283
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
This commit is contained in:
Jianing Ren 2020-04-28 09:18:42 +08:00 committed by Tao Huang
parent b155a5d744
commit 745529254c

View File

@ -1375,10 +1375,24 @@ static int rv1126_usb2phy_tuning(struct rockchip_usb2phy *rphy)
{
int ret = 0;
/* set iddig interrupt filter time to 10ms */
ret = regmap_write(rphy->grf, 0x1031c, 0x000f4240);
if (ret)
goto out;
if (rphy->phy_cfg->reg == 0xff4c0000) {
/* set iddig interrupt filter time to 10ms */
ret = regmap_write(rphy->grf, 0x1031c, 0x000f4240);
if (ret)
goto out;
/* set pready_cnt to 1 and rden_cnt to 0 */
ret = regmap_write(rphy->grf, 0x1027c, 0x0f0f0100);
if (ret)
goto out;
}
if (rphy->phy_cfg->reg == 0xff4c8000) {
/* set pready_cnt to 1 and rden_cnt to 0 */
ret = regmap_write(rphy->grf, 0x1028c, 0x0f0f0100);
if (ret)
goto out;
}
out:
return ret;