summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-whistler-panel.c
diff options
context:
space:
mode:
authorWen Yi <wyi@nvidia.com>2011-03-21 11:10:21 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2012-03-24 01:44:13 -0700
commit600e1093b5117e3ab9a5ac1f3ec609b52ef21967 (patch)
tree9996472be2acf2950189be58df74d2b36b61ce2d /arch/arm/mach-tegra/board-whistler-panel.c
parentd74ec0e2ad7d0cdb428760e65166e40274274629 (diff)
ARM: tegra: whistler: blank display at early suspension
When early suspension is triggered, blank display and when later_resume is triggered, un-blank display. Bug 803498 Original-Change-Id: I2c2a18fbc0074215cf2adf668097d32fa3dbd566 Reviewed-on: http://git-master/r/23719 Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R56dbb4570837ea34306a3fd536ee1d7498a80cb3
Diffstat (limited to 'arch/arm/mach-tegra/board-whistler-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-whistler-panel.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c
index c8ef6f075021..47bb8ffbffa3 100644
--- a/arch/arm/mach-tegra/board-whistler-panel.c
+++ b/arch/arm/mach-tegra/board-whistler-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/tegra_pwm_bl.h>
#include <linux/nvhost.h>
@@ -301,6 +302,25 @@ static struct platform_device *whistler_gfx_devices[] __initdata = {
&whistler_disp1_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 whistler_panel_early_suspender;
+
+static void whistler_panel_early_suspend(struct early_suspend *h)
+{
+ if (num_registered_fb > 0)
+ fb_blank(registered_fb[0], FB_BLANK_POWERDOWN);
+}
+
+static void whistler_panel_late_resume(struct early_suspend *h)
+{
+ if (num_registered_fb > 0)
+ fb_blank(registered_fb[0], FB_BLANK_UNBLANK);
+}
+#endif
+
int __init whistler_panel_init(void)
{
int err;
@@ -310,6 +330,13 @@ int __init whistler_panel_init(void)
gpio_request(whistler_hdmi_hpd, "hdmi_hpd");
gpio_direction_input(whistler_hdmi_hpd);
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ whistler_panel_early_suspender.suspend = whistler_panel_early_suspend;
+ whistler_panel_early_suspender.resume = whistler_panel_late_resume;
+ whistler_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB;
+ register_early_suspend(&whistler_panel_early_suspender);
+#endif
+
#if defined(CONFIG_TEGRA_NVMAP)
whistler_carveouts[1].base = tegra_carveout_start;
whistler_carveouts[1].size = tegra_carveout_size;