Lines Matching refs:ws
27 struct wakeup_source *ws = dev_get_drvdata(dev); \
29 return sprintf(buf, "%lu\n", ws->_name); \
41 struct wakeup_source *ws = dev_get_drvdata(dev); in active_time_ms_show() local
43 ws->active ? ktime_sub(ktime_get(), ws->last_time) : 0; in active_time_ms_show()
52 struct wakeup_source *ws = dev_get_drvdata(dev); in total_time_ms_show() local
54 ktime_t total_time = ws->total_time; in total_time_ms_show()
56 if (ws->active) { in total_time_ms_show()
57 active_time = ktime_sub(ktime_get(), ws->last_time); in total_time_ms_show()
67 struct wakeup_source *ws = dev_get_drvdata(dev); in max_time_ms_show() local
69 ktime_t max_time = ws->max_time; in max_time_ms_show()
71 if (ws->active) { in max_time_ms_show()
72 active_time = ktime_sub(ktime_get(), ws->last_time); in max_time_ms_show()
83 struct wakeup_source *ws = dev_get_drvdata(dev); in last_change_ms_show() local
85 return sprintf(buf, "%lld\n", ktime_to_ms(ws->last_time)); in last_change_ms_show()
92 struct wakeup_source *ws = dev_get_drvdata(dev); in name_show() local
94 return sprintf(buf, "%s\n", ws->name); in name_show()
102 struct wakeup_source *ws = dev_get_drvdata(dev); in prevent_suspend_time_ms_show() local
103 ktime_t prevent_sleep_time = ws->prevent_sleep_time; in prevent_suspend_time_ms_show()
105 if (ws->active && ws->autosleep_enabled) { in prevent_suspend_time_ms_show()
107 ktime_sub(ktime_get(), ws->start_prevent_time)); in prevent_suspend_time_ms_show()
134 struct wakeup_source *ws) in wakeup_source_device_create() argument
151 dev_set_drvdata(dev, ws); in wakeup_source_device_create()
154 retval = kobject_set_name(&dev->kobj, "wakeup%d", ws->id); in wakeup_source_device_create()
174 int wakeup_source_sysfs_add(struct device *parent, struct wakeup_source *ws) in wakeup_source_sysfs_add() argument
178 dev = wakeup_source_device_create(parent, ws); in wakeup_source_sysfs_add()
181 ws->dev = dev; in wakeup_source_sysfs_add()
203 void wakeup_source_sysfs_remove(struct wakeup_source *ws) in wakeup_source_sysfs_remove() argument
205 device_unregister(ws->dev); in wakeup_source_sysfs_remove()