diff options
author | Anup Patel <anup.patel@wdc.com> | 2022-02-10 11:19:44 +0530 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2022-03-10 09:29:44 -0800 |
commit | 9d976d6721dfb525b81ce981e1363c70c0975aab (patch) | |
tree | 2607ced4361d162f1c624c6b44e039ca9a8cd89f /drivers/cpuidle/cpuidle-psci.h | |
parent | b8200905e48891b4a3134b47f35c730347135eed (diff) | |
download | linux-9d976d6721dfb525b81ce981e1363c70c0975aab.tar.gz |
cpuidle: Factor-out power domain related code from PSCI domain driver
The generic power domain related code in PSCI domain driver is largely
independent of PSCI and can be shared with RISC-V SBI domain driver
hence we factor-out this code into dt_idle_genpd.c and dt_idle_genpd.h.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'drivers/cpuidle/cpuidle-psci.h')
-rw-r--r-- | drivers/cpuidle/cpuidle-psci.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/cpuidle/cpuidle-psci.h b/drivers/cpuidle/cpuidle-psci.h index d8e925e84c27..4e132640ed64 100644 --- a/drivers/cpuidle/cpuidle-psci.h +++ b/drivers/cpuidle/cpuidle-psci.h @@ -10,8 +10,19 @@ void psci_set_domain_state(u32 state); int psci_dt_parse_state_node(struct device_node *np, u32 *state); #ifdef CONFIG_ARM_PSCI_CPUIDLE_DOMAIN -struct device *psci_dt_attach_cpu(int cpu); -void psci_dt_detach_cpu(struct device *dev); + +#include "dt_idle_genpd.h" + +static inline struct device *psci_dt_attach_cpu(int cpu) +{ + return dt_idle_attach_cpu(cpu, "psci"); +} + +static inline void psci_dt_detach_cpu(struct device *dev) +{ + dt_idle_detach_cpu(dev); +} + #else static inline struct device *psci_dt_attach_cpu(int cpu) { return NULL; } static inline void psci_dt_detach_cpu(struct device *dev) { } |