CHROMIUM: drm/exynos: dp: Add force_connected flag
authorSean Paul <seanpaul@chromium.org>
Fri, 25 Jan 2013 22:09:04 +0000 (17:09 -0500)
committerChromeBot <chrome-bot@google.com>
Sat, 26 Jan 2013 00:20:43 +0000 (16:20 -0800)
Add a new flag to the DisplayPort platform data to optionally force
is_connected to return true. This is useful for cases such as ours where
we don't have a proper DP monitor connected, but rather a noisy bridge
that doesn't know when it's actually ready to assert hotplug.

This will also prevent drm from assuming we're disconnected and detaching
our encoder from the connector (thus losing us forever as a result of
the interrupt scheme in the driver, which needs to be fixed).

BUG=chromium-os:38006
TEST=Tested manually using Doug's reproduction instructions in c17 on the bug

Change-Id: If2034458d9de93259e92a0f3eb8f386c340b0d7d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42042
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
arch/arm/mach-exynos/mach-exynos5-dt.c
drivers/gpu/drm/exynos/exynos_dp_core.c
drivers/gpu/drm/exynos/exynos_dp_core.h
include/video/exynos_dp.h

index 1b1b62a..f7818db 100644 (file)
@@ -592,11 +592,12 @@ static struct video_info ps8622_dp_config = {
 };
 
 static struct exynos_dp_platdata smdk5250_dp_data = {
-       .video_info     = &ptn3460_dp_config,
-       .training_type  = SW_LINK_TRAINING,
-       .hpd_gpio       = -ENODEV,
-       .phy_init       = s5p_dp_phy_init,
-       .phy_exit       = s5p_dp_phy_exit,
+       .video_info             = &ptn3460_dp_config,
+       .training_type          = SW_LINK_TRAINING,
+       .hpd_gpio               = -ENODEV,
+       .force_connected        = true,
+       .phy_init               = s5p_dp_phy_init,
+       .phy_exit               = s5p_dp_phy_exit,
 };
 
 #define S5P_PMU_DEBUG                          S5P_PMUREG(0x0A00)
index 1e96e52..d787cd8 100644 (file)
@@ -1057,10 +1057,11 @@ static int exynos_dp_check_timing(void *ctx, void *timing)
 static bool exynos_dp_is_connected(void *ctx)
 {
        struct exynos_dp_device *dp = ctx;
-       int ret;
 
-       ret = exynos_dp_detect_hpd(dp);
-       return !ret;
+       if (dp->force_connected)
+               return true;
+       else
+               return !exynos_dp_detect_hpd(dp);
 }
 
 static int exynos_dp_subdrv_probe(void *ctx, struct drm_device *drm_dev)
@@ -1152,6 +1153,7 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
 
        dp->training_type = pdata->training_type;
        dp->video_info = pdata->video_info;
+       dp->force_connected = pdata->force_connected;
        if (pdata->phy_init) {
                dp->phy_ops.phy_init = pdata->phy_init;
                dp->phy_ops.phy_init();
index 3572619..e62b625 100644 (file)
@@ -46,6 +46,7 @@ struct exynos_dp_device {
        int                     irq;
        void __iomem            *reg_base;
        int                     hpd_gpio;
+       bool                    force_connected;
 
        struct dp_phy_ops       phy_ops;
        struct video_info       *video_info;
index de5a9a2..ae33bab 100644 (file)
@@ -132,6 +132,7 @@ struct exynos_dp_platdata {
        enum link_training_type training_type;
 
        int hpd_gpio;
+       bool force_connected;
 
        void (*phy_init)(void);
        void (*phy_exit)(void);