From: Vic Yang Date: Thu, 13 Dec 2012 02:09:51 +0000 (-0800) Subject: CHROMIUM: drm/exynos: dp: Handle bad hotplug IRQ X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4e65cdf84181e0f8d5c3ac7f067f81b912d721a3;p=people%2Faperard%2Flinux-chromebook.git CHROMIUM: drm/exynos: dp: Handle bad hotplug IRQ 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 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 Commit-Queue: Vic Yang Tested-by: Vic Yang Reviewed-by: Vincent Palatin --- diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index b1eb02ddd6ece..1e96e52c78cb9 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -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);