Commit Graph

626 Commits

Author SHA1 Message Date
joerg 892f4bbba1 sprintf -> snprintf 2009-04-08 12:39:27 +00:00
dyoung 222f7adf37 Refactor slightly to create acpi_rescan(), a hook for rescanning the
devices that attach at acpi(4).

Begin deriving an acpi(4) device-detachment hook, acpi_detach(), from
acpi_attach().  The code between #if 0 and #endif still needs to be
turned to the opposite calls (enables to disables, maps to unmaps,
attaches to detaches), which should be run in the opposite order.
Somebody with deep ACPI knowledge can probably finish this off without
too much trouble.
2009-04-08 00:23:30 +00:00
dyoung 5b0576e7eb Add acpitimer_detach() to eventually support acpi(4) detachment. 2009-04-08 00:15:45 +00:00
dyoung 1fb1e79dd5 During shutdown, detach attimer at acpi. 2009-04-07 17:59:18 +00:00
drochner 0785c6f16e avoid tsleep also during shutdown (and in particular ACPI poweroff),
should fix PR kern/39141 by Takahiro Kambe and PR port-i386/41110
by Reinoud Zandijk
2009-03-31 17:17:47 +00:00
cegger f7d20361b0 ansify function definitions 2009-03-15 15:40:33 +00:00
dsl 454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
jmcneill 8cf7d77c2c Don't assume ACPI == x86, from kiyohara@kk.iij4u.or.jp 2009-03-14 13:56:41 +00:00
jmcneill 74dd0aeee0 Change a confusing attach message; if the embedded controller was attached
via ECDT, we would print:
  acpiec0 at acpi0 (EC, PHP0C09-0): ACPI Embedded Controller (disabled)
The embedded controller isn't actually disabled, but instead this driver
instance, so change the message to read:
  acpiec0 at acpi0 (EC, PHP0C09-0): using acpiecdt0
2009-02-28 19:40:23 +00:00
jmcneill c315121ad0 Cut the amount of spam from acpi devices in roughly half by printing
resources on the same line as autoconf messages. Things like:
  pcppi1 at acpi0 (SPKR, PNP0800)
  pcppi1: io 0x61
become:
  pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
2009-02-17 12:46:01 +00:00
jmcneill 3c220ee07d Use aprint_debug 2009-02-17 12:30:31 +00:00
jmcneill 0cc9fff237 PR# kern/38817: regression in acpi sleep on lifebook S6510
Switch to polling mode after the acpi(4) device has been suspended as
interrupts will be disabled later on and we may still need to execute
AML that tries to sleep or wait on a semaphore.
2009-01-30 12:51:03 +00:00
christos d2ebfa6451 PR/40471: Pierre Pronchery: ASUS CUR-DLS board found on HP NetServer E800 box
has broken ACPI BIOS. Disable it.
2009-01-25 02:26:30 +00:00
jnemeth 45ff970e0f add a comment explaining how to regenerate acpidevs_data.h 2009-01-21 14:15:43 +00:00
yamt b1fea83762 remove extra semicolons. 2009-01-03 03:43:21 +00:00
mlelstv 1f5b658b8a Handle printing of _STR attribute with non-string data type gracefully. 2008-12-07 10:53:57 +00:00
joerg a5be52d405 On resum-from-RAM explicitly restore PCI link device state before
reenabling interrupts. At least one BIOS doesn't do this automatically
as reported by Christoph Egger.
2008-11-17 23:29:49 +00:00
pgoyette 7355d18b97 Leave the task of displaying sensor states to envsys_sysmon() unless we
are in debug mode.
2008-11-09 13:54:06 +00:00
pgoyette 18913ef363 Temp sensor should report a critical-overtemp condition (ENVSYS_SCRITOVER)
not a simple critical (ENVSYS_SCRITICAL) condition.
2008-11-09 03:36:04 +00:00
hans f8681c958c Initialize sc->sc_dev before using it, and use it as argument for the
interrupt handler. Makes this work again. OK by christos.
2008-11-01 20:31:26 +00:00
hans f86fa4502c Make the driver work (except for setting display brightness) on older
machines by removing the check for the CMOS method from thinkpad_match.
OK by jmcneill.
2008-11-01 19:22:25 +00:00
apb 96230fab84 Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
2008-10-19 22:05:19 +00:00
jmcneill e38f75f075 Add fan sensor support, from Thomas E. Spanjaard 2008-10-18 16:35:40 +00:00
jmcneill c175112638 Remember previous display brightness across suspend/resume; now we don't
need X to restore the display for us.
2008-09-21 21:15:28 +00:00
jmcneill 13e32ea2ea Revert previous. 2008-09-19 11:15:50 +00:00
pgoyette d17c220979 Add another touchpad device - this one found in my Acer2413WLCi laptop.
Tested by me.
OK garbled@
2008-09-16 11:24:55 +00:00
jmcneill b1cb1c6dcb PR# 38683 - T61 cannot suspend with recent kernels
Don't restore spl until after AcpiLeaveSleepState.
2008-09-10 03:56:12 +00:00
jmcneill 25b0c73dd3 Clarify some printfs in error cases so we at least know what subsystem
reported them.
2008-07-28 12:20:35 +00:00
dyoung 2e4b9b5581 Make acpilid(4) detachable. 2008-07-15 16:19:37 +00:00
dyoung 03df89373a Introduce acpi_clear_wake_gpe() to undo acpi_set_wake_gpe().
Extract common code from acpi_clear_wake_gpe() and acpi_set_wake_gpe(),
creating acpi_wake_gpe_helper().
2008-07-15 16:15:28 +00:00
cegger 17dbee905c use device_lookup_private to get softc 2008-06-12 21:46:21 +00:00
jmcneill 976a12aad4 Fix a mis-tabbed brace, no functional change. 2008-06-04 21:37:03 +00:00
joerg bd8a810c44 Before 1.46, the EC driver would try to send a command again to the EC
after a timeout. This was removed, but the loops remained, so fix them
up as well.
2008-06-03 15:12:39 +00:00
jmcneill fc993c6a36 Reintroduce acpibat_refresh, only have it refresh battery status (not info,
we will get notified for changes there). Use SME_POLL_ONLY so applications
that use GTREDATA don't cause trouble, and don't use SME_INIT_REFRESH as it
appears to be completely broken.
2008-06-03 15:02:31 +00:00
jmcneill edd4ea5b7d Refresh battery info/status on resume. 2008-06-03 12:16:34 +00:00
jmcneill daaa85a781 Simplify SME usage within acpibat:
* No need for sme_refresh callback; GPE handler will tell us when the
    device status changed (otherwise we can refresh data up to once a second,
    and that can take time!)
  * Since sme_refresh callback is gone, mutex is no longer required to
    synchronize GPE handlers and refresh thread, so nuke it.
  * Don't do any more work in GPE handler than required; use AcpiOsExecute
    to clear battery status/information in the sysmon_task_queue along with
    the refresh.

