Commit Graph

43 Commits

Author SHA1 Message Date
jruoho 2b0b13f21f Use ioconf for the module declarations. 2011-02-16 08:35:51 +00:00
jruoho 70e14dc983 Bump WARNS to 4. 2010-10-25 07:48:03 +00:00
jruoho 8c53a12242 Bypass ACPI_NOTIFY_DEVICE_WAKE also in acpilid(4). Use aprint_debug_dev(9)
for an unknown notify. (The ACPI drivers should really not print anything
as we now have a global notify handler that can catch the debug information.)
2010-08-24 15:03:34 +00:00
jruoho f04ee53053 Use ACPICA's standard notify values from <actypes.h> and move the
device-specific notify constants to the device-specific files.
2010-04-27 05:57:43 +00:00
jruoho 55052eca77 As discussed with jmcneill@, install a global "bus notification handler"
that receives all notifications and deliver notifications to drivers via it.
2010-04-15 07:02:24 +00:00
jruoho fb53d8ceed No need to spread the ACPICA type system any more than is necessary:
UINT8 -> uint8_t and UINT32 -> uint32_t.
2010-04-14 19:27:28 +00:00
jruoho c38f7a7cda Preparing a device for wakeup involves:
(a) turning on all power resources required by the device; and
  (b) executing _DSW (or _PSW) control method.

This implements (b). Ok jmcneill@.
2010-03-05 21:01:44 +00:00
jruoho 5a425210a3 Remove <dev/acpi/acpica.h> from all files. It is included from
<dev/acpi/acpivar.h>. Ditto for <dev/sysmon/sysmonvar.h>, <sys/bus.h>,
<dev/pci/pcivar.h>, and <dev/isa/isavar.h>.

Also nuke a lot of unused and invalid headers. Some of these are audibly
provided by standard headers (namely <sys/param.h> and <sys/device.h>), some
have nothing to do with ACPI devices (e.g. <sys/syslog.h>), and some are
nonexistent local includes (e.g. "mpu_ym.h"). Moreoever, try to group the
includes into their respective blocks.

Tested with GENERIC and ALL (i386). No functional change.
2010-03-05 14:00:16 +00:00
jruoho 86c3014958 Introduce support for ACPI kernel modules.
Tested on couple of laptops.
2010-02-28 17:22:41 +00:00
jruoho 5d978521d4 Cleanup:
* Semantics.
  * Remove ACPI_LID_DEBUG.
  * Reduce the amount of error reporting.
  * As the status of the lid (open/closed) is known upon suspend, move the
    state variable to the softc, and avoid one object evaluation this way.
2010-02-28 09:23:30 +00:00
dyoung c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
jruoho a86a868599 Add the _COMPONENT definition for ACPI_DEBUG. 2010-01-30 18:35:48 +00:00
dyoung cd6e1fbf91 Expand PMF_FN_* macros. 2010-01-08 19:53:10 +00:00
jruoho 44a36c99e4 As the _PSW control method was deprecated in ACPI 3.0, augment the wake
event call with the newer _DSW control method.

ok pgoyette@, jmcneill@
2009-12-31 10:12:51 +00:00
cegger 63ec7a18dd Introduce acpi_eval_set_integer().
Use it in various acpi drivers to simplify code.
Patch presented on tech-kern@:
http://mail-index.netbsd.org/tech-kern/2009/11/28/msg006552.html

No comments.

XXX Is there an acpi(9) manpage?
2009-11-29 21:32:50 +00:00
jmcneill 80adfeb08d PR# kern/41179: Incorrect return values from AcpiOsExecute()
ACPICA functions return ACPI_STATUS instead of int, so use it for
consistency.
2009-08-25 10:34:08 +00:00
jmcneill f5e82b659b add hw.wake.* sysctl subtree for toggling which devices are allowed to
restore the system from sleep. set/clear wake GPEs as specified before
entering sleep.

by default, the following devices are enabled for wake:
 - sleep/power buttons
 - lid switch
 - pc kbd controller

reviewed by: joerg
2009-08-04 14:20:40 +00:00
dyoung 2e4b9b5581 Make acpilid(4) detachable. 2008-07-15 16:19:37 +00:00
xtraeme 2be2546b16 Split device_t/softc and related cosmetic changes. 2008-03-26 15:31:59 +00:00
xtraeme 5a14ef4138 Add missing acpilid_wake_event() proto. 2008-03-23 14:20:15 +00:00
dyoung 61ad1dd43b Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:35:40 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
kochi 6f20259365 use aprint_* 2006-02-20 12:17:49 +00:00
kochi 92d51ace0f prototypes don't need argument names 2006-02-16 06:19:26 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
kochi a7c9d49c21 Merge changes for ACPI-CA 20050408 2005-05-02 14:53:04 +00:00
kochi beb4a7fe16 specify static where appropriate. 2004-05-01 12:03:27 +00:00
kochi 2bde9b6026 return (x) -> return x
use consitent variable name for ACPI_STATUS
2004-04-11 06:48:25 +00:00
kanaoka 5886bca6f0 Make it compile (int -> ACPI_INTEGER) 2004-03-24 11:26:46 +00:00
mycroft 4ac0e3e5c6 More cleanup:
* Use ACPI_FAILURE() and ACPI_SUCCESS().
* Output exception strings in a few more places.
2003-11-03 18:07:10 +00:00
mycroft 01558f7ee2 Clean up some messages:
* Use AcpiFormatException() in a bunch of places.
* acpi_resource_parse() already prints an error, so don't do it in the callers.
2003-11-03 17:24:22 +00:00
kochi 84795bd3fd * now the size of ACPI_DEVICE_INFO is variable:
it can now accomodate multiple _CIDs
  sizeof(ACPI_DEVICE_INFO) should not be used
* make ad_devinfo member in acpi_devnode a pointer
* implement acpi_match_hid() to simplify matching devices;
  _CIDs are also taken into account now as well as _HID
2003-11-03 06:03:47 +00:00
mycroft fec4c11f9e Catch up with ABI changes in ACPI-CA. Some additional changes to acpi_bat to
set the VALID bits correctly, so we don't report garbage for missing batteries.
2003-10-31 20:54:18 +00:00
thorpej 5a20f4be3c * Add a generic power management event API, defined in <sys/power.h>.
Right now, only power switch state change events are supported.  This
  is a work-in-progress.
* Add support to sysmon for delivering power mangement events to userland.
  Add poll, kqueue, and read entry points to sysmon.
* Adapt ACPI to use the new generic <sys/power.h> event types.

This provides the kernel support for a forthcoming powerd(8) which can
do nice things like gracefully shut the system down when an ACPI power
button is pressed.
2003-04-18 01:31:34 +00:00
thorpej b7394dfe47 Adapt to the sysmon_pswitch interface. 2003-04-17 01:34:14 +00:00
thorpej c9b3657ce9 Add trailing ; to CFATTACH_DECL. 2002-10-02 16:33:28 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
lukem 13ac430285 add RCSID 2001-11-13 13:01:57 +00:00
thorpej 4ce1f116cf Don't be DEBUG by default, but still be noisy about lid status
changes until such time as we actually do something with them.
2001-09-29 05:36:49 +00:00
thorpej 1a9d24bce1 Add stub drivers for ACPI buttons and lid switches. These don't
really do anything yet.
2001-09-28 02:30:13 +00:00