blob: b21f35f0ee2eafbfae04fa7c193f5be543d75825 [file] [log] [blame]
Rafael J. Wysockif7218892011-07-01 22:12:45 +02001/*
2 * pm_domain.h - Definitions and headers related to device power domains.
3 *
4 * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
5 *
6 * This file is released under the GPLv2.
7 */
8
9#ifndef _LINUX_PM_DOMAIN_H
10#define _LINUX_PM_DOMAIN_H
11
12#include <linux/device.h>
Paul Gortmaker313162d2012-01-30 11:46:54 -050013#include <linux/mutex.h>
14#include <linux/pm.h>
Guennadi Liakhovetski4f042cd2011-12-01 00:05:31 +010015#include <linux/err.h>
Thomas Abrahamc8aa1302012-01-27 15:22:07 +090016#include <linux/of.h>
Rafael J. Wysocki6ff7bb0d02012-05-01 21:34:07 +020017#include <linux/notifier.h>
Lina Iyerd716f472016-10-14 10:47:55 -070018#include <linux/spinlock.h>
Ulf Hanssoneb594b72019-03-27 15:35:46 +010019#include <linux/cpumask.h>
Rafael J. Wysockif7218892011-07-01 22:12:45 +020020
Ulf Hanssone5089c22018-10-03 16:38:16 +020021/*
22 * Flags to control the behaviour of a genpd.
23 *
24 * These flags may be set in the struct generic_pm_domain's flags field by a
25 * genpd backend driver. The flags must be set before it calls pm_genpd_init(),
26 * which initializes a genpd.
27 *
28 * GENPD_FLAG_PM_CLK: Instructs genpd to use the PM clk framework,
29 * while powering on/off attached devices.
30 *
31 * GENPD_FLAG_IRQ_SAFE: This informs genpd that its backend callbacks,
32 * ->power_on|off(), doesn't sleep. Hence, these
33 * can be invoked from within atomic context, which
34 * enables genpd to power on/off the PM domain,
35 * even when pm_runtime_is_irq_safe() returns true,
36 * for any of its attached devices. Note that, a
37 * genpd having this flag set, requires its
38 * masterdomains to also have it set.
39 *
40 * GENPD_FLAG_ALWAYS_ON: Instructs genpd to always keep the PM domain
41 * powered on.
42 *
43 * GENPD_FLAG_ACTIVE_WAKEUP: Instructs genpd to keep the PM domain powered
44 * on, in case any of its attached devices is used
45 * in the wakeup path to serve system wakeups.
Ulf Hanssoneb594b72019-03-27 15:35:46 +010046 *
47 * GENPD_FLAG_CPU_DOMAIN: Instructs genpd that it should expect to get
48 * devices attached, which may belong to CPUs or
49 * possibly have subdomains with CPUs attached.
50 * This flag enables the genpd backend driver to
51 * deploy idle power management support for CPUs
52 * and groups of CPUs. Note that, the backend
53 * driver must then comply with the so called,
54 * last-man-standing algorithm, for the CPUs in the
55 * PM domain.
Leonard Crestezed61e182019-04-30 15:06:11 +000056 *
57 * GENPD_FLAG_RPM_ALWAYS_ON: Instructs genpd to always keep the PM domain
58 * powered on except for system suspend.
Ulf Hanssone5089c22018-10-03 16:38:16 +020059 */
60#define GENPD_FLAG_PM_CLK (1U << 0)
61#define GENPD_FLAG_IRQ_SAFE (1U << 1)
62#define GENPD_FLAG_ALWAYS_ON (1U << 2)
63#define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3)
Ulf Hanssoneb594b72019-03-27 15:35:46 +010064#define GENPD_FLAG_CPU_DOMAIN (1U << 4)
Leonard Crestezed61e182019-04-30 15:06:11 +000065#define GENPD_FLAG_RPM_ALWAYS_ON (1U << 5)
Ulf Hanssonc11f6f52014-12-01 12:50:21 +010066
Rafael J. Wysocki17b75ec2011-07-12 00:39:29 +020067enum gpd_status {
68 GPD_STATE_ACTIVE = 0, /* PM domain is active */
Rafael J. Wysocki17b75ec2011-07-12 00:39:29 +020069 GPD_STATE_POWER_OFF, /* PM domain is off */
70};
Rafael J. Wysocki596ba342011-07-01 22:13:19 +020071
Rafael J. Wysockif7218892011-07-01 22:12:45 +020072struct dev_power_governor {
73 bool (*power_down_ok)(struct dev_pm_domain *domain);
Ulf Hansson9df39212016-03-31 11:21:25 +020074 bool (*suspend_ok)(struct device *dev);
Rafael J. Wysockif7218892011-07-01 22:12:45 +020075};
76
Rafael J. Wysockid5e4cbf2011-11-27 13:11:36 +010077struct gpd_dev_ops {
78 int (*start)(struct device *dev);
79 int (*stop)(struct device *dev);
Rafael J. Wysockid5e4cbf2011-11-27 13:11:36 +010080};
81
Axel Haslamfc5cbf02016-02-15 11:10:51 +010082struct genpd_power_state {
83 s64 power_off_latency_ns;
84 s64 power_on_latency_ns;
Lina Iyer405f7222016-10-14 10:47:50 -070085 s64 residency_ns;
Lina Iyer0c9b6942016-10-14 10:47:52 -070086 struct fwnode_handle *fwnode;
Thara Gopinathafece3a2017-07-14 13:10:15 -040087 ktime_t idle_time;
Ulf Hansson49a27e22019-03-27 15:35:45 +010088 void *data;
Axel Haslamfc5cbf02016-02-15 11:10:51 +010089};
90
Lina Iyer35241d12016-10-14 10:47:54 -070091struct genpd_lock_ops;
Viresh Kumar6e417662017-11-29 15:21:51 +053092struct dev_pm_opp;
Viresh Kumar1067ae32018-11-02 11:18:08 +053093struct opp_table;
Lina Iyer35241d12016-10-14 10:47:54 -070094
Rafael J. Wysockif7218892011-07-01 22:12:45 +020095struct generic_pm_domain {
Viresh Kumar401ea152017-03-17 11:26:19 +053096 struct device dev;
Rafael J. Wysockif7218892011-07-01 22:12:45 +020097 struct dev_pm_domain domain; /* PM domain operations */
Rafael J. Wysocki5125bbf382011-07-13 12:31:52 +020098 struct list_head gpd_list_node; /* Node in the global PM domains list */
Rafael J. Wysocki5063ce12011-08-08 23:43:40 +020099 struct list_head master_links; /* Links with PM domain as a master */
100 struct list_head slave_links; /* Links with PM domain as a slave */
Rafael J. Wysockif7218892011-07-01 22:12:45 +0200101 struct list_head dev_list; /* List of devices */
Rafael J. Wysockif7218892011-07-01 22:12:45 +0200102 struct dev_power_governor *gov;
103 struct work_struct power_off_work;
Jon Hunterde0aa06d2016-09-12 12:01:12 +0100104 struct fwnode_handle *provider; /* Identity of the domain provider */
105 bool has_provider;
Geert Uytterhoevend07e9c12014-08-29 15:13:21 +0200106 const char *name;
Rafael J. Wysockic4bb3162011-08-08 23:43:04 +0200107 atomic_t sd_count; /* Number of subdomains with power "on" */
Rafael J. Wysocki17b75ec2011-07-12 00:39:29 +0200108 enum gpd_status status; /* Current state of the domain */
Rafael J. Wysocki596ba342011-07-01 22:13:19 +0200109 unsigned int device_count; /* Number of devices */
110 unsigned int suspended_count; /* System suspend device counter */
111 unsigned int prepared_count; /* Suspend counter of prepared devices */
Viresh Kumar42f62842017-10-12 15:07:23 +0530112 unsigned int performance_state; /* Aggregated max performance state */
Ulf Hanssoneb594b72019-03-27 15:35:46 +0100113 cpumask_var_t cpus; /* A cpumask of the attached CPUs */
Rafael J. Wysockif7218892011-07-01 22:12:45 +0200114 int (*power_off)(struct generic_pm_domain *domain);
115 int (*power_on)(struct generic_pm_domain *domain);
Viresh Kumar1067ae32018-11-02 11:18:08 +0530116 struct opp_table *opp_table; /* OPP table of the genpd */
Viresh Kumar6e417662017-11-29 15:21:51 +0530117 unsigned int (*opp_to_performance_state)(struct generic_pm_domain *genpd,
118 struct dev_pm_opp *opp);
Viresh Kumar42f62842017-10-12 15:07:23 +0530119 int (*set_performance_state)(struct generic_pm_domain *genpd,
120 unsigned int state);
Rafael J. Wysockid5e4cbf2011-11-27 13:11:36 +0100121 struct gpd_dev_ops dev_ops;
Rafael J. Wysocki221e9b52011-12-01 00:02:10 +0100122 s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
Rafael J. Wysocki6ff7bb0d02012-05-01 21:34:07 +0200123 bool max_off_time_changed;
124 bool cached_power_down_ok;
Ulf Hanssone9499962019-04-11 20:17:33 +0200125 bool cached_power_down_state_idx;
Ulf Hanssonc16561e2014-11-06 00:37:08 +0100126 int (*attach_dev)(struct generic_pm_domain *domain,
127 struct device *dev);
128 void (*detach_dev)(struct generic_pm_domain *domain,
129 struct device *dev);
Ulf Hanssonc11f6f52014-12-01 12:50:21 +0100130 unsigned int flags; /* Bit field of configs for genpd */
Lina Iyer59d65b72016-10-14 10:47:49 -0700131 struct genpd_power_state *states;
Ulf Hansson49a27e22019-03-27 15:35:45 +0100132 void (*free_states)(struct genpd_power_state *states,
133 unsigned int state_count);
Axel Haslamfc5cbf02016-02-15 11:10:51 +0100134 unsigned int state_count; /* number of states */
135 unsigned int state_idx; /* state that genpd will go to when off */
Thara Gopinathafece3a2017-07-14 13:10:15 -0400136 ktime_t on_time;
137 ktime_t accounting_time;
Lina Iyer35241d12016-10-14 10:47:54 -0700138 const struct genpd_lock_ops *lock_ops;
Lina Iyerd716f472016-10-14 10:47:55 -0700139 union {
140 struct mutex mlock;
141 struct {
142 spinlock_t slock;
143 unsigned long lock_flags;
144 };
145 };
Axel Haslamfc5cbf02016-02-15 11:10:51 +0100146
Rafael J. Wysockif7218892011-07-01 22:12:45 +0200147};
148
Rafael J. Wysocki596ba342011-07-01 22:13:19 +0200149static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
150{
151 return container_of(pd, struct generic_pm_domain, domain);
152}
153
Rafael J. Wysocki5063ce12011-08-08 23:43:40 +0200154struct gpd_link {
155 struct generic_pm_domain *master;
156 struct list_head master_node;
157 struct generic_pm_domain *slave;
158 struct list_head slave_node;
Viresh Kumar18edf492018-11-02 14:40:19 +0530159
160 /* Sub-domain's per-master domain performance state */
161 unsigned int performance_state;
162 unsigned int prev_performance_state;
Rafael J. Wysocki5063ce12011-08-08 23:43:40 +0200163};
164
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100165struct gpd_timing_data {
Ulf Hansson2b1d88c2015-10-15 17:02:19 +0200166 s64 suspend_latency_ns;
167 s64 resume_latency_ns;
Rafael J. Wysockia5bef8102012-04-29 22:54:17 +0200168 s64 effective_constraint_ns;
Rafael J. Wysocki6ff7bb0d02012-05-01 21:34:07 +0200169 bool constraint_changed;
Ulf Hansson9df39212016-03-31 11:21:25 +0200170 bool cached_suspend_ok;
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100171};
172
Ulf Hansson00e7c292014-11-14 08:41:32 +0100173struct pm_domain_data {
174 struct list_head list_node;
175 struct device *dev;
176};
177
Rafael J. Wysockicd0ea672011-09-26 20:22:02 +0200178struct generic_pm_domain_data {
179 struct pm_domain_data base;
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100180 struct gpd_timing_data td;
Rafael J. Wysocki6ff7bb0d02012-05-01 21:34:07 +0200181 struct notifier_block nb;
Ulf Hanssonf9ccd7c2019-04-25 11:04:13 +0200182 int cpu;
Viresh Kumar42f62842017-10-12 15:07:23 +0530183 unsigned int performance_state;
Dave Gerlacha5ea7a02017-04-04 08:51:29 -0700184 void *data;
Rafael J. Wysockicd0ea672011-09-26 20:22:02 +0200185};
186
Guennadi Liakhovetski9b4f617b2012-02-04 22:26:49 +0100187#ifdef CONFIG_PM_GENERIC_DOMAINS
Rafael J. Wysockicd0ea672011-09-26 20:22:02 +0200188static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *pdd)
189{
190 return container_of(pdd, struct generic_pm_domain_data, base);
191}
192
Rafael J. Wysockid5e4cbf2011-11-27 13:11:36 +0100193static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
194{
195 return to_gpd_data(dev->power.subsys_data->domain_data);
196}
197
Ulf Hansson1a7a6702018-05-29 12:04:14 +0200198int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev);
Ulf Hansson924f4482018-05-29 12:04:15 +0200199int pm_genpd_remove_device(struct device *dev);
Ulf Hansson781b9d62018-05-29 12:04:13 +0200200int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
201 struct generic_pm_domain *new_subdomain);
202int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
203 struct generic_pm_domain *target);
204int pm_genpd_init(struct generic_pm_domain *genpd,
205 struct dev_power_governor *gov, bool is_off);
206int pm_genpd_remove(struct generic_pm_domain *genpd);
207int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state);
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100208
Ulf Hanssonae3c5112014-09-03 12:52:31 +0200209extern struct dev_power_governor simple_qos_governor;
Mark Brown925b44a2011-12-08 23:27:28 +0100210extern struct dev_power_governor pm_domain_always_on_gov;
Ulf Hanssone9499962019-04-11 20:17:33 +0200211#ifdef CONFIG_CPU_IDLE
212extern struct dev_power_governor pm_domain_cpu_gov;
213#endif
Rafael J. Wysockif7218892011-07-01 22:12:45 +0200214#else
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100215
Magnus Dammb6426312012-02-25 22:14:18 +0100216static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
217{
218 return ERR_PTR(-ENOSYS);
219}
Ulf Hansson1a7a6702018-05-29 12:04:14 +0200220static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
221 struct device *dev)
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100222{
223 return -ENOSYS;
224}
Ulf Hansson924f4482018-05-29 12:04:15 +0200225static inline int pm_genpd_remove_device(struct device *dev)
Rafael J. Wysockif7218892011-07-01 22:12:45 +0200226{
227 return -ENOSYS;
228}
229static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
230 struct generic_pm_domain *new_sd)
231{
232 return -ENOSYS;
233}
234static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
235 struct generic_pm_domain *target)
236{
237 return -ENOSYS;
238}
Ulf Hansson7eb231c2016-06-17 12:27:52 +0200239static inline int pm_genpd_init(struct generic_pm_domain *genpd,
240 struct dev_power_governor *gov, bool is_off)
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100241{
Ulf Hansson7eb231c2016-06-17 12:27:52 +0200242 return -ENOSYS;
Rafael J. Wysockib02c9992011-12-01 00:02:05 +0100243}
Jon Hunter3fe57712016-09-12 12:01:13 +0100244static inline int pm_genpd_remove(struct generic_pm_domain *genpd)
245{
246 return -ENOTSUPP;
247}
Geert Uytterhoeven16d0bf12017-02-08 19:37:55 +0100248
Viresh Kumar42f62842017-10-12 15:07:23 +0530249static inline int dev_pm_genpd_set_performance_state(struct device *dev,
250 unsigned int state)
251{
252 return -ENOTSUPP;
253}
254
Geert Uytterhoeven16d0bf12017-02-08 19:37:55 +0100255#define simple_qos_governor (*(struct dev_power_governor *)(NULL))
256#define pm_domain_always_on_gov (*(struct dev_power_governor *)(NULL))
Rafael J. Wysocki17f2ae72011-08-14 13:34:31 +0200257#endif
258
Rafael J. Wysocki77f827d2012-08-06 01:39:57 +0200259#ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP
Ulf Hansson781b9d62018-05-29 12:04:13 +0200260void pm_genpd_syscore_poweroff(struct device *dev);
261void pm_genpd_syscore_poweron(struct device *dev);
Rafael J. Wysocki77f827d2012-08-06 01:39:57 +0200262#else
Ulf Hanssond47e6462014-09-03 12:52:24 +0200263static inline void pm_genpd_syscore_poweroff(struct device *dev) {}
264static inline void pm_genpd_syscore_poweron(struct device *dev) {}
Rafael J. Wysocki77f827d2012-08-06 01:39:57 +0200265#endif
266
Tomasz Figaaa422402014-09-19 20:27:36 +0200267/* OF PM domain providers */
268struct of_device_id;
269
Thierry Reding40845522017-03-29 18:34:50 +0200270typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args,
271 void *data);
272
Tomasz Figaaa422402014-09-19 20:27:36 +0200273struct genpd_onecell_data {
274 struct generic_pm_domain **domains;
275 unsigned int num_domains;
Thierry Reding40845522017-03-29 18:34:50 +0200276 genpd_xlate_t xlate;
Tomasz Figaaa422402014-09-19 20:27:36 +0200277};
278
Tomasz Figaaa422402014-09-19 20:27:36 +0200279#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
Jon Hunter892ebdcc2016-09-12 12:01:09 +0100280int of_genpd_add_provider_simple(struct device_node *np,
281 struct generic_pm_domain *genpd);
282int of_genpd_add_provider_onecell(struct device_node *np,
283 struct genpd_onecell_data *data);
Tomasz Figaaa422402014-09-19 20:27:36 +0200284void of_genpd_del_provider(struct device_node *np);
Ulf Hansson781b9d62018-05-29 12:04:13 +0200285int of_genpd_add_device(struct of_phandle_args *args, struct device *dev);
286int of_genpd_add_subdomain(struct of_phandle_args *parent,
287 struct of_phandle_args *new_subdomain);
288struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
289int of_genpd_parse_idle_states(struct device_node *dn,
290 struct genpd_power_state **states, int *n);
Viresh Kumare38f89d2018-06-13 20:22:04 +0530291unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev,
292 struct dev_pm_opp *opp);
Tomasz Figaaa422402014-09-19 20:27:36 +0200293
294int genpd_dev_pm_attach(struct device *dev);
Ulf Hansson3c095f32018-05-31 12:59:58 +0200295struct device *genpd_dev_pm_attach_by_id(struct device *dev,
296 unsigned int index);
Ulf Hansson5d6be702018-06-29 13:04:31 +0200297struct device *genpd_dev_pm_attach_by_name(struct device *dev,
Douglas Anderson7416f1f2019-02-14 10:12:48 -0800298 const char *name);
Tomasz Figaaa422402014-09-19 20:27:36 +0200299#else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
Jon Hunter892ebdcc2016-09-12 12:01:09 +0100300static inline int of_genpd_add_provider_simple(struct device_node *np,
301 struct generic_pm_domain *genpd)
Tomasz Figaaa422402014-09-19 20:27:36 +0200302{
Jon Hunter892ebdcc2016-09-12 12:01:09 +0100303 return -ENOTSUPP;
Tomasz Figaaa422402014-09-19 20:27:36 +0200304}
Tomasz Figaaa422402014-09-19 20:27:36 +0200305
Jon Hunter892ebdcc2016-09-12 12:01:09 +0100306static inline int of_genpd_add_provider_onecell(struct device_node *np,
307 struct genpd_onecell_data *data)
308{
309 return -ENOTSUPP;
310}
311
312static inline void of_genpd_del_provider(struct device_node *np) {}
Tomasz Figaaa422402014-09-19 20:27:36 +0200313
Jon Hunterec695722016-09-12 12:01:05 +0100314static inline int of_genpd_add_device(struct of_phandle_args *args,
315 struct device *dev)
316{
317 return -ENODEV;
318}
319
320static inline int of_genpd_add_subdomain(struct of_phandle_args *parent,
321 struct of_phandle_args *new_subdomain)
322{
323 return -ENODEV;
324}
325
Lina Iyer30f604282016-10-14 10:47:51 -0700326static inline int of_genpd_parse_idle_states(struct device_node *dn,
327 struct genpd_power_state **states, int *n)
328{
329 return -ENODEV;
330}
331
Viresh Kumar6e417662017-11-29 15:21:51 +0530332static inline unsigned int
Viresh Kumare38f89d2018-06-13 20:22:04 +0530333pm_genpd_opp_to_performance_state(struct device *genpd_dev,
334 struct dev_pm_opp *opp)
335{
336 return 0;
337}
338
Tomasz Figaaa422402014-09-19 20:27:36 +0200339static inline int genpd_dev_pm_attach(struct device *dev)
340{
Ulf Hansson919b7302018-05-09 12:17:52 +0200341 return 0;
Tomasz Figaaa422402014-09-19 20:27:36 +0200342}
Jon Hunter17926552016-09-12 12:01:14 +0100343
Ulf Hansson3c095f32018-05-31 12:59:58 +0200344static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev,
345 unsigned int index)
346{
347 return NULL;
348}
349
Ulf Hansson5d6be702018-06-29 13:04:31 +0200350static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
Douglas Anderson7416f1f2019-02-14 10:12:48 -0800351 const char *name)
Ulf Hansson5d6be702018-06-29 13:04:31 +0200352{
353 return NULL;
354}
355
Jon Hunter17926552016-09-12 12:01:14 +0100356static inline
357struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
358{
359 return ERR_PTR(-ENOTSUPP);
360}
Tomasz Figaaa422402014-09-19 20:27:36 +0200361#endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
362
Ulf Hanssonf48c7672014-09-29 13:58:47 +0200363#ifdef CONFIG_PM
Ulf Hansson781b9d62018-05-29 12:04:13 +0200364int dev_pm_domain_attach(struct device *dev, bool power_on);
Ulf Hansson82e12d92018-05-31 12:59:59 +0200365struct device *dev_pm_domain_attach_by_id(struct device *dev,
366 unsigned int index);
Ulf Hansson27dceb82018-06-29 13:04:32 +0200367struct device *dev_pm_domain_attach_by_name(struct device *dev,
Douglas Andersoneeb35df2019-02-14 10:12:49 -0800368 const char *name);
Ulf Hansson781b9d62018-05-29 12:04:13 +0200369void dev_pm_domain_detach(struct device *dev, bool power_off);
370void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
Ulf Hanssonf48c7672014-09-29 13:58:47 +0200371#else
372static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
373{
Ulf Hansson919b7302018-05-09 12:17:52 +0200374 return 0;
Ulf Hanssonf48c7672014-09-29 13:58:47 +0200375}
Ulf Hansson82e12d92018-05-31 12:59:59 +0200376static inline struct device *dev_pm_domain_attach_by_id(struct device *dev,
377 unsigned int index)
378{
379 return NULL;
380}
Ulf Hansson27dceb82018-06-29 13:04:32 +0200381static inline struct device *dev_pm_domain_attach_by_name(struct device *dev,
Douglas Andersoneeb35df2019-02-14 10:12:49 -0800382 const char *name)
Ulf Hansson27dceb82018-06-29 13:04:32 +0200383{
384 return NULL;
385}
Ulf Hanssonf48c7672014-09-29 13:58:47 +0200386static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {}
Tomeu Vizoso989561d2016-01-07 16:46:13 +0100387static inline void dev_pm_domain_set(struct device *dev,
388 struct dev_pm_domain *pd) {}
Ulf Hanssonf48c7672014-09-29 13:58:47 +0200389#endif
390
Rafael J. Wysockif7218892011-07-01 22:12:45 +0200391#endif /* _LINUX_PM_DOMAIN_H */