Ulf Hansson | a5e0454 | 2019-10-28 16:32:23 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | |
| 3 | #ifndef __CPUIDLE_PSCI_H |
| 4 | #define __CPUIDLE_PSCI_H |
| 5 | |
Ulf Hansson | 166bf83 | 2020-07-07 14:58:02 +0200 | [diff] [blame] | 6 | struct device; |
Ulf Hansson | a65a397 | 2019-10-10 12:01:48 +0200 | [diff] [blame] | 7 | struct device_node; |
| 8 | |
| 9 | void psci_set_domain_state(u32 state); |
Ulf Hansson | 166bf83 | 2020-07-07 14:58:02 +0200 | [diff] [blame] | 10 | int psci_dt_parse_state_node(struct device_node *np, u32 *state); |
Ulf Hansson | a65a397 | 2019-10-10 12:01:48 +0200 | [diff] [blame] | 11 | |
Ulf Hansson | 0317561 | 2020-07-07 14:58:00 +0200 | [diff] [blame] | 12 | #ifdef CONFIG_ARM_PSCI_CPUIDLE_DOMAIN |
Anup Patel | 9d976d6 | 2022-02-10 11:19:44 +0530 | [diff] [blame] | 13 | |
| 14 | #include "dt_idle_genpd.h" |
| 15 | |
| 16 | static inline struct device *psci_dt_attach_cpu(int cpu) |
| 17 | { |
| 18 | return dt_idle_attach_cpu(cpu, "psci"); |
| 19 | } |
| 20 | |
| 21 | static inline void psci_dt_detach_cpu(struct device *dev) |
| 22 | { |
| 23 | dt_idle_detach_cpu(dev); |
| 24 | } |
| 25 | |
Ulf Hansson | a5e0454 | 2019-10-28 16:32:23 +0100 | [diff] [blame] | 26 | #else |
Ulf Hansson | 166bf83 | 2020-07-07 14:58:02 +0200 | [diff] [blame] | 27 | static inline struct device *psci_dt_attach_cpu(int cpu) { return NULL; } |
| 28 | static inline void psci_dt_detach_cpu(struct device *dev) { } |
Ulf Hansson | a5e0454 | 2019-10-28 16:32:23 +0100 | [diff] [blame] | 29 | #endif |
| 30 | |
| 31 | #endif /* __CPUIDLE_PSCI_H */ |