summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-ventana-panel.c
diff options
context:
space:
mode:
authorRenuka Apte <rapte@nvidia.com>2010-12-07 17:07:29 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:52:10 -0800
commitbb506cb001022253bc24761f8937699346033849 (patch)
tree9ec4d4f69467fb1f0e24e96487e5bf6d59f2e810 /arch/arm/mach-tegra/board-ventana-panel.c
parent3412d93104352c35f6fe820547b2c3b5c205f991 (diff)
[ARM] tegra: add early_suspend/late resume hooks to ventana panel
Original-Change-Id: I5115a7a9918e28449b585687689d362dae5057df Reviewed-on: http://git-master/r/12259 Reviewed-by: Acorn Pooley <apooley@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Rea019cecf0e264c9d98b23a44b9acba2846117c4
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-ventana-panel.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c
index 042fcba830a0..6a60070852a0 100644
--- a/arch/arm/mach-tegra/board-ventana-panel.c
+++ b/arch/arm/mach-tegra/board-ventana-panel.c
@@ -24,6 +24,7 @@
#include <linux/resource.h>
#include <asm/mach-types.h>
#include <linux/platform_device.h>
+#include <linux/earlysuspend.h>
#include <linux/pwm_backlight.h>
#include <linux/nvhost.h>
#include <mach/nvmap.h>
@@ -339,6 +340,25 @@ static struct platform_device *ventana_gfx_devices[] __initdata = {
&ventana_backlight_device,
};
+#ifdef CONFIG_HAS_EARLYSUSPEND
+/* put early_suspend/late_resume handlers here for the display in order
+ * to keep the code out of the display driver, keeping it closer to upstream
+ */
+struct early_suspend ventana_panel_early_suspender;
+
+static void ventana_panel_early_suspend(struct early_suspend *h)
+{
+ if (num_registered_fb > 0)
+ fb_blank(registered_fb[0], FB_BLANK_POWERDOWN);
+}
+
+static void ventana_panel_late_resume(struct early_suspend *h)
+{
+ if (num_registered_fb > 0)
+ fb_blank(registered_fb[0], FB_BLANK_UNBLANK);
+}
+#endif
+
int __init ventana_panel_init(void)
{
int err;
@@ -360,6 +380,13 @@ int __init ventana_panel_init(void)
gpio_request(ventana_hdmi_hpd, "hdmi_hpd");
gpio_direction_input(ventana_hdmi_hpd);
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ ventana_panel_early_suspender.suspend = ventana_panel_early_suspend;
+ ventana_panel_early_suspender.resume = ventana_panel_late_resume;
+ ventana_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB;
+ register_early_suspend(&ventana_panel_early_suspender);
+#endif
+
ventana_carveouts[1].base = tegra_carveout_start;
ventana_carveouts[1].size = tegra_carveout_size;