xref: /openbmc/linux/drivers/cpuidle/dt_idle_genpd.h (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
19d976d67SAnup Patel /* SPDX-License-Identifier: GPL-2.0 */
29d976d67SAnup Patel #ifndef __DT_IDLE_GENPD
39d976d67SAnup Patel #define __DT_IDLE_GENPD
49d976d67SAnup Patel 
59d976d67SAnup Patel struct device_node;
69d976d67SAnup Patel struct generic_pm_domain;
79d976d67SAnup Patel 
89d976d67SAnup Patel #ifdef CONFIG_DT_IDLE_GENPD
99d976d67SAnup Patel 
109d976d67SAnup Patel void dt_idle_pd_free(struct generic_pm_domain *pd);
119d976d67SAnup Patel 
129d976d67SAnup Patel struct generic_pm_domain *dt_idle_pd_alloc(struct device_node *np,
139d976d67SAnup Patel 			int (*parse_state)(struct device_node *, u32 *));
149d976d67SAnup Patel 
159d976d67SAnup Patel int dt_idle_pd_init_topology(struct device_node *np);
169d976d67SAnup Patel 
17*9a8fa00dSMaulik Shah int dt_idle_pd_remove_topology(struct device_node *np);
18*9a8fa00dSMaulik Shah 
199d976d67SAnup Patel struct device *dt_idle_attach_cpu(int cpu, const char *name);
209d976d67SAnup Patel 
219d976d67SAnup Patel void dt_idle_detach_cpu(struct device *dev);
229d976d67SAnup Patel 
239d976d67SAnup Patel #else
249d976d67SAnup Patel 
dt_idle_pd_free(struct generic_pm_domain * pd)259d976d67SAnup Patel static inline void dt_idle_pd_free(struct generic_pm_domain *pd)
269d976d67SAnup Patel {
279d976d67SAnup Patel }
289d976d67SAnup Patel 
dt_idle_pd_alloc(struct device_node * np,int (* parse_state)(struct device_node *,u32 *))299d976d67SAnup Patel static inline struct generic_pm_domain *dt_idle_pd_alloc(
309d976d67SAnup Patel 			struct device_node *np,
319d976d67SAnup Patel 			int (*parse_state)(struct device_node *, u32 *))
329d976d67SAnup Patel {
339d976d67SAnup Patel 	return NULL;
349d976d67SAnup Patel }
359d976d67SAnup Patel 
dt_idle_pd_init_topology(struct device_node * np)369d976d67SAnup Patel static inline int dt_idle_pd_init_topology(struct device_node *np)
379d976d67SAnup Patel {
389d976d67SAnup Patel 	return 0;
399d976d67SAnup Patel }
409d976d67SAnup Patel 
dt_idle_pd_remove_topology(struct device_node * np)41*9a8fa00dSMaulik Shah static inline int dt_idle_pd_remove_topology(struct device_node *np)
42*9a8fa00dSMaulik Shah {
43*9a8fa00dSMaulik Shah 	return 0;
44*9a8fa00dSMaulik Shah }
45*9a8fa00dSMaulik Shah 
dt_idle_attach_cpu(int cpu,const char * name)469d976d67SAnup Patel static inline struct device *dt_idle_attach_cpu(int cpu, const char *name)
479d976d67SAnup Patel {
489d976d67SAnup Patel 	return NULL;
499d976d67SAnup Patel }
509d976d67SAnup Patel 
dt_idle_detach_cpu(struct device * dev)519d976d67SAnup Patel static inline void dt_idle_detach_cpu(struct device *dev)
529d976d67SAnup Patel {
539d976d67SAnup Patel }
549d976d67SAnup Patel 
559d976d67SAnup Patel #endif
569d976d67SAnup Patel 
579d976d67SAnup Patel #endif
58