diff options
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana-panel.c')
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-panel.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c index 042fcba830a0..6a60070852a0 100644 --- a/arch/arm/mach-tegra/board-ventana-panel.c +++ b/arch/arm/mach-tegra/board-ventana-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/nvhost.h> #include <mach/nvmap.h> @@ -339,6 +340,25 @@ static struct platform_device *ventana_gfx_devices[] __initdata = { &ventana_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 ventana_panel_early_suspender; + +static void ventana_panel_early_suspend(struct early_suspend *h) +{ + if (num_registered_fb > 0) + fb_blank(registered_fb[0], FB_BLANK_POWERDOWN); +} + +static void ventana_panel_late_resume(struct early_suspend *h) +{ + if (num_registered_fb > 0) + fb_blank(registered_fb[0], FB_BLANK_UNBLANK); +} +#endif + int __init ventana_panel_init(void) { int err; @@ -360,6 +380,13 @@ int __init ventana_panel_init(void) gpio_request(ventana_hdmi_hpd, "hdmi_hpd"); gpio_direction_input(ventana_hdmi_hpd); +#ifdef CONFIG_HAS_EARLYSUSPEND + ventana_panel_early_suspender.suspend = ventana_panel_early_suspend; + ventana_panel_early_suspender.resume = ventana_panel_late_resume; + ventana_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB; + register_early_suspend(&ventana_panel_early_suspender); +#endif + ventana_carveouts[1].base = tegra_carveout_start; ventana_carveouts[1].size = tegra_carveout_size; |