Suspend for PMU machines
Richard Hughes
hughsient at gmail.com
Tue Dec 20 05:22:37 PST 2005
On Mon, 2005-12-05 at 14:42 -0500, David Zeuthen wrote:
> 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.
Attached patch. Sorry for such a mega patch, but I've been working with
Gad for testing all the PowerMac parts, and it's much easier to test all
the functionality in one large patch that I can easily regenerate.
The patch does five things:
* Adds a hal-system-power-pmu helper that lets us call sleep, setlcd and
getlcd using ioctls. These work, tested.
* Adds the needed hooks into the existing scripts to call the new pmu
sleep/brightess functionality. Probably work, lightly tested.
* Tidies up pmu.c to use a small helper function, pmu_synthesize_item to
reduce the LOC (just like I did for acpi). Tested by Gad.
* Adds the powermac version strings to pmu.c using the pmu chip. Lightly
tested, and didn't work for Gad.
* Adds the lcd-brightness support into the pmu.c driver so that
PowerBooks can now query and set the brightness using the same dbus API
that ACPI users now use. This means sleep, and brightness (mostly) just
work in programs like gnome-power-manager.
I know it's a bit raw, but I wanted some detailed feedback if I'm doing
things wrong. I can split the patches up if required.
Thanks, Richard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-pmu-lcdsleep.patch
Type: text/x-patch
Size: 17880 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20051220/66ce7a7b/hal-pmu-lcdsleep.bin
More information about the hal
mailing list