From: "Arve Hjønnevåg" <arve@android.com>
To: linux-pm@lists.linux-foundation.org
Cc: swetland@google.com
Subject: [PATCH 02/11] PM: Add early suspend api.
Date: Tue, 13 Jan 2009 17:27:47 -0800 [thread overview]
Message-ID: <1231896476-22445-3-git-send-email-arve@android.com> (raw)
In-Reply-To: <1231896476-22445-2-git-send-email-arve@android.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
---
include/linux/earlysuspend.h | 56 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
create mode 100755 include/linux/earlysuspend.h
diff --git a/include/linux/earlysuspend.h b/include/linux/earlysuspend.h
new file mode 100755
index 0000000..8343b81
--- /dev/null
+++ b/include/linux/earlysuspend.h
@@ -0,0 +1,56 @@
+/* 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,
+};
+struct early_suspend {
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ struct list_head link;
+ int level;
+ 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
+
--
1.6.1
_______________________________________________
linux-pm mailing list
linux-pm@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/linux-pm
next prev parent reply other threads:[~2009-01-14 1:27 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-14 1:27 [RFC][PATCH 00/11] Android PM extensions Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 01/11] PM: Add wake lock api Arve Hjønnevåg
2009-01-14 1:27 ` Arve Hjønnevåg [this message]
2009-01-14 1:27 ` [PATCH 03/11] PM: Implement wakelock api Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 04/11] PM: Implement early suspend api Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 05/11] PM: Enable early suspend through /sys/power/state Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 06/11] PM: Add user-space wake lock api Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 07/11] PM: wakelock: Abort task freezing if a wake lock is held Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 08/11] PM: earlysuspend: Add console switch when user requested sleep state changes Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 09/11] PM: earlysuspend: Removing dependence on console Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 10/11] Input: Hold wake lock while event queue is not empty Arve Hjønnevåg
2009-01-14 1:27 ` [PATCH 11/11] ledtrig-sleep: Add led trigger for sleep debugging Arve Hjønnevåg
2009-01-30 12:43 ` [PATCH 06/11] PM: Add user-space wake lock api Uli Luckas
2009-01-31 0:17 ` Arve Hjønnevåg
2009-01-31 7:24 ` Brian Swetland
2009-01-28 19:34 ` [PATCH 05/11] PM: Enable early suspend through /sys/power/state Pavel Machek
2009-01-31 3:13 ` Arve Hjønnevåg
2009-01-31 15:49 ` Alan Stern
2009-02-02 11:44 ` Pavel Machek
2009-02-02 11:45 ` Pavel Machek
2009-02-02 22:36 ` Arve Hjønnevåg
2009-01-14 9:48 ` [PATCH 04/11] PM: Implement early suspend api Nigel Cunningham
2009-01-14 23:57 ` Arve Hjønnevåg
2009-01-14 9:30 ` [PATCH 03/11] PM: Implement wakelock api Nigel Cunningham
2009-01-14 23:28 ` Arve Hjønnevåg
2009-01-14 9:17 ` [PATCH 02/11] PM: Add early suspend api Nigel Cunningham
2009-01-14 23:18 ` Arve Hjønnevåg
2009-01-14 9:09 ` [PATCH 01/11] PM: Add wake lock api Nigel Cunningham
2009-01-14 23:07 ` Arve Hjønnevåg
2009-01-14 9:01 ` [RFC][PATCH 00/11] Android PM extensions Nigel Cunningham
2009-01-15 0:10 ` Arve Hjønnevåg
2009-01-15 4:42 ` Arve Hjønnevåg
2009-01-15 15:08 ` Alan Stern
2009-01-15 20:34 ` Arve Hjønnevåg
2009-01-29 13:04 ` Pavel Machek
2009-01-30 1:16 ` Arve Hjønnevåg
2009-01-30 3:27 ` Alan Stern
2009-01-30 4:40 ` Arve Hjønnevåg
2009-01-30 6:04 ` Arve Hjønnevåg
2009-02-02 11:49 ` Pavel Machek
2009-01-30 9:11 ` Pavel Machek
2009-01-30 12:34 ` Uli Luckas
2009-02-02 11:46 ` Pavel Machek
2009-01-30 15:13 ` Alan Stern
2009-01-31 0:02 ` Arve Hjønnevåg
2009-01-31 16:19 ` Alan Stern
2009-01-31 23:28 ` Arve Hjønnevåg
2009-02-02 10:42 ` Uli Luckas
2009-02-02 15:05 ` Alan Stern
2009-02-02 16:15 ` Uli Luckas
2009-02-02 16:35 ` Alan Stern
2009-02-03 20:15 ` Pavel Machek
2009-01-31 7:47 ` Brian Swetland
2009-01-31 15:41 ` Alan Stern
2009-01-31 18:39 ` Rafael J. Wysocki
2009-01-31 18:54 ` Igor Stoppa
2009-02-01 1:04 ` Arve Hjønnevåg
2009-02-02 11:55 ` Pavel Machek
2009-01-31 22:41 ` Arve Hjønnevåg
2009-01-31 23:20 ` Rafael J. Wysocki
2009-01-31 23:32 ` Arve Hjønnevåg
2009-02-01 0:18 ` Rafael J. Wysocki
2009-02-01 1:17 ` Arve Hjønnevåg
2009-02-01 1:32 ` Rafael J. Wysocki
2009-02-01 2:14 ` Arve Hjønnevåg
2009-02-01 12:30 ` Rafael J. Wysocki
2009-02-01 14:03 ` Woodruff, Richard
2009-02-01 17:43 ` Alan Stern
2009-02-01 19:27 ` Woodruff, Richard
2009-02-02 11:00 ` Uli Luckas
2009-02-02 15:09 ` Alan Stern
2009-02-02 16:24 ` Uli Luckas
2009-02-02 21:47 ` Nigel Cunningham
2009-02-02 23:21 ` Arve Hjønnevåg
2009-02-02 23:51 ` Nigel Cunningham
2009-02-03 0:08 ` Arve Hjønnevåg
2009-02-04 13:25 ` Pavel Machek
2009-02-02 23:10 ` Arve Hjønnevåg
2009-02-03 3:27 ` Alan Stern
2009-02-03 4:18 ` Arve Hjønnevåg
2009-02-03 20:30 ` Alan Stern
2009-02-04 13:29 ` Pavel Machek
2009-02-02 11:56 ` Pavel Machek
2009-02-02 12:38 ` Uli Luckas
2009-01-30 9:08 ` Pavel Machek
2009-01-30 9:25 ` Brian Swetland
2009-01-28 19:31 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1231896476-22445-3-git-send-email-arve@android.com \
--to=arve@android.com \
--cc=linux-pm@lists.linux-foundation.org \
--cc=swetland@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox