summaryrefslogtreecommitdiffstats
path: root/drivers/phy/starfive
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/phy/starfive')
-rw-r--r--drivers/phy/starfive/phy-jh7110-dphy-tx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/phy/starfive/phy-jh7110-dphy-tx.c b/drivers/phy/starfive/phy-jh7110-dphy-tx.c
index 61b0da6096e5..c64d1c91b130 100644
--- a/drivers/phy/starfive/phy-jh7110-dphy-tx.c
+++ b/drivers/phy/starfive/phy-jh7110-dphy-tx.c
@@ -235,12 +235,14 @@ static int stf_dphy_configure(struct phy *phy, union phy_configure_opts *opts)
const struct stf_dphy_config *p = reg_configs;
unsigned long alignment = STF_DPHY_BITRATE_ALIGN;
u32 bitrate = opts->mipi_dphy.hs_clk_rate;
- u32 i = stf_dphy_get_config_index(bitrate);
u32 tmp;
+ u32 i;
if (bitrate % alignment)
bitrate += alignment - (bitrate % alignment);
+ i = stf_dphy_get_config_index(bitrate);
+
tmp = readl(dphy->topsys + STF_DPHY_APBIFSAIF_SYSCFG(100));
tmp &= ~STF_DPHY_REFCLK_IN_SEL;
tmp |= FIELD_PREP(STF_DPHY_REFCLK_IN_SEL, STF_DPHY_REFCLK_12M);