With these changes running GNOME's battstat-applet-2 no longer causes
my mouse to stutter once a second, and significantly reduces its CPU usage.
2008-06-03 01:11:18 +00:00
jmcneill 7eba414472 Don't reload usageid on resume, this should never change. 2008-06-01 23:35:18 +00:00
joerg 42fe28f522 Fix compilation with ACPI_EXTRA_DEBUG. 2008-06-01 19:01:57 +00:00
jmcneill 9f877bc707 Don't use cv_timedwait_sig if (cold) 2008-05-31 21:38:02 +00:00
jmcneill 70b1702726 Remove powerhook_establish calls; this functionality has been broken since
4.99.42 and nobody has complained. Newer systems with ioapic shouldn't
need this, and older non-ioapic systems should properly restore PCI IRQ
routing within their PCI-ISA bridge drivers.
2008-05-31 15:31:05 +00:00
jmcneill ce25e3c5e1 lpt(4): register NULL pmf handler. 2008-05-31 14:07:03 +00:00
jmcneill 10f75496ad MI implementation of AcpiAcquireGlobalLock and AcpiReleaseGlobalLock. 2008-05-24 22:16:20 +00:00
cegger 256cdaf669 correct wrong comment: envsys(4) wants uK 2008-05-20 14:46:31 +00:00
cegger 33e33b567c acpidalb(4): Driver for PNP0C32 Hotkeys aka "Direct Application Launch Buttons".
"awesome" jmcneill
2008-05-18 22:05:59 +00:00
jmcneill 86acf021ce For device nodes that we handle internally, do not bother calling
config_found_ia on the node to save a bunch of useless 'device NNN
not configured' messages at startup. While here, condense ACPI printfs
at attach time.
2008-05-17 15:42:25 +00:00
jmcneill 05f909b7fa Fix memory leak on attach/resume. 2008-05-14 12:15:47 +00:00
ad bf21e0a741 Noisy printf. 2008-05-11 22:16:45 +00:00
jmcneill 729313d52c Use 2-clause license. 2008-05-05 00:12:49 +00:00
jmcneill 35033371fe Use M_ZERO instead of malloc+memset 2008-05-03 16:14:40 +00:00
simonb 96093a0d4f Sprinkle a teeny bit of KNF goodness.. 2008-05-02 01:53:33 +00:00