Skip to content

Commit 5889ee5

Browse files
committed
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 <[email protected]>
1 parent 2dfd045 commit 5889ee5

File tree

3 files changed

+13
-24
lines changed

3 files changed

+13
-24
lines changed

drivers/gpu/drm/xlnx/zynqmp_dp.c

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,27 +1610,10 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data)
16101610
* Initialization & Cleanup
16111611
*/
16121612

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-
16311613
int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub, struct drm_device *drm)
16321614
{
16331615
struct platform_device *pdev = to_platform_device(dpsub->dev);
1616+
struct drm_bridge *bridge;
16341617
struct zynqmp_dp *dp;
16351618
struct resource *res;
16361619
int ret;
@@ -1673,6 +1656,14 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub, struct drm_device *drm)
16731656
if (ret)
16741657
goto err_reset;
16751658

1659+
/* Initialize the bridge. */
1660+
bridge = &dp->bridge;
1661+
bridge->funcs = &zynqmp_dp_bridge_funcs;
1662+
bridge->ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID
1663+
| DRM_BRIDGE_OP_HPD;
1664+
bridge->type = DRM_MODE_CONNECTOR_DisplayPort;
1665+
dpsub->bridge = bridge;
1666+
16761667
/*
16771668
* Acquire the next bridge in the chain. Ignore errors caused by port@5
16781669
* not being connected for backward-compatibility with older DTs.
@@ -1683,6 +1674,9 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub, struct drm_device *drm)
16831674
goto err_reset;
16841675

16851676
/* Initialize the hardware. */
1677+
dp->config.misc0 &= ~ZYNQMP_DP_MAIN_STREAM_MISC0_SYNC_LOCK;
1678+
zynqmp_dp_set_format(dp, NULL, ZYNQMP_DPSUB_FORMAT_RGB, 8);
1679+
16861680
zynqmp_dp_write(dp, ZYNQMP_DP_TX_PHY_POWER_DOWN,
16871681
ZYNQMP_DP_TX_PHY_POWER_DOWN_ALL);
16881682
zynqmp_dp_set(dp, ZYNQMP_DP_PHY_RESET, ZYNQMP_DP_PHY_RESET_ALL_RESET);

drivers/gpu/drm/xlnx/zynqmp_dp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ struct zynqmp_dpsub;
2020
void zynqmp_dp_enable_vblank(struct zynqmp_dp *dp);
2121
void zynqmp_dp_disable_vblank(struct zynqmp_dp *dp);
2222

23-
int zynqmp_dp_drm_init(struct zynqmp_dpsub *dpsub);
2423
int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub, struct drm_device *drm);
2524
void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub);
2625

drivers/gpu/drm/xlnx/zynqmp_kms.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ int zynqmp_dpsub_kms_init(struct zynqmp_dpsub *dpsub)
348348
struct drm_connector *connector;
349349
int ret;
350350

351-
/* Create the planes and the CRTC, and initialize the DP encoder. */
351+
/* Create the planes and the CRTC. */
352352
ret = zynqmp_dpsub_create_planes(dpsub);
353353
if (ret)
354354
return ret;
@@ -359,10 +359,6 @@ int zynqmp_dpsub_kms_init(struct zynqmp_dpsub *dpsub)
359359

360360
zynqmp_dpsub_map_crtc_to_plane(dpsub);
361361

362-
ret = zynqmp_dp_drm_init(dpsub);
363-
if (ret)
364-
return ret;
365-
366362
/* Create the encoder and attach the bridge. */
367363
encoder->possible_crtcs |= drm_crtc_mask(&dpsub->crtc);
368364
drm_simple_encoder_init(&dpsub->drm, encoder, DRM_MODE_ENCODER_NONE);

0 commit comments

Comments
 (0)