aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_drv.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2017-06-02 08:26:35 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-08-15 08:18:25 -0400
commit3c5968002bb47556aff9c15939e8e15fb7f53756 (patch)
treef4d89053c58b6d183b9ffec018f10466bd65a371 /drivers/gpu/drm/omapdrm/omap_drv.c
parent95552191f0a0c3632808d8883fc05d37a5c2fe14 (diff)
drm/omap: Support for HDMI hot plug detection
The HPD signal can be used for detecting HDMI cable plug and unplug event without the need for polling the status of the line. This will speed up detecting such event because we do not need to wait for the next poll event to notice the state change. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_drv.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 721a358531b0..10e24ca928f2 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -324,6 +324,32 @@ static int omap_modeset_init(struct drm_device *dev)
324} 324}
325 325
326/* 326/*
327 * Enable the HPD in external components if supported
328 */
329static void omap_modeset_enable_external_hpd(void)
330{
331 struct omap_dss_device *dssdev = NULL;
332
333 for_each_dss_dev(dssdev) {
334 if (dssdev->driver->enable_hpd)
335 dssdev->driver->enable_hpd(dssdev);
336 }
337}
338
339/*
340 * Disable the HPD in external components if supported
341 */
342static void omap_modeset_disable_external_hpd(void)
343{
344 struct omap_dss_device *dssdev = NULL;
345
346 for_each_dss_dev(dssdev) {
347 if (dssdev->driver->disable_hpd)
348 dssdev->driver->disable_hpd(dssdev);
349 }
350}
351
352/*
327 * drm ioctl funcs 353 * drm ioctl funcs
328 */ 354 */
329 355
@@ -602,6 +628,7 @@ static int pdev_probe(struct platform_device *pdev)
602 priv->fbdev = omap_fbdev_init(ddev); 628 priv->fbdev = omap_fbdev_init(ddev);
603 629
604 drm_kms_helper_poll_init(ddev); 630 drm_kms_helper_poll_init(ddev);
631 omap_modeset_enable_external_hpd();
605 632
606 /* 633 /*
607 * Register the DRM device with the core and the connectors with 634 * Register the DRM device with the core and the connectors with
@@ -614,6 +641,7 @@ static int pdev_probe(struct platform_device *pdev)
614 return 0; 641 return 0;
615 642
616err_cleanup_helpers: 643err_cleanup_helpers:
644 omap_modeset_disable_external_hpd();
617 drm_kms_helper_poll_fini(ddev); 645 drm_kms_helper_poll_fini(ddev);
618 if (priv->fbdev) 646 if (priv->fbdev)
619 omap_fbdev_free(ddev); 647 omap_fbdev_free(ddev);
@@ -642,6 +670,7 @@ static int pdev_remove(struct platform_device *pdev)
642 670
643 drm_dev_unregister(ddev); 671 drm_dev_unregister(ddev);
644 672
673 omap_modeset_disable_external_hpd();
645 drm_kms_helper_poll_fini(ddev); 674 drm_kms_helper_poll_fini(ddev);
646 675
647 if (priv->fbdev) 676 if (priv->fbdev)