.setup_hpd = &dw_hdmi_phy_setup_hpd,
 };
 
+static void sun8i_hdmi_phy_unlock(struct sun8i_hdmi_phy *phy)
+{
+       /* enable read access to HDMI controller */
+       regmap_write(phy->regs, SUN8I_HDMI_PHY_READ_EN_REG,
+                    SUN8I_HDMI_PHY_READ_EN_MAGIC);
+
+       /* unscramble register offsets */
+       regmap_write(phy->regs, SUN8I_HDMI_PHY_UNSCRAMBLE_REG,
+                    SUN8I_HDMI_PHY_UNSCRAMBLE_MAGIC);
+}
+
 static void sun8i_hdmi_phy_init_a83t(struct sun8i_hdmi_phy *phy)
 {
+       sun8i_hdmi_phy_unlock(phy);
+
        regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_DBG_CTRL_REG,
                           SUN8I_HDMI_PHY_DBG_CTRL_PX_LOCK,
                           SUN8I_HDMI_PHY_DBG_CTRL_PX_LOCK);
 {
        unsigned int val;
 
+       sun8i_hdmi_phy_unlock(phy);
+
        regmap_write(phy->regs, SUN8I_HDMI_PHY_ANA_CFG1_REG, 0);
        regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_ANA_CFG1_REG,
                           SUN8I_HDMI_PHY_ANA_CFG1_ENBI,
 
 void sun8i_hdmi_phy_init(struct sun8i_hdmi_phy *phy)
 {
-       /* enable read access to HDMI controller */
-       regmap_write(phy->regs, SUN8I_HDMI_PHY_READ_EN_REG,
-                    SUN8I_HDMI_PHY_READ_EN_MAGIC);
-
-       /* unscramble register offsets */
-       regmap_write(phy->regs, SUN8I_HDMI_PHY_UNSCRAMBLE_REG,
-                    SUN8I_HDMI_PHY_UNSCRAMBLE_MAGIC);
-
        phy->variant->phy_init(phy);
 }