Mark Rutland | bff6079 | 2015-07-31 15:46:16 +0100 | [diff] [blame] | 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); |
Lorenzo Pieralisi | 068654c | 2015-05-26 16:49:01 +0100 | [diff] [blame] | 24 | bool psci_power_state_loses_context(u32 state); |
| 25 | bool psci_power_state_is_valid(u32 state); |
Mark Rutland | bff6079 | 2015-07-31 15:46:16 +0100 | [diff] [blame] | 26 | |
| 27 | struct psci_operations { |
| 28 | int (*cpu_suspend)(u32 state, unsigned long entry_point); |
| 29 | int (*cpu_off)(u32 state); |
| 30 | int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); |
| 31 | int (*migrate)(unsigned long cpuid); |
| 32 | int (*affinity_info)(unsigned long target_affinity, |
| 33 | unsigned long lowest_affinity_level); |
| 34 | int (*migrate_info_type)(void); |
| 35 | }; |
| 36 | |
| 37 | extern struct psci_operations psci_ops; |
| 38 | |
| 39 | #if defined(CONFIG_ARM_PSCI_FW) |
| 40 | int __init psci_dt_init(void); |
| 41 | #else |
| 42 | static inline int psci_dt_init(void) { return 0; } |
| 43 | #endif |
| 44 | |
| 45 | #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI) |
| 46 | int __init psci_acpi_init(void); |
| 47 | bool __init acpi_psci_present(void); |
| 48 | bool __init acpi_psci_use_hvc(void); |
| 49 | #else |
| 50 | static inline int psci_acpi_init(void) { return 0; } |
| 51 | static inline bool acpi_psci_present(void) { return false; } |
| 52 | #endif |
| 53 | |
| 54 | #endif /* __LINUX_PSCI_H */ |