Suspend for PMU machines

Richard Hughes hughsient at gmail.com
Sun Dec 4 14:32:31 PST 2005


The hibernation and suspending compatibility scripts we have at the
moment works really well, except for Apple machines. To reliably suspend
on a Apple machine, you need to do:

ioctl (fd, PMU_IOC_SLEEP, 0);
(where fd is opened /dev/pmu)

Note, we can't yet (or for the foreseeable future) use /sys/power/state
as I assumed we could, as the pmu kernel PM stuff is a long way from
being finished and complete [1].

Now, ideally in HAL we want to call this ioctl only if the machine is
identified as having power_management.type="pmu", but I wondered if
there was a quick and easy way we can call this ioctl from the command
line in hal-system-power-suspend using a command line tool (anyone any
ideas?)

Else we are going to need a super small executable that just calls this
ioctl (and returns success), which is executed from
hal-system-power-suspend.

I thought of using pbbcmd for this, but we don't want to use any other
of the functionality other than the three sleep and brightness up/down
ioctls, which we can do in a really tiny C file. I was thinking
something like this:

hal-system-power-pmu suspend
hal-system-power-pmu lcdup
hal-system-power-pmu lcddown

i.e. one tool for all three functions. All the other ioctl'y stuff
(ambient light sensor etc) can be done internally in pmu.c or addons
(for polling the sensor). This can return errors to stdout and just be
hooked into the existing scripts really easily.

Feedback please.

Richard.

[1] http://bugzilla.kernel.org/show_bug.cgi?id=5528



More information about the hal mailing list