• Home
  • Raw
  • Download

Lines Matching refs:state

167 static bool valid_state(suspend_state_t state)  in valid_state()  argument
175 return suspend_ops && suspend_ops->valid && suspend_ops->valid(state) && in valid_state()
193 suspend_state_t state; in mem_sleep_default_setup() local
195 for (state = PM_SUSPEND_TO_IDLE; state <= PM_SUSPEND_MEM; state++) in mem_sleep_default_setup()
196 if (mem_sleep_labels[state] && in mem_sleep_default_setup()
197 !strcmp(str, mem_sleep_labels[state])) { in mem_sleep_default_setup()
198 mem_sleep_default = state; in mem_sleep_default_setup()
242 int suspend_valid_only_mem(suspend_state_t state) in suspend_valid_only_mem() argument
244 return state == PM_SUSPEND_MEM; in suspend_valid_only_mem()
248 static bool sleep_state_supported(suspend_state_t state) in sleep_state_supported() argument
250 return state == PM_SUSPEND_TO_IDLE || in sleep_state_supported()
251 (valid_state(state) && !cxl_mem_active()); in sleep_state_supported()
254 static int platform_suspend_prepare(suspend_state_t state) in platform_suspend_prepare() argument
256 return state != PM_SUSPEND_TO_IDLE && suspend_ops->prepare ? in platform_suspend_prepare()
260 static int platform_suspend_prepare_late(suspend_state_t state) in platform_suspend_prepare_late() argument
262 return state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->prepare ? in platform_suspend_prepare_late()
266 static int platform_suspend_prepare_noirq(suspend_state_t state) in platform_suspend_prepare_noirq() argument
268 if (state == PM_SUSPEND_TO_IDLE) in platform_suspend_prepare_noirq()
275 static void platform_resume_noirq(suspend_state_t state) in platform_resume_noirq() argument
277 if (state == PM_SUSPEND_TO_IDLE) { in platform_resume_noirq()
285 static void platform_resume_early(suspend_state_t state) in platform_resume_early() argument
287 if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->restore) in platform_resume_early()
291 static void platform_resume_finish(suspend_state_t state) in platform_resume_finish() argument
293 if (state != PM_SUSPEND_TO_IDLE && suspend_ops->finish) in platform_resume_finish()
297 static int platform_suspend_begin(suspend_state_t state) in platform_suspend_begin() argument
299 if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->begin) in platform_suspend_begin()
302 return suspend_ops->begin(state); in platform_suspend_begin()
307 static void platform_resume_end(suspend_state_t state) in platform_resume_end() argument
309 if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->end) in platform_resume_end()
315 static void platform_recover(suspend_state_t state) in platform_recover() argument
317 if (state != PM_SUSPEND_TO_IDLE && suspend_ops->recover) in platform_recover()
321 static bool platform_suspend_again(suspend_state_t state) in platform_suspend_again() argument
323 return state != PM_SUSPEND_TO_IDLE && suspend_ops->suspend_again ? in platform_suspend_again()
355 static int suspend_prepare(suspend_state_t state) in suspend_prepare() argument
359 if (!sleep_state_supported(state)) in suspend_prepare()
402 static int suspend_enter(suspend_state_t state, bool *wakeup) in suspend_enter() argument
406 error = platform_suspend_prepare(state); in suspend_enter()
419 error = platform_suspend_prepare_late(state); in suspend_enter()
432 error = platform_suspend_prepare_noirq(state); in suspend_enter()
439 if (state == PM_SUSPEND_TO_IDLE) { in suspend_enter()
460 state, true); in suspend_enter()
461 error = suspend_ops->enter(state); in suspend_enter()
463 state, false); in suspend_enter()
480 platform_resume_noirq(state); in suspend_enter()
484 platform_resume_early(state); in suspend_enter()
490 platform_resume_finish(state); in suspend_enter()
498 int suspend_devices_and_enter(suspend_state_t state) in suspend_devices_and_enter() argument
503 if (!sleep_state_supported(state)) in suspend_devices_and_enter()
506 pm_suspend_target_state = state; in suspend_devices_and_enter()
508 if (state == PM_SUSPEND_TO_IDLE) in suspend_devices_and_enter()
511 error = platform_suspend_begin(state); in suspend_devices_and_enter()
529 error = suspend_enter(state, &wakeup); in suspend_devices_and_enter()
530 } while (!error && !wakeup && platform_suspend_again(state)); in suspend_devices_and_enter()
537 trace_suspend_resume(TPS("resume_console"), state, true); in suspend_devices_and_enter()
539 trace_suspend_resume(TPS("resume_console"), state, false); in suspend_devices_and_enter()
542 platform_resume_end(state); in suspend_devices_and_enter()
548 platform_recover(state); in suspend_devices_and_enter()
573 static int enter_state(suspend_state_t state) in enter_state() argument
577 trace_suspend_resume(TPS("suspend_enter"), state, true); in enter_state()
578 if (state == PM_SUSPEND_TO_IDLE) { in enter_state()
585 } else if (!valid_state(state)) { in enter_state()
591 if (state == PM_SUSPEND_TO_IDLE) in enter_state()
600 pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]); in enter_state()
602 error = suspend_prepare(state); in enter_state()
609 trace_suspend_resume(TPS("suspend_enter"), state, false); in enter_state()
610 pm_pr_dbg("Suspending system (%s)\n", mem_sleep_labels[state]); in enter_state()
612 error = suspend_devices_and_enter(state); in enter_state()
631 int pm_suspend(suspend_state_t state) in pm_suspend() argument
635 if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) in pm_suspend()
638 pr_info("suspend entry (%s)\n", mem_sleep_labels[state]); in pm_suspend()
639 error = enter_state(state); in pm_suspend()