[PATCH 08/10] video: exynos_dp: Move hotplug into a workqueue

Subsystems: framebuffer layer, the rest

STALE5089d REVIEWED: 1 (0M)

1 review trailer.

4 messages, 2 authors, 2012-11-01 · open the first message on its own page

[PATCH 08/10] video: exynos_dp: Move hotplug into a workqueue

From: Sean Paul <hidden>
Date: 2012-08-08 03:54:22

Move the hotplug related code from probe and resume into a workqueue.
This allows us to initialize the DP driver (and resume it) when there
is no monitor connected.

Signed-off-by: Sean Paul <redacted>
Reviewed-by: Olof Johansson <redacted>
---
 drivers/video/exynos/exynos_dp_core.c |   94 +++++++++++++++++----------------
 drivers/video/exynos/exynos_dp_core.h |    1 +
 2 files changed, 50 insertions(+), 45 deletions(-)
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 2882362..68ad494 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -834,6 +834,45 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
+static void exynos_dp_hotplug(struct work_struct *work)
+{
+	struct exynos_dp_device *dp;
+	int ret;
+
+	dp = container_of(work, struct exynos_dp_device, hotplug_work);
+
+	ret = exynos_dp_detect_hpd(dp);
+	if (ret) {
+		dev_err(dp->dev, "unable to detect hpd\n");
+		return;
+	}
+
+	ret = exynos_dp_handle_edid(dp);
+	if (ret) {
+		dev_err(dp->dev, "unable to handle edid\n");
+		return;
+	}
+
+	ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
+					dp->video_info->link_rate);
+	if (ret) {
+		dev_err(dp->dev, "unable to do link train\n");
+		return;
+	}
+
+	exynos_dp_enable_scramble(dp, 1);
+	exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
+	exynos_dp_enable_enhanced_mode(dp, 1);
+
+	exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
+	exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
+
+	exynos_dp_init_video(dp);
+	ret = exynos_dp_config_video(dp, dp->video_info);
+	if (ret)
+		dev_err(&dp->dev, "unable to config video\n");
+}
+
 static int __devinit exynos_dp_probe(struct platform_device *pdev)
 {
 	struct resource *res;
@@ -886,6 +925,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
 		goto err_clock;
 	}
 
+	INIT_WORK(&dp->hotplug_work, exynos_dp_hotplug);
+
 	ret = devm_request_irq(&pdev->dev, dp->irq, exynos_dp_irq_handler, 0,
 				"exynos-dp", dp);
 	if (ret) {
@@ -899,36 +940,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
 
 	exynos_dp_init_dp(dp);
 
-	ret = exynos_dp_detect_hpd(dp);
-	if (ret) {
-		dev_err(&pdev->dev, "unable to detect hpd\n");
-		goto err_clock;
-	}
-
-	exynos_dp_handle_edid(dp);
-
-	ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-				dp->video_info->link_rate);
-	if (ret) {
-		dev_err(&pdev->dev, "unable to do link train\n");
-		goto err_clock;
-	}
-
-	exynos_dp_enable_scramble(dp, 1);
-	exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-	exynos_dp_enable_enhanced_mode(dp, 1);
-
-	exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-	exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-	exynos_dp_init_video(dp);
-	ret = exynos_dp_config_video(dp, dp->video_info);
-	if (ret) {
-		dev_err(&pdev->dev, "unable to config video\n");
-		goto err_clock;
-	}
-
 	platform_set_drvdata(pdev, dp);
+	schedule_work(&dp->hotplug_work);
 
 	return 0;
 
@@ -943,6 +956,9 @@ static int __devexit exynos_dp_remove(struct platform_device *pdev)
 	struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
 	struct exynos_dp_device *dp = platform_get_drvdata(pdev);
 
+	if (work_pending(&dp->hotplug_work))
+		flush_work_sync(&dp->hotplug_work);
+
 	if (pdata && pdata->phy_exit)
 		pdata->phy_exit();
 
@@ -959,6 +975,9 @@ static int exynos_dp_suspend(struct device *dev)
 	struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
 	struct exynos_dp_device *dp = platform_get_drvdata(pdev);
 
+	if (work_pending(&dp->hotplug_work))
+		flush_work_sync(&dp->hotplug_work);
+
 	if (pdata && pdata->phy_exit)
 		pdata->phy_exit();
 
@@ -979,22 +998,7 @@ static int exynos_dp_resume(struct device *dev)
 	clk_enable(dp->clock);
 
 	exynos_dp_init_dp(dp);
-
-	exynos_dp_detect_hpd(dp);
-	exynos_dp_handle_edid(dp);
-
-	exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-				dp->video_info->link_rate);
-
-	exynos_dp_enable_scramble(dp, 1);
-	exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-	exynos_dp_enable_enhanced_mode(dp, 1);
-
-	exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-	exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-	exynos_dp_init_video(dp);
-	exynos_dp_config_video(dp, dp->video_info);
+	schedule_work(&dp->hotplug_work);
 
 	return 0;
 }
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 6431c65..cf1010b 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -32,6 +32,7 @@ struct exynos_dp_device {
 
 	struct video_info	*video_info;
 	struct link_train	link_train;
+	struct work_struct	hotplug_work;
 };
 
 /* exynos_dp_reg.c */
-- 
1.7.7.3

Re: [PATCH 08/10] video: exynos_dp: Move hotplug into a workqueue

From: Sean Paul <hidden>
Date: 2012-10-31 17:20:28

On Tue, Aug 7, 2012 at 11:54 PM, Sean Paul [off-list ref] wrote:
Move the hotplug related code from probe and resume into a workqueue.
This allows us to initialize the DP driver (and resume it) when there
is no monitor connected.
Comments?

quoted hunk
Signed-off-by: Sean Paul <redacted>
Reviewed-by: Olof Johansson <redacted>
---
 drivers/video/exynos/exynos_dp_core.c |   94 +++++++++++++++++----------------
 drivers/video/exynos/exynos_dp_core.h |    1 +
 2 files changed, 50 insertions(+), 45 deletions(-)
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 2882362..68ad494 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -834,6 +834,45 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void *arg)
        return IRQ_HANDLED;
 }

+static void exynos_dp_hotplug(struct work_struct *work)
+{
+       struct exynos_dp_device *dp;
+       int ret;
+
+       dp = container_of(work, struct exynos_dp_device, hotplug_work);
+
+       ret = exynos_dp_detect_hpd(dp);
+       if (ret) {
+               dev_err(dp->dev, "unable to detect hpd\n");
+               return;
+       }
+
+       ret = exynos_dp_handle_edid(dp);
+       if (ret) {
+               dev_err(dp->dev, "unable to handle edid\n");
+               return;
+       }
+
+       ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
+                                       dp->video_info->link_rate);
+       if (ret) {
+               dev_err(dp->dev, "unable to do link train\n");
+               return;
+       }
+
+       exynos_dp_enable_scramble(dp, 1);
+       exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
+       exynos_dp_enable_enhanced_mode(dp, 1);
+
+       exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
+       exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
+
+       exynos_dp_init_video(dp);
+       ret = exynos_dp_config_video(dp, dp->video_info);
+       if (ret)
+               dev_err(&dp->dev, "unable to config video\n");
+}
+
 static int __devinit exynos_dp_probe(struct platform_device *pdev)
 {
        struct resource *res;
@@ -886,6 +925,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
                goto err_clock;
        }

+       INIT_WORK(&dp->hotplug_work, exynos_dp_hotplug);
+
        ret = devm_request_irq(&pdev->dev, dp->irq, exynos_dp_irq_handler, 0,
                                "exynos-dp", dp);
        if (ret) {
@@ -899,36 +940,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)

        exynos_dp_init_dp(dp);

-       ret = exynos_dp_detect_hpd(dp);
-       if (ret) {
-               dev_err(&pdev->dev, "unable to detect hpd\n");
-               goto err_clock;
-       }
-
-       exynos_dp_handle_edid(dp);
-
-       ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-                               dp->video_info->link_rate);
-       if (ret) {
-               dev_err(&pdev->dev, "unable to do link train\n");
-               goto err_clock;
-       }
-
-       exynos_dp_enable_scramble(dp, 1);
-       exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-       exynos_dp_enable_enhanced_mode(dp, 1);
-
-       exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-       exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-       exynos_dp_init_video(dp);
-       ret = exynos_dp_config_video(dp, dp->video_info);
-       if (ret) {
-               dev_err(&pdev->dev, "unable to config video\n");
-               goto err_clock;
-       }
-
        platform_set_drvdata(pdev, dp);
+       schedule_work(&dp->hotplug_work);

        return 0;
@@ -943,6 +956,9 @@ static int __devexit exynos_dp_remove(struct platform_device *pdev)
        struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
        struct exynos_dp_device *dp = platform_get_drvdata(pdev);

+       if (work_pending(&dp->hotplug_work))
+               flush_work_sync(&dp->hotplug_work);
+
        if (pdata && pdata->phy_exit)
                pdata->phy_exit();
@@ -959,6 +975,9 @@ static int exynos_dp_suspend(struct device *dev)
        struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
        struct exynos_dp_device *dp = platform_get_drvdata(pdev);

+       if (work_pending(&dp->hotplug_work))
+               flush_work_sync(&dp->hotplug_work);
+
        if (pdata && pdata->phy_exit)
                pdata->phy_exit();
@@ -979,22 +998,7 @@ static int exynos_dp_resume(struct device *dev)
        clk_enable(dp->clock);

        exynos_dp_init_dp(dp);
-
-       exynos_dp_detect_hpd(dp);
-       exynos_dp_handle_edid(dp);
-
-       exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-                               dp->video_info->link_rate);
-
-       exynos_dp_enable_scramble(dp, 1);
-       exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-       exynos_dp_enable_enhanced_mode(dp, 1);
-
-       exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-       exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-       exynos_dp_init_video(dp);
-       exynos_dp_config_video(dp, dp->video_info);
+       schedule_work(&dp->hotplug_work);

        return 0;
 }
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 6431c65..cf1010b 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -32,6 +32,7 @@ struct exynos_dp_device {

        struct video_info       *video_info;
        struct link_train       link_train;
+       struct work_struct      hotplug_work;
 };

 /* exynos_dp_reg.c */
--
1.7.7.3

Re: [PATCH 08/10] video: exynos_dp: Move hotplug into a workqueue

From: Jingoo Han <hidden>
Date: 2012-11-01 00:36:58

On Thursday, November 01, 2012 2:20 AM Sean Paul wrote
On Tue, Aug 7, 2012 at 11:54 PM, Sean Paul [off-list ref] wrote:
quoted
Move the hotplug related code from probe and resume into a workqueue.
This allows us to initialize the DP driver (and resume it) when there
is no monitor connected.
Comments?
It looks good, but, I have to test this.

quoted
Signed-off-by: Sean Paul <redacted>
Reviewed-by: Olof Johansson <redacted>
---
 drivers/video/exynos/exynos_dp_core.c |   94 +++++++++++++++++----------------
 drivers/video/exynos/exynos_dp_core.h |    1 +
 2 files changed, 50 insertions(+), 45 deletions(-)
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 2882362..68ad494 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -834,6 +834,45 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void *arg)
        return IRQ_HANDLED;
 }

+static void exynos_dp_hotplug(struct work_struct *work)
+{
+       struct exynos_dp_device *dp;
+       int ret;
+
+       dp = container_of(work, struct exynos_dp_device, hotplug_work);
+
+       ret = exynos_dp_detect_hpd(dp);
+       if (ret) {
+               dev_err(dp->dev, "unable to detect hpd\n");
+               return;
+       }
+
+       ret = exynos_dp_handle_edid(dp);
+       if (ret) {
+               dev_err(dp->dev, "unable to handle edid\n");
+               return;
+       }
+
+       ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
+                                       dp->video_info->link_rate);
+       if (ret) {
+               dev_err(dp->dev, "unable to do link train\n");
+               return;
+       }
+
+       exynos_dp_enable_scramble(dp, 1);
+       exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
+       exynos_dp_enable_enhanced_mode(dp, 1);
+
+       exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
+       exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
+
+       exynos_dp_init_video(dp);
+       ret = exynos_dp_config_video(dp, dp->video_info);
+       if (ret)
+               dev_err(&dp->dev, "unable to config video\n");
+}
+
 static int __devinit exynos_dp_probe(struct platform_device *pdev)
 {
        struct resource *res;
@@ -886,6 +925,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
                goto err_clock;
        }

+       INIT_WORK(&dp->hotplug_work, exynos_dp_hotplug);
+
        ret = devm_request_irq(&pdev->dev, dp->irq, exynos_dp_irq_handler, 0,
                                "exynos-dp", dp);
        if (ret) {
@@ -899,36 +940,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)

        exynos_dp_init_dp(dp);

-       ret = exynos_dp_detect_hpd(dp);
-       if (ret) {
-               dev_err(&pdev->dev, "unable to detect hpd\n");
-               goto err_clock;
-       }
-
-       exynos_dp_handle_edid(dp);
-
-       ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-                               dp->video_info->link_rate);
-       if (ret) {
-               dev_err(&pdev->dev, "unable to do link train\n");
-               goto err_clock;
-       }
-
-       exynos_dp_enable_scramble(dp, 1);
-       exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-       exynos_dp_enable_enhanced_mode(dp, 1);
-
-       exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-       exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-       exynos_dp_init_video(dp);
-       ret = exynos_dp_config_video(dp, dp->video_info);
-       if (ret) {
-               dev_err(&pdev->dev, "unable to config video\n");
-               goto err_clock;
-       }
-
        platform_set_drvdata(pdev, dp);
+       schedule_work(&dp->hotplug_work);

        return 0;
@@ -943,6 +956,9 @@ static int __devexit exynos_dp_remove(struct platform_device *pdev)
        struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
        struct exynos_dp_device *dp = platform_get_drvdata(pdev);

+       if (work_pending(&dp->hotplug_work))
+               flush_work_sync(&dp->hotplug_work);
+
        if (pdata && pdata->phy_exit)
                pdata->phy_exit();
@@ -959,6 +975,9 @@ static int exynos_dp_suspend(struct device *dev)
        struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
        struct exynos_dp_device *dp = platform_get_drvdata(pdev);

+       if (work_pending(&dp->hotplug_work))
+               flush_work_sync(&dp->hotplug_work);
+
        if (pdata && pdata->phy_exit)
                pdata->phy_exit();
@@ -979,22 +998,7 @@ static int exynos_dp_resume(struct device *dev)
        clk_enable(dp->clock);

        exynos_dp_init_dp(dp);
-
-       exynos_dp_detect_hpd(dp);
-       exynos_dp_handle_edid(dp);
-
-       exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-                               dp->video_info->link_rate);
-
-       exynos_dp_enable_scramble(dp, 1);
-       exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-       exynos_dp_enable_enhanced_mode(dp, 1);
-
-       exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-       exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-       exynos_dp_init_video(dp);
-       exynos_dp_config_video(dp, dp->video_info);
+       schedule_work(&dp->hotplug_work);

        return 0;
 }
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 6431c65..cf1010b 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -32,6 +32,7 @@ struct exynos_dp_device {

        struct video_info       *video_info;
        struct link_train       link_train;
+       struct work_struct      hotplug_work;
 };

 /* exynos_dp_reg.c */
--
1.7.7.3

Re: [PATCH 08/10] video: exynos_dp: Move hotplug into a workqueue

From: Jingoo Han <hidden>
Date: 2012-11-01 02:51:25

On Wednesday, August 08, 2012 12:54 PM Sean Paul wrote
quoted hunk
Move the hotplug related code from probe and resume into a workqueue.
This allows us to initialize the DP driver (and resume it) when there
is no monitor connected.

Signed-off-by: Sean Paul <redacted>
Reviewed-by: Olof Johansson <redacted>
---
 drivers/video/exynos/exynos_dp_core.c |   94 +++++++++++++++++----------------
 drivers/video/exynos/exynos_dp_core.h |    1 +
 2 files changed, 50 insertions(+), 45 deletions(-)
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 2882362..68ad494 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -834,6 +834,45 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void *arg)
 	return IRQ_HANDLED;
 }

+static void exynos_dp_hotplug(struct work_struct *work)
+{
+	struct exynos_dp_device *dp;
+	int ret;
+
+	dp = container_of(work, struct exynos_dp_device, hotplug_work);
+
+	ret = exynos_dp_detect_hpd(dp);
+	if (ret) {
+		dev_err(dp->dev, "unable to detect hpd\n");
+		return;
+	}
+
+	ret = exynos_dp_handle_edid(dp);
+	if (ret) {
+		dev_err(dp->dev, "unable to handle edid\n");
+		return;
+	}
+
+	ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
+					dp->video_info->link_rate);
+	if (ret) {
+		dev_err(dp->dev, "unable to do link train\n");
+		return;
+	}
+
+	exynos_dp_enable_scramble(dp, 1);
+	exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
+	exynos_dp_enable_enhanced_mode(dp, 1);
+
+	exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
+	exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
+
+	exynos_dp_init_video(dp);
+	ret = exynos_dp_config_video(dp, dp->video_info);
+	if (ret)
+		dev_err(&dp->dev, "unable to config video\n");
Please, remove build warnings and re-submit new patch.

drivers/video/exynos/exynos_dp_core.c: In function 'exynos_dp_hotplug':
drivers/video/exynos/exynos_dp_core.c:875:3: warning: passing argument 1 of 'dev_err' from incompatible pointer type [enabled by
default]
include/linux/device.h:928:5: note: expected 'const struct device *' but argument is of type 'struct device **'
drivers/video/exynos/exynos_dp_core.c: In function 'exynos_dp_remove':
drivers/video/exynos/exynos_dp_core.c:950:3: warning: 'flush_work_sync' is deprecated (declared at include/linux/workqueue.h:448)
[-Wdeprecated-declarations]
drivers/video/exynos/exynos_dp_core.c: In function 'exynos_dp_suspend':
drivers/video/exynos/exynos_dp_core.c:968:3: warning: 'flush_work_sync' is deprecated (declared at include/linux/workqueue.h:448)
[-Wdeprecated-declarations]

quoted hunk
+}
+
 static int __devinit exynos_dp_probe(struct platform_device *pdev)
 {
 	struct resource *res;
@@ -886,6 +925,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)
 		goto err_clock;
 	}

+	INIT_WORK(&dp->hotplug_work, exynos_dp_hotplug);
+
 	ret = devm_request_irq(&pdev->dev, dp->irq, exynos_dp_irq_handler, 0,
 				"exynos-dp", dp);
 	if (ret) {
@@ -899,36 +940,8 @@ static int __devinit exynos_dp_probe(struct platform_device *pdev)

 	exynos_dp_init_dp(dp);

-	ret = exynos_dp_detect_hpd(dp);
-	if (ret) {
-		dev_err(&pdev->dev, "unable to detect hpd\n");
-		goto err_clock;
-	}
-
-	exynos_dp_handle_edid(dp);
-
-	ret = exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-				dp->video_info->link_rate);
-	if (ret) {
-		dev_err(&pdev->dev, "unable to do link train\n");
-		goto err_clock;
-	}
-
-	exynos_dp_enable_scramble(dp, 1);
-	exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-	exynos_dp_enable_enhanced_mode(dp, 1);
-
-	exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-	exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-	exynos_dp_init_video(dp);
-	ret = exynos_dp_config_video(dp, dp->video_info);
-	if (ret) {
-		dev_err(&pdev->dev, "unable to config video\n");
-		goto err_clock;
-	}
-
 	platform_set_drvdata(pdev, dp);
+	schedule_work(&dp->hotplug_work);

 	return 0;
@@ -943,6 +956,9 @@ static int __devexit exynos_dp_remove(struct platform_device *pdev)
 	struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
 	struct exynos_dp_device *dp = platform_get_drvdata(pdev);

+	if (work_pending(&dp->hotplug_work))
+		flush_work_sync(&dp->hotplug_work);
+
 	if (pdata && pdata->phy_exit)
 		pdata->phy_exit();
@@ -959,6 +975,9 @@ static int exynos_dp_suspend(struct device *dev)
 	struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
 	struct exynos_dp_device *dp = platform_get_drvdata(pdev);

+	if (work_pending(&dp->hotplug_work))
+		flush_work_sync(&dp->hotplug_work);
+
 	if (pdata && pdata->phy_exit)
 		pdata->phy_exit();
@@ -979,22 +998,7 @@ static int exynos_dp_resume(struct device *dev)
 	clk_enable(dp->clock);

 	exynos_dp_init_dp(dp);
-
-	exynos_dp_detect_hpd(dp);
-	exynos_dp_handle_edid(dp);
-
-	exynos_dp_set_link_train(dp, dp->video_info->lane_count,
-				dp->video_info->link_rate);
-
-	exynos_dp_enable_scramble(dp, 1);
-	exynos_dp_enable_rx_to_enhanced_mode(dp, 1);
-	exynos_dp_enable_enhanced_mode(dp, 1);
-
-	exynos_dp_set_lane_count(dp, dp->video_info->lane_count);
-	exynos_dp_set_link_bandwidth(dp, dp->video_info->link_rate);
-
-	exynos_dp_init_video(dp);
-	exynos_dp_config_video(dp, dp->video_info);
+	schedule_work(&dp->hotplug_work);

 	return 0;
 }
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 6431c65..cf1010b 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -32,6 +32,7 @@ struct exynos_dp_device {

 	struct video_info	*video_info;
 	struct link_train	link_train;
+	struct work_struct	hotplug_work;
 };

 /* exynos_dp_reg.c */
--
1.7.7.3

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help