diff options
author | Liviu Dudau <Liviu.Dudau@arm.com> | 2017-06-06 10:05:21 -0400 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2017-06-21 05:30:01 -0400 |
commit | de5cc8155cd250a31da67dea49aff7637ce98887 (patch) | |
tree | 8b685a96d3e768a5bb0bdcf32a73d008107ec057 | |
parent | 047b8e21e3bfa9faa4ed9a0c337fe0c687710251 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/arm/hdlcd_drv.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 345c8357b273..d3da87fbd85a 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c | |||
@@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev) | |||
297 | if (ret) | 297 | if (ret) |
298 | goto err_free; | 298 | goto err_free; |
299 | 299 | ||
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 | |||
300 | ret = component_bind_all(dev, drm); | 303 | ret = component_bind_all(dev, drm); |
301 | if (ret) { | 304 | if (ret) { |
302 | DRM_ERROR("Failed to bind all components\n"); | 305 | DRM_ERROR("Failed to bind all components\n"); |
@@ -340,11 +343,14 @@ err_register: | |||
340 | } | 343 | } |
341 | err_fbdev: | 344 | err_fbdev: |
342 | drm_kms_helper_poll_fini(drm); | 345 | drm_kms_helper_poll_fini(drm); |
346 | drm_vblank_cleanup(drm); | ||
343 | err_vblank: | 347 | err_vblank: |
344 | pm_runtime_disable(drm->dev); | 348 | pm_runtime_disable(drm->dev); |
345 | err_pm_active: | 349 | err_pm_active: |
346 | component_unbind_all(dev, drm); | 350 | component_unbind_all(dev, drm); |
347 | err_unload: | 351 | err_unload: |
352 | of_node_put(hdlcd->crtc.port); | ||
353 | hdlcd->crtc.port = NULL; | ||
348 | drm_irq_uninstall(drm); | 354 | drm_irq_uninstall(drm); |
349 | of_reserved_mem_device_release(drm->dev); | 355 | of_reserved_mem_device_release(drm->dev); |
350 | err_free: | 356 | err_free: |
@@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev) | |||
367 | } | 373 | } |
368 | drm_kms_helper_poll_fini(drm); | 374 | drm_kms_helper_poll_fini(drm); |
369 | component_unbind_all(dev, drm); | 375 | component_unbind_all(dev, drm); |
376 | of_node_put(hdlcd->crtc.port); | ||
377 | hdlcd->crtc.port = NULL; | ||
378 | drm_vblank_cleanup(drm); | ||
370 | pm_runtime_get_sync(drm->dev); | 379 | pm_runtime_get_sync(drm->dev); |
371 | drm_irq_uninstall(drm); | 380 | drm_irq_uninstall(drm); |
372 | pm_runtime_put_sync(drm->dev); | 381 | pm_runtime_put_sync(drm->dev); |