diff options
author | Ke Qinghua <qinghua.ke@freescale.com> | 2014-04-04 16:22:34 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-21 22:35:45 -0500 |
commit | 24b7d5ca843cd63f1ee1ae7ebdb00f78dd3f62b9 (patch) | |
tree | a7c935a5401c93ad3bdec37a9957da95a5287406 /include/linux | |
parent | 85c1fa95bf70927b33a0613edb690ae4759e0653 (diff) |
ENGR00305254-7 imx6sx sarbesd board bring up
Enable early suspend/late resume code
Signed-off-by: Ke Qinghua <qinghua.ke@freescale.com>
Acked-by: Jason Liu
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/earlysuspend.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/include/linux/earlysuspend.h b/include/linux/earlysuspend.h new file mode 100644 index 000000000000..cddd0b470179 --- /dev/null +++ b/include/linux/earlysuspend.h @@ -0,0 +1,58 @@ +/* include/linux/earlysuspend.h + * + * Copyright (C) 2007-2008 Google, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _LINUX_EARLYSUSPEND_H +#define _LINUX_EARLYSUSPEND_H + +#ifdef CONFIG_HAS_EARLYSUSPEND +#include <linux/list.h> +#endif + +/* The early_suspend structure defines suspend and resume hooks to be called + * when the user visible sleep state of the system changes, and a level to + * control the order. They can be used to turn off the screen and input + * devices that are not used for wakeup. + * Suspend handlers are called in low to high level order, resume handlers are + * called in the opposite order. If, when calling register_early_suspend, + * the suspend handlers have already been called without a matching call to the + * resume handlers, the suspend handler will be called directly from + * register_early_suspend. This direct call can violate the normal level order. + */ +enum { + EARLY_SUSPEND_LEVEL_BLANK_SCREEN = 50, + EARLY_SUSPEND_LEVEL_STOP_DRAWING = 100, + EARLY_SUSPEND_LEVEL_DISABLE_FB = 150, + EARLY_SUSPEND_LEVEL_POST_DISABLE_FB = 200, +}; +struct early_suspend { +#ifdef CONFIG_HAS_EARLYSUSPEND + struct list_head link; + int level; + void *data; + void (*suspend)(struct early_suspend *h); + void (*resume)(struct early_suspend *h); +#endif +}; + +#ifdef CONFIG_HAS_EARLYSUSPEND +void register_early_suspend(struct early_suspend *handler); +void unregister_early_suspend(struct early_suspend *handler); +#else +#define register_early_suspend(handler) do { } while (0) +#define unregister_early_suspend(handler) do { } while (0) +#endif + +#endif + |