public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: Fix wake GPE enabling
@ 2004-04-08 20:38 Moore, Robert
       [not found] ` <37F890616C995246BE76B3E6B2DBE0554F1C5F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Moore, Robert @ 2004-04-08 20:38 UTC (permalink / raw)
  To: Nate Lawson
  Cc: Dominik Brodowski, Brown, Len,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Grover, Andrew

Nate,

Yes, the code below looks good.  This is the model that we have in mind
for the ACPI CA code, OSPM, and individual drivers.

Bob


> -----Original Message-----
> From: Nate Lawson [mailto:nate-Y6VGUYTwhu0@public.gmane.org]
> Sent: Thursday, April 08, 2004 10:48 AM
> To: Moore, Robert
> Cc: Dominik Brodowski; Brown, Len; acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org;
> Grover, Andrew
> Subject: RE: [ACPI] Fix wake GPE enabling
> 
> On Thu, 8 Apr 2004, Moore, Robert wrote:
> > Linux needs a user interface and some additional OSPM software to
> > identify and program the wake devices, as well as handle the other
> > information in the _PRW methods.
> >
> > The ACPI CA core subsystem will only identify wake vs. runtime GPEs.
> >
> > > -> wake_enable is not touched directly,
> > > -> events/evgpeblk.c does not care, and according to your opinion,
> > should
> > >    not care.
> > > -> acpi_enable_gpe is _only_ called by drivers/acpi/ec.c, which
means
> > it
> > > is
> > >    _not_ called for buttons, which are very clearly needed in most
> > cases
> > > to
> > >    wake up a system.
> > >
> > > At least for buttons, the ACPI subsystem should enable their wake
> > > functionality, e.g. the wake GPEs, unconditionally. Having to
manually
> > > enter
> > > "echo powerbutton > /proc/acpi/wakeup_devices", as the patch in
bug
> > #1415
> > > suggests, seems to be overly complicated. However, having this
file as
> > > override might be a valid option, I agree.
> > >
> >
> > The ACPI CA core subsystem does NOT scan for particular devices (via
the
> > _HID, _UID, etc.)  The upper OSPM software already does this and is
thus
> > responsible for enabling individual devices and GPEs for wake-up,
> > including the power button, lid button, etc.  This code apparently
still
> > needs to be written.
> 
> You mean like this code snippet?
> 
> -Nate
> 
> acpi_button_attach(device_t dev)
> {
>     if (sc->fixed) {
>         AcpiClearEvent(event);
>         status = AcpiInstallFixedEventHandler(event,
>                         acpi_button_fixed_handler, sc);
>     } else {
>         status = AcpiInstallNotifyHandler(sc->button_handle,
>                         ACPI_DEVICE_NOTIFY,
acpi_button_notify_handler,
> sc);
>     }
> 
>     acpi_device_enable_wake_capability(sc->button_handle, 1);
> }
> 
> acpi_button_suspend(device_t dev)
> {
>     struct acpi_button_softc    *sc;
> 
>     sc = device_get_softc(dev);
>     acpi_device_enable_wake_event(sc->button_handle);
>     return (0);
> }
> 
> acpi_device_enable_wake_capability(ACPI_HANDLE h, int enable)
> {
>     /*
>      * All Power Resources referenced by elements 2 through N
>      * of the _PRW object are put into the ON state.
>      */
> 
>     (void)acpi_SetInteger(h, "_PSW", enable);
> }
> 
> acpi_device_enable_wake_event(ACPI_HANDLE h)
> {
>     status = AcpiEvaluateObject(h, "_PRW", NULL, &prw_buffer);
>     if (ACPI_FAILURE(status))
>         return;
> 
>     switch (res->Package.Elements[0].Type) {
>     case ACPI_TYPE_INTEGER:
>         /*
>          * If the data type of this package element is numeric, then
this
>          * _PRW package element is the bit index in the GPEx_EN, in
the
>          * GPE blocks described in the FADT, of the enable bit that is
>          * enabled for the wake event.
>          */
>         status = AcpiEnableGpe(NULL, res-
> >Package.Elements[0].Integer.Value,
>                                ACPI_EVENT_WAKE_ENABLE);
> }


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-09 22:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-08 20:38 Fix wake GPE enabling Moore, Robert
     [not found] ` <37F890616C995246BE76B3E6B2DBE0554F1C5F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-04-08 22:20   ` Nate Lawson
     [not found]     ` <20040409061527.GA8572@dominikbrodowski.de>
     [not found]       ` <20040409061527.GA8572-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-04-09 22:58         ` S3-resume in FreeBSD Nate Lawson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox