]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PM / Sleep: Change wakeup source statistics to follow Android
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 29 Apr 2012 20:52:52 +0000 (22:52 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 29 Apr 2012 20:52:52 +0000 (22:52 +0200)
commit7b6cdde8d6940cf95bac01cd7a7d15ccb0c0ba56
tree7a23ddd7e9ab1f81bbc6e86f293cca2bb86a1973
parent455901781fa7328074bde97677d527cbaef30332
PM / Sleep: Change wakeup source statistics to follow Android

Wakeup statistics used by Android are slightly different from what we
have in wakeup sources at the moment and there aren't any known
users of those statistics other than Android, so modify them to make
it easier for Android to switch to wakeup sources.

This removes the struct wakeup_source's hit_cout field, which is very
rough and therefore not very useful, and adds two new fields,
wakeup_count and expire_count.  The first one tracks how many times
the wakeup source is activated with events_check_enabled set (which
roughly corresponds to the situations when a system power transition
to a sleep state is in progress and would be aborted by this wakeup
source if it were the only active one at that time) and the second
one is the number of times the wakeup source has been activated with
a timeout that expired.

Additionally, the last_time field is now updated when the wakeup
source is deactivated too (previously it was only updated during
the wakeup source's activation), which seems to be what Android does
with the analogous counter for wakelocks.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/sysfs-devices-power
drivers/base/power/sysfs.c
drivers/base/power/wakeup.c
include/linux/pm_wakeup.h