mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
phy: rockchip-inno-usb2: register 480MHz clk at the end of probe
We find an usb phy 480MHz clk prepare fail issue on PX30/RK3326 platforms with RK819 PMIC. On PX30/RK3326 platforms, we set the usb480m clk to critical because GPU 480M is from usb480m and the source clocks should be always on. And the usb phy 480MHz clk is parent of usb480m clk, so the clk framework will prepare the usb phy 480MHz clk when register it. This logic works well if the usb phy probe only once. But if the usb phy needs to probe twice or more because of some reasons (e.g. fail to get vbus regulator from RK819), the usb phy 480MHz clk will be unregistered and registered again, however, the clk framework doesn't prepare the usb phy 480MHz clk except the first time register operation. So we move the 480MHz clk register to the end of probe, and make sure only register it once. Change-Id: If69378b49035746a7c0107c6a363c4d91dfc15e5 Signed-off-by: William Wu <william.wu@rock-chips.com> Signed-off-by: Bin Yang <yangbin@rock-chips.com> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
@@ -383,7 +383,7 @@ static int
|
||||
rockchip_usb2phy_clk480m_register(struct rockchip_usb2phy *rphy)
|
||||
{
|
||||
struct device_node *node = rphy->dev->of_node;
|
||||
struct clk_init_data init;
|
||||
struct clk_init_data init = {};
|
||||
const char *clk_name;
|
||||
int ret;
|
||||
|
||||
@@ -1808,12 +1808,6 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
|
||||
rphy->clk = NULL;
|
||||
}
|
||||
|
||||
ret = rockchip_usb2phy_clk480m_register(rphy);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to register 480m output clock\n");
|
||||
goto disable_clks;
|
||||
}
|
||||
|
||||
if (rphy->phy_cfg->phy_tuning) {
|
||||
ret = rphy->phy_cfg->phy_tuning(rphy);
|
||||
if (ret)
|
||||
@@ -1873,6 +1867,12 @@ next_child:
|
||||
goto put_child;
|
||||
}
|
||||
|
||||
ret = rockchip_usb2phy_clk480m_register(rphy);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to register 480m output clock\n");
|
||||
goto put_child;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
put_child:
|
||||
|
||||
Reference in New Issue
Block a user