2014년 10월 24일 금요일

eMMC runtime power management control (sysfs)

[sysfs for runtime PM]
#cd /sys/bus/mmc/devices/mmc1:0001/power
# ls -la
-rw-r--r-- root     root         4096 1970-01-01 03:50 autosuspend_delay_ms
-rw-r--r-- root     root         4096 1970-01-01 03:50 control
-r--r--r-- root     root         4096 1970-01-01 03:50 runtime_active_time
-r--r--r-- root     root         4096 1970-01-01 03:50 runtime_status
-r--r--r-- root     root         4096 1970-01-01 03:50 runtime_suspended_time
# cat ./control
auto
# cat ./runtime_status
active
# cat ./runtime_status
suspended

[Source file]
kernel/drivers/base/power/sysfs.c

/*
 * control - Report/change current runtime PM setting of the device
 *
 * Runtime power management of a device can be blocked with the help of
 * this attribute.  All devices have one of the following two values for
 * the power/control file:
 *
 * + "auto\n" to allow the device to be power managed at run time;
 * + "on\n" to prevent the device from being power managed at run time;
 *
 * The default for all devices is "auto", which means that devices may be
 * subject to automatic power management, depending on their drivers.
 * Changing this attribute to "on" prevents the driver from power managing
 * the device at run time.  Doing that while the device is suspended causes
 * it to be woken up.