summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-enterprise-panel.c
diff options
context:
space:
mode:
authorKasoju Mallikarjun <mkasoju@nvidia.com>2011-04-07 00:41:48 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:52:14 -0800
commit637ed9d9185102b8ef59d04ea60a0bc27c7d4109 (patch)
tree92fcda7db5a242319cbcb7aa928cea4f124d5c51 /arch/arm/mach-tegra/board-enterprise-panel.c
parentd61a08be66786a8938b4b10a1dcf469bf4251b7f (diff)
android: earlysuspend: arm: tegra: tegra_enterprise: Creating board files
Creating initial board files and config files for tegra_enterprise board. Original-Change-Id: I77dcd612421167b9c6441d5d6fb779bb51491efa Reviewed-on: http://git-master/r/20852 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com> Change-Id: I498fe3cde454657c22fb1c1bc2212eb5e2f7fd6e Rebase-Id: R28dd2eb9859e2f5d0e01d0df3687600c6738d7c7
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-enterprise-panel.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c
index 7ab44635be28..288b4fa106c1 100644
--- a/arch/arm/mach-tegra/board-enterprise-panel.c
+++ b/arch/arm/mach-tegra/board-enterprise-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/tegra_pwm_bl.h>
#include <asm/atomic.h>
#include <linux/nvhost.h>
@@ -702,6 +703,25 @@ static struct platform_device *enterprise_bl_devices[] = {
&enterprise_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 enterprise_panel_early_suspender;
+
+static void enterprise_panel_early_suspend(struct early_suspend *h)
+{
+ if (num_registered_fb > 0)
+ fb_blank(registered_fb[0], FB_BLANK_POWERDOWN);
+}
+
+static void enterprise_panel_late_resume(struct early_suspend *h)
+{
+ if (num_registered_fb > 0)
+ fb_blank(registered_fb[0], FB_BLANK_UNBLANK);
+}
+#endif
+
int __init enterprise_panel_init(void)
{
int err;
@@ -738,6 +758,13 @@ int __init enterprise_panel_init(void)
gpio_direction_input(enterprise_lcd_te);
#endif
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ enterprise_panel_early_suspender.suspend = enterprise_panel_early_suspend;
+ enterprise_panel_early_suspender.resume = enterprise_panel_late_resume;
+ enterprise_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB;
+ register_early_suspend(&enterprise_panel_early_suspender);
+#endif
+
err = platform_add_devices(enterprise_gfx_devices,
ARRAY_SIZE(enterprise_gfx_devices));