1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_SUSPEND_H
3 #define _LINUX_SUSPEND_H
4
5 #include <linux/swap.h>
6 #include <linux/notifier.h>
7 #include <linux/init.h>
8 #include <linux/pm.h>
9 #include <linux/mm.h>
10 #include <linux/freezer.h>
11 #include <linux/android_kabi.h>
12 #include <asm/errno.h>
13
14 #ifdef CONFIG_VT
15 extern void pm_set_vt_switch(int);
16 #else
pm_set_vt_switch(int do_switch)17 static inline void pm_set_vt_switch(int do_switch)
18 {
19 }
20 #endif
21
22 #ifdef CONFIG_VT_CONSOLE_SLEEP
23 extern void pm_prepare_console(void);
24 extern void pm_restore_console(void);
25 #else
pm_prepare_console(void)26 static inline void pm_prepare_console(void)
27 {
28 }
29
pm_restore_console(void)30 static inline void pm_restore_console(void)
31 {
32 }
33 #endif
34
35 typedef int __bitwise suspend_state_t;
36
37 #define PM_SUSPEND_ON ((__force suspend_state_t) 0)
38 #define PM_SUSPEND_TO_IDLE ((__force suspend_state_t) 1)
39 #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 2)
40 #define PM_SUSPEND_MEM ((__force suspend_state_t) 3)
41 #define PM_SUSPEND_MIN PM_SUSPEND_TO_IDLE
42 #define PM_SUSPEND_MAX ((__force suspend_state_t) 4)
43
44 enum suspend_stat_step {
45 SUSPEND_FREEZE = 1,
46 SUSPEND_PREPARE,
47 SUSPEND_SUSPEND,
48 SUSPEND_SUSPEND_LATE,
49 SUSPEND_SUSPEND_NOIRQ,
50 SUSPEND_RESUME_NOIRQ,
51 SUSPEND_RESUME_EARLY,
52 SUSPEND_RESUME
53 };
54
55 struct suspend_stats {
56 int success;
57 int fail;
58 int failed_freeze;
59 int failed_prepare;
60 int failed_suspend;
61 int failed_suspend_late;
62 int failed_suspend_noirq;
63 int failed_resume;
64 int failed_resume_early;
65 int failed_resume_noirq;
66 #define REC_FAILED_NUM 2
67 int last_failed_dev;
68 char failed_devs[REC_FAILED_NUM][40];
69 int last_failed_errno;
70 int errno[REC_FAILED_NUM];
71 int last_failed_step;
72 enum suspend_stat_step failed_steps[REC_FAILED_NUM];
73 };
74
75 extern struct suspend_stats suspend_stats;
76
dpm_save_failed_dev(const char * name)77 static inline void dpm_save_failed_dev(const char *name)
78 {
79 strlcpy(suspend_stats.failed_devs[suspend_stats.last_failed_dev],
80 name,
81 sizeof(suspend_stats.failed_devs[0]));
82 suspend_stats.last_failed_dev++;
83 suspend_stats.last_failed_dev %= REC_FAILED_NUM;
84 }
85
dpm_save_failed_errno(int err)86 static inline void dpm_save_failed_errno(int err)
87 {
88 suspend_stats.errno[suspend_stats.last_failed_errno] = err;
89 suspend_stats.last_failed_errno++;
90 suspend_stats.last_failed_errno %= REC_FAILED_NUM;
91 }
92
dpm_save_failed_step(enum suspend_stat_step step)93 static inline void dpm_save_failed_step(enum suspend_stat_step step)
94 {
95 suspend_stats.failed_steps[suspend_stats.last_failed_step] = step;
96 suspend_stats.last_failed_step++;
97 suspend_stats.last_failed_step %= REC_FAILED_NUM;
98 }
99
100 /**
101 * struct platform_suspend_ops - Callbacks for managing platform dependent
102 * system sleep states.
103 *
104 * @valid: Callback to determine if given system sleep state is supported by
105 * the platform.
106 * Valid (ie. supported) states are advertised in /sys/power/state. Note
107 * that it still may be impossible to enter given system sleep state if the
108 * conditions aren't right.
109 * There is the %suspend_valid_only_mem function available that can be
110 * assigned to this if the platform only supports mem sleep.
111 *
112 * @begin: Initialise a transition to given system sleep state.
113 * @begin() is executed right prior to suspending devices. The information
114 * conveyed to the platform code by @begin() should be disregarded by it as
115 * soon as @end() is executed. If @begin() fails (ie. returns nonzero),
116 * @prepare(), @enter() and @finish() will not be called by the PM core.
117 * This callback is optional. However, if it is implemented, the argument
118 * passed to @enter() is redundant and should be ignored.
119 *
120 * @prepare: Prepare the platform for entering the system sleep state indicated
121 * by @begin().
122 * @prepare() is called right after devices have been suspended (ie. the
123 * appropriate .suspend() method has been executed for each device) and
124 * before device drivers' late suspend callbacks are executed. It returns
125 * 0 on success or a negative error code otherwise, in which case the
126 * system cannot enter the desired sleep state (@prepare_late(), @enter(),
127 * and @wake() will not be called in that case).
128 *
129 * @prepare_late: Finish preparing the platform for entering the system sleep
130 * state indicated by @begin().
131 * @prepare_late is called before disabling nonboot CPUs and after
132 * device drivers' late suspend callbacks have been executed. It returns
133 * 0 on success or a negative error code otherwise, in which case the
134 * system cannot enter the desired sleep state (@enter() will not be
135 * executed).
136 *
137 * @enter: Enter the system sleep state indicated by @begin() or represented by
138 * the argument if @begin() is not implemented.
139 * This callback is mandatory. It returns 0 on success or a negative
140 * error code otherwise, in which case the system cannot enter the desired
141 * sleep state.
142 *
143 * @wake: Called when the system has just left a sleep state, right after
144 * the nonboot CPUs have been enabled and before device drivers' early
145 * resume callbacks are executed.
146 * This callback is optional, but should be implemented by the platforms
147 * that implement @prepare_late(). If implemented, it is always called
148 * after @prepare_late and @enter(), even if one of them fails.
149 *
150 * @finish: Finish wake-up of the platform.
151 * @finish is called right prior to calling device drivers' regular suspend
152 * callbacks.
153 * This callback is optional, but should be implemented by the platforms
154 * that implement @prepare(). If implemented, it is always called after
155 * @enter() and @wake(), even if any of them fails. It is executed after
156 * a failing @prepare.
157 *
158 * @suspend_again: Returns whether the system should suspend again (true) or
159 * not (false). If the platform wants to poll sensors or execute some
160 * code during suspended without invoking userspace and most of devices,
161 * suspend_again callback is the place assuming that periodic-wakeup or
162 * alarm-wakeup is already setup. This allows to execute some codes while
163 * being kept suspended in the view of userland and devices.
164 *
165 * @end: Called by the PM core right after resuming devices, to indicate to
166 * the platform that the system has returned to the working state or
167 * the transition to the sleep state has been aborted.
168 * This callback is optional, but should be implemented by the platforms
169 * that implement @begin(). Accordingly, platforms implementing @begin()
170 * should also provide a @end() which cleans up transitions aborted before
171 * @enter().
172 *
173 * @recover: Recover the platform from a suspend failure.
174 * Called by the PM core if the suspending of devices fails.
175 * This callback is optional and should only be implemented by platforms
176 * which require special recovery actions in that situation.
177 */
178 struct platform_suspend_ops {
179 int (*valid)(suspend_state_t state);
180 int (*begin)(suspend_state_t state);
181 int (*prepare)(void);
182 int (*prepare_late)(void);
183 int (*enter)(suspend_state_t state);
184 void (*wake)(void);
185 void (*finish)(void);
186 bool (*suspend_again)(void);
187 void (*end)(void);
188 void (*recover)(void);
189
190 ANDROID_KABI_RESERVE(1);
191 };
192
193 struct platform_s2idle_ops {
194 int (*begin)(void);
195 int (*prepare)(void);
196 int (*prepare_late)(void);
197 bool (*wake)(void);
198 void (*restore_early)(void);
199 void (*restore)(void);
200 void (*end)(void);
201
202 ANDROID_KABI_RESERVE(1);
203 };
204
205 #ifdef CONFIG_SUSPEND
206 extern suspend_state_t mem_sleep_current;
207 extern suspend_state_t mem_sleep_default;
208
209 /**
210 * suspend_set_ops - set platform dependent suspend operations
211 * @ops: The new suspend operations to set.
212 */
213 extern void suspend_set_ops(const struct platform_suspend_ops *ops);
214 extern int suspend_valid_only_mem(suspend_state_t state);
215
216 extern unsigned int pm_suspend_global_flags;
217
218 #define PM_SUSPEND_FLAG_FW_SUSPEND BIT(0)
219 #define PM_SUSPEND_FLAG_FW_RESUME BIT(1)
220 #define PM_SUSPEND_FLAG_NO_PLATFORM BIT(2)
221
pm_suspend_clear_flags(void)222 static inline void pm_suspend_clear_flags(void)
223 {
224 pm_suspend_global_flags = 0;
225 }
226
pm_set_suspend_via_firmware(void)227 static inline void pm_set_suspend_via_firmware(void)
228 {
229 pm_suspend_global_flags |= PM_SUSPEND_FLAG_FW_SUSPEND;
230 }
231
pm_set_resume_via_firmware(void)232 static inline void pm_set_resume_via_firmware(void)
233 {
234 pm_suspend_global_flags |= PM_SUSPEND_FLAG_FW_RESUME;
235 }
236
pm_set_suspend_no_platform(void)237 static inline void pm_set_suspend_no_platform(void)
238 {
239 pm_suspend_global_flags |= PM_SUSPEND_FLAG_NO_PLATFORM;
240 }
241
242 /**
243 * pm_suspend_via_firmware - Check if platform firmware will suspend the system.
244 *
245 * To be called during system-wide power management transitions to sleep states
246 * or during the subsequent system-wide transitions back to the working state.
247 *
248 * Return 'true' if the platform firmware is going to be invoked at the end of
249 * the system-wide power management transition (to a sleep state) in progress in
250 * order to complete it, or if the platform firmware has been invoked in order
251 * to complete the last (or preceding) transition of the system to a sleep
252 * state.
253 *
254 * This matters if the caller needs or wants to carry out some special actions
255 * depending on whether or not control will be passed to the platform firmware
256 * subsequently (for example, the device may need to be reset before letting the
257 * platform firmware manipulate it, which is not necessary when the platform
258 * firmware is not going to be invoked) or when such special actions may have
259 * been carried out during the preceding transition of the system to a sleep
260 * state (as they may need to be taken into account).
261 */
pm_suspend_via_firmware(void)262 static inline bool pm_suspend_via_firmware(void)
263 {
264 return !!(pm_suspend_global_flags & PM_SUSPEND_FLAG_FW_SUSPEND);
265 }
266
267 /**
268 * pm_resume_via_firmware - Check if platform firmware has woken up the system.
269 *
270 * To be called during system-wide power management transitions from sleep
271 * states.
272 *
273 * Return 'true' if the platform firmware has passed control to the kernel at
274 * the beginning of the system-wide power management transition in progress, so
275 * the event that woke up the system from sleep has been handled by the platform
276 * firmware.
277 */
pm_resume_via_firmware(void)278 static inline bool pm_resume_via_firmware(void)
279 {
280 return !!(pm_suspend_global_flags & PM_SUSPEND_FLAG_FW_RESUME);
281 }
282
283 /**
284 * pm_suspend_no_platform - Check if platform may change device power states.
285 *
286 * To be called during system-wide power management transitions to sleep states
287 * or during the subsequent system-wide transitions back to the working state.
288 *
289 * Return 'true' if the power states of devices remain under full control of the
290 * kernel throughout the system-wide suspend and resume cycle in progress (that
291 * is, if a device is put into a certain power state during suspend, it can be
292 * expected to remain in that state during resume).
293 */
pm_suspend_no_platform(void)294 static inline bool pm_suspend_no_platform(void)
295 {
296 return !!(pm_suspend_global_flags & PM_SUSPEND_FLAG_NO_PLATFORM);
297 }
298
299 /* Suspend-to-idle state machnine. */
300 enum s2idle_states {
301 S2IDLE_STATE_NONE, /* Not suspended/suspending. */
302 S2IDLE_STATE_ENTER, /* Enter suspend-to-idle. */
303 S2IDLE_STATE_WAKE, /* Wake up from suspend-to-idle. */
304 };
305
306 extern enum s2idle_states __read_mostly s2idle_state;
307
idle_should_enter_s2idle(void)308 static inline bool idle_should_enter_s2idle(void)
309 {
310 return unlikely(s2idle_state == S2IDLE_STATE_ENTER);
311 }
312
313 extern bool pm_suspend_default_s2idle(void);
314 extern void __init pm_states_init(void);
315 extern void s2idle_set_ops(const struct platform_s2idle_ops *ops);
316 extern void s2idle_wake(void);
317
318 /**
319 * arch_suspend_disable_irqs - disable IRQs for suspend
320 *
321 * Disables IRQs (in the default case). This is a weak symbol in the common
322 * code and thus allows architectures to override it if more needs to be
323 * done. Not called for suspend to disk.
324 */
325 extern void arch_suspend_disable_irqs(void);
326
327 /**
328 * arch_suspend_enable_irqs - enable IRQs after suspend
329 *
330 * Enables IRQs (in the default case). This is a weak symbol in the common
331 * code and thus allows architectures to override it if more needs to be
332 * done. Not called for suspend to disk.
333 */
334 extern void arch_suspend_enable_irqs(void);
335
336 extern int pm_suspend(suspend_state_t state);
337 extern bool sync_on_suspend_enabled;
338 #else /* !CONFIG_SUSPEND */
339 #define suspend_valid_only_mem NULL
340
pm_suspend_clear_flags(void)341 static inline void pm_suspend_clear_flags(void) {}
pm_set_suspend_via_firmware(void)342 static inline void pm_set_suspend_via_firmware(void) {}
pm_set_resume_via_firmware(void)343 static inline void pm_set_resume_via_firmware(void) {}
pm_suspend_via_firmware(void)344 static inline bool pm_suspend_via_firmware(void) { return false; }
pm_resume_via_firmware(void)345 static inline bool pm_resume_via_firmware(void) { return false; }
pm_suspend_no_platform(void)346 static inline bool pm_suspend_no_platform(void) { return false; }
pm_suspend_default_s2idle(void)347 static inline bool pm_suspend_default_s2idle(void) { return false; }
348
suspend_set_ops(const struct platform_suspend_ops * ops)349 static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
pm_suspend(suspend_state_t state)350 static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
sync_on_suspend_enabled(void)351 static inline bool sync_on_suspend_enabled(void) { return true; }
idle_should_enter_s2idle(void)352 static inline bool idle_should_enter_s2idle(void) { return false; }
pm_states_init(void)353 static inline void __init pm_states_init(void) {}
s2idle_set_ops(const struct platform_s2idle_ops * ops)354 static inline void s2idle_set_ops(const struct platform_s2idle_ops *ops) {}
s2idle_wake(void)355 static inline void s2idle_wake(void) {}
356 #endif /* !CONFIG_SUSPEND */
357
358 /* struct pbe is used for creating lists of pages that should be restored
359 * atomically during the resume from disk, because the page frames they have
360 * occupied before the suspend are in use.
361 */
362 struct pbe {
363 void *address; /* address of the copy */
364 void *orig_address; /* original address of a page */
365 struct pbe *next;
366 };
367
368 /* mm/page_alloc.c */
369 extern void mark_free_pages(struct zone *zone);
370
371 /**
372 * struct platform_hibernation_ops - hibernation platform support
373 *
374 * The methods in this structure allow a platform to carry out special
375 * operations required by it during a hibernation transition.
376 *
377 * All the methods below, except for @recover(), must be implemented.
378 *
379 * @begin: Tell the platform driver that we're starting hibernation.
380 * Called right after shrinking memory and before freezing devices.
381 *
382 * @end: Called by the PM core right after resuming devices, to indicate to
383 * the platform that the system has returned to the working state.
384 *
385 * @pre_snapshot: Prepare the platform for creating the hibernation image.
386 * Called right after devices have been frozen and before the nonboot
387 * CPUs are disabled (runs with IRQs on).
388 *
389 * @finish: Restore the previous state of the platform after the hibernation
390 * image has been created *or* put the platform into the normal operation
391 * mode after the hibernation (the same method is executed in both cases).
392 * Called right after the nonboot CPUs have been enabled and before
393 * thawing devices (runs with IRQs on).
394 *
395 * @prepare: Prepare the platform for entering the low power state.
396 * Called right after the hibernation image has been saved and before
397 * devices are prepared for entering the low power state.
398 *
399 * @enter: Put the system into the low power state after the hibernation image
400 * has been saved to disk.
401 * Called after the nonboot CPUs have been disabled and all of the low
402 * level devices have been shut down (runs with IRQs off).
403 *
404 * @leave: Perform the first stage of the cleanup after the system sleep state
405 * indicated by @set_target() has been left.
406 * Called right after the control has been passed from the boot kernel to
407 * the image kernel, before the nonboot CPUs are enabled and before devices
408 * are resumed. Executed with interrupts disabled.
409 *
410 * @pre_restore: Prepare system for the restoration from a hibernation image.
411 * Called right after devices have been frozen and before the nonboot
412 * CPUs are disabled (runs with IRQs on).
413 *
414 * @restore_cleanup: Clean up after a failing image restoration.
415 * Called right after the nonboot CPUs have been enabled and before
416 * thawing devices (runs with IRQs on).
417 *
418 * @recover: Recover the platform from a failure to suspend devices.
419 * Called by the PM core if the suspending of devices during hibernation
420 * fails. This callback is optional and should only be implemented by
421 * platforms which require special recovery actions in that situation.
422 */
423 struct platform_hibernation_ops {
424 int (*begin)(pm_message_t stage);
425 void (*end)(void);
426 int (*pre_snapshot)(void);
427 void (*finish)(void);
428 int (*prepare)(void);
429 int (*enter)(void);
430 void (*leave)(void);
431 int (*pre_restore)(void);
432 void (*restore_cleanup)(void);
433 void (*recover)(void);
434
435 ANDROID_KABI_RESERVE(1);
436 };
437
438 #ifdef CONFIG_HIBERNATION
439 /* kernel/power/snapshot.c */
440 extern void register_nosave_region(unsigned long b, unsigned long e);
441 extern int swsusp_page_is_forbidden(struct page *);
442 extern void swsusp_set_page_free(struct page *);
443 extern void swsusp_unset_page_free(struct page *);
444 extern unsigned long get_safe_page(gfp_t gfp_mask);
445 extern asmlinkage int swsusp_arch_suspend(void);
446 extern asmlinkage int swsusp_arch_resume(void);
447
448 extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
449 extern int hibernate(void);
450 extern bool system_entering_hibernation(void);
451 extern bool hibernation_available(void);
452 asmlinkage int swsusp_save(void);
453 extern struct pbe *restore_pblist;
454 int pfn_is_nosave(unsigned long pfn);
455
456 int hibernate_quiet_exec(int (*func)(void *data), void *data);
457 #else /* CONFIG_HIBERNATION */
register_nosave_region(unsigned long b,unsigned long e)458 static inline void register_nosave_region(unsigned long b, unsigned long e) {}
swsusp_page_is_forbidden(struct page * p)459 static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
swsusp_set_page_free(struct page * p)460 static inline void swsusp_set_page_free(struct page *p) {}
swsusp_unset_page_free(struct page * p)461 static inline void swsusp_unset_page_free(struct page *p) {}
462
hibernation_set_ops(const struct platform_hibernation_ops * ops)463 static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {}
hibernate(void)464 static inline int hibernate(void) { return -ENOSYS; }
system_entering_hibernation(void)465 static inline bool system_entering_hibernation(void) { return false; }
hibernation_available(void)466 static inline bool hibernation_available(void) { return false; }
467
hibernate_quiet_exec(int (* func)(void * data),void * data)468 static inline int hibernate_quiet_exec(int (*func)(void *data), void *data) {
469 return -ENOTSUPP;
470 }
471 #endif /* CONFIG_HIBERNATION */
472
473 #ifdef CONFIG_HIBERNATION_SNAPSHOT_DEV
474 int is_hibernate_resume_dev(dev_t dev);
475 #else
is_hibernate_resume_dev(dev_t dev)476 static inline int is_hibernate_resume_dev(dev_t dev) { return 0; }
477 #endif
478
479 /* Hibernation and suspend events */
480 #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
481 #define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
482 #define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
483 #define PM_POST_SUSPEND 0x0004 /* Suspend finished */
484 #define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
485 #define PM_POST_RESTORE 0x0006 /* Restore failed */
486
487 extern struct mutex system_transition_mutex;
488
489 #ifdef CONFIG_PM_SLEEP
490 void save_processor_state(void);
491 void restore_processor_state(void);
492
493 /* kernel/power/main.c */
494 extern int register_pm_notifier(struct notifier_block *nb);
495 extern int unregister_pm_notifier(struct notifier_block *nb);
496 extern void ksys_sync_helper(void);
497
498 #define pm_notifier(fn, pri) { \
499 static struct notifier_block fn##_nb = \
500 { .notifier_call = fn, .priority = pri }; \
501 register_pm_notifier(&fn##_nb); \
502 }
503
504 /* drivers/base/power/wakeup.c */
505 extern bool events_check_enabled;
506 extern suspend_state_t pm_suspend_target_state;
507
508 extern bool pm_wakeup_pending(void);
509 extern void pm_system_wakeup(void);
510 extern void pm_system_cancel_wakeup(void);
511 extern void pm_wakeup_clear(unsigned int irq_number);
512 extern void pm_system_irq_wakeup(unsigned int irq_number);
513 extern unsigned int pm_wakeup_irq(void);
514 extern bool pm_get_wakeup_count(unsigned int *count, bool block);
515 extern bool pm_save_wakeup_count(unsigned int count);
516 extern void pm_wakep_autosleep_enabled(bool set);
517 extern void pm_print_active_wakeup_sources(void);
518 extern void pm_get_active_wakeup_sources(char *pending_sources, size_t max);
519
520 extern void lock_system_sleep(void);
521 extern void unlock_system_sleep(void);
522
523 #else /* !CONFIG_PM_SLEEP */
524
register_pm_notifier(struct notifier_block * nb)525 static inline int register_pm_notifier(struct notifier_block *nb)
526 {
527 return 0;
528 }
529
unregister_pm_notifier(struct notifier_block * nb)530 static inline int unregister_pm_notifier(struct notifier_block *nb)
531 {
532 return 0;
533 }
534
ksys_sync_helper(void)535 static inline void ksys_sync_helper(void) {}
536
537 #define pm_notifier(fn, pri) do { (void)(fn); } while (0)
538
pm_wakeup_pending(void)539 static inline bool pm_wakeup_pending(void) { return false; }
pm_system_wakeup(void)540 static inline void pm_system_wakeup(void) {}
pm_wakeup_clear(bool reset)541 static inline void pm_wakeup_clear(bool reset) {}
pm_system_irq_wakeup(unsigned int irq_number)542 static inline void pm_system_irq_wakeup(unsigned int irq_number) {}
543
lock_system_sleep(void)544 static inline void lock_system_sleep(void) {}
unlock_system_sleep(void)545 static inline void unlock_system_sleep(void) {}
546
547 #endif /* !CONFIG_PM_SLEEP */
548
549 #ifdef CONFIG_PM_SLEEP_DEBUG
550 extern bool pm_print_times_enabled;
551 extern bool pm_debug_messages_on;
552 extern __printf(2, 3) void __pm_pr_dbg(bool defer, const char *fmt, ...);
553 #else
554 #define pm_print_times_enabled (false)
555 #define pm_debug_messages_on (false)
556
557 #include <linux/printk.h>
558
559 #define __pm_pr_dbg(defer, fmt, ...) \
560 no_printk(KERN_DEBUG fmt, ##__VA_ARGS__)
561 #endif
562
563 #define pm_pr_dbg(fmt, ...) \
564 __pm_pr_dbg(false, fmt, ##__VA_ARGS__)
565
566 #define pm_deferred_pr_dbg(fmt, ...) \
567 __pm_pr_dbg(true, fmt, ##__VA_ARGS__)
568
569 #ifdef CONFIG_PM_AUTOSLEEP
570
571 /* kernel/power/autosleep.c */
572 void queue_up_suspend_work(void);
573
574 #else /* !CONFIG_PM_AUTOSLEEP */
575
queue_up_suspend_work(void)576 static inline void queue_up_suspend_work(void) {}
577
578 #endif /* !CONFIG_PM_AUTOSLEEP */
579
580 #endif /* _LINUX_SUSPEND_H */
581