OSDN Git Service

Merge android-4.4-p.200 (903fbe7) into msm-4.4
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / include / linux / psci.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License version 2 as
4  * published by the Free Software Foundation.
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9  * GNU General Public License for more details.
10  *
11  * Copyright (C) 2015 ARM Limited
12  */
13
14 #ifndef __LINUX_PSCI_H
15 #define __LINUX_PSCI_H
16
17 #include <linux/init.h>
18 #include <linux/types.h>
19
20 #define PSCI_POWER_STATE_TYPE_STANDBY           0
21 #define PSCI_POWER_STATE_TYPE_POWER_DOWN        1
22
23 bool psci_tos_resident_on(int cpu);
24 bool psci_power_state_loses_context(u32 state);
25 bool psci_power_state_is_valid(u32 state);
26
27 int psci_cpu_init_idle(unsigned int cpu);
28 int psci_cpu_suspend_enter(unsigned long index);
29
30 enum psci_conduit {
31         PSCI_CONDUIT_NONE,
32         PSCI_CONDUIT_SMC,
33         PSCI_CONDUIT_HVC,
34 };
35
36 enum smccc_version {
37         SMCCC_VERSION_1_0,
38         SMCCC_VERSION_1_1,
39 };
40
41 struct psci_operations {
42         u32 (*get_version)(void);
43         int (*cpu_suspend)(u32 state, unsigned long entry_point);
44         int (*cpu_off)(u32 state);
45         int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);
46         int (*migrate)(unsigned long cpuid);
47         int (*affinity_info)(unsigned long target_affinity,
48                         unsigned long lowest_affinity_level);
49         int (*migrate_info_type)(void);
50         enum psci_conduit conduit;
51         enum smccc_version smccc_version;
52 };
53
54 extern struct psci_operations psci_ops;
55
56 #if defined(CONFIG_ARM_PSCI_FW)
57 int __init psci_dt_init(void);
58 #else
59 static inline int psci_dt_init(void) { return 0; }
60 #endif
61
62 #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI)
63 int __init psci_acpi_init(void);
64 bool __init acpi_psci_present(void);
65 bool __init acpi_psci_use_hvc(void);
66 #else
67 static inline int psci_acpi_init(void) { return 0; }
68 static inline bool acpi_psci_present(void) { return false; }
69 #endif
70
71 #endif /* __LINUX_PSCI_H */