Commit Graph

665 Commits

Author SHA1 Message Date
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
cegger
d9b775927c hpqlb(4): driver for HP Quick Launch buttons - found on HP Pavilion Notebooks 2008-05-01 20:18:18 +00:00
simonb
c3325defad Be consistent with #define<space-or-tab>. 2008-05-01 16:06:41 +00:00
martin
11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
jmcneill
da01aef3c1 Use isareg constants in thinkpad_brightness_read where possible 2008-04-26 01:19:15 +00:00
jmcneill
dd8d5fe840 Define ACPI_THREAD_ID as uintptr_t, and return curlwp instead of
curlwp->l_lid from AcpiOsGetThreadId(), as suggested by ad@
2008-04-24 21:42:05 +00:00
jmcneill
50629393a5 s/struct cfdata */cfdata_t/ 2008-04-23 11:19:09 +00:00
jmcneill
fd495c5ce3 AcpiOsGetThreadId should return lwpid, not pid -- otherwise we always return
the same value! Fixes the AE_AML_MUTEX_NOT_ACQUIRED issue when evaluating
_BST on ASUS Eee PC. Who knows what other mysterious bugs this has caused
over the years...
2008-04-22 02:02:50 +00:00
xtraeme
a7315e0fc1 Misc cleanups from Geoff Wing. 2008-04-21 14:25:48 +00:00
jmcneill
865860bc30 Improve error reporting when we fail to enter a sleep state, eg:
acpi0: entering state 1
  acpi0: ACPI S1 not available on this platform
2008-04-20 16:26:36 +00:00
xtraeme
2930df439c Make this work again, now that ACPI_TYPE_ANY returns NULL objects
after recent ACPICA update.

Applied patch from Geoff Wing on current-users@.
2008-04-17 19:57:27 +00:00
cegger
376411d2dd device_t / softc split. From Hans Rosenfeld. 2008-04-16 09:39:01 +00:00
cegger
b849cd90e5 device_t / softc split. From Hans Rosenfeld 2008-04-15 15:02:28 +00:00
jmcneill
76fcb78d00 Compatibility with ACPICA 20080321; from the release notes:
All Reference Objects returned via the AcpiEvaluateObject interface are now
marked as type "REFERENCE" instead of "ANY". The type ANY is now reserved for
NULL objects - either NULL package elements or unresolved named references.
2008-04-14 00:30:30 +00:00
jmcneill
75aae009fe Cosmetic aprintification fix, as noted by Thomas Klausner on current-users 2008-04-07 10:16:59 +00:00
cegger
335ec2beb5 use aprint_*_dev and device_xname 2008-04-05 21:44:50 +00:00
xtraeme
bc77ebea72 Remove useless returns at the end of void functions. 2008-03-31 15:28:47 +00:00
jmcneill
4fab67daa7 Add ASUS ACPI hotkey driver, as found in the Eee PC. 2008-03-31 15:17:21 +00:00
jmcneill
2529ffb3cf Fix printf in ACPI_DEBUG case, pointed out by mlelstv@ 2008-03-29 13:33:12 +00:00
xtraeme
0ab2da71ce Split device_t/softc for mpu(4) and its attachments, plus other
related cosmetic changes.

Reviewed by cube@.
2008-03-27 10:22:00 +00:00
jmcneill
fcb7a4511a Split device_t and softc 2008-03-27 02:51:26 +00:00
xtraeme
71c3052b91 Split device_t/softc and related cosmetic changes. 2008-03-26 18:35:17 +00:00
xtraeme
701c2ae0a3 Split device_t/softc for joy(4) and all its attachments. Also
use device_lookup_private() and related cosmetic changes.

Reviewed by cube@.
2008-03-26 18:27:07 +00:00
xtraeme
678337ef71 acpitz_get_zone expects now a device_t not a softc. 2008-03-26 16:48:53 +00:00
xtraeme
8bea7f6b6e Split device_t/softc for ug(4) and other related cosmetic changes. 2008-03-26 16:09:37 +00:00
xtraeme
2be2546b16 Split device_t/softc and related cosmetic changes. 2008-03-26 15:31:59 +00:00
xtraeme
6405ed23e5 acpiacad_get_status: move sc_notifysent to the correct place, otherwise
the notify might not be sent.
2008-03-23 18:38:57 +00:00
xtraeme
a7e669727a Register a resume pmf(9) handler that clears the status. It is needed
to always fetch new status after resuming, otherwise if AACAD_F_AVAILABLE
is set, acpiacad_get_status() won't be called.

Also use the SME_INIT_REFRESH flag to fetch sensor data once in the
autoconf(9) process.

Ok'ed by <jmcneill>.
2008-03-23 16:22:00 +00:00
xtraeme
6e9673dcb2 Use the SME_INIT_REFRESH flag to fetch sensor data once in the
autoconf(9) process.
2008-03-23 16:12:45 +00:00
xtraeme
5a14ef4138 Add missing acpilid_wake_event() proto. 2008-03-23 14:20:15 +00:00
xtraeme
c280868dfa Split device_t/softc for all hpet consumers. 2008-03-21 13:28:14 +00:00
cube
fa7e4a28ef Don't assume a struct device is embedded in the softc. 2008-03-16 15:22:05 +00:00
yamt
d28c692afa fix compilation 2008-03-16 13:58:22 +00:00
cube
bb192d4cfd Split device_t and softc for the ... wait for it ... [air quotes] MI
variant of fdc(4)/fd(4).  Other cosmetic changes as appropriate.
2008-03-16 00:58:56 +00:00
cube
a22d8d4abb Split device_t and softc for pckbc(4) and its attachments. 2008-03-15 13:23:24 +00:00
cube
607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
dyoung
3df2b2feb5 Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.

        Add a 'flags' argument to suspend/resume handlers and
        callers such as pmf_system_suspend().

        Define a flag, PMF_F_SELF, which indicates to PMF that a
        device is suspending/resuming itself.  Add helper routines,
        pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
        that call pmf_device_suspend(dev, PMF_F_SELF) and
        pmf_device_resume(dev, PMF_F_SELF), respectively.  Use
        PMF_F_SELF to suspend/resume self in ath(4), audio(4),
        rtw(4), and sip(4).

        In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
        callbacks, provided by the bus front-end, with
        self-suspension/resumption.  Also, clean up the bus
        front-ends.  Make sure that the interrupt handler is
        disestablished during suspension.  Get rid of driver-private
        flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
        device_is_active()/device_has_power() calls, instead.

        In the network-class suspend handler, call if_stop(, 0)
        instead of if_stop(, 1), because the latter is superfluous
        (bus- and driver-suspension hooks will 'disable' the NIC),
        and it may cause recursion.

        In the network-class resume handler, prevent infinite
        recursion through if_init() by getting out early if we are
        self-suspending (PMF_F_SELF).

rtw(4) improvements:

        Destroy rtw(4) callouts when we detach it.  Make rtw at
        pci detachable.  Print some more information with the "rx
        frame too long" warning.

Remove activate() methods:

        Get rid of rtw_activate() and ath_activate().  The device
        activate() methods are not good for much these days.

Make ath at cardbus resume with crypto functions intact:

        Introduce a boolean device property, "pmf-powerdown".  If
        pmf-powerdown is present and false, it indicates that a
        bus back-end should not remove power from a device.

        Honor this property in cardbus_child_suspend().

        Set this property to 'false' in ath_attach(), since removing
        power from an ath at cardbus seems to lobotomize the WPA
        crypto engine.  XXX Should the pmf-powerdown property
        propagate toward the root of the device tree?

Miscellaneous ath(4) changes:

        Warn if ath(4) tries to write crypto keys to suspended
        hardware.

        Reduce differences between FreeBSD and NetBSD in ath(4)
        multicast filter setup.

        Make ath_printrxbuf() print an rx descriptor's status &
        key index, to help debug crypto errors.

        Shorten a staircase in ath_ioctl().  Don't check for
        ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 18:02:21 +00:00
dyoung
73e95caf73 Use device_t and accessors. Use aprint_*_dev().
Add a method for detaching children.  XXX acpi(4) may leak some
resources for each child detached.  Needs attention from someone
who understands acpi(4).
2008-03-10 20:58:38 +00:00
jmcneill
80e26751e9 shutdownhook_establish is deprecated, but instead of converting to pmf,
just delete it as acpi_shutdown was empty.
2008-03-09 19:09:00 +00:00
cube
3c5e53b4e2 Split device_t/softc for i386's apm(4), and other related cosmetic changes. 2008-03-07 21:45:07 +00:00
cube
8ecf8999bf Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
2008-03-07 17:15:51 +00:00
cube
926915cf40 - Split device_t and softc for pcppi(4) and attimer(4)
- Change the attimer <-> pcppi communication using device_t so that
  pcppi(4) doesn't have to know about the contents of struct attimer_softc.

XXX pcppi's childdet function is completely wrong.  This has to be
XXX revisited later.
2008-03-04 16:35:18 +00:00
dyoung
e4f3892584 Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine.  Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev().  Use PMF_FN_ARGS, PMF_FN_PROTO.
2008-02-29 07:02:04 +00:00
dyoung
61ad1dd43b Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:35:40 +00:00
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