blob: 1f4fdab98ba859f6a81cc67fc8a6135f19904b0e [file] [log] [blame]
Mahesh Sivasubramanian0558d4b2012-10-12 18:05:28 -06001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -06002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#ifndef __ARCH_ARM_MACH_MSM_RPM_NOTIF_H
14#define __ARCH_ARM_MACH_MSM_RPM_NOTIF_H
15
16struct msm_rpm_notifier_data {
17 uint32_t rsc_type;
18 uint32_t rsc_id;
19 uint32_t key;
20 uint32_t size;
21 uint8_t *value;
22};
Mahesh Sivasubramanian11dad772012-07-13 14:00:01 -060023/**
24 * msm_rpm_register_notifier - Register for sleep set notifications
25 *
26 * @nb - notifier block to register
27 *
28 * return 0 on success, errno on failure.
29 */
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -060030int msm_rpm_register_notifier(struct notifier_block *nb);
Mahesh Sivasubramanian11dad772012-07-13 14:00:01 -060031
32/**
33 * msm_rpm_unregister_notifier - Unregister previously registered notifications
34 *
35 * @nb - notifier block to unregister
36 *
37 * return 0 on success, errno on failure.
38 */
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -060039int msm_rpm_unregister_notifier(struct notifier_block *nb);
40
Mahesh Sivasubramanian11dad772012-07-13 14:00:01 -060041/**
42 * msm_rpm_enter_sleep - Notify RPM driver to prepare for entering sleep
Mahesh Sivasubramanian0558d4b2012-10-12 18:05:28 -060043 *
44 * @bool - flag to enable print contents of sleep buffer.
Mahesh Sivasubramanianfc2eb5b2013-11-21 18:30:06 -070045 * @cpumask - cpumask of next wakeup cpu
Mahesh Sivasubramanian0558d4b2012-10-12 18:05:28 -060046 *
47 * return 0 on success errno on failure.
Mahesh Sivasubramanian11dad772012-07-13 14:00:01 -060048 */
Mahesh Sivasubramanianfc2eb5b2013-11-21 18:30:06 -070049int msm_rpm_enter_sleep(bool print, const struct cpumask *cpumask);
Mahesh Sivasubramanian11dad772012-07-13 14:00:01 -060050
51/**
52 * msm_rpm_exit_sleep - Notify RPM driver about resuming from power collapse
53 */
54void msm_rpm_exit_sleep(void);
Mahesh Sivasubramanian9063a292012-11-09 09:15:30 -070055
56/**
57 * msm_rpm_waiting_for_ack - Indicate if there is RPM message
58 * pending acknowledgement.
59 * returns true for pending messages and false otherwise
60 */
61bool msm_rpm_waiting_for_ack(void);
62
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -060063#endif /*__ARCH_ARM_MACH_MSM_RPM_NOTIF_H */