public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Nate Lawson <nate-Y6VGUYTwhu0@public.gmane.org>
To: "Moore, Robert" <robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Dominik Brodowski
	<linux-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>,
	"Brown, Len" <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	"Grover,
	Andrew" <andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: RE: Fix wake GPE enabling
Date: Thu, 8 Apr 2004 15:20:33 -0700 (PDT)	[thread overview]
Message-ID: <20040408151829.L43644@root.org> (raw)
In-Reply-To: <37F890616C995246BE76B3E6B2DBE0554F1C5F-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>

It's cut/pasted from FreeBSD, been around since July 2002 and tested as
working.

-Nate

On Thu, 8 Apr 2004, Moore, Robert wrote:
> 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=1470&alloc_id=3638&op=click

  parent reply	other threads:[~2004-04-08 22:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [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
  -- strict thread matches above, loose matches on Subject: below --
2004-04-09 22:12 Fix wake GPE enabling Moore, Robert
2004-04-09 16:57 Moore, Robert
     [not found] ` <37F890616C995246BE76B3E6B2DBE0554F207E-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-04-09 23:27   ` Masanori Kanaoka
2004-04-08 16:43 Moore, Robert
     [not found] ` <37F890616C995246BE76B3E6B2DBE0554F1A53-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-04-08 17:47   ` Nate Lawson
     [not found]     ` <20040408104615.K42238-Y6VGUYTwhu0@public.gmane.org>
2004-04-08 21:05       ` Dominik Brodowski
2004-04-08 21:13   ` Dominik Brodowski
     [not found]     ` <20040408211323.GB7340-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-04-21 21:57       ` Pavel Machek
2004-04-08 16:32 Moore, Robert
     [not found] ` <37F890616C995246BE76B3E6B2DBE0554F1A3B-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-04-09 10:10   ` Masanori Kanaoka
2004-04-08 16:00 Moore, Robert
2004-04-07 22:20 Manpreet Singh
2004-04-07 21:34 Moore, Robert
     [not found] ` <37F890616C995246BE76B3E6B2DBE055442912-sBd4vmA9Se7vCEQmvpVV9VDQ4js95KgL@public.gmane.org>
2004-04-08  6:45   ` Dominik Brodowski
2004-04-08 13:50   ` Takayoshi Kochi
2004-04-07 20:53 Dominik Brodowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040408151829.L43644@root.org \
    --to=nate-y6vguytwhu0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org \
    --cc=robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox