summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2013-08-27 13:22:16 +0900
committerRiham Haidar <rhaidar@nvidia.com>2013-10-04 17:58:07 -0700
commit7a880ee55ff6c88fd9a125932d71f6ba0f3a5541 (patch)
treec89480e83bd7b0fc6b3196f058941f17b2b458c3
parent67a86f5a21bd9677f20691e36a3afca5a4a76730 (diff)
tegra: dc: hdmi: allow LP0 wakeup by hotplug GPIO
Introduce a new TEGRA_DC_OUT_HOTPLUG_WAKE_LP0 flag which can be specified for DC controllers for which we want the HDMI hotplug GPIO to serve as a LP0 wake source. Bug 1345127 Change-Id: I9193be6ada4b0eca1c074c4b9a5888e3b0e49150 Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-on: http://git-master/r/266365 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Aaron Gamble <jgamble@nvidia.com> Reviewed-by: Prajakta Gudadhe <pgudadhe@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-on: http://git-master/r/281798 Reviewed-by: Todd Poynter <tpoynter@nvidia.com> Tested-by: Todd Poynter <tpoynter@nvidia.com> Reviewed-by: Kevin Bruckert <kbruckert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/include/mach/dc.h2
-rw-r--r--drivers/video/tegra/dc/hdmi.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h
index ed4a3f74ffc2..b5abc2400558 100644
--- a/arch/arm/mach-tegra/include/mach/dc.h
+++ b/arch/arm/mach-tegra/include/mach/dc.h
@@ -515,6 +515,8 @@ struct tegra_dc_out {
#define TEGRA_DC_OUT_N_SHOT_MODE (1 << 4)
#define TEGRA_DC_OUT_ONE_SHOT_LP_MODE (1 << 5)
#define TEGRA_DC_OUT_INITIALIZED_MODE (1 << 6)
+/* Makes hotplug GPIO a LP0 wakeup source */
+#define TEGRA_DC_OUT_HOTPLUG_WAKE_LP0 (1 << 7)
#define TEGRA_DC_ALIGN_MSB 0
#define TEGRA_DC_ALIGN_LSB 1
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index 5ad5d1fcbdf9..d7629e8b4d15 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -979,6 +979,18 @@ static void tegra_dc_hdmi_suspend(struct tegra_dc *dc)
struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
unsigned long flags;
+ if (dc->out->flags & TEGRA_DC_OUT_HOTPLUG_WAKE_LP0) {
+ int wake_irq = gpio_to_irq(dc->out->hotplug_gpio);
+ int ret;
+
+ ret = enable_irq_wake(wake_irq);
+ if (ret < 0) {
+ dev_err(&dc->ndev->dev,
+ "%s: Couldn't enable HDMI wakeup, irq=%d, error=%d\n",
+ __func__, wake_irq, ret);
+ }
+ }
+
/* turn off hotplug detection to avoid resume event when +5V falls */
tegra_hdmi_hotplug_disable(hdmi);
@@ -998,6 +1010,9 @@ static void tegra_dc_hdmi_resume(struct tegra_dc *dc)
spin_unlock_irqrestore(&hdmi->suspend_lock, flags);
+ if (dc->out->flags & TEGRA_DC_OUT_HOTPLUG_WAKE_LP0)
+ disable_irq_wake(gpio_to_irq(dc->out->hotplug_gpio));
+
tegra_nvhdcp_resume(hdmi->nvhdcp);
/* restore hotplug detection */
tegra_hdmi_hotplug_enable(hdmi);