Openmoko Bug #2008: Suspend exceptions: Do not suspend when certain apps are running
Openmoko Public Trac
bugs at docs.openmoko.org
Thu Sep 18 01:27:25 CEST 2008
#2008: Suspend exceptions: Do not suspend when certain apps are running
----------------------------------+-----------------------------------------
Reporter: Benih | Owner: openmoko-kernel
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: System Software | Version: Om2008.8
Severity: minor | Resolution:
Keywords: suspend exception | Blockedby:
Reproducible: | Blocking:
----------------------------------+-----------------------------------------
Comment(by raster):
this has been going on for a long while. everything you n4eed is already
there. ompower is a userspace daemon you talk to via dbus to request power
states of a device (right now only cpu supported and implicitly screen
backlight is managed as a result). its a very small program too so can be
extended very easily.
to request suspend:
dbus-send --system --dest=org.openmoko.Power / \
org.openmoko.Power.Core.RequestResourceState \
string:cpu string:my-system-name string:off
to tell ompower that "i want to keep suspend from happening because i need
the cpu":
dbus-send --system --dest=org.openmoko.Power / \
org.openmoko.Power.Core.RequestResourceState \
string:cpu string:my-system-name string:on
when you are done with your desire to keep the cpu up or you dont think it
should be suspended anymore:
dbus-send --system --dest=org.openmoko.Power / \
org.openmoko.Power.Core.RemoveRequestedResourceState \
string:cpu string:my-system-name
so in the case of "i dont want to suspend while it is connected via usb"
on usb connect:
dbus-send --system --dest=org.openmoko.Power / \
org.openmoko.Power.Core.RequestResourceState \
string:cpu string:usb-connection string:on
on usb disconnect:
dbus-send --system --dest=org.openmoko.Power / \
org.openmoko.Power.Core.RemoveRequestedResourceState \
string:cpu string:usb-connection
you can do this of course from anything that can talk dbus - not just the
cmd-line. remember the "my-system-name" is an identifier for who is asking
(i did it this way so it could be used from the cmd-line via dbus-send).
it says "me - the usb connection" or "me the dialler" or "me the gps nav
program" is asking for the cpu to stay on, or suspend. as long as at least
1 person is asking for the cpu to be on - it stays on. when everyone who
asked for it to be on removes their "keep it on for me" requests, then
ompower will allow it to suspend *IF there is any off request in the
queue. at that point ompower executes "apm -s".
--
Ticket URL: <https://docs.openmoko.org/trac/ticket/2008#comment:10>
docs.openmoko.org <http://docs.openmoko.org/trac/>
openmoko trac
More information about the buglog
mailing list