#31 BLOC Trial-2: OHM Power Manager for OLPC laptops
Jim Gettys
jg at laptop.org
Wed Jul 11 11:05:07 EDT 2007
X itself will take care of dealing with the dcon.
All Ohm has to do is ensure the right screen saver parameters get set.
- Jim
On Wed, 2007-07-11 at 14:55 +0000, Zarro Boogs per Child wrote:
> #31: OHM Power Manager for OLPC laptops
> -----------------------------+----------------------------------------------
> Reporter: jg | Owner: hughsient at gmail.com
> Type: task | Status: new
> Priority: blocker | Milestone: Trial-2
> Component: infrastructure | Version:
> Resolution: | Keywords: power
> Verified: 0 |
> -----------------------------+----------------------------------------------
> Comment (by cjb):
>
> Hi Richard,
>
> Replying to [comment:23 hughsient at gmail.com]:
> > > * power button support -- we should suspend whenever the power button
> is pressed
> >
> > I'll do this today. I guess it's exposed in HAL as a button of type
> power.
>
> (See below about us probably needing a kernel change here.)
>
> > > * lid event -- we should suspend *and* set the dcon to "sleep" mode
> via sysfs on lid close
> >
> > How to set dcon to sleep and suspend? What's the _exact_ commands on a
> B3?
>
> DCON sleep is:
> {{{
> echo 1 > /sys/devices/platform/dcon # sleep
> echo 0 > /sys/devices/platform/dcon # wake
> }}}
>
> And, CPU suspend is the usual:
> {{{
> echo mem > /sys/power/state
> }}}
>
> > > * ebook event -- we should `xrandr -o left` on ebook=1, `xrandr -o
> normal` on ebook=0
> >
> > What is the ebook event - a HAL button press or dbus api?
>
> Lid and ebook are already being broadcast by HAL as the appropriate
> signals: if you install the latest build and close/open lid and
> flip/unflip into ebook, lshal --monitor gives:
>
> {{{
> -bash-3.2# lshal --monitor
>
> Start monitoring devicelist:
> -------------------------------------------------
> 14:56:51.815: computer_logicaldev_input_0 property button.state.value =
> true
> 14:56:51.822: computer_logicaldev_input_0 condition ButtonPressed = lid
> 14:56:52.389: computer_logicaldev_input_0 property button.state.value =
> false
> 14:56:52.397: computer_logicaldev_input_0 condition ButtonPressed = lid
> 14:56:56.328: computer_logicaldev_input_1 property button.state.value =
> true
> 14:56:56.429: computer_logicaldev_input_1 condition ButtonPressed =
> tablet_mode
> 14:56:57.370: computer_logicaldev_input_1 property button.state.value =
> false
> 14:56:57.377: computer_logicaldev_input_1 condition ButtonPressed =
> tablet_mode
> }}}
>
> > Can we do the xranr stuff in c bindings rather than run a command - it
> would be much faster.
>
> That sounds fine, though I don't have sample code for doing it with the
> bindings, and would be happy with getting the exec going now and
> optimizing it later given our time constraints. Whichever you prefer.
>
> > > HAL doesn't currently see/broadcast the power button -- maybe that's
> because X uses the grab ioctl on the pm_inputdev device, which would mean
> we need to split out the power button into its own (correctly labeled)
> device like we did with lid and ebook. That's a simple kernel patch; if
> we need to do that, I can get it done quickly.
> >
> > Yup, it needs to be a separate device, ala ACPI.
>
> Yeah, makes sense. I'll get a kernel RPM with the extra device for the
> lid switch ready for when you get in tomorrow.
>
> > I'll make this stuff priority one this morning.
>
> You rock. :) Thanks so much!
>
--
Jim Gettys
One Laptop Per Child
More information about the Devel
mailing list