summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Mayo <jmayo@nvidia.com>2011-04-12 18:14:22 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-04-26 15:55:38 -0700
commitd05379b5925a25672aef058fc7a3029b75146724 (patch)
tree15cac8a3a33360994e15fc36f303efaa0ba3f05f
parentc0410d7acf4550a16def2a5b595e23d4de36e35d (diff)
arm: video: tegra: dc callbacks for hotplug init
add new dc out callback hotplug_init and postsuspend to handle board specific configuration of power and gpios for detecting hotplug. bug 812083 bug 811523 Original-Change-Id: Ia7937cc9461465502cabbd2a5efaee0093bccfe0 Reviewed-on: http://git-master/r/27570 Reviewed-by: Jonathan Mayo <jmayo@nvidia.com> Tested-by: Jonathan Mayo <jmayo@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Change-Id: Iab0fbe0e493ad3818416454ba7a2dda679f68dfb
-rw-r--r--arch/arm/mach-tegra/include/mach/dc.h3
-rw-r--r--drivers/video/tegra/dc/dc.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h
index cacce44f6219..0043c9a8a3a4 100644
--- a/arch/arm/mach-tegra/include/mach/dc.h
+++ b/arch/arm/mach-tegra/include/mach/dc.h
@@ -284,6 +284,9 @@ struct tegra_dc_out {
int (*enable)(void);
int (*postpoweron)(void);
int (*disable)(void);
+
+ int (*hotplug_init)(void);
+ int (*postsuspend)(void);
};
/* bits for tegra_dc_out.flags */
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index dd2c909487f1..fe68a66aaa04 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -1727,6 +1727,9 @@ static int tegra_dc_probe(struct nvhost_device *ndev)
dc->overlay = NULL;
}
+ if (dc->out && dc->out->hotplug_init)
+ dc->out->hotplug_init();
+
if (dc->out_ops && dc->out_ops->detect)
dc->out_ops->detect(dc);
@@ -1800,6 +1803,12 @@ static int tegra_dc_suspend(struct nvhost_device *ndev, pm_message_t state)
dc->suspended = true;
}
+
+ if (dc->out && dc->out->postsuspend) {
+ dc->out->postsuspend();
+ msleep(100); /* avoid resume event due to voltage falling */
+ }
+
mutex_unlock(&dc->lock);
return 0;
@@ -1817,6 +1826,9 @@ static int tegra_dc_resume(struct nvhost_device *ndev)
if (dc->enabled)
_tegra_dc_enable(dc);
+ if (dc->out && dc->out->hotplug_init)
+ dc->out->hotplug_init();
+
if (dc->out_ops && dc->out_ops->resume)
dc->out_ops->resume(dc);
mutex_unlock(&dc->lock);