Commit Graph

32 Commits

Author SHA1 Message Date
Jung-uk Kim
2be4e4713a Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
David E. O'Brien
2a191126de Canonize the include of acpi.h. 2005-09-11 18:39:03 +00:00
David E. O'Brien
dad97fee58 Fix SCM ID's. 2005-03-02 09:22:34 +00:00
Nate Lawson
d4b9ff9179 Move flags into a private ivar so it can't collide with device flags.
Unify the code to disable GPEs with the enable code.  Shutdown is handled
the same way.  ACPI now does all wake/sleep prep for child devices so
now they no longer need to call external functions in the suspend/resume
path.  Add the flags to non-ACPI busses (i.e., pci).
2004-06-30 16:08:03 +00:00
Nate Lawson
5fcc8a587e Use the acpi_id_probe() method instead of acpi_MatchHid(), which is now
static.
2004-06-29 19:02:27 +00:00
Nate Lawson
9123341378 Add support to ACPI to manage its own resources. Previously, resource
allocation was passed up to nexus.  Now, we probe sysresource objects and
manage the resources they describe in a local rman pool.  This helps
devices which attach/detach varying resources (like the _CST object) and
module loads/unloads.  The allocation/release routines now check to see if
the resource is described in a child sysresource object and if so,
allocate from the local rman.  Sysresource objects add their resources to
the pool and reserve them upon boot.  This means sysresources need to be
probed before other ACPI devices.

Changes include:
* Add ordering to the child device probe.  The current order is:  system
resource objects, embedded controllers, then everything else.
* Make acpi_MatchHid take a handle instead of a device_t arg.
* Replace acpi_{get,set}_resource with the generic equivalents.
2004-06-13 22:52:30 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Nate Lawson
cc85c78ce3 Update the new suspend/resume GPE methods to properly limit the GPE
based on the destination sleep state.  Add a method to restore the old
state on resume.  This is needed for the case of suspending to a very low
state disabling a GPE (i.e. S4), resuming, and then suspending to a higher
state (i.e. S3).  This case should now keep the proper GPEs enabled.
2004-05-28 07:04:09 +00:00
Nate Lawson
e8b4d56eb5 Restructure the wake GPE API. Now there are three functions:
acpi_wake_init:
    Evaluate _PRW and set the GPE type
acpi_wake_set_enable:
    Enable or disable a device's GPE.
acpi_wake_sleep_prep:
    Perform any last-minute changes to the device to prepare it for
    entering the given sleep state.

Also, walk the entire namespace when transitioning to a sleep state,
disabling any GPEs which aren't appropriate for the given state.  Transition
acpi_lid and acpi_button to the new API.

This clears the way for non-ACPI-aware devices to wake the system (i.e.
modems) and fixes a problem where systems power up after shutdown when a
GPE is triggered.
2004-05-27 18:38:45 +00:00
Nate Lawson
841caa96b4 Enable GPE at runtime rather than suspend time. This is to match the
new behavior in ACPI-CA that defers GPE configuration.  This is a temporary
measure while reworking the GPE interface.
2004-05-25 16:17:39 +00:00
Nate Lawson
f3fc4f8b4a Changes to implement 20040514:
* Add calls to AcpiSetGpeType.  We use wake/run as the type for lid and
button switches since wake-only causes Thinkpads to immediately wake on
the second suspend.  Note that with wake/run, some systems return both
wake and device-specific notifies so we don't register for system notifies
for lid and button switches.
* Remove the hw.acpi.osi_method tunable since it is not needed.
* Always print unknown notifies for all types.
* Add more cleanup for the EC if it fails to attach.
* Use the GPE handle now that we parse it.  This allows GPEs to be defined
in AML GPE blocks.
* Always use ACPI_NOT_ISR since it's ok to acquire a mutex in our thread
which processes queued requests.
2004-05-25 02:47:35 +00:00
Nate Lawson
64278df5e0 Add MODULE_DEPEND entries so some of these drivers can eventually be
loaded separately from ACPI (i.e., embedded use).
2004-04-09 18:14:32 +00:00
Nate Lawson
bb949efb95 Do not remove the fixed handlers. Several systems (e.g., ASUS) only
return events on the fixed handler even after defining a duplicate in the
AML.  While this violates the spec, hopefully we can get by with leaving
both installed.
2004-02-19 18:16:34 +00:00
Nate Lawson
968c0e1bf4 Fix problem caused by previous commit where some users' buttons
stopped returning events.  Don't disable the event when removing
the handler because it still needs to be enabled for the other
handler.  Also, remove duplicate AcpiEnableEvent calls since the
install function now does this for us.
2004-02-19 05:35:20 +00:00
Nate Lawson
33febf93d6 Prefer buttons defined in the AML over the ones in the FADT. Some
systems define power/sleep buttons in both places but only deliver
notifies to the ones defined in the AML.

Also, reduce length of various function handler names.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-02-11 02:57:33 +00:00
Nate Lawson
9b937d4836 Add devctl(4) notify support to ACPI. Various subsystems now notify
userland whenever events occur.  See the example in devd.conf below
to see how to use it.
2003-10-25 05:03:25 +00:00
Nate Lawson
a6a1d01594 Fix the ACPI_DEBUG case.
Reported by:	Larry Rosenman <ler@lerctr.org>
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2003-09-22 04:50:29 +00:00
Poul-Henning Kamp
d2f243d06a Make this compile. 2003-09-21 18:54:52 +00:00
Nate Lawson
be8dca590c Add support for fixed event buttons defined in the DSDT (HID "ACPI_FSB"
and "ACPI_FPB").

Pointed out by:		Linux
2003-09-21 02:49:59 +00:00
Nate Lawson
798fb860d5 Style cleanups to match the rest of this directory. For acpi_battery.c,
remove unused includes.
2003-08-11 15:34:43 +00:00
Takanori Watanabe
62d4c42b21 Enable wake up GPE before shutdown, not only for sleeping. 2003-07-26 09:54:17 +00:00
Mitsuru IWASAKI
a1fccb4765 Add device(power/sleep button and lid) wake function from sleeping state.
This is required for some Thinkpad (and maybe VAIO) machines to wake
the system up from sleep.

Currently partially implemented, more complete implementation will come later.
2002-07-22 12:52:54 +00:00
Bruce Evans
e788f79698 Fixed printf format errors which apparently crept in while -Wformat was
disabled for gcc-3.
2002-05-25 11:18:03 +00:00
Peter Wemm
b4a052380f Brutally deal with __func__ being 'const char *' on gcc-3.1. 2002-05-19 06:16:47 +00:00
Mike Smith
9127281c88 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
2002-02-23 05:26:45 +00:00
Mike Smith
3273b00523 Staticise devclasses and some unnecessarily global variables. 2002-01-08 06:46:01 +00:00
Mitsuru IWASAKI
6971b3c7d1 Cleanups of verbose printing. All the messages for the debugging is
disabled unless verbose flag is set.  Also fix some messages in terms
of English.
The critical messages and error messages in probe/attach routine are
unchanged by this commit.
2001-11-18 18:12:07 +00:00
Mike Smith
bfae45aa43 Convert from acpi_strerror() to AcpiFormatException()
Fix dangling include of the dear departed acpi_ecreg.h
2001-07-21 10:24:37 +00:00
Mike Smith
67ce16735b Don't call ourselves a "control method" anything, that's not useful.
Move the "button pressed" diagnostics to the point where we can print
out which button was actually pressed.
2001-07-21 04:05:08 +00:00
Mike Smith
2a4ac806d7 - Updates for new constant naming in the ACPI CA 20010518 update.
- Use __func__ instead of __FUNCTION.
 - Support power-off to S3 or S5 (takawata)
 - Enable ACPI debugging earlier (with a sysinit)
 - Fix a deadlock in the EC code (takawata)
 - Improve arithmetic and reduce the risk of spurious wakeup in
   AcpiOsSleep.
 - Add AcpiOsGetThreadId.
 - Simplify mutex code (still disabled).
2001-05-29 20:13:42 +00:00
Mike Smith
0ae554237c - Convert a lot of homebrew debugging output to use the ACPI CA debugging
infrastructure.  It's not perfect, but it's a lot better than what
   we've been using so far.  The following rules apply to this:
    o BSD component names should be capitalised
    o Layer names should be taken from the non-CA set for now.  We
      may elect to add some new BSD-specific layers later.

 - Make it possible to turn off selective debugging flags or layers
   by listing them in debug.acpi.layer or debug.acpi.level prefixed
   with !.

 - Fully implement support for avoiding nodes in the ACPI namespace.
   Nodes may be listed in the debug.acpi.avoid environment variable;
   these nodes and all their children will be ignored (although still
   scanned over) by ACPI functions which scan the namespace.  Multiple
   nodes can be specified, separated by whitespace.

 - Implement support for selectively disabling ACPI subsystem components
   via the debug.acpi.disable environment variable.  The following
   components can be disabled:
    o bus	creation/scanning of the ACPI 'bus'
    o children	attachment of children to the ACPI 'bus'
    o button	the acpi_button control-method button driver
    o ec	the acpi_ec embedded-controller driver
    o isa	acpi replacement of PnP BIOS for ISA device discovery
    o lid	the control-method lid switch driver
    o pci	pci root-bus discovery
    o processor CPU power/speed management
    o thermal	system temperature detection and control
    o timer	ACPI timecounter
   Multiple components may be disabled by specifying their name(s)
   separated by whitespace.

 - Add support for ioctl registration.  ACPI subsystem components may
   register ioctl handlers with the /dev/acpi generic ioctl handler,
   allowing us to avoid the need for a multitude of /dev/acpi* control
   devices, etc.
2000-12-08 09:16:20 +00:00
Mike Smith
15e32d5d03 Initial FreeBSD OSPM (operating system power management) modules for
ACPICA.  Most of these are still works in progress.  Support exists for:

 - Fixed feature and control method power, lid and sleep buttons.
 - Detection of ISA PnP devices using ACPI namespace.
 - Detection of PCI root busses using ACPI namespace.
 - CPU throttling and sleep states (incomplete)
 - Thermal monitoring and cooling control (incomplete)
 - Interface to platform embedded controllers (mostly complete)
 - ACPI timer (incomplete)
 - Simple userland control of sleep states.
 - Shutdown and poweroff.
2000-10-28 06:59:48 +00:00