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()
292 char *buf) in state_show() argument
294 char *s = buf; in state_show()
305 if (s != buf) in state_show()
308 return (s - buf); in state_show()
311 static suspend_state_t decode_state(const char *buf, size_t n) in decode_state() argument
319 p = memchr(buf, '\n', n); in decode_state()
320 len = p ? p - buf : n; in decode_state()
323 if (len == 4 && !strncmp(buf, "disk", len)) in decode_state()
330 if (label && len == strlen(label) && !strncmp(buf, label, len)) in decode_state()
339 const char *buf, size_t n) in state_store() argument
353 state = decode_state(buf, n); in state_store()
399 char *buf) in wakeup_count_show() argument
404 sprintf(buf, "%u\n", val) : -EINTR; in wakeup_count_show()
409 const char *buf, size_t n) in wakeup_count_store() argument
424 if (sscanf(buf, "%u", &val) == 1) { in wakeup_count_store()
441 char *buf) in autosleep_show() argument
446 return sprintf(buf, "off\n"); in autosleep_show()
450 return sprintf(buf, "%s\n", pm_states[state] ? in autosleep_show()
454 return sprintf(buf, "disk\n"); in autosleep_show()
456 return sprintf(buf, "error"); in autosleep_show()
462 const char *buf, size_t n) in autosleep_store() argument
464 suspend_state_t state = decode_state(buf, n); in autosleep_store()
468 && strcmp(buf, "off") && strcmp(buf, "off\n")) in autosleep_store()
481 char *buf) in wake_lock_show() argument
483 return pm_show_wakelocks(buf, true); in wake_lock_show()
488 const char *buf, size_t n) in wake_lock_store() argument
490 int error = pm_wake_lock(buf); in wake_lock_store()
498 char *buf) in wake_unlock_show() argument
500 return pm_show_wakelocks(buf, false); in wake_unlock_show()
505 const char *buf, size_t n) in wake_unlock_store() argument
507 int error = pm_wake_unlock(buf); in wake_unlock_store()
520 char *buf) in pm_trace_show() argument
522 return sprintf(buf, "%d\n", pm_trace_enabled); in pm_trace_show()
527 const char *buf, size_t n) in pm_trace_store() argument
531 if (sscanf(buf, "%d", &val) == 1) { in pm_trace_store()
546 char *buf) in pm_trace_dev_match_show() argument
548 return show_trace_dev_match(buf, PAGE_SIZE); in pm_trace_dev_match_show()
553 const char *buf, size_t n) in pm_trace_dev_match_store() argument
564 struct kobj_attribute *attr, char *buf) in pm_freeze_timeout_show() argument
566 return sprintf(buf, "%u\n", freeze_timeout_msecs); in pm_freeze_timeout_show()
571 const char *buf, size_t n) in pm_freeze_timeout_store() argument
575 if (kstrtoul(buf, 10, &val)) in pm_freeze_timeout_store()