Skip to content

Commit de5cc81

Browse files
committed
drm/arm: hdlcd: Set the CRTC's port before binding the encoder.
The component-based encoder(s) used by HDLCD expect the CRTC port to be set before binding in order to find the right endpoint. Without this patch, the TDA19988 encoder driver prints a warning "Falling back to first CRTC". Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
1 parent 047b8e2 commit de5cc81

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎drivers/gpu/drm/arm/hdlcd_drv.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev)
297297
if (ret)
298298
goto err_free;
299299

300+
/* Set the CRTC's port so that the encoder component can find it */
301+
hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);
302+
300303
ret = component_bind_all(dev, drm);
301304
if (ret) {
302305
DRM_ERROR("Failed to bind all components\n");
@@ -340,11 +343,14 @@ static int hdlcd_drm_bind(struct device *dev)
340343
}
341344
err_fbdev:
342345
drm_kms_helper_poll_fini(drm);
346+
drm_vblank_cleanup(drm);
343347
err_vblank:
344348
pm_runtime_disable(drm->dev);
345349
err_pm_active:
346350
component_unbind_all(dev, drm);
347351
err_unload:
352+
of_node_put(hdlcd->crtc.port);
353+
hdlcd->crtc.port = NULL;
348354
drm_irq_uninstall(drm);
349355
of_reserved_mem_device_release(drm->dev);
350356
err_free:
@@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev)
367373
}
368374
drm_kms_helper_poll_fini(drm);
369375
component_unbind_all(dev, drm);
376+
of_node_put(hdlcd->crtc.port);
377+
hdlcd->crtc.port = NULL;
378+
drm_vblank_cleanup(drm);
370379
pm_runtime_get_sync(drm->dev);
371380
drm_irq_uninstall(drm);
372381
pm_runtime_put_sync(drm->dev);

0 commit comments

Comments
 (0)