Lines Matching defs:buf

36 static ssize_t period_show(struct device *child, struct device_attribute *attr, char *buf)
43 return sprintf(buf, "%llu\n", state.period);
46 static ssize_t period_store(struct device *child, struct device_attribute *attr, const char *buf, size_t size)
54 ret = kstrtou64(buf, 0, &val);
68 static ssize_t duty_cycle_show(struct device *child, struct device_attribute *attr, char *buf)
75 return sprintf(buf, "%llu\n", state.duty_cycle);
78 static ssize_t duty_cycle_store(struct device *child, struct device_attribute *attr, const char *buf, size_t size)
86 ret = kstrtou64(buf, 0, &val);
101 static ssize_t oneshot_count_show(struct device *child, struct device_attribute *attr, char *buf)
108 return sprintf(buf, "%llu\n", state.oneshot_count);
111 static ssize_t oneshot_count_store(struct device *child, struct device_attribute *attr, const char *buf, size_t size)
119 ret = kstrtouint(buf, 0, &val);
134 static ssize_t enable_show(struct device *child, struct device_attribute *attr, char *buf)
141 return sprintf(buf, "%d\n", state.enabled);
144 static ssize_t enable_store(struct device *child, struct device_attribute *attr, const char *buf, size_t size)
151 ret = kstrtoint(buf, 0, &val);
179 static ssize_t polarity_show(struct device *child, struct device_attribute *attr, char *buf)
197 return sprintf(buf, "%s\n", polarity);
200 static ssize_t polarity_store(struct device *child, struct device_attribute *attr, const char *buf, size_t size)
208 if (sysfs_streq(buf, "normal")) {
210 } else if (sysfs_streq(buf, "inversed")) {
225 static ssize_t capture_show(struct device *child, struct device_attribute *attr, char *buf)
236 return sprintf(buf, "%u %u\n", result.period, result.duty_cycle);
335 static ssize_t export_store(struct device *parent, struct device_attribute *attr, const char *buf, size_t len)
342 ret = kstrtouint(buf, 0, &hwpwm);
365 static ssize_t unexport_store(struct device *parent, struct device_attribute *attr, const char *buf, size_t len)
371 ret = kstrtouint(buf, 0, &hwpwm);
386 static ssize_t npwm_show(struct device *parent, struct device_attribute *attr, char *buf)
390 return sprintf(buf, "%u\n", chip->npwm);