diff options
| author | Amit Jain <ajain@motorola.com> | 2014-06-30 16:05:49 -0500 |
|---|---|---|
| committer | Jee Su Chang <w20740@motorola.com> | 2014-07-10 16:58:09 +0000 |
| commit | 9e3e9ec9a545ce65cf325f4c7eab401ab0269184 (patch) | |
| tree | 352abbf179994e7229303239001a78f0e7c735f0 /drivers/misc/wakeup_source_notify.c | |
| parent | 2f02ffa1a9d46c192d19fed48190beceb9b6ec21 (diff) | |
| download | olio-linux-3.10-9e3e9ec9a545ce65cf325f4c7eab401ab0269184.tar.xz olio-linux-3.10-9e3e9ec9a545ce65cf325f4c7eab401ab0269184.zip | |
IKXCLOCK-1435: early init of display
Change-Id: I2996c32892066b5874e011c4fe7454d5ebae1aad
Diffstat (limited to 'drivers/misc/wakeup_source_notify.c')
| -rw-r--r-- | drivers/misc/wakeup_source_notify.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/misc/wakeup_source_notify.c b/drivers/misc/wakeup_source_notify.c new file mode 100644 index 00000000000..86ab8b00d0b --- /dev/null +++ b/drivers/misc/wakeup_source_notify.c @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2014 Motorola Mobility LLC. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * 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. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <linux/notifier.h> +#include <linux/wakeup_source_notify.h> + +static BLOCKING_NOTIFIER_HEAD(wakeup_source_notifier_list); + +/** + * wakeup_source_register_notify - register a notifier callback for triggering display init + * @nb: pointer to the notifier block for the callback events. + * + */ +void wakeup_source_register_notify(struct notifier_block *nb) +{ + blocking_notifier_chain_register(&wakeup_source_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(wakeup_source_register_notify); + +/** + * wakeup_source_unregister_notify - unregister a notifier callback + * @nb: pointer to the notifier block for the callback events. + * + * wakeup_source_register_notify() must have been previously called + * for this function to work properly. + */ +void wakeup_source_unregister_notify(struct notifier_block *nb) +{ + blocking_notifier_chain_unregister(&wakeup_source_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(wakeup_source_unregister_notify); + +void wakeup_source_notify_subscriber(unsigned long event) +{ + blocking_notifier_call_chain(&wakeup_source_notifier_list, event, NULL); +} +EXPORT_SYMBOL_GPL(wakeup_source_notify_subscriber); + |