Commit Graph

610 Commits

Author SHA1 Message Date
xtraeme
4a09170d84 Use __unused in function arguments where appropiate. (hi christos) 2006-10-12 06:56:47 +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
gdt
ac02696458 Aggregate discharge rate over all batteries. Makes time remaining
reasonable when battery 0 is in use and battery 1 is fully discharged.
2006-10-11 19:14:29 +00:00
gdt
cf2f8187a8 Aggregate current charge level and lastcap over all batteries, rather
than taking values from the last battery checked.  Solves problem of
apm showing status of 2nd battery in a 2-battery system.
2006-10-11 19:00:12 +00:00
jmcneill
466af2f141 When resuming from S1 standby, don't try to release a mutex that we hadn't
previously acquired.
2006-09-26 01:50:43 +00:00
dogcow
a3fae2e5b9 blah blah discard pointer qualifier blah. 2006-09-24 06:03:20 +00:00
jmcneill
f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
fvdl
5f5c640d2e In acpi_pci_link_dump, print out polarity and trigger for the link device
properties.
2006-09-23 17:05:33 +00:00
fvdl
e1d75075c5 Define the "broken IRQ0 override" quirk, and add it for one type of ACPI
BIOS.
2006-09-23 17:04:26 +00:00
christos
ec7d898cf1 Complete the declaration. 2006-08-27 23:13:47 +00:00
christos
7e11d29fc2 Delete unsigned comparison with < 0 2006-08-27 22:33:49 +00:00
christos
9d18036adc PR/34241: Dave Sainty: Bound a memcpy to the sizeof the buffer where we
are trying to save the contents, instead of trying to copy what the lenght
of the acpi resource tells us.
2006-08-20 15:10:59 +00:00
itohy
cdb1835aff ACPI frontend for Yamaha OPL3-SA[23].
Derived from PR kern/33991 by jasper at pointless dot net.
2006-08-14 09:34:43 +00:00
christos
dfb16d34c3 PR/34117: Takuya SHIOZAKI: enhancement for acpiapm(4)
- make sleep state corresponding to standby/suspend changeable by using sysctl,
- make sure to generate APM events appropriately.
- arrange the code for getting power status.
2006-08-06 15:47:51 +00:00
christos
0fe2e6efc3 PR/34116: Takuya SHIOZAKI: acpiapm(4) misuses config(9)
acpiapm(4) always matches the first node of AML, which is unrelated
with acpiapm. Separate acpi(4)'s children into two individual interface
attributes.
2006-08-06 15:46:54 +00:00
xtraeme
911aafad9f Make this build again and fix the bus_space_tag_t member of the softc,
it's defined in the com_regs struct now.
2006-07-14 05:02:00 +00:00
gdamore
34537908ab Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@.  Fixes PR port-evbmips/32362.
2006-07-13 22:56:00 +00:00
hira
7c54838d63 Fix typo (discarge -> discharge). 2006-07-12 13:16:36 +00:00
christos
2fbd5d820a Prevent zerodivide (from Kouichirou Hiratsuka) 2006-07-12 11:31:39 +00:00
fvdl
6bde80fce7 Do not try to disable link devices (using _DIS) at startup. This causes
problems on some systems. Leave the code commented out, we might want
to revisit this at some point in the future.
2006-07-10 09:18:36 +00:00
christos
bb97a3d660 url for M$ file changed. 2006-07-09 19:25:18 +00:00
christos
4998e59f23 Add acpi apm attachment based on sysmon hooks. 2006-07-08 20:23:53 +00:00
xtraeme
9c392ba6f4 Repeat after me, use __KERNEL_RCSID. 2006-07-05 18:17:59 +00:00
christos
01158ea892 Apply fvdl's acpi pci interrupt configuration code.
- MPACPI is no more.
- MPACPI_SCANPCI -> ACPI_SCANPCI
2006-07-04 00:30:21 +00:00
bouyer
0692f212b3 Move acpi_timer.h outside of __HAVE_TIMECOUNTER, as we need acpitimer_init()
for the non-timecounter case too.
2006-07-02 18:53:33 +00:00
christos
46e62b977f - use aprint instead of printf.
- centralize all the suspend/resume glue in one function.
2006-07-01 21:44:13 +00:00
xtraeme
8ad8d8401b Add __KERNEL_RCSID(). 2006-06-30 23:21:19 +00:00
xtraeme
1f14228ee9 Remove a debug printf. 2006-06-30 23:19:40 +00:00
drochner
3ce3b9b485 test the PM timer for glitches (using the algorithm from FreeBSD)
and use a single read if the timer looks good,
patch from Juan RP, with minor simplification by me
2006-06-26 12:29:36 +00:00
tsarna
d0e9109021 fix typo: idicator -> indicator 2006-06-24 23:40:50 +00:00
drochner
c14d23ac86 First cut on an implementation of an ACPI power management counter
backend for timecounters.
Due to known bugs in some chipsets, always read until we get 3 successive
samples which are monotonic, as FreeBSD does in its "safe" variant.
This can be refined later, either by chipset quirks or by a test (as
FreeBSD does).
2006-06-21 17:47:23 +00:00
cube
8b8d583b02 When we consume a resource definition from _PRS, advance to the next one.
Otherwise, if there are two resources definitions of the same type in _CRS,
the same one from _PRS will be used twice, which of course leads to errors.

Note:  _PRS is Possible Resources Set
       _CRS is Current Resources Set

XXX acpi_allocate_resources is still very weak, e.g. it completely ignores
    StartDependentFn entries which are kind of a switch.  But at least it's
    slightly better that way.

Tested by jmcneill@.
2006-06-20 12:31:19 +00:00
jmcneill
a3f69214b6 acpi_pci_fixup didn't work as well as I had hoped; don't bother for now. 2006-06-19 10:18:08 +00:00
jmcneill
3aa64055a0 Fixup PCI interrupt routing using ACPI tables on return from S3 sleep.
Requires options PCI_INTR_FIXUP in your kernel.
2006-06-19 02:32:12 +00:00
jmcneill
66bdce4546 EXPERIMENTAL: Add sysctl for triggering ACPI sleep. This interface is not
stable, so do not depend on it!

    To trigger sleep:
        # sysctl -w machdep.sleep_state=<n>
    Where <n> is typically 1 (standby), 3 (suspend), or 4 (hibernate).
2006-06-15 18:05:08 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
dogcow
12d973491c gcc4: 'Data' may be used uninitialized in this function 2006-05-14 03:02:14 +00:00
rpaulo
5cd433e986 My laptop sends DeviceCheck instead of PowerSourceStatusChanged. 2006-04-30 20:44:35 +00:00
kochi
bde9af0a6f NULL check for a parameter of AcpiOsSignal().
The upper layer (ACPI-CA) might call with NULL pointer.

This should resolve Coverity CID 1114.
2006-04-13 08:27:09 +00:00
kochi
046e0fba2e Change header location in accordance with moving ACPI-CA to sys/dist/acpica 2006-03-23 13:46:13 +00:00
kochi
143b386a80 change header location in accordance with moving ACPI-CA to sys/dist 2006-03-23 13:45:11 +00:00
kochi
31d00d1ca0 Move ACPI-CA to sys/dist/acpica.
also move ACPI-CA OS dependent sources from sys/dev/acpi/acpica/Osd to
sys/dev/acpi/acpica.
2006-03-23 13:44:10 +00:00
kochi
f0c5abbdc8 Move to sys/dev/acpi/acpica. 2006-03-23 13:43:05 +00:00
kochi
f4afd64ab0 Move to sys/dist/acpica.
suggested by cube.
2006-03-23 13:42:25 +00:00
kochi
cf31c67b37 Move from sys/dev/acpi/acpica/Osd. 2006-03-23 13:41:13 +00:00
kochi
90cb0d3a79 Merge ACPI-CA 20060217 2006-03-12 06:48:15 +00:00
cube
20468175d2 Regen. 2006-03-01 09:30:22 +00:00
cube
687f061948 Add INT0800 (Intel FWH RNG). Make tabulation consistent. 2006-03-01 09:29:47 +00:00
cube
2d6c09f7a7 Resource lists end with END_TAG, not END_DEPENDENT. Makes the
PCI_INTR_FIXUP code "work" again.

Most of the time it will produce a warning about a misaligned resource
pointer, but it's harmless, and the warning was removed in the next version
of the ACPI-CA code.
2006-02-26 18:46:04 +00:00
wiz
078081c6ad Fix typo in aprint argument. 2006-02-23 17:38:03 +00:00
kochi
6f20259365 use aprint_* 2006-02-20 12:17:49 +00:00
kochi
f172eb96ae regen. 2006-02-17 04:34:00 +00:00
kochi
5f0ceef69b Correct some existing device names (PCI bridges, ACPI buses) according
to the up-to-date specs (ACPI 3.0a/PCI Firmware spec 3.0).
Add some ACPI specific devices (ACPI000x).
2006-02-17 04:33:12 +00:00
kochi
9fca0c53be define acpi_dbgr as static 2006-02-16 09:23:23 +00:00
kochi
92d51ace0f prototypes don't need argument names 2006-02-16 06:19:26 +00:00
kochi
539e1b8f22 use ACPI_FAILURE() macro instead of directly check AE_OK 2006-02-16 06:18:59 +00:00
kochi
0cdeab4c58 remove ACPI_DISABLE_ON_POWEROFF option, which was there just for
compatibility of our old driver behavior, which is not necessary.
2006-01-31 09:30:06 +00:00
kochi
9e72fe1e5e adapt for ACPI-CA 20060113 2006-01-29 03:12:22 +00:00
kochi
5d63813b95 Merge ACPI-CA 20060113 2006-01-29 03:11:26 +00:00
kochi
86bf0f2eb2 Merge ACPI-CA 20060113 (new files)
CVg: Committing in .CPI-CA 20060113'
2006-01-29 03:10:55 +00:00
kochi
2564e681ae Merge ACPI-CA 20060113 2006-01-29 03:05:46 +00:00
kochi
13bafec3c5 Import the INTEL ACPI-CA 20060113 2006-01-29 03:02:40 +00:00
rpaulo
69846c9381 More comments fixing. 2006-01-05 17:13:20 +00:00
rpaulo
e438cb4b93 * defflag ACPI_DSDT_OVERRIDE and defparam ACPI_DSDT_FILE.
* adjust comments to reality
2006-01-05 16:56:54 +00:00
perry
93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
sekiya
469147a42c I fixed the cardbus bus enumeration problem awhile back, but the interrupt
fixup problems remain.  Adjust TODO comments to match, and add a link to
cube's comments.
2005-12-21 08:48:25 +00:00
cube
9af385388e machdep.acpi_root -> hw.acpi.root, as discussed on source-changes. 2005-12-13 23:27:31 +00:00
cube
3de4cab6f7 Move the (one liner) logic of AcpiOsGetRootPointer() out of acpica/Osd to
acpi.c and take the opportunity to create a sysctl node that contains the
address of the main ACPI table.

The name of the node, "machdep.acpi_root", is questionable but matches the
one FreeBSD has, which will make it easier to port their acpidump(8)
program.
2005-12-12 15:04:50 +00:00
rpaulo
c747cf7094 Add NSC (NSC6001) IRDA device. 2005-12-11 18:48:51 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
rpaulo
861d507d5b regen 2005-11-12 11:54:29 +00:00
rpaulo
645b6b622a Add ACPI Three-wire Device Bus. 2005-11-12 11:53:30 +00:00
kochi
ec63345182 regen. 2005-11-11 02:11:07 +00:00
kochi
2d0bb278d1 add HPET timer PNP ID.
reported in PR32040 by  Nicolas Joly
2005-11-11 02:10:09 +00:00
rpaulo
07c827131f regen 2005-11-10 13:31:03 +00:00
rpaulo
7928f127e6 Add NSC IrDA Fast Infrared Port. 2005-11-10 13:30:46 +00:00
rpaulo
f5602021b6 regen 2005-11-10 13:26:34 +00:00
rpaulo
066abf15d0 Add Synaptics PS/2-style Touchpad. 2005-11-10 13:25:59 +00:00
kochi
1b13c5e5de revive a piece of code for workaround for buggy BIOSes.
this code was accidentally dropped when the last merge of ACPI-CA.
(this code is one of NetBSD-local changes against original ACPI-CA)
2005-10-23 16:39:29 +00:00
drochner
fbdec13c62 reduce the last commit to its essence; the rest was
not so helpful
2005-07-11 18:31:12 +00:00
christos
79de18714f PR/30720: Nicolas Joly: compilation failure with ACPI_FDC_DEBUG 2005-07-11 14:40:00 +00:00
sekiya
13e5f23389 Fix up interrupt line when line == 0. Discussed with christos@ 2005-06-30 22:28:03 +00:00
christos
66276ec095 There is an error when we return -1, not < 1. 2005-06-30 19:31:53 +00:00
sekiya
b72e560799 Likewise, ACPI_PCI_FIXUP has been replaced by PCI_INTR_FIXUP, and we should
notify when an old kernel config is used.  Recommended by wiz@
2005-06-21 11:49:10 +00:00
sekiya
0919f4d283 Rework the configuration scheme for PCI fixups:
* bus enumeration fixups are not PCIBIOS-specific, interrupt fixups are done
  by both PCIBIOS and ACPI.  The redundancy is very redundant.  Therefore,
  rename PCIBIOS_*_FIXUP to PCI_*_FIXUP, use PCI_INTR_FIXUP in place of
  ACPI_PCI_FIXUP, and change code refences to match.

* move the fixup defines from opt_pcibios.h to opt_pcifixup.h to reflect
  the above.

* fix up the PCI bus numbering in mainbus_attach(), right after we detect the
  configuration mode.  This probably renders the fixup in pcibios.c
  redundant -- but it should be harmless.

These changes make cardbus work in ACPI-only machines, when PCI_BUS_FIXUP
and PCI_INTR_FIXUP are defined.
2005-06-21 08:19:25 +00:00
sekiya
da1b13d741 Also fix up interrupt line if interrupt is zero, as well as 255. Fixes
interrupt issues on two of my laptops that lack PCIBIOS.
2005-06-20 12:21:36 +00:00
drochner
a5c2eed454 kill the "busname" attach arg, it is not really needed 2005-06-01 16:44:38 +00:00
drochner
3f6e0487d2 lots of cast-qual fallout 2005-05-31 21:08:37 +00:00
christos
85d43e7f3d Sprinkle const freely and delete unnecessary casts. 2005-05-29 20:56:02 +00:00
kochi
a7c9d49c21 Merge changes for ACPI-CA 20050408 2005-05-02 14:53:04 +00:00
kochi
57d7792cce Merge ACPI-CA 20050408 2005-05-02 14:52:09 +00:00
kochi
1b73770414 Import the INTEL ACPI-CA 20050408 2005-05-02 14:42:07 +00:00
cube
040e3b19e5 Add attimer(4) driver, with ISA and ACPI attachments.
attimer(4) is the new body of the part of pcppi(4) that mapped the TIMER1
register to set the pitch of the bell.  It was necessary to separate them
in order to have a working ACPI attachment (as the two appear as different
devices in the ACPI structures).
2005-03-25 23:06:19 +00:00
xtraeme
57218e5576 Add pcppi(4) ACPI attachment, which matches the "AT-style speaker
sound" ACPI device.

Reviewed by christos@.
2005-03-21 14:06:46 +00:00
perry
f11b400470 regen 2005-02-27 05:18:58 +00:00
perry
23679f7026 remove trailing whitespace from the "generated from:" line 2005-02-27 05:18:32 +00:00
perry
f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
jmcneill
f697b3820f Fix typo (Capabiltites -> Capabilities). 2005-01-29 18:06:18 +00:00
xtraeme
76025558e1 Add ACPI joy(4) attachment, based on lpt_acpi.c by jmcneill@,
reviewed and ok'ed by cube@ and martin@.
2004-12-02 14:33:31 +00:00
xtraeme
347378fc9f Add ACPI mpu(4) attachment, based on lpt_acpi.c by jmcneill@,
reviewed by christos@, cube@ and martin@.

While here, remove a printf() in mpu_attach() (ic/mpu.c) to remove
an empty line in some frontends (mpu_isa.c, etc).
2004-12-02 09:50:41 +00:00
yamt
05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
drochner
46289e1fef Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
2004-08-30 15:05:15 +00:00
mycroft
33f3ac88e8 Handle a "device check" message by reloading battery information. 2004-06-25 13:47:04 +00:00
yamt
c1c70ffbb9 don't rely on the value of hz. 2004-06-25 11:15:15 +00:00
kochi
d639792bc2 The "implicit return" problem is already fixed since when I imported
ACPICA_PEDANTIC changes from FreeBSD.
Added one item (processor driver).
2004-06-09 16:48:49 +00:00
kochi
7322c3b561 Add code for replacing DSDT. See comments in the file.
Ideas from T.Shiozaki.
2004-06-07 17:35:14 +00:00
kochi
71dc5a9687 Add ACPI_DISABLE_ON_POWEROFF option.
Note: the default behavior is changed.  Now we don't disable the ACPI
subsystem on power off (halt -p) by default.
'options ACPI_DISABLE_ON_POWEROFF' in a kernel config file makes the kernel
behave the way we used to be.
2004-06-07 15:33:17 +00:00
kochi
248f79eb70 Remove the first one (split _REG initialization path into two phases;
which has been done since post-20031203 version of ACPI-CA).
Pointed out by mycroft.
2004-06-07 15:30:03 +00:00
martin
0db10bbadb In acpitz_get_zone only print verbose temperature thresholds when called
from acpitz_attach. This removes strange (and possibly scaring) messages
described in PR kern/25747.
2004-06-06 17:27:05 +00:00
mycroft
4713b8ea6e Remove a couple of items that are done now. XXX Is the first one also done? 2004-06-05 03:14:45 +00:00
kochi
951c6675f8 don't compile acpi_madt.c unless options MPACPI is specified. 2004-05-27 11:26:33 +00:00
kochi
2134725caf ThermalZone improvement work by lha at stacken.kth.se, inspired from
FreeBSD thermal zone code.  Minor style fixes and bugfixes by me.
2004-05-26 17:15:17 +00:00
kochi
660dc92018 Fix typo in variable name. 2004-05-16 07:14:17 +00:00
kochi
e48192f908 Add sysmon pswitch hook so that powerd(8) can monitor
AC adapter online/offline events.
2004-05-03 07:44:36 +00:00
kochi
beb4a7fe16 specify static where appropriate. 2004-05-01 12:03:27 +00:00
yamt
4a3c33632a EcGpeHandler: in the case that the ec is EcLock'ed, always set
EC_F_PENDQUERY flag so that AcpiClearGpe() will be called later.
2004-04-24 09:07:50 +00:00
simonb
9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
itojun
aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
kochi
01e95b11cc fix compilation when ACPI_DEBUG is not set.
pointed out by Sverre Froyen.
2004-04-12 15:11:04 +00:00
kochi
1d26507180 minor space nit from Alexander Yurchenko. 2004-04-12 15:09:46 +00:00
kochi
d742fdc844 - don't evaluate _UID, reuse ACPI_DEVINFO
- move acpi_resources from acpi_ec_softc to stack
2004-04-11 15:41:50 +00:00
kochi
1055d5f701 split power button and sleep button HIDs so that they can be matched
against compatibility IDs.
2004-04-11 11:25:34 +00:00
kochi
193c08b383 Clean up memory allocated during autoconfiguration 2004-04-11 10:36:35 +00:00
kochi
23f6ddb8d9 change acpi_resource_parse API to support _PRS parsing as well as _CRS 2004-04-11 09:38:19 +00:00
kochi
0dd2fcbaed + add prototype
+ designated initializers
+ call callback functions only when defined
2004-04-11 09:25:28 +00:00
kochi
e0945a0006 change acpi_resource_parse API to support _PRS parsing as well as _CRS 2004-04-11 08:56:48 +00:00
kochi
b547a6d28f change acpi_resource_parse API to support _PRS parsing as well as _CRS 2004-04-11 08:36:19 +00:00
kochi
9a5dc2e233 return (x) -> return x 2004-04-11 06:52:38 +00:00
kochi
2bde9b6026 return (x) -> return x
use consitent variable name for ACPI_STATUS
2004-04-11 06:48:25 +00:00
kochi
db7198d645 whitespace nit 2004-04-10 11:48:10 +00:00
kochi
fa6f52f090 A bugfix for Mutex handling.
Originally reported by Takahiro Kambe and this fixed
powerdown on his Panasonic CF-R1N.
This fix is already reported to Intel ACPI-CA team, and will be
included in future releases of ACPI-CA.
2004-04-07 18:19:33 +00:00
tron
d44cf8f504 Only call acpiec_early_attach() in "acpi.c" if the kernel is configured
to include the "acpiec" device.
2004-03-31 11:19:39 +00:00
wiz
700791bc6c Fix date in previous (shouldn't the entry just be removed?). 2004-03-30 16:46:58 +00:00
kochi
3f81329e9c ECDT support is complete. 2004-03-30 15:51:53 +00:00
kochi
bd130aba8f Add ACPI ECDT (Embedded Controller Description Table) support.
This will enable usage of EC in early stage of ACPI initialization.
2004-03-30 15:18:55 +00:00
kochi
bd173d33bf Fix 16bit-wide access to PCI configuration space. 2004-03-30 11:12:32 +00:00
kanaoka
b7bbe36649 Set sc->sc_glk,if acpi_eval_integer() evaluate _GLK in acpiec_attach. 2004-03-24 14:47:19 +00:00
kochi
601c8f6d64 Don't include unnecessary header (acpi_osd.h) 2004-03-24 13:02:23 +00:00
kochi
7afcffbeb7 - Don't use ACPI CA internal functions
- make MADT table pointer static
2004-03-24 12:49:45 +00:00
kanaoka
5886bca6f0 Make it compile (int -> ACPI_INTEGER) 2004-03-24 11:26:46 +00:00
martin
f87286c8e4 Make it compile (int -> ACPI_INTEGER) 2004-03-24 09:14:58 +00:00
drochner
d81255df54 some int->ACPI_INTEGER to make it compile on amd64 again 2004-03-23 19:00:03 +00:00
kochi
2b5897d796 Don't use ACPI CA internal functions 2004-03-23 14:07:42 +00:00
kochi
93ec3b2720 Merge ACPI-CA 20040211. 2004-02-14 16:57:24 +00:00
wiz
d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
soren
12e7c81811 As pointed out by Dave Huang, revert back to using 273.15 rather than 273.16
when converting between kelvin and celsius.
2004-02-02 10:36:19 +00:00
soren
e8492b62f8 Log message from FreeBSD:
When creating a package element via "Store(0xXXX, Index(ArgX, 0xXXX))",
  be sure to increment the refcount of the argument so it is not
  prematurely deleted.  This is a workaround and may appear in a different
  form in ACPI-CA.  This fixes battery evaluation on Thinkpads that was
  broken by fixing the Dell battery state.

  Submitted by:   Luming Yu <luming.yu at intel.com>
2004-02-02 08:00:56 +00:00
soren
0a0ed6029c Within the scope of the ACPI spec, K = C + 273.2; correct for it. 2004-02-02 07:58:11 +00:00
jdolecek
5ecaa7ecee add dependency on isadma for atppc attachments
add atppc_isadma.c for atppc@isapnp and atppc@ofisa, too
2004-01-31 13:59:20 +00:00
jdolecek
fea475b595 add ACPI atppc(4) attachment; probes properly, DMA and actual transfer
not tested yet
2004-01-25 11:46:49 +00:00
gendalia
710460b874 Apply http://bugme.osdl.org/attachment.cgi?id=1777&action=view from
http://bugme.osdl.org/show_bug.cgi?id=1766

makes acpi work on my Dell Latitude D600, and should fix PR i386/23868.

Approved by gimpy, thanks to soren for finding it.
2004-01-04 22:03:34 +00:00
kochi
392db58804 correct handling of _SI.SST method as it is described in ACPI spec. 2003-12-21 10:27:23 +00:00
kochi
503ef186e1 Make ACPI interpreter a bit permissive:
* emulate ReturnOp where expected but not existing
     (which is found in some buggy firmwares)
from FreeBSD's local changes
2003-12-21 07:53:57 +00:00
kochi
2bd0af644b Give up unresponding hardware when entering sleep state.
from FreeBSD's local changes.
2003-12-21 07:51:18 +00:00
kochi
d4eea31ad8 Make ACPI interpreter a bit permissive:
* allow access beyond limit of a region
     (which is found in some buggy firmwares)
from FreeBSD's local changes
2003-12-21 07:50:26 +00:00
jmc
43bf89bfc6 Fixes from PR#23177. Various lint/logic fixes:
Fix some non-initialized variables
close the output files when done
Redo the printing for RCS strings so they don't expand in the awk script too
Do proper tests for variables existance before accessing

Verified output from all scripts is identical to original versions
2003-12-15 07:32:20 +00:00
kochi
c2adc9e9b9 Merge ACPI-CA 20031203 2003-12-13 18:10:59 +00:00
jmc
867ec2f3a6 Just use the default field separator 2003-12-12 06:51:47 +00:00
jmc
fde398f9ce Regen (picks up PNP8389 after devlist2h.awk changes 2003-12-12 06:51:36 +00:00
jmc
6125716f79 Fix from PR#23177. Pass lint and while here use a regular field separator
and shift off the first entry to get the description. This fixes one that
was getting missed and prevents future errors
2003-12-12 06:50:54 +00:00
christos
165834b297 make this compile again. 2003-12-11 17:46:23 +00:00
keihan
b8702f530b netbsd.org -> NetBSD.org
This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean".  Thanks for the patiance, and sorry for all the commits.
2003-12-04 13:57:30 +00:00
kochi
26cac303c7 Remove unused file. 2003-11-26 16:06:12 +00:00
kochi
9e86672dce convert tab -> space (pointed out by Kanaoka-san) 2003-11-20 16:15:59 +00:00
kochi
e712db964a fix for ThinkPad 'large reference count' problem.
from shaohua.li at intel.com
2003-11-20 15:42:16 +00:00
yamt
9a34eb3d5a - fix deadlocks due to using lock_status() from interrupt context.
- process pending queries in EcUnlock() to close a race window.
  now there's no need to do polling for EcQuery().
- reorder inline functions and other prototypes so that
  the formers can get needed prototypes.
- add missing prototypes.
2003-11-12 13:59:23 +00:00
yamt
5980449814 use snprintf("%X") instead of "%x" + strupr(). 2003-11-12 13:18:24 +00:00
kochi
ca17019a08 * Preserve original $Revision$
* add __KERNEL_RCSID
2003-11-09 11:50:59 +00:00
mycroft
64bd03aa66 Remove acpiec locking from the list. 2003-11-03 20:16:46 +00:00
mycroft
823720b33d Rework slightly so we use acpi_match_hid() in pckbc_acpi_attach() too. 2003-11-03 19:11:41 +00:00
mycroft
3ee522bd34 Match all PNP03?? IDs.
Also match more PNP0F?? IDs (e.g. the one the HP OmniBook reports).  There's
also no need to check IBM3780 any more, as the IBM and Acer machines which
returned it also return a CID of PNP0F13.
2003-11-03 19:04:56 +00:00
mycroft
cec77f23d6 Match all PNP04?? IDs. 2003-11-03 19:03:54 +00:00
mycroft
c992c0b1e9 Match all PNP07?? IDs. 2003-11-03 19:03:40 +00:00
mycroft
8a8efa0ccf Use pmatch() so that we can use patterns. 2003-11-03 18:51:31 +00:00
mycroft
d4f7d52915 Add a SMC ID. 2003-11-03 18:25:56 +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
mycroft
72ae89b69a Fix locking protocol, and use _GLK appropriately. From kochi, with some
modifications.
2003-11-03 17:23:38 +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
21978e6e0a Add another item, and some comments on particular machines affected. 2003-11-03 05:41:06 +00:00
mycroft
d94e36f311 Add another one. 2003-11-02 19:42:03 +00:00
matt
0c6f824d5a Fix LP64 bug. 2003-11-02 18:29:46 +00:00
jdolecek
076f4674a8 acpi_res_parse_ioport(): if the added entry is next to a previous I/O port
entry, just expand the previous entry instead of adding separate mapping

apparently some BIOSes make separate I/O port entries like this, and
some drivers then fail to attach; this change fixes mappings like

	fdc0: io 0x3f2-0x3f3,0x3f4-0x3f5,0x3f7 irq 6 drq 2

to

	fdc0: io 0x3f2-0x3f5,0x3f7 irq 6 drq 2

change tested by Bernd Ernesti
2003-11-02 11:12:53 +00:00
mycroft
e45065a344 Dropped a word... 2003-11-01 23:22:54 +00:00
mycroft
c4330d824f A small list of things needed here. 2003-11-01 23:22:21 +00:00
mycroft
4b29327094 Don't bothering reinitializing the sensor name strings when the battery info
is updated.  Do print out the battery manufacturer info, though.  (It's too
bad we can't return this through envsys........)
2003-11-01 22:55:53 +00:00
mycroft
31806f9f22 One more spot for a structure change. 2003-11-01 20:58:33 +00:00
yamt
64f5a4d263 make this compilable again with ACPI_DEBUG. 2003-11-01 19:24:42 +00:00
mycroft
efe8779bb3 Provide percentages for the threshold values too. 2003-11-01 10:55:12 +00:00
mycroft
7be875cdd8 Whoops, made a typo there. 2003-11-01 10:25:35 +00:00
mycroft
cf1951c350 Split "load" into "charge rate" and "discharge rate", depending on the state
of the battery.
2003-11-01 10:24:17 +00:00
mycroft
5c001506f5 Small change to use the "last full capacity" as the capacity maximum. 2003-11-01 09:49:45 +00:00
mycroft
007e2cd3b4 There's no need to clear the data_s fields now that the VALID bits are correct. 2003-11-01 09:41:25 +00:00
mycroft
be8e41d93a sc_lockhandle is garbage. 2003-11-01 08:34:54 +00:00
mycroft
10e36668fc Remove an unnecessary call to AcpiGlearGpe(). 2003-11-01 08:27:37 +00:00
mycroft
b596969039 Correct arguments to AcpiClearGpe(). 2003-11-01 08:14:39 +00:00
mycroft
ff9f7d764c Do not install address handlers before calling AcpiEnableSubsystem() -- this
is done by AcpiInitializeObjects() anyway.
2003-11-01 08:03:24 +00:00
mycroft
6831bfd482 Remove some unused #defines. 2003-11-01 03:45:58 +00:00
mycroft
8dc2532a4f Update copyright. 2003-11-01 03:45:48 +00:00
mycroft
63bc27bf55 Correct arguments to AcpiInstallGpeHandler, as per Linux and FreeBSD. 2003-11-01 01:38:25 +00:00
mycroft
8632b558b7 Move a declaration. 2003-11-01 01:03:23 +00:00
mycroft
0ec2bd2926 Whoops, forgot the /10 in the default case. 2003-10-31 21:52:11 +00:00
mycroft
3c3855c148 Print out the polling interval, and display a less confusing message if _TZP
is not defined.
2003-10-31 21:44:50 +00:00
mycroft
fbd3c995b1 Remove an outdated comment. 2003-10-31 21:39:51 +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
mycroft
3970401fd9 Add a file. 2003-10-31 20:52:47 +00:00
mycroft
ded1804c79 Catch up with changes to the AcpiOs*() interfaces. 2003-10-31 20:52:30 +00:00
mycroft
6c29cf39bb Merge acpica-unix-20031029. 2003-10-31 20:51:07 +00:00
mycroft
0314a111c1 Import latest ACPI-CA. 2003-10-31 20:47:38 +00:00
mycroft
31273d1288 We were passing flags to AcpiEnableSubsystem() that aren't even used there.
Call AcpiInitializeObjects() to create global variables and run _INI methods.
2003-10-31 17:22:28 +00:00
mycroft
f0b481ee05 Swap the order of buffer initialization and _STA/_INI execution. _INI methods
sometimes want to store data in global buffers (e.g. on the Inspiron 8500, to
remember initial battery status).
2003-10-31 17:21:01 +00:00
mycroft
68a1d153b6 Use ratecheck() to prevent envstat(1) doing many ACPI calls at once. Now my
MP3 player doesn't skip...
2003-10-30 22:12:02 +00:00
mycroft
95dfd3bd55 Use AcpiEvulateObjectTyped() to simplify some code. 2003-10-30 20:29:54 +00:00
mycroft
9e419e7a10 Check to see if we have valid status info before looking at it. 2003-10-30 19:33:24 +00:00
mycroft
208fa12050 Remove another extra AcpiGetObjectInfo(). 2003-10-30 18:15:35 +00:00
mycroft
97fa5fbf36 Minor tweaks:
* Only fetch the object info a second time if we activated the device.
* Do not attempt to activate a device with no HID.
2003-10-30 18:13:38 +00:00
mycroft
3dc763c88b Patches from Christos to fix double-frees and error handling. 2003-10-30 17:46:08 +00:00
simonb
b6abb6ab1d Remove some assigned-to but otherwise unused variables. 2003-10-30 01:58:17 +00:00
christos
50459b4529 Fix uninitialized variable warnings. 2003-10-27 06:15:52 +00:00
christos
7e494b3ce8 Add a Quirk for my Appro, where it does not find all its busses in ACPI 2003-10-02 16:05:33 +00:00
christos
7da4d27c12 imake this compile again. 2003-09-25 21:55:49 +00:00
mycroft
864b96269c Modify the fdcattach() interface again, splitting it into two parts, so that
DRQ allocation is done earlier.
2003-09-25 19:06:19 +00:00
mycroft
3d7395ab71 Update for new attach method. 2003-09-25 01:12:43 +00:00
gson
144519b826 The unit displayed when printing battery capacities and
charge/discharge rates was incorrect - the value printed is actually
in A, W, Ah, or Wh, not in mA, mW, mAh, or mWh (assuming as we must
that the period is interpreted as a decimal point, not a thousands
separator).
2003-08-31 01:36:12 +00:00
kochi
42ade8383d check return value of AcpiEnterSleepStatePrep() to catch
any failure
2003-08-17 03:45:19 +00:00
kochi
e7df232658 'struct acpi_resources' will have references to malloc'ed memory.
So it's better to not to allocate on stack.
2003-08-15 17:22:23 +00:00
kochi
77db8900ab Correct calculation of timeout. 2003-08-15 17:07:04 +00:00
kochi
645984364d Workaround for AcpiOsGetThreadId: can be called with curlwp == NULL 2003-08-03 08:19:58 +00:00
kochi
28e9389fdb Fix a wrong handling of clearing a flag 2003-08-03 08:16:07 +00:00
christos
ec3e43edf4 appease gcc-3 by adding ULL to constants that do not fit in longs 2003-08-03 03:49:29 +00:00
lukem
365cbd9428 add missing __KERNEL_RCSID() 2003-07-14 15:47:00 +00:00
kochi
61634e9a74 Don't compile db*.c & dm*.c unless ACPI_DEBUG and DDB are specified 2003-07-08 15:34:32 +00:00
itojun
a706d499a1 function prototype must not have variable name 2003-07-08 09:07:15 +00:00
kochi
473dc8a475 make bootup messages prettier 2003-07-06 05:24:18 +00:00
kochi
9ab543513d o cleanup usage of ACPI_ACTIVATE_DEV/ACPI_PCI_FIXUP
o delete usage of ENABLE_DEBUGGER

As ACPI_ACTIVATE_DEV/ACPI_PCI_FIXUP are defflag'ed in files.acpi,
these options don't have to have a value.
2003-07-06 04:03:21 +00:00
kochi
03c72d8b24 Fix typo. 2003-07-06 03:50:07 +00:00
kochi
3c3271accf Cleanup usage of ENABLE_DEBUGGER/ACPI_DEBUGGER/DDB.
By this change, ACPI debugger/disassembler are only
compiled when both DDB and ACPI_DEBUG options are
specified.  This change also reduces the kernel size
a little when ACPI_DEBUG is not specified.
2003-07-03 14:37:34 +00:00
kochi
7a37dbe54d cleanup usage of ACPI_ALLOCATE_BUFFER/AcpiOsFree combination 2003-07-02 12:23:25 +00:00
kochi
735150f269 print ACPI CA version 2003-07-02 11:54:43 +00:00
kochi
68dae3c110 Implement AcpiOsDerivePciId 2003-07-02 11:45:08 +00:00
kochi
862f80594c Bugfix from FreeBSD tree:
>Fix a bug in register access.  This should fix warning messages of:
>  ACPI-0340: *** Error: Could not release ACPI Global Lock, AE_BAD_PARAMETER

Thanks for jhb@freebsd to find out this problem.
2003-07-01 17:49:57 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
drochner
1a03e79900 don't #include <sys/dkstat.h> where it is (appearently) unused 2003-06-18 08:58:34 +00:00
gson
f60f21cf0b The remaining capacity percentage was incorrect for batteries larger than
21.47 Wh becaue of integer overflow.
2003-05-29 02:47:49 +00:00
kochi
0cb6714769 Backport a bugfix from the latest ACPI CA.
This will fix false AE_NOT_FOUND messages, reported in
port-i386/20897.
2003-05-25 10:08:24 +00:00
kochi
0d6c5a668c * make use of NetBSD ACPI APIs (acpi_eval_{struct,integer})
* minor cleanups
2003-05-22 15:35:51 +00:00
christos
a2f80a1464 size_t != unsigned int all the time. 2003-05-21 17:23:55 +00:00
fvdl
c0b6986667 Add quirk handling to ACPI. First quirk entry is "PTLTD " rev 0x06040000,
which gives problems with PCI bus finding; the object hierarchy doesn't
match the real world for some systems, most notably SuperMicro boards.
Linux has this one blacklisted as well.
2003-05-15 21:29:49 +00:00
kochi
bf026fa41a Fix a reference count problem that may cause unexpected memory free etc.
This is a backport of the latest ACPI CA that has a fix for this.
2003-05-13 13:29:00 +00:00