Commit Graph

532 Commits

Author SHA1 Message Date
dyoung 36f58dc899 Use aprint_*_dev(), device_t and accessors. Constify a bit. 2008-02-18 06:19:50 +00:00
jmcneill 95fc3f2649 Add hw.acpi.supported_states sysctl node:
$ sysctl hw.acpi.supported_states
  hw.acpi.supported_states = S0 S3 S4 S5
2008-02-13 15:27:55 +00:00
xtraeme 74a0270856 aiboost_getcomp: use Package.Count to allocate and iterate over
the elements rather than Integer.Value, which sometimes doesn't
match and gives unexpected results on the error path.

This fixes the kmem_poison_check on DEBUG kernels (finally). Patch
by Fukumoto Atsushi. Thanks!
2008-02-01 23:12:30 +00:00
xtraeme d187549ef6 Pass the same size to kmem_alloc(9) and kmem_free(9), this fixes
the kmem_poison_check panic on DEBUG kernels.
2008-01-29 19:35:05 +00:00
jmcneill b7cf8d358c The Thinkpad T61/x61 family powers off the USB power resource on resume
from S3 sleep. Until we get proper ACPI power resource support, simply
call \\_SB.PCI0.LPC.EC.PUBS._ON() on resume if the method exists.

Fixes kern/37279 by Steven M Bellovin.
2008-01-28 20:31:55 +00:00
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
jmcneill 8761d09319 Don't be so aggressive in polling the EC when cold, port-i386/37790. 2008-01-18 01:03:24 +00:00
jmcneill 91a074d893 If we are in polling mode, do not try to spin forever in the state machine
waiting for a read or write to complete. Workaround an issue on my VAIO,
but we really need to figure out why it is failing in the first place.
2008-01-18 00:33:54 +00:00
dyoung 636e434283 Support pcppi(4) detachment.
Use device_t, device_private().  Get rid of a struct device * cast.
2008-01-10 07:58:39 +00:00
xtraeme 53fd152fd5 Remove useless returns at the end of void functions. 2008-01-09 14:52:52 +00:00
tnn 303f9ebb5b Make the ACPI_MADT_DEBUG code compile again. 2008-01-07 06:04:07 +00:00
christos d1b79165fa clamp min/max values properly. 2008-01-06 19:42:03 +00:00
ad 0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
dyoung 09fd56f9ec Detach attimer at acpi, attimer at isa. 2008-01-03 01:21:44 +00:00
dyoung 95bf02050e Use device_t, device_private(). 2008-01-02 20:47:28 +00:00
jmcneill 13f097963d Always enable the Fn key quirk if a device node for the Sony Programmable
Interrupt Controller (SNY6001) is not present.
2007-12-23 18:03:02 +00:00
jmcneill 9f7f6d9be0 Move Sony Notebook Controller (sony(4)) driver from MD to MI directory,
as it can be used on amd64 as well.
2007-12-23 17:29:26 +00:00
jmcneill 8fce0f055c Move display switching out of the kernel; deliver this (and other) events
to sysmon so a powerd script can handle them.
2007-12-22 18:38:13 +00:00
jmcneill 6fffc8ef3c Add experimental display switching support. 2007-12-22 13:06:30 +00:00
jmcneill bf34549b28 Only toggle bluetooth when the wireless button is pressed, simplifies
things and it seems I forgot that my laptop has a separate wifi switch.
2007-12-22 03:19:29 +00:00
jmcneill 4ec3c2b1cd Add support for the WLAN / Bluetooth switch. 2007-12-21 22:14:03 +00:00
xtraeme 6d771ab8b4 Register a pmf(9) power handler... ok jmcneill@. 2007-12-21 21:52:10 +00:00
jmcneill aa518c7bc8 Hook Thinkpad temperature sensors into envsys:
$ envstat -d thinkpad0
TMP0:     46.000 degC
TMP1:     39.000 degC
TMP2:     32.000 degC
TMP3:        N/A
TMP4:     50.000 degC
TMP5:        N/A
TMP6:     29.000 degC
TMP7:        N/A
2007-12-21 21:24:45 +00:00
jmcneill f5210660c0 Add acpiec_bus_{read,write} and acpiec_get_handle, for use in other
device drivers.
2007-12-21 21:22:54 +00:00
jmcneill c48902ebaf Handle notifications in a separate thread, and ensure that the BIOS doesn't
try to play trick with us when we are trying to manage the brightness
keys.
2007-12-21 18:43:39 +00:00
jmcneill ef8922785d Convert AcpiOsSleep from using tsleep to cv_timedwait_sig 2007-12-21 18:42:38 +00:00
jmcneill eedb1a1f01 Typo in previous. 2007-12-21 16:38:59 +00:00
jmcneill ea50d249d2 Handle key repeat, and only match if MHKV returns an HKEY version we have
a chance of supporting.
2007-12-21 16:38:02 +00:00
jmcneill 5b0f734d51 Add Thinkpad ACPI driver, for controlling hotkeys and display brightness. 2007-12-21 15:15:19 +00:00
joerg bc8d3e534e It seems like ACPICA can't deal with GPEs being handled before the GPE
handler is called, so clear the GPE bit in the callout as well.
This fixes the EC issues on T42 models.
2007-12-19 20:48:56 +00:00
jmcneill dd0320ef8b Fix comment before AcpiOsGetTimer, no functional change. 2007-12-17 15:02:31 +00:00
jmcneill f13c9086d0 acpi_pci_link_route_interrupt: if we're going to return a valid IRQ, we
need to fill in irq, pol, and trig arguments.
2007-12-16 23:11:08 +00:00
jmcneill a73b778622 Now that ACPI-CA doesn't parse the X/RSDT for us, we need to map it
ourselves.

Before:
  acpi0: X/RSDT: OemId <      ,        ,00000000>, AslId <    ,00000000>
After:
  acpi0: X/RSDT: OemId <LENOVO,TP-7L   ,00001260>, AslId < LTP,00000000>

ACPI can now access the X/RSDT using 'acpi_map_rsdt' and 'acpi_unmap_rsdt'.
2007-12-16 21:10:34 +00:00
joerg 36cdfbe0db Don't retry to post a command if the EC doesn't answer for a second.
It seems to create more issues than it fixes. Try to defend against
lost/late GPEs by using a callout to kick the state machine regulary.
Add some notes about the purpose and working of the driver.
2007-12-15 09:30:59 +00:00
jmcneill d72049ddbd Restore acpi_quirk functionality, lost in the latest ACPI-CA update. 2007-12-15 02:19:55 +00:00
perry 9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
jmcneill e692a6c76a Introduce pmf_system_bus_resume. In the ACPI S3 resume path, use this to
separate powering up devices from restoring their state. This is required
on some machines where AcpiLeaveSleepState can fail due to an attempt to
access a powered off device.
2007-12-14 01:29:29 +00:00
xtraeme fcad73742f Check return value of pmf_device_register(), pointed out by joerg.
Looks like the pmf(9) manpage declared it as void and not bool...
2007-12-13 15:36:29 +00:00
jmcneill 645fe8c342 Try not to pass garbage to pci_make_tag; workaround for odd ACPI DSDTs.
Fixes kern/37527.
2007-12-12 23:33:22 +00:00
jmcneill faa68cee64 Rename acpiec_gpe_state_maschine -> acpiec_gpe_state_machine 2007-12-12 12:57:48 +00:00
jmcneill c44d13d630 No longer required after jmcneill-pm merge. 2007-12-11 23:07:30 +00:00
xtraeme 0cd3ab0981 Register to the pmf(9) framework and fix an error path. 2007-12-10 23:25:59 +00:00
reinoud 3a44e8ad9d Add missing \n and remove surplus . 2007-12-10 22:56:29 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
jmcneill 0273402379 kern/37501: cosmetic error in acpi_tz probe messages 2007-12-08 23:01:30 +00:00
ad 6874e511b7 lockmgr -> mutex 2007-12-05 07:58:29 +00:00
ad 598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
jmcneill 61d5fb95a4 No need to waste more than one line of output at attach time. 2007-12-02 06:26:40 +00:00
jmcneill 4fbe23fdd0 aprintify 2007-12-01 04:50:50 +00:00
xtraeme 31962fc6e5 Extend the envsys2 API (one more time, sorry) as defined in:
http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html

sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).

sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.

The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).

Update all users and documentation to reflect these changes.
2007-11-16 08:00:11 +00:00