diff options
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 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; |