Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/sun4i: sun8i-hdmi-phy: Group PHY ops functions by generation

Now that the PHY ops are separated, sort them topologically, with the
common sun8i_hdmi_phy_set_polarity helper at the top. No function
contents are changed in this commit.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220615045543.62813-7-samuel@sholland.org

authored by

Samuel Holland and committed by
Maxime Ripard
6da62368 ef2731e4

+32 -35
+32 -35
drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
··· 124 124 }; 125 125 126 126 static void sun8i_hdmi_phy_set_polarity(struct sun8i_hdmi_phy *phy, 127 - const struct drm_display_mode *mode); 127 + const struct drm_display_mode *mode) 128 + { 129 + u32 val = 0; 130 + 131 + if (mode->flags & DRM_MODE_FLAG_NHSYNC) 132 + val |= SUN8I_HDMI_PHY_DBG_CTRL_POL_NHSYNC; 133 + 134 + if (mode->flags & DRM_MODE_FLAG_NVSYNC) 135 + val |= SUN8I_HDMI_PHY_DBG_CTRL_POL_NVSYNC; 136 + 137 + regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_DBG_CTRL_REG, 138 + SUN8I_HDMI_PHY_DBG_CTRL_POL_MASK, val); 139 + }; 128 140 129 141 static int sun8i_a83t_hdmi_phy_config(struct dw_hdmi *hdmi, void *data, 130 142 const struct drm_display_info *display, ··· 204 192 205 193 return 0; 206 194 } 195 + 196 + static void sun8i_a83t_hdmi_phy_disable(struct dw_hdmi *hdmi, void *data) 197 + { 198 + struct sun8i_hdmi_phy *phy = data; 199 + 200 + dw_hdmi_phy_gen2_txpwron(hdmi, 0); 201 + dw_hdmi_phy_gen2_pddq(hdmi, 1); 202 + 203 + regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_REXT_CTRL_REG, 204 + SUN8I_HDMI_PHY_REXT_CTRL_REXT_EN, 0); 205 + } 206 + 207 + static const struct dw_hdmi_phy_ops sun8i_a83t_hdmi_phy_ops = { 208 + .init = sun8i_a83t_hdmi_phy_config, 209 + .disable = sun8i_a83t_hdmi_phy_disable, 210 + .read_hpd = dw_hdmi_phy_read_hpd, 211 + .update_hpd = dw_hdmi_phy_update_hpd, 212 + .setup_hpd = dw_hdmi_phy_setup_hpd, 213 + }; 207 214 208 215 static int sun8i_h3_hdmi_phy_config(struct dw_hdmi *hdmi, void *data, 209 216 const struct drm_display_info *display, ··· 379 348 return 0; 380 349 } 381 350 382 - static void sun8i_hdmi_phy_set_polarity(struct sun8i_hdmi_phy *phy, 383 - const struct drm_display_mode *mode) 384 - { 385 - u32 val = 0; 386 - 387 - if (mode->flags & DRM_MODE_FLAG_NHSYNC) 388 - val |= SUN8I_HDMI_PHY_DBG_CTRL_POL_NHSYNC; 389 - 390 - if (mode->flags & DRM_MODE_FLAG_NVSYNC) 391 - val |= SUN8I_HDMI_PHY_DBG_CTRL_POL_NVSYNC; 392 - 393 - regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_DBG_CTRL_REG, 394 - SUN8I_HDMI_PHY_DBG_CTRL_POL_MASK, val); 395 - }; 396 - 397 - static void sun8i_a83t_hdmi_phy_disable(struct dw_hdmi *hdmi, void *data) 398 - { 399 - struct sun8i_hdmi_phy *phy = data; 400 - 401 - dw_hdmi_phy_gen2_txpwron(hdmi, 0); 402 - dw_hdmi_phy_gen2_pddq(hdmi, 1); 403 - 404 - regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_REXT_CTRL_REG, 405 - SUN8I_HDMI_PHY_REXT_CTRL_REXT_EN, 0); 406 - } 407 - 408 351 static void sun8i_h3_hdmi_phy_disable(struct dw_hdmi *hdmi, void *data) 409 352 { 410 353 struct sun8i_hdmi_phy *phy = data; ··· 389 384 SUN8I_HDMI_PHY_ANA_CFG1_ENBI); 390 385 regmap_write(phy->regs, SUN8I_HDMI_PHY_PLL_CFG1_REG, 0); 391 386 } 392 - 393 - static const struct dw_hdmi_phy_ops sun8i_a83t_hdmi_phy_ops = { 394 - .init = sun8i_a83t_hdmi_phy_config, 395 - .disable = sun8i_a83t_hdmi_phy_disable, 396 - .read_hpd = dw_hdmi_phy_read_hpd, 397 - .update_hpd = dw_hdmi_phy_update_hpd, 398 - .setup_hpd = dw_hdmi_phy_setup_hpd, 399 - }; 400 387 401 388 static const struct dw_hdmi_phy_ops sun8i_h3_hdmi_phy_ops = { 402 389 .init = sun8i_h3_hdmi_phy_config,