Sarah Sharp 1512300689 USB: Export suspend statistics
This patch exports two statistics to userspace:
/sys/bus/usb/device/.../power/connected_duration
/sys/bus/usb/device/.../power/active_duration

connected_duration is the total time (in msec) that the device has
been connected.  active_duration is the total time the device has not
been suspended.  With these two statistics, tools like PowerTOP can
calculate the percentage time that a device is active, i.e. not
suspended or auto-suspended.

Users can also use the active_duration to check if a device is actually
autosuspended.  Currently, they can set power/level to auto and
power/autosuspend to a positive timeout, but there's no way to know from
userspace if a device was actually autosuspended without looking at the
dmesg output.  These statistics will be useful in creating an automated
userspace script to test autosuspend for USB devices.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 14:35:00 -08:00
..
2008-01-31 11:25:51 +11:00
2008-02-01 09:26:32 +01:00
2008-01-31 11:25:51 +11:00
2008-01-28 13:21:30 +00:00
2008-02-01 09:26:33 +01:00
2008-01-30 13:14:02 -06:00
2008-01-31 17:29:48 +01:00
2007-12-31 23:11:11 +00:00
2008-01-31 11:25:51 +11:00
2008-01-31 17:29:48 +01:00
2008-01-31 11:25:51 +11:00
2008-01-31 11:25:51 +11:00
2008-01-31 11:25:51 +11:00
2008-01-24 20:40:43 -08:00
2008-02-01 14:35:00 -08:00