aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/sysfs.c')
-rw-r--r--drivers/base/power/sysfs.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index 95c12f6cb5b9..13e40b9021b9 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -314,22 +314,41 @@ static ssize_t wakeup_active_count_show(struct device *dev,
314 314
315static DEVICE_ATTR(wakeup_active_count, 0444, wakeup_active_count_show, NULL); 315static DEVICE_ATTR(wakeup_active_count, 0444, wakeup_active_count_show, NULL);
316 316
317static ssize_t wakeup_hit_count_show(struct device *dev, 317static ssize_t wakeup_abort_count_show(struct device *dev,
318 struct device_attribute *attr, char *buf) 318 struct device_attribute *attr,
319 char *buf)
320{
321 unsigned long count = 0;
322 bool enabled = false;
323
324 spin_lock_irq(&dev->power.lock);
325 if (dev->power.wakeup) {
326 count = dev->power.wakeup->wakeup_count;
327 enabled = true;
328 }
329 spin_unlock_irq(&dev->power.lock);
330 return enabled ? sprintf(buf, "%lu\n", count) : sprintf(buf, "\n");
331}
332
333static DEVICE_ATTR(wakeup_abort_count, 0444, wakeup_abort_count_show, NULL);
334
335static ssize_t wakeup_expire_count_show(struct device *dev,
336 struct device_attribute *attr,
337 char *buf)
319{ 338{
320 unsigned long count = 0; 339 unsigned long count = 0;
321 bool enabled = false; 340 bool enabled = false;
322 341
323 spin_lock_irq(&dev->power.lock); 342 spin_lock_irq(&dev->power.lock);
324 if (dev->power.wakeup) { 343 if (dev->power.wakeup) {
325 count = dev->power.wakeup->hit_count; 344 count = dev->power.wakeup->expire_count;
326 enabled = true; 345 enabled = true;
327 } 346 }
328 spin_unlock_irq(&dev->power.lock); 347 spin_unlock_irq(&dev->power.lock);
329 return enabled ? sprintf(buf, "%lu\n", count) : sprintf(buf, "\n"); 348 return enabled ? sprintf(buf, "%lu\n", count) : sprintf(buf, "\n");
330} 349}
331 350
332static DEVICE_ATTR(wakeup_hit_count, 0444, wakeup_hit_count_show, NULL); 351static DEVICE_ATTR(wakeup_expire_count, 0444, wakeup_expire_count_show, NULL);
333 352
334static ssize_t wakeup_active_show(struct device *dev, 353static ssize_t wakeup_active_show(struct device *dev,
335 struct device_attribute *attr, char *buf) 354 struct device_attribute *attr, char *buf)
@@ -486,7 +505,8 @@ static struct attribute *wakeup_attrs[] = {
486 &dev_attr_wakeup.attr, 505 &dev_attr_wakeup.attr,
487 &dev_attr_wakeup_count.attr, 506 &dev_attr_wakeup_count.attr,
488 &dev_attr_wakeup_active_count.attr, 507 &dev_attr_wakeup_active_count.attr,
489 &dev_attr_wakeup_hit_count.attr, 508 &dev_attr_wakeup_abort_count.attr,
509 &dev_attr_wakeup_expire_count.attr,
490 &dev_attr_wakeup_active.attr, 510 &dev_attr_wakeup_active.attr,
491 &dev_attr_wakeup_total_time_ms.attr, 511 &dev_attr_wakeup_total_time_ms.attr,
492 &dev_attr_wakeup_max_time_ms.attr, 512 &dev_attr_wakeup_max_time_ms.attr,