aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/cpu_pm.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/include/asm/cpu_pm.h
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'arch/arm/include/asm/cpu_pm.h')
-rw-r--r--arch/arm/include/asm/cpu_pm.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/arch/arm/include/asm/cpu_pm.h b/arch/arm/include/asm/cpu_pm.h
new file mode 100644
index 00000000000..07b1b6ec025
--- /dev/null
+++ b/arch/arm/include/asm/cpu_pm.h
@@ -0,0 +1,123 @@
1/*
2 * Copyright (C) 2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#ifndef _ASMARM_CPU_PM_H
19#define _ASMARM_CPU_PM_H
20
21#include <linux/kernel.h>
22#include <linux/notifier.h>
23
24/*
25 * When a CPU goes to a low power state that turns off power to the CPU's
26 * power domain, the contents of some blocks (floating point coprocessors,
27 * interrutp controllers, caches, timers) in the same power domain can
28 * be lost. The cpm_pm notifiers provide a method for platform idle, suspend,
29 * and hotplug implementations to notify the drivers for these blocks that
30 * they may be reset.
31 *
32 * All cpu_pm notifications must be called with interrupts disabled.
33 *
34 * The notifications are split into two classes, CPU notifications and CPU
35 * complex notifications.
36 *
37 * CPU notifications apply to a single CPU, and must be called on the affected
38 * CPU. They are used to save per-cpu context for affected blocks.
39 *
40 * CPU complex notifications apply to all CPUs in a single power domain. They
41 * are used to save any global context for affected blocks, and must be called
42 * after all the CPUs in the power domain have been notified of the low power
43 * state.
44 *
45 */
46
47/*
48 * Event codes passed as unsigned long val to notifier calls
49 */
50enum cpu_pm_event {
51 /* A single cpu is entering a low power state */
52 CPU_PM_ENTER,
53
54 /* A single cpu failed to enter a low power state */
55 CPU_PM_ENTER_FAILED,
56
57 /* A single cpu is exiting a low power state */
58 CPU_PM_EXIT,
59
60 /* A cpu power domain is entering a low power state */
61 CPU_COMPLEX_PM_ENTER,
62
63 /* A cpu power domain failed to enter a low power state */
64 CPU_COMPLEX_PM_ENTER_FAILED,
65
66 /* A cpu power domain is exiting a low power state */
67 CPU_COMPLEX_PM_EXIT,
68};
69
70int cpu_pm_register_notifier(struct notifier_block *nb);
71int cpu_pm_unregister_notifier(struct notifier_block *nb);
72
73/*
74 * cpm_pm_enter
75 *
76 * Notifies listeners that a single cpu is entering a low power state that may
77 * cause some blocks in the same power domain as the cpu to reset.
78 *
79 * Must be called on the affected cpu with interrupts disabled. Platform is
80 * responsible for ensuring that cpu_pm_enter is not called twice on the same
81 * cpu before cpu_pm_exit is called.
82 */
83int cpu_pm_enter(void);
84
85/*
86 * cpm_pm_exit
87 *
88 * Notifies listeners that a single cpu is exiting a low power state that may
89 * have caused some blocks in the same power domain as the cpu to reset.
90 *
91 * Must be called on the affected cpu with interrupts disabled.
92 */
93int cpu_pm_exit(void);
94
95/*
96 * cpm_complex_pm_enter
97 *
98 * Notifies listeners that all cpus in a power domain are entering a low power
99 * state that may cause some blocks in the same power domain to reset.
100 *
101 * Must be called after cpu_pm_enter has been called on all cpus in the power
102 * domain, and before cpu_pm_exit has been called on any cpu in the power
103 * domain.
104 *
105 * Must be called with interrupts disabled.
106 */
107int cpu_complex_pm_enter(void);
108
109/*
110 * cpm_pm_enter
111 *
112 * Notifies listeners that a single cpu is entering a low power state that may
113 * cause some blocks in the same power domain as the cpu to reset.
114 *
115 * Must be called after cpu_pm_enter has been called on all cpus in the power
116 * domain, and before cpu_pm_exit has been called on any cpu in the power
117 * domain.
118 *
119 * Must be called with interrupts disabled.
120 */
121int cpu_complex_pm_exit(void);
122
123#endif