diff options
| author | Amit Jain <ajain@motorola.com> | 2014-10-02 11:11:23 -0500 |
|---|---|---|
| committer | Amit Jain <ajain@motorola.com> | 2014-10-03 13:37:12 +0000 |
| commit | 58efe519a5477c70a184cdf376520122127f69f0 (patch) | |
| tree | 597aef9bad8256e13a695b110888ac697b8c9589 /drivers/misc/display_notify.c | |
| parent | 079a36c83139757332cde9a8a588d7249645283b (diff) | |
| download | olio-linux-3.10-58efe519a5477c70a184cdf376520122127f69f0.tar.xz olio-linux-3.10-58efe519a5477c70a184cdf376520122127f69f0.zip | |
IKXCLOCK-4061: power key behavior change
Diffstat (limited to 'drivers/misc/display_notify.c')
| -rw-r--r-- | drivers/misc/display_notify.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/misc/display_notify.c b/drivers/misc/display_notify.c new file mode 100644 index 00000000000..e243058fc4e --- /dev/null +++ b/drivers/misc/display_notify.c @@ -0,0 +1,50 @@ +/* + * 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/display_notify.h> + +static BLOCKING_NOTIFIER_HEAD(display_notifier_list); + +/** + * display_register_notify - register a notifier callback for triggering display init + * @nb: pointer to the notifier block for the callback events. + * + */ +void display_register_notify(struct notifier_block *nb) +{ + blocking_notifier_chain_register(&display_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(display_register_notify); + +/** + * display_unregister_notify - unregister a notifier callback + * @nb: pointer to the notifier block for the callback events. + * + * display_register_notify() must have been previously called + * for this function to work properly. + */ +void display_unregister_notify(struct notifier_block *nb) +{ + blocking_notifier_chain_unregister(&display_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(display_unregister_notify); + +void display_notify_subscriber(unsigned long event) +{ + blocking_notifier_call_chain(&display_notifier_list, event, NULL); +} +EXPORT_SYMBOL_GPL(display_notify_subscriber); |