]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: drm/exynos: dp: Handle bad hotplug IRQ
authorVic Yang <victoryang@chromium.org>
Thu, 13 Dec 2012 02:09:51 +0000 (18:09 -0800)
committerChromeBot <chrome-bot@google.com>
Wed, 9 Jan 2013 18:32:21 +0000 (10:32 -0800)
If the hotplug detect pin cannot be mapped to an IRQ number, we should
still be able to detect the display with polling loop. This CL prevents
driver initialization from failing in this case, and adds a call to
hotplug handling function in power on sequence.

Signed-off-by: Vic Yang <victoryang@chromium.org>
BUG=chrome-os-partner:16280
TEST=on Snow and Spring, boot and see display.

Change-Id: Idaa908ac38e85b8dd10c367a4c1f8ec47a4432b9
Reviewed-on: https://gerrit.chromium.org/gerrit/40363
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
drivers/gpu/drm/exynos/exynos_dp_core.c

index b1eb02ddd6ece02f9ed756b1a4870df48ab784f0..1e96e52c78cb95874db0c3758f3e9e6bde66eb74 100644 (file)
@@ -1013,6 +1013,14 @@ static int exynos_dp_power_on(struct exynos_dp_device *dp)
 
        exynos_dp_init_dp(dp);
 
+       /*
+        * DP controller is reset and needs HPD interrupt to trigger
+        * re-configuration. If we don't have valid IRQ, this is never
+        * going to happen. Let's reconfigure it here in this case.
+        */
+       if (dp->irq < 0 && !exynos_dp_detect_hpd(dp))
+               schedule_work(&dp->hotplug_work);
+
        return 0;
 }
 
@@ -1061,6 +1069,8 @@ static int exynos_dp_subdrv_probe(void *ctx, struct drm_device *drm_dev)
 
        dp->drm_dev = drm_dev;
 
+       exynos_dp_power(dp, DRM_MODE_DPMS_ON);
+
        return 0;
 }
 
@@ -1140,12 +1150,6 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
                irqflags = 0;
        }
 
-       if (dp->irq < 0) {
-               dev_err(&pdev->dev, "failed to get irq\n");
-               ret = -ENODEV;
-               goto err_gpio;
-       }
-
        dp->training_type = pdata->training_type;
        dp->video_info = pdata->video_info;
        if (pdata->phy_init) {
@@ -1157,17 +1161,17 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
 
        INIT_WORK(&dp->hotplug_work, exynos_dp_hotplug);
 
-       ret = request_irq(dp->irq, exynos_dp_irq_handler, irqflags,
-                       "exynos-dp", dp);
-       if (ret) {
-               dev_err(&pdev->dev, "failed to request irq\n");
-               goto err_gpio;
+       if (dp->irq >= 0) {
+               ret = request_irq(dp->irq, exynos_dp_irq_handler, irqflags,
+                               "exynos-dp", dp);
+               if (ret) {
+                       dev_err(&pdev->dev, "failed to request irq\n");
+                       goto err_gpio;
+               }
        }
 
        platform_set_drvdata(pdev, dp);
 
-       exynos_dp_power(dp, DRM_MODE_DPMS_ON);
-
        exynos_display_attach_panel(EXYNOS_DRM_DISPLAY_TYPE_FIMD, &dp_panel_ops,
                        dp);