diff options
author | Renuka Apte <rapte@nvidia.com> | 2010-12-07 17:07:29 -0800 |
---|---|---|
committer | Bharat Nihalani <bnihalani@nvidia.com> | 2010-12-15 05:19:59 -0800 |
commit | f22a0367722d2c24fee84dcb23dc47a042d42108 (patch) | |
tree | 78c55d52d9f0639cfda40d543e7030769257590b /arch | |
parent | f7a9b97454b957e1a650b16f8119142253ee7135 (diff) |
[ARM] tegra: add early_suspend/late resume hooks to ventana panel
Change-Id: I5115a7a9918e28449b585687689d362dae5057df
Reviewed-on: http://git-master/r/12259
Reviewed-by: Acorn Pooley <apooley@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-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 b2f61b323e27..7d0f01593e6e 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 <mach/nvhost.h> #include <mach/nvmap.h> @@ -322,6 +323,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; @@ -338,6 +358,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 + err = platform_add_devices(ventana_gfx_devices, ARRAY_SIZE(ventana_gfx_devices)); |