mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-21 18:14:48 +08:00
9d976d6721
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>
32 lines
672 B
C
32 lines
672 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef __CPUIDLE_PSCI_H
|
|
#define __CPUIDLE_PSCI_H
|
|
|
|
struct device;
|
|
struct device_node;
|
|
|
|
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
|
|
|
|
#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) { }
|
|
#endif
|
|
|
|
#endif /* __CPUIDLE_PSCI_H */
|