From 4f49ce63b233cab89f3b9462e142355fb1899f68 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Thu, 16 Sep 2010 14:44:16 -0700 Subject: [PATCH] [ARM] tegra: add early_suspend/late resume hooks to stringay panel Signed-off-by: Erik Gilling Change-Id: Id8c33f04fa776bdf846b97a01081c145005c9ad5 --- arch/arm/mach-tegra/board-stingray-panel.c | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/mach-tegra/board-stingray-panel.c b/arch/arm/mach-tegra/board-stingray-panel.c index 83f27e40a263..d00b5cae4658 100644 --- a/arch/arm/mach-tegra/board-stingray-panel.c +++ b/arch/arm/mach-tegra/board-stingray-panel.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -309,6 +310,29 @@ static struct i2c_board_info __initdata stingray_i2c_bus1_led_info[] = { }, }; +#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 stingray_panel_early_suspender; + +static void stingray_panel_early_suspend(struct early_suspend *h) +{ + if (num_registered_fb > 0) + fb_blank(registered_fb[0], FB_BLANK_POWERDOWN); + + pr_info("KONK: early_suspend\n"); +} + +static void stingray_panel_late_resume(struct early_suspend *h) +{ + if (num_registered_fb > 0) + fb_blank(registered_fb[0], FB_BLANK_UNBLANK); + + pr_info("KONK: late_resume\n"); +} +#endif + #define FB_MEM_SIZE (1920 * 1080 * 4 * 2) void __init stingray_fb_alloc(void) { @@ -349,6 +373,13 @@ int __init stingray_panel_init(void) regulator_enable(stingray_csi_reg); } +#ifdef CONFIG_HAS_EARLYSUSPEND + stingray_panel_early_suspender.suspend = stingray_panel_early_suspend; + stingray_panel_early_suspender.resume = stingray_panel_late_resume; + stingray_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB; + register_early_suspend(&stingray_panel_early_suspender); +#endif + return nvhost_device_register(&stingray_disp1_device); // return nvhost_device_register(&stingray_disp2_device); } -- 2.34.1