summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorWen Yi <wyi@nvidia.com>2011-03-21 11:10:21 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-03-23 17:39:01 -0800
commit4f0829673b7d5972670d716a77503c002eba9a97 (patch)
tree2df62e3e083de75169eefc22490f87eb91d87d32 /arch/arm
parenta3d9d5c1ebc36b2a7bf0b4e375c2084afd9f64e1 (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 Change-Id: I2c2a18fbc0074215cf2adf668097d32fa3dbd566 Reviewed-on: http://git-master/r/23719 Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-tegra/board-whistler-panel.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c
index 8df6604661b3..c2333ce5953b 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 <mach/nvhost.h>
@@ -285,6 +286,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;
@@ -294,6 +314,12 @@ 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
whistler_carveouts[1].base = tegra_carveout_start;
whistler_carveouts[1].size = tegra_carveout_size;