Suspend for PMU machines

David Zeuthen david at fubar.dk
Mon Dec 5 11:42:29 PST 2005


On Sun, 2005-12-04 at 22:32 +0000, Richard Hughes wrote:
> The hibernation and suspending compatibility scripts we have at the
> moment works really well,

Good to hear; thanks for reporting this.

>  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].

Someday...

> 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 think we should do exactly this, it should be really simple.

> 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.

Sounds like a plan to me.

Cheers,
David



More information about the hal mailing list