From 600e1093b5117e3ab9a5ac1f3ec609b52ef21967 Mon Sep 17 00:00:00 2001 From: Wen Yi Date: Mon, 21 Mar 2011 11:10:21 -0700 Subject: 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 Tested-by: Varun Colbert Rebase-Id: R56dbb4570837ea34306a3fd536ee1d7498a80cb3 --- arch/arm/mach-tegra/board-whistler-panel.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'arch') 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 #include #include +#include #include #include #include @@ -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; -- cgit v1.2.3