Lines Matching refs:buf
52 char *buf) in pm_async_show() argument
54 return sprintf(buf, "%d\n", pm_async_enabled); in pm_async_show()
58 const char *buf, size_t n) in pm_async_store() argument
62 if (kstrtoul(buf, 10, &val)) in pm_async_store()
87 char *buf) in pm_test_show() argument
89 char *s = buf; in pm_test_show()
100 if (s != buf) in pm_test_show()
104 return (s - buf); in pm_test_show()
108 const char *buf, size_t n) in pm_test_store() argument
116 p = memchr(buf, '\n', n); in pm_test_store()
117 len = p ? p - buf : n; in pm_test_store()
123 if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) { in pm_test_store()
248 struct kobj_attribute *attr, char *buf) in pm_print_times_show() argument
250 return sprintf(buf, "%d\n", pm_print_times_enabled); in pm_print_times_show()
255 const char *buf, size_t n) in pm_print_times_store() argument
259 if (kstrtoul(buf, 10, &val)) in pm_print_times_store()
278 char *buf) in pm_wakeup_irq_show() argument
280 return pm_wakeup_irq ? sprintf(buf, "%u\n", pm_wakeup_irq) : -ENODATA; in pm_wakeup_irq_show()
285 const char *buf, size_t n) in pm_wakeup_irq_store() argument
308 char *buf) in state_show() argument
310 char *s = buf; in state_show()
321 if (s != buf) in state_show()
324 return (s - buf); in state_show()
327 static suspend_state_t decode_state(const char *buf, size_t n) in decode_state() argument
335 p = memchr(buf, '\n', n); in decode_state()
336 len = p ? p - buf : n; in decode_state()
339 if (len == 4 && !strncmp(buf, "disk", len)) in decode_state()
346 if (label && len == strlen(label) && !strncmp(buf, label, len)) in decode_state()
355 const char *buf, size_t n) in state_store() argument
369 state = decode_state(buf, n); in state_store()
415 char *buf) in wakeup_count_show() argument
420 sprintf(buf, "%u\n", val) : -EINTR; in wakeup_count_show()
425 const char *buf, size_t n) in wakeup_count_store() argument
440 if (sscanf(buf, "%u", &val) == 1) { in wakeup_count_store()
457 char *buf) in autosleep_show() argument
462 return sprintf(buf, "off\n"); in autosleep_show()
466 return sprintf(buf, "%s\n", pm_states[state] ? in autosleep_show()
470 return sprintf(buf, "disk\n"); in autosleep_show()
472 return sprintf(buf, "error"); in autosleep_show()
478 const char *buf, size_t n) in autosleep_store() argument
480 suspend_state_t state = decode_state(buf, n); in autosleep_store()
484 && strcmp(buf, "off") && strcmp(buf, "off\n")) in autosleep_store()
497 char *buf) in wake_lock_show() argument
499 return pm_show_wakelocks(buf, true); in wake_lock_show()
504 const char *buf, size_t n) in wake_lock_store() argument
506 int error = pm_wake_lock(buf); in wake_lock_store()
514 char *buf) in wake_unlock_show() argument
516 return pm_show_wakelocks(buf, false); in wake_unlock_show()
521 const char *buf, size_t n) in wake_unlock_store() argument
523 int error = pm_wake_unlock(buf); in wake_unlock_store()
536 char *buf) in pm_trace_show() argument
538 return sprintf(buf, "%d\n", pm_trace_enabled); in pm_trace_show()
543 const char *buf, size_t n) in pm_trace_store() argument
547 if (sscanf(buf, "%d", &val) == 1) { in pm_trace_store()
562 char *buf) in pm_trace_dev_match_show() argument
564 return show_trace_dev_match(buf, PAGE_SIZE); in pm_trace_dev_match_show()
569 const char *buf, size_t n) in pm_trace_dev_match_store() argument
580 struct kobj_attribute *attr, char *buf) in pm_freeze_timeout_show() argument
582 return sprintf(buf, "%u\n", freeze_timeout_msecs); in pm_freeze_timeout_show()
587 const char *buf, size_t n) in pm_freeze_timeout_store() argument
591 if (kstrtoul(buf, 10, &val)) in pm_freeze_timeout_store()