From ee2c42400237c637c1616016b37a90d2e6e01dd5 Mon Sep 17 00:00:00 2001 From: Jon Mayo Date: Thu, 10 Mar 2011 16:07:26 -0800 Subject: tegra: cardhu: use earlysuspend for display trigger display FB_BLANK_POWERDOWN during earlysuspend. Original-Change-Id: I21c75bca28bd599730b93b84d2c5de1dcb40a74e Reviewed-on: http://git-master/r/22472 Reviewed-by: Jonathan Mayo Tested-by: Jonathan Mayo Reviewed-by: Aleksandr Frid Tested-by: Aleksandr Frid Reviewed-by: Mayuresh Kulkarni Reviewed-by: Yu-Huan Hsu Original-Change-Id: I1a9bc8b499ab39cebea0a1435bfe519dba7c55c0 Rebase-Id: R63cbab44f6fb4b09f4396e238ef84f9a810c57b6 --- arch/arm/mach-tegra/board-cardhu-panel.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'arch/arm/mach-tegra/board-cardhu-panel.c') diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c index e5d5d345ad8b..b667fbe2508b 100644 --- a/arch/arm/mach-tegra/board-cardhu-panel.c +++ b/arch/arm/mach-tegra/board-cardhu-panel.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1039,6 +1040,25 @@ static struct platform_device *cardhu_gfx_devices[] __initdata = { }; +#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 cardhu_panel_early_suspender; + +static void cardhu_panel_early_suspend(struct early_suspend *h) +{ + if (num_registered_fb > 0) + fb_blank(registered_fb[0], FB_BLANK_POWERDOWN); +} + +static void cardhu_panel_late_resume(struct early_suspend *h) +{ + if (num_registered_fb > 0) + fb_blank(registered_fb[0], FB_BLANK_UNBLANK); +} +#endif + int __init cardhu_panel_init(void) { int err; @@ -1122,6 +1142,14 @@ int __init cardhu_panel_init(void) tegra_gpio_enable(cardhu_hdmi_hpd); gpio_request(cardhu_hdmi_hpd, "hdmi_hpd"); gpio_direction_input(cardhu_hdmi_hpd); + +#ifdef CONFIG_HAS_EARLYSUSPEND + cardhu_panel_early_suspender.suspend = cardhu_panel_early_suspend; + cardhu_panel_early_suspender.resume = cardhu_panel_late_resume; + cardhu_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB; + register_early_suspend(&cardhu_panel_early_suspender); +#endif + err = platform_add_devices(cardhu_gfx_devices, ARRAY_SIZE(cardhu_gfx_devices)); -- cgit v1.2.3