Mahesh Sivasubramanian | 0558d4b | 2012-10-12 18:05:28 -0600 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Mahesh Sivasubramanian | a8ff992 | 2012-03-27 17:50:42 -0600 | [diff] [blame] | 2 | * |
| 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 | |
| 16 | struct 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 Sivasubramanian | 11dad77 | 2012-07-13 14:00:01 -0600 | [diff] [blame] | 23 | /** |
| 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 Sivasubramanian | a8ff992 | 2012-03-27 17:50:42 -0600 | [diff] [blame] | 30 | int msm_rpm_register_notifier(struct notifier_block *nb); |
Mahesh Sivasubramanian | 11dad77 | 2012-07-13 14:00:01 -0600 | [diff] [blame] | 31 | |
| 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 Sivasubramanian | a8ff992 | 2012-03-27 17:50:42 -0600 | [diff] [blame] | 39 | int msm_rpm_unregister_notifier(struct notifier_block *nb); |
| 40 | |
Mahesh Sivasubramanian | 11dad77 | 2012-07-13 14:00:01 -0600 | [diff] [blame] | 41 | /** |
| 42 | * msm_rpm_enter_sleep - Notify RPM driver to prepare for entering sleep |
Mahesh Sivasubramanian | 0558d4b | 2012-10-12 18:05:28 -0600 | [diff] [blame] | 43 | * |
| 44 | * @bool - flag to enable print contents of sleep buffer. |
Mahesh Sivasubramanian | fc2eb5b | 2013-11-21 18:30:06 -0700 | [diff] [blame] | 45 | * @cpumask - cpumask of next wakeup cpu |
Mahesh Sivasubramanian | 0558d4b | 2012-10-12 18:05:28 -0600 | [diff] [blame] | 46 | * |
| 47 | * return 0 on success errno on failure. |
Mahesh Sivasubramanian | 11dad77 | 2012-07-13 14:00:01 -0600 | [diff] [blame] | 48 | */ |
Mahesh Sivasubramanian | fc2eb5b | 2013-11-21 18:30:06 -0700 | [diff] [blame] | 49 | int msm_rpm_enter_sleep(bool print, const struct cpumask *cpumask); |
Mahesh Sivasubramanian | 11dad77 | 2012-07-13 14:00:01 -0600 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * msm_rpm_exit_sleep - Notify RPM driver about resuming from power collapse |
| 53 | */ |
| 54 | void msm_rpm_exit_sleep(void); |
Mahesh Sivasubramanian | 9063a29 | 2012-11-09 09:15:30 -0700 | [diff] [blame] | 55 | |
| 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 | */ |
| 61 | bool msm_rpm_waiting_for_ack(void); |
| 62 | |
Mahesh Sivasubramanian | a8ff992 | 2012-03-27 17:50:42 -0600 | [diff] [blame] | 63 | #endif /*__ARCH_ARM_MACH_MSM_RPM_NOTIF_H */ |