Originally Posted by Gertjan
You're close. The device is put into low power mode after 5 seconds of idle by a call to idle.sh. There is a standby microprocessor in the device which controls power to various components, key input etc (it does not drive the display though). The hwclock-line is called when operation is resumed to sync the Linux clock as it does not get updated while in idle mode.
Thanks Gertjan, now it makes sense. I was wondering what this "serio" actually means, since it takes an "idle" command:
SERIO=`find /sys/devices -name "serio*"`
#echo -n "1 0" > $SERIO/rgbled
if [[ "$1" == "" ]]; then
echo -n "idle 0" > $SERIO/power_mode
echo -n "idle $1" > $SERIO/power_mode
And according to i.MX31L's document
, it can enter into different level's power saving mode. I believe you are referring to the "wait" or even "doze" mode when the CPU clock is gated.
So now it is clear that user defined CPU timer is "paused" after this idle mode is activated, and will be "resumed" after this mode is terminated.
Regarding the clock implementation, the only way to make it self-updated is to set its timer in sync with the idle timer (5 sec) so that the idle mode is never enabled. I have tested this on my device and it works this way. However, not going to idle mode will significantly reduce battery time, so it is not worth it.
So setting the clock timeout to be between 5 and 10 is more usable. In this case, the clock timer is likely to be suspended on the idle timer, and times out during the next idle window to update the clock. Currently I am using 7 on my device, and works fine without noticeable battery problem. Of course, if the device is busy (flipping pages in less than 5 seconds, or using the stylus all the time etc etc), there is some overhead to have a 7 seconds timers.
What I don't understand yet is why adding an eripc call in the clock timeout function will SOMETIMES update the clock after about 30 seconds of page turn, which is much longer than the idle timeout.
Another way is to only update the clock on a page turn event. Unfortunately, there is no obvious event that can be used after using DR1000's uds, since the "page counter" in the popupmenu is disabled in document viewer, and the "pagebar" is embedded in the uds. Using dbus-monitor shows some signals being sent when flipbar is flipped left or right for a PDF doc, will have to do more experiments in other cases to identify a usable signal.