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

drm: xlnx: zynqmp_dpsub: Move DP bridge init to zynqmp_dp_probe()

There's no need to delay bridge initialization, move it to
zynqmp_dp_probe() and drop the zynqmp_dp_drm_init() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

+13 -24
+12 -18
drivers/gpu/drm/xlnx/zynqmp_dp.c
··· 1610 1610 * Initialization & Cleanup 1611 1611 */ 1612 1612 1613 - int zynqmp_dp_drm_init(struct zynqmp_dpsub *dpsub) 1614 - { 1615 - struct zynqmp_dp *dp = dpsub->dp; 1616 - struct drm_bridge *bridge = &dp->bridge; 1617 - 1618 - dp->config.misc0 &= ~ZYNQMP_DP_MAIN_STREAM_MISC0_SYNC_LOCK; 1619 - zynqmp_dp_set_format(dp, NULL, ZYNQMP_DPSUB_FORMAT_RGB, 8); 1620 - 1621 - /* Initialize the bridge. */ 1622 - bridge->funcs = &zynqmp_dp_bridge_funcs; 1623 - bridge->ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID 1624 - | DRM_BRIDGE_OP_HPD; 1625 - bridge->type = DRM_MODE_CONNECTOR_DisplayPort; 1626 - dpsub->bridge = bridge; 1627 - 1628 - return 0; 1629 - } 1630 - 1631 1613 int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub, struct drm_device *drm) 1632 1614 { 1633 1615 struct platform_device *pdev = to_platform_device(dpsub->dev); 1616 + struct drm_bridge *bridge; 1634 1617 struct zynqmp_dp *dp; 1635 1618 struct resource *res; 1636 1619 int ret; ··· 1656 1673 if (ret) 1657 1674 goto err_reset; 1658 1675 1676 + /* Initialize the bridge. */ 1677 + bridge = &dp->bridge; 1678 + bridge->funcs = &zynqmp_dp_bridge_funcs; 1679 + bridge->ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID 1680 + | DRM_BRIDGE_OP_HPD; 1681 + bridge->type = DRM_MODE_CONNECTOR_DisplayPort; 1682 + dpsub->bridge = bridge; 1683 + 1659 1684 /* 1660 1685 * Acquire the next bridge in the chain. Ignore errors caused by port@5 1661 1686 * not being connected for backward-compatibility with older DTs. ··· 1674 1683 goto err_reset; 1675 1684 1676 1685 /* Initialize the hardware. */ 1686 + dp->config.misc0 &= ~ZYNQMP_DP_MAIN_STREAM_MISC0_SYNC_LOCK; 1687 + zynqmp_dp_set_format(dp, NULL, ZYNQMP_DPSUB_FORMAT_RGB, 8); 1688 + 1677 1689 zynqmp_dp_write(dp, ZYNQMP_DP_TX_PHY_POWER_DOWN, 1678 1690 ZYNQMP_DP_TX_PHY_POWER_DOWN_ALL); 1679 1691 zynqmp_dp_set(dp, ZYNQMP_DP_PHY_RESET, ZYNQMP_DP_PHY_RESET_ALL_RESET);
-1
drivers/gpu/drm/xlnx/zynqmp_dp.h
··· 20 20 void zynqmp_dp_enable_vblank(struct zynqmp_dp *dp); 21 21 void zynqmp_dp_disable_vblank(struct zynqmp_dp *dp); 22 22 23 - int zynqmp_dp_drm_init(struct zynqmp_dpsub *dpsub); 24 23 int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub, struct drm_device *drm); 25 24 void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub); 26 25
+1 -5
drivers/gpu/drm/xlnx/zynqmp_kms.c
··· 348 348 struct drm_connector *connector; 349 349 int ret; 350 350 351 - /* Create the planes and the CRTC, and initialize the DP encoder. */ 351 + /* Create the planes and the CRTC. */ 352 352 ret = zynqmp_dpsub_create_planes(dpsub); 353 353 if (ret) 354 354 return ret; ··· 358 358 return ret; 359 359 360 360 zynqmp_dpsub_map_crtc_to_plane(dpsub); 361 - 362 - ret = zynqmp_dp_drm_init(dpsub); 363 - if (ret) 364 - return ret; 365 361 366 362 /* Create the encoder and attach the bridge. */ 367 363 encoder->possible_crtcs |= drm_crtc_mask(&dpsub->crtc);