History

Merge tag 'pm-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki: "These add support for 'artificial' Energy Models in which power numbers for different entities may be in different scales, add support for some new hardware, fix bugs and clean up code in multiple places. Specifics: - Update the Energy Model support code to allow the Energy Model to be artificial, which means that the power values may not be on a uniform scale with other devices providing power information, and update the cpufreq_cooling and devfreq_cooling thermal drivers to support artificial Energy Models (Lukasz Luba). - Make DTPM check the Energy Model type (Lukasz Luba). - Fix policy counter decrementation in cpufreq if Energy Model is in use (Pierre Gondois). - Add CPU-based scaling support to passive devfreq governor (Saravana Kannan, Chanwoo Choi). - Update the rk3399_dmc devfreq driver (Brian Norris). - Export dev_pm_ops instead of suspend() and resume() in the IIO chemical scd30 driver (Jonathan Cameron). - Add namespace variants of EXPORT[_GPL]_SIMPLE_DEV_PM_OPS and PM-runtime counterparts (Jonathan Cameron). - Move symbol exports in the IIO chemical scd30 driver into the IIO_SCD30 namespace (Jonathan Cameron). - Avoid device PM-runtime usage count underflows (Rafael Wysocki). - Allow dynamic debug to control printing of PM messages (David Cohen). - Fix some kernel-doc comments in hibernation code (Yang Li, Haowen Bai). - Preserve ACPI-table override during hibernation (Amadeusz Sławiński). - Improve support for suspend-to-RAM for PSCI OSI mode (Ulf Hansson). - Make Intel RAPL power capping driver support the RaptorLake and AlderLake N processors (Zhang Rui, Sumeet Pawnikar). - Remove redundant store to value after multiply in the RAPL power capping driver (Colin Ian King). - Add AlderLake processor support to the intel_idle driver (Zhang Rui). - Fix regression leading to no genpd governor in the PSCI cpuidle driver and fix the riscv-sbi cpuidle driver to allow a genpd governor to be used (Ulf Hansson). - Fix cpufreq governor clean up code to avoid using kfree() directly to free kobject-based items (Kevin Hao). - Prepare cpufreq for powerpc's asm/prom.h cleanup (Christophe Leroy). - Make intel_pstate notify frequency invariance code when no_turbo is turned on and off (Chen Yu). - Add Sapphire Rapids OOB mode support to intel_pstate (Srinivas Pandruvada). - Make cpufreq avoid unnecessary frequency updates due to mismatch between hardware and the frequency table (Viresh Kumar). - Make remove_cpu_dev_symlink() clear the real_cpus mask to simplify code (Viresh Kumar). - Rearrange cpufreq_offline() and cpufreq_remove_dev() to make the calling convention for some driver callbacks consistent (Rafael Wysocki). - Avoid accessing half-initialized cpufreq policies from the show() and store() sysfs functions (Schspa Shi). - Rearrange cpufreq_offline() to make the calling convention for some driver callbacks consistent (Schspa Shi). - Update CPPC handling in cpufreq (Pierre Gondois). - Extend dev_pm_domain_detach() doc (Krzysztof Kozlowski). - Move genpd's time-accounting to ktime_get_mono_fast_ns() (Ulf Hansson). - Improve the way genpd deals with its governors (Ulf Hansson). - Update the turbostat utility to version 2022.04.16 (Len Brown, Dan Merillat, Sumeet Pawnikar, Zephaniah E. Loss-Cutler-Hull, Chen Yu)" * tag 'pm-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (94 commits) PM: domains: Trust domain-idle-states from DT to be correct by genpd PM: domains: Measure power-on/off latencies in genpd based on a governor PM: domains: Allocate governor data dynamically based on a genpd governor PM: domains: Clean up some code in pm_genpd_init() and genpd_remove() PM: domains: Fix initialization of genpd's next_wakeup PM: domains: Fixup QoS latency measurements for IRQ safe devices in genpd PM: domains: Measure suspend/resume latencies in genpd based on governor PM: domains: Move the next_wakeup variable into the struct gpd_timing_data PM: domains: Allocate gpd_timing_data dynamically based on governor PM: domains: Skip another warning in irq_safe_dev_in_sleep_domain() PM: domains: Rename irq_safe_dev_in_no_sleep_domain() in genpd PM: domains: Don't check PM_QOS_FLAG_NO_POWER_OFF in genpd PM: domains: Drop redundant code for genpd always-on governor PM: domains: Add GENPD_FLAG_RPM_ALWAYS_ON for the always-on governor powercap: intel_rapl: remove redundant store to value after multiply cpufreq: CPPC: Enable dvfs_possible_from_any_cpu cpufreq: CPPC: Enable fast_switch ACPI: CPPC: Assume no transition latency if no PCCT ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported ACPI: CPPC: Check _OSC for flexible address space ...

Linus Torvalds committed 4 years ago

Commit 09583df2 parents 1961b06 0d6448260 files · +2463 −1005Browse files

Showing the changes to include (9 of 60 files). Show all

Unified · Split

9 files
  1. include/acpi/cppc_acpi.h +5 −0
  2. include/linux/acpi.h +2 −0
  3. include/linux/devfreq.h +15 −2
  4. include/linux/energy_model.h +31 −4
  5. include/linux/pm.h +9 −5
  6. include/linux/pm_domain.h +14 −10
  7. include/linux/pm_runtime.h +8 −2
  8. include/linux/suspend.h +39 −5
  9. include/soc/rockchip/pm_domains.h +25 −0
include/acpi/cppc_acpi.h+5−0
@@ -141,6 +141,7 @@ extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); · 140 unmodified lines
141141 extern int cppc_set_enable(int cpu, bool enable);
142142 extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
143143 extern bool acpi_cpc_valid(void);
144+extern bool cppc_allow_fast_switch(void);
144145 extern int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data);
145146 extern unsigned int cppc_get_transition_latency(int cpu);
146147 extern bool cpc_ffh_supported(void);
@@ -175,6 +176,10 @@ static inline bool acpi_cpc_valid(void) · 28 unmodified lines
175176 {
176177 return false;
177178 }
179+static inline bool cppc_allow_fast_switch(void)
180+{
181+ return false;
182+}
178183 static inline unsigned int cppc_get_transition_latency(int cpu)
179184 {
180185 return CPUFREQ_ETERNAL;
include/linux/acpi.h+2−0
@@ -574,6 +574,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); · 573 unmodified lines
574574 #define OSC_SB_OSLPI_SUPPORT 0x00000100
575575 #define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT 0x00001000
576576 #define OSC_SB_GENERIC_INITIATOR_SUPPORT 0x00002000
577+#define OSC_SB_CPC_FLEXIBLE_ADR_SPACE 0x00004000
577578 #define OSC_SB_NATIVE_USB4_SUPPORT 0x00040000
578579 #define OSC_SB_PRM_SUPPORT 0x00200000
579580
@@ -581,6 +582,7 @@ extern bool osc_sb_apei_support_acked; · 1 unmodified line
581582 extern bool osc_pc_lpi_support_confirmed;
582583 extern bool osc_sb_native_usb4_support_confirmed;
583584 extern bool osc_sb_cppc_not_supported;
585+extern bool osc_cpc_flexible_adr_space_confirmed;
584586
585587 /* USB4 Capabilities */
586588 #define OSC_USB_USB3_TUNNELING 0x00000001
include/linux/devfreq.h+15−2
@@ -38,6 +38,7 @@ enum devfreq_timer { · 37 unmodified lines
3838
3939 struct devfreq;
4040 struct devfreq_governor;
41+struct devfreq_cpu_data;
4142 struct thermal_cooling_device;
4243
4344 /**
@@ -288,6 +289,11 @@ struct devfreq_simple_ondemand_data { · 244 unmodified lines
288289 #endif
289290
290291 #if IS_ENABLED(CONFIG_DEVFREQ_GOV_PASSIVE)
292+enum devfreq_parent_dev_type {
293+ DEVFREQ_PARENT_DEV,
294+ CPUFREQ_PARENT_DEV,
295+};
296+
291297 /**
292298 * struct devfreq_passive_data - ``void *data`` fed to struct devfreq
293299 * and devfreq_add_device
@@ -299,8 +305,11 @@ struct devfreq_simple_ondemand_data { · 5 unmodified lines
299305 * using governors except for passive governor.
300306 * If the devfreq device has the specific method to decide
301307 * the next frequency, should use this callback.
302− * @this: the devfreq instance of own device.
303− * @nb: the notifier block for DEVFREQ_TRANSITION_NOTIFIER list
308+ * @parent_type: the parent type of the device.
309+ * @this: the devfreq instance of own device.
310+ * @nb: the notifier block for DEVFREQ_TRANSITION_NOTIFIER or
311+ * CPUFREQ_TRANSITION_NOTIFIER list.
312+ * @cpu_data_list: the list of cpu frequency data for all cpufreq_policy.
304313 *
305314 * The devfreq_passive_data have to set the devfreq instance of parent
306315 * device with governors except for the passive governor. But, don't need to
@@ -314,9 +323,13 @@ struct devfreq_passive_data { · 7 unmodified lines
314323 /* Optional callback to decide the next frequency of passvice device */
315324 int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
316325
326+ /* Should set the type of parent device */
327+ enum devfreq_parent_dev_type parent_type;
328+
317329 /* For passive governor's internal use. Don't need to set them */
318330 struct devfreq *this;
319331 struct notifier_block nb;
332+ struct list_head cpu_data_list;
320333 };
321334 #endif
322335
include/linux/energy_model.h+31−4
@@ -67,11 +67,16 @@ struct em_perf_domain { · 66 unmodified lines
6767 *
6868 * EM_PERF_DOMAIN_SKIP_INEFFICIENCIES: Skip inefficient states when estimating
6969 * energy consumption.
70+ *
71+ * EM_PERF_DOMAIN_ARTIFICIAL: The power values are artificial and might be
72+ * created by platform missing real power information
7073 */
7174 #define EM_PERF_DOMAIN_MILLIWATTS BIT(0)
7275 #define EM_PERF_DOMAIN_SKIP_INEFFICIENCIES BIT(1)
76+#define EM_PERF_DOMAIN_ARTIFICIAL BIT(2)
7377
7478 #define em_span_cpus(em) (to_cpumask((em)->cpus))
79+#define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL)
7580
7681 #ifdef CONFIG_ENERGY_MODEL
7782 #define EM_MAX_POWER 0xFFFF
@@ -96,11 +101,11 @@ struct em_data_callback { · 18 unmodified lines
96101 /**
97102 * active_power() - Provide power at the next performance state of
98103 * a device
104+ * @dev : Device for which we do this operation (can be a CPU)
99105 * @power : Active power at the performance state
100106 * (modified)
101107 * @freq : Frequency at the performance state in kHz
102108 * (modified)
103− * @dev : Device for which we do this operation (can be a CPU)
104109 *
105110 * active_power() must find the lowest performance state of 'dev' above
106111 * 'freq' and update 'power' and 'freq' to the matching active power
@@ -112,11 +117,32 @@ struct em_data_callback { · 5 unmodified lines
112117 *
113118 * Return 0 on success.
114119 */
115− int (*active_power)(unsigned long *power, unsigned long *freq,
116− struct device *dev);
120+ int (*active_power)(struct device *dev, unsigned long *power,
121+ unsigned long *freq);
122+
123+ /**
124+ * get_cost() - Provide the cost at the given performance state of
125+ * a device
126+ * @dev : Device for which we do this operation (can be a CPU)
127+ * @freq : Frequency at the performance state in kHz
128+ * @cost : The cost value for the performance state
129+ * (modified)
130+ *
131+ * In case of CPUs, the cost is the one of a single CPU in the domain.
132+ * It is expected to fit in the [0, EM_MAX_POWER] range due to internal
133+ * usage in EAS calculation.
134+ *
135+ * Return 0 on success, or appropriate error value in case of failure.
136+ */
137+ int (*get_cost)(struct device *dev, unsigned long freq,
138+ unsigned long *cost);
117139 };
118−#define EM_DATA_CB(_active_power_cb) { .active_power = &_active_power_cb }
119140 #define EM_SET_ACTIVE_POWER_CB(em_cb, cb) ((em_cb).active_power = cb)
141+#define EM_ADV_DATA_CB(_active_power_cb, _cost_cb) \
142+ { .active_power = _active_power_cb, \
143+ .get_cost = _cost_cb }
144+#define EM_DATA_CB(_active_power_cb) \
145+ EM_ADV_DATA_CB(_active_power_cb, NULL)
120146
121147 struct em_perf_domain *em_cpu_get(int cpu);
122148 struct em_perf_domain *em_pd_get(struct device *dev);
@@ -264,6 +290,7 @@ static inline int em_pd_nr_perf_states(struct em_perf_domain *pd) · 141 unmodified lines
264290
265291 #else
266292 struct em_data_callback {};
293+#define EM_ADV_DATA_CB(_active_power_cb, _cost_cb) { }
267294 #define EM_DATA_CB(_active_power_cb) { }
268295 #define EM_SET_ACTIVE_POWER_CB(em_cb, cb) do { } while (0)
269296
include/linux/pm.h+9−5
@@ -368,13 +368,13 @@ const struct dev_pm_ops name = { \ · 367 unmodified lines
368368
369369 #ifdef CONFIG_PM
370370 #define _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, runtime_suspend_fn, \
371− runtime_resume_fn, idle_fn, sec) \
371+ runtime_resume_fn, idle_fn, sec, ns) \
372372 _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, runtime_suspend_fn, \
373373 runtime_resume_fn, idle_fn); \
374− _EXPORT_SYMBOL(name, sec)
374+ __EXPORT_SYMBOL(name, sec, ns)
375375 #else
376376 #define _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, runtime_suspend_fn, \
377− runtime_resume_fn, idle_fn, sec) \
377+ runtime_resume_fn, idle_fn, sec, ns) \
378378 static __maybe_unused _DEFINE_DEV_PM_OPS(__static_##name, suspend_fn, \
379379 resume_fn, runtime_suspend_fn, \
380380 runtime_resume_fn, idle_fn)
@@ -391,9 +391,13 @@ static __maybe_unused _DEFINE_DEV_PM_OPS(__static_##name, suspend_fn, \ · 10 unmodified lines
391391 _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL)
392392
393393 #define EXPORT_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
394− _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "")
394+ _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "", "")
395395 #define EXPORT_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
396− _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "_gpl")
396+ _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "_gpl", "")
397+#define EXPORT_NS_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \
398+ _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "", #ns)
399+#define EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \
400+ _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL, "_gpl", #ns)
397401
398402 /* Deprecated. Use DEFINE_SIMPLE_DEV_PM_OPS() instead. */
399403 #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
include/linux/pm_domain.h+14−10
@@ -91,6 +91,14 @@ struct gpd_dev_ops { · 90 unmodified lines
9191 int (*stop)(struct device *dev);
9292 };
9393
94+struct genpd_governor_data {
95+ s64 max_off_time_ns;
96+ bool max_off_time_changed;
97+ ktime_t next_wakeup;
98+ bool cached_power_down_ok;
99+ bool cached_power_down_state_idx;
100+};
101+
94102 struct genpd_power_state {
95103 s64 power_off_latency_ns;
96104 s64 power_on_latency_ns;
@@ -98,7 +106,7 @@ struct genpd_power_state { · 1 unmodified line
98106 u64 usage;
99107 u64 rejected;
100108 struct fwnode_handle *fwnode;
101− ktime_t idle_time;
109+ u64 idle_time;
102110 void *data;
103111 };
104112
@@ -114,6 +122,7 @@ struct generic_pm_domain { · 9 unmodified lines
114122 struct list_head child_links; /* Links with PM domain as a child */
115123 struct list_head dev_list; /* List of devices */
116124 struct dev_power_governor *gov;
125+ struct genpd_governor_data *gd; /* Data used by a genpd governor. */
117126 struct work_struct power_off_work;
118127 struct fwnode_handle *provider; /* Identity of the domain provider */
119128 bool has_provider;
@@ -134,11 +143,6 @@ struct generic_pm_domain { · 14 unmodified lines
134143 int (*set_performance_state)(struct generic_pm_domain *genpd,
135144 unsigned int state);
136145 struct gpd_dev_ops dev_ops;
137− s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
138− ktime_t next_wakeup; /* Maintained by the domain governor */
139− bool max_off_time_changed;
140− bool cached_power_down_ok;
141− bool cached_power_down_state_idx;
142146 int (*attach_dev)(struct generic_pm_domain *domain,
143147 struct device *dev);
144148 void (*detach_dev)(struct generic_pm_domain *domain,
@@ -149,8 +153,8 @@ struct generic_pm_domain { · 4 unmodified lines
149153 unsigned int state_count);
150154 unsigned int state_count; /* number of states */
151155 unsigned int state_idx; /* state that genpd will go to when off */
152− ktime_t on_time;
153− ktime_t accounting_time;
156+ u64 on_time;
157+ u64 accounting_time;
154158 const struct genpd_lock_ops *lock_ops;
155159 union {
156160 struct mutex mlock;
@@ -182,6 +186,7 @@ struct gpd_timing_data { · 25 unmodified lines
182186 s64 suspend_latency_ns;
183187 s64 resume_latency_ns;
184188 s64 effective_constraint_ns;
189+ ktime_t next_wakeup;
185190 bool constraint_changed;
186191 bool cached_suspend_ok;
187192 };
@@ -193,14 +198,13 @@ struct pm_domain_data { · 5 unmodified lines
193198
194199 struct generic_pm_domain_data {
195200 struct pm_domain_data base;
196− struct gpd_timing_data td;
201+ struct gpd_timing_data *td;
197202 struct notifier_block nb;
198203 struct notifier_block *power_nb;
199204 int cpu;
200205 unsigned int performance_state;
201206 unsigned int default_pstate;
202207 unsigned int rpm_pstate;
203− ktime_t next_wakeup;
204208 void *data;
205209 };
206210
include/linux/pm_runtime.h+8−2
@@ -41,10 +41,16 @@ · 40 unmodified lines
4141
4242 #define EXPORT_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
4343 _EXPORT_DEV_PM_OPS(name, pm_runtime_force_suspend, pm_runtime_force_resume, \
44− suspend_fn, resume_fn, idle_fn, "")
44+ suspend_fn, resume_fn, idle_fn, "", "")
4545 #define EXPORT_GPL_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
4646 _EXPORT_DEV_PM_OPS(name, pm_runtime_force_suspend, pm_runtime_force_resume, \
47− suspend_fn, resume_fn, idle_fn, "_gpl")
47+ suspend_fn, resume_fn, idle_fn, "_gpl", "")
48+#define EXPORT_NS_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn, ns) \
49+ _EXPORT_DEV_PM_OPS(name, pm_runtime_force_suspend, pm_runtime_force_resume, \
50+ suspend_fn, resume_fn, idle_fn, "", #ns)
51+#define EXPORT_NS_GPL_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn, ns) \
52+ _EXPORT_DEV_PM_OPS(name, pm_runtime_force_suspend, pm_runtime_force_resume, \
53+ suspend_fn, resume_fn, idle_fn, "_gpl", #ns)
4854
4955 #ifdef CONFIG_PM
5056 extern struct workqueue_struct *pm_wq;
include/linux/suspend.h+39−5
@@ -542,22 +542,56 @@ static inline void unlock_system_sleep(void) {} · 541 unmodified lines
542542 #ifdef CONFIG_PM_SLEEP_DEBUG
543543 extern bool pm_print_times_enabled;
544544 extern bool pm_debug_messages_on;
545−extern __printf(2, 3) void __pm_pr_dbg(bool defer, const char *fmt, ...);
545+static inline int pm_dyn_debug_messages_on(void)
546+{
547+#ifdef CONFIG_DYNAMIC_DEBUG
548+ return 1;
549+#else
550+ return 0;
551+#endif
552+}
553+#ifndef pr_fmt
554+#define pr_fmt(fmt) "PM: " fmt
555+#endif
556+#define __pm_pr_dbg(fmt, ...) \
557+ do { \
558+ if (pm_debug_messages_on) \
559+ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
560+ else if (pm_dyn_debug_messages_on()) \
561+ pr_debug(fmt, ##__VA_ARGS__); \
562+ } while (0)
563+#define __pm_deferred_pr_dbg(fmt, ...) \
564+ do { \
565+ if (pm_debug_messages_on) \
566+ printk_deferred(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
567+ } while (0)
546568 #else
547569 #define pm_print_times_enabled (false)
548570 #define pm_debug_messages_on (false)
549571
550572 #include <linux/printk.h>
551573
552−#define __pm_pr_dbg(defer, fmt, ...) \
553− no_printk(KERN_DEBUG fmt, ##__VA_ARGS__)
574+#define __pm_pr_dbg(fmt, ...) \
575+ no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
576+#define __pm_deferred_pr_dbg(fmt, ...) \
577+ no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
554578 #endif
555579
580+/**
581+ * pm_pr_dbg - print pm sleep debug messages
582+ *
583+ * If pm_debug_messages_on is enabled, print message.
584+ * If pm_debug_messages_on is disabled and CONFIG_DYNAMIC_DEBUG is enabled,
585+ * print message only from instances explicitly enabled on dynamic debug's
586+ * control.
587+ * If pm_debug_messages_on is disabled and CONFIG_DYNAMIC_DEBUG is disabled,
588+ * don't print message.
589+ */
556590 #define pm_pr_dbg(fmt, ...) \
557− __pm_pr_dbg(false, fmt, ##__VA_ARGS__)
591+ __pm_pr_dbg(fmt, ##__VA_ARGS__)
558592
559593 #define pm_deferred_pr_dbg(fmt, ...) \
560− __pm_pr_dbg(true, fmt, ##__VA_ARGS__)
594+ __pm_deferred_pr_dbg(fmt, ##__VA_ARGS__)
561595
562596 #ifdef CONFIG_PM_AUTOSLEEP
563597
include/soc/rockchip/pm_domains.h+25−0
@@ -0,0 +1,25 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright 2022, The Chromium OS Authors. All rights reserved.
4+ */
5+
6+#ifndef __SOC_ROCKCHIP_PM_DOMAINS_H__
7+#define __SOC_ROCKCHIP_PM_DOMAINS_H__
8+
9+#ifdef CONFIG_ROCKCHIP_PM_DOMAINS
10+
11+int rockchip_pmu_block(void);
12+void rockchip_pmu_unblock(void);
13+
14+#else /* CONFIG_ROCKCHIP_PM_DOMAINS */
15+
16+static inline int rockchip_pmu_block(void)
17+{
18+ return 0;
19+}
20+
21+static inline void rockchip_pmu_unblock(void) { }
22+
23+#endif /* CONFIG_ROCKCHIP_PM_DOMAINS */
24+
25+#endif /* __SOC_ROCKCHIP_PM_DOMAINS_H__ */