diff options
author | Wen Yi <wyi@nvidia.com> | 2011-03-21 11:10:21 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:52:18 -0800 |
commit | 20fb8f11a213ecfa2cd9a6d818ce65d8c2838209 (patch) | |
tree | d6092057fab6d46f7d0fbdd65411ce0d60f252fd /arch/arm/mach-tegra/board-whistler-panel.c | |
parent | ad646d78ca3b1fc6f20c2ae0fdb9d8a2dbfd8570 (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.c | 26 |
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 0f3610fec6a0..4d15575b05b2 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> @@ -300,6 +301,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; @@ -309,6 +329,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; |