phy/rockchip: samsung-hdptx: Check if PHY need configured during startup

Signed-off-by: Wyon bi <bivvy.bi@rock-chips.com>
Change-Id: Idd91b95ea60cd6240dbc77d4396c9cae4affdba1
This commit is contained in:
Wyon bi
2021-12-27 15:59:51 +08:00
parent 5efa128dc6
commit eb4c42e291

View File

@@ -886,6 +886,15 @@ static void rockchip_hdptx_phy_reset(struct rockchip_hdptx_phy *hdptx)
FIELD_PREP(BGR_EN, 0));
}
static bool rockchip_hdptx_phy_enabled(struct rockchip_hdptx_phy *hdptx)
{
u32 status;
regmap_read(hdptx->grf, HDPTXPHY_GRF_STATUS0, &status);
return FIELD_GET(SB_RDY, status);
}
static int rockchip_hdptx_phy_power_on(struct phy *phy)
{
struct rockchip_hdptx_phy *hdptx = phy_get_drvdata(phy);
@@ -897,6 +906,9 @@ static int rockchip_hdptx_phy_power_on(struct phy *phy)
if (ret)
return ret;
if (rockchip_hdptx_phy_enabled(hdptx))
return 0;
rockchip_hdptx_phy_reset(hdptx);
reset_control_assert(hdptx->apb_reset);