summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_ec.c
Commit message (Collapse)AuthorAgeFilesLines
* Add an informational debugging printf of the maximum time spent innjl2003-07-251-0/+10
| | | | | EcEventWait(). If you get AE_HARDWARE_NO_RESPONSE errors, please enable this info by setting hw.acpi.verbose=1 in loader.conf.
* Do not call acpi_MatchHid() for all probe cases since it accesses thenjl2003-07-201-8/+7
| | | | | | | | | | namespace. To compensate for it only being used in the !ECDT case, use a more robust approach to indicate a device was probed via ECDT by setting the private ivar to be &acpi_ec_devclass. Without the acpi_MatchHid() call now, it might have been possible for a non-EC device to have had its magic match our previous flag. Pointed out by: takawata
* Close a race condition by passing status retrieved via a non-SCI callnjl2003-07-201-43/+32
| | | | | | | | | | | to EcGpeQueryHandler on to any waiting threads through the softc. Similar behavior was in the original version. Also: * Merge EcQuery into EcGpeQueryHandler to simplify locking * Hold EcLock from the initial read of the CSR down to the wakeup or until after the query command has been processed. * ec_gpebit only needs to be a UINT8
* Add ECDT (ACPI 2.0) support. This allows the EC to be enabled before thenjl2003-07-201-41/+161
| | | | | | | | | | | | | | | namespace has been evaluated. Machines with ACPI 2.0 expect this behavior and have AML which calls EC functions early in the boot process. If the ECDT is not available, fall back to original probe behavior. Other minor changes: * Add GPE bit and GLK usage to the device announcement * Always use the global lock in the ECDT case, but potentially downgrade to not using it if _GLK is 0 once the namespace is available. This is announced with "Changing GLK from 1 to 0" * Remove the acpi_object_list definitions which were earlier deprecated Ideas from: takawata
* Change the msleep part of EcWaitEvent to be a separate loop, fixing anjl2003-07-151-31/+42
| | | | | | | problem that for some very slow ECs (~6 ms occasionally) causes a timeout. Also finish resource cleanup in the error case in attach. Tested by: ume
* Update code to work with 0619 distnjl2003-07-131-6/+7
| | | | | | | | * Use ACPI_BUFFER as the type for AcpiGetObjectInfo * Remove AcpiEnableEvent/AcpiClearEvent for ACPI_EVENT_FIXED (power/sleep buttons) as they are no longer needed * Change calls to use the new GPE functions * Add AcpiOs*Lock functions
* Rewrite much of the embedded controller driver.njl2003-07-101-311/+263
| | | | | | | | | | | | | | | | | | | | * Always use polled mode. The intr approach did not work for many controllers and required the hw.acpi.ec.event_driven workaround. * Only use an edge (not level) triggered GPE handler * Add sc->ec_mtx for locking operations to a single EC. There were many race conditions earlier between an SCI event and EcRead/Write. * Use 1 ms as the global lock timeout * Only acquire global lock if _GLK != 0 * Update EcWaitEvent to use an incremental backoff delay in its poll loop. Wait 50 ms max instead of 10. Most ECs respond in < 5 us (50 us when heavily loaded). However, some time out occasionally even with a 10 ms timeout. For delays past 1 ms, use msleep instead of DELAY to give SCI interrupts a chance to occur. * Add EcCommand to send a command and wait for the appropriate event. * The hw.acpi.ec.event_driven tunable is no longer applicable and has been removed. Ideas from: Linux
* Whitespace cleanups (verified with MD5 1832ce5ede6c58c844dfb53fd48f0eea).njl2003-06-271-123/+133
| | | | | Also clarify a macro expansion with an XXX. I will be fixing access to Acpi Global Lock in a subsequent commit.
* Resolve conflicts arising from the ACPI CA 20021118 import.iwasaki2002-11-271-2/+2
|
* Add new loader tunable hw.acpi.ec.event_driven so that we controliwasaki2002-10-241-1/+4
| | | | | | EcWaitEventIntr()'s behavior. Some EC controllers require this for working properly (including sleep/wakeup).
* Catch up to changes in acpivar.h to add support for using ACPI onjhb2002-10-161-2/+0
| | | | | | 4-stable systems. Sponsored by: The Weather Channel
* Make interrupt driven EC transaction optional.takawata2002-07-021-0/+2
|
* Brutally deal with __func__ being 'const char *' on gcc-3.1.peter2002-05-191-6/+6
|
* Match namespace cleanup changes in ACPI CA 20020217 update.msmith2002-02-231-38/+44
| | | | | | | | Use ACPI_SUCCESS/ACPI_FAILURE consistently. The ACPI global lock acquire takes a timeout value. I'm not sure what we should do about timeouts on it; a deadlock against this lock is catastrophic.
* Fix error handling.takawata2002-01-311-7/+19
| | | | | PR:30665 Submitted by:TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>
* Staticise devclasses and some unnecessarily global variables.msmith2002-01-081-1/+1
|
* Add OS layer ACPI mutex and threading support.iwasaki2001-12-221-1/+3
| | | | | | | | | | | | | | | | | | - Temporary fix a bug of Intel ACPI CA core code. - Add OS layer ACPI mutex support. This can be disabled by specifying option ACPI_NO_SEMAPHORES. - Add ACPI threading support. Now that we have a dedicate taskqueue for ACPI tasks and more ACPI task threads can be created by specifying option ACPI_MAX_THREADS. - Change acpi_EvaluateIntoBuffer() behavior slightly to reuse given caller's buffer unless AE_BUFFER_OVERFLOW occurs. Also CM battery's evaluations were changed to use acpi_EvaluateIntoBuffer(). - Add new utility function acpi_ConvertBufferToInteger(). - Add simple locking for CM battery and temperature updating. - Fix a minor problem on EC locking. - Make the thermal zone polling rate to be changeable. - Change minor things on AcpiOsSignal(); in ACPI_SIGNAL_FATAL case, entering Debugger is easier to investigate the problem rather than panic.
* Synch with minor changes in the ACPI CA 20011120 snapshot.msmith2001-11-281-6/+6
|
* Cleanups of verbose printing. All the messages for the debugging isiwasaki2001-11-181-15/+29
| | | | | | | disabled unless verbose flag is set. Also fix some messages in terms of English. The critical messages and error messages in probe/attach routine are unchanged by this commit.
* Update usage of AcpiEnableEvent to reflect a new argument.msmith2001-10-041-3/+3
| | | | | | | | Fix acpi_DeviceIsPresent to check for valid _STA data and to check the "present" and "functioning" bits. Use acpi_DeviceIsPresent in acpi_pcib rather than rolling our own (also broken) version.
* Don't parse our resources ourself, the ACPI core code must do it.msmith2001-08-301-6/+0
|
* Updates to match the ACPI CA 20010816 import:msmith2001-08-261-4/+4
| | | | | - New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size. - New debug level/subsystem codes.
* Convert from acpi_strerror() to AcpiFormatException()msmith2001-07-211-6/+5
| | | | Fix dangling include of the dear departed acpi_ecreg.h
* Merge the EC register definitions into the EC module proper, they're notmsmith2001-07-211-2/+71
| | | | | | used anywhere else. AcpiOsSleepUsec() -> AcpiOsStall()
* Improve some error messages slightly.msmith2001-07-051-2/+5
|
* Use msleep() when we sleep waiting for a GPE, since we are holding themsmith2001-06-291-37/+55
| | | | | | | | ACPI mutex. Add some comments to EcWaitEventIntr. Clean up deviant style, add debugging to be consistent.
* - Updates for new constant naming in the ACPI CA 20010518 update.msmith2001-05-291-22/+20
| | | | | | | | | | | - Use __func__ instead of __FUNCTION. - Support power-off to S3 or S5 (takawata) - Enable ACPI debugging earlier (with a sysinit) - Fix a deadlock in the EC code (takawata) - Improve arithmetic and reduce the risk of spurious wakeup in AcpiOsSleep. - Add AcpiOsGetThreadId. - Simplify mutex code (still disabled).
* - Use a loop to read consecutive bytes from the embedded controller tojhb2001-02-261-10/+19
| | | | | | | | handle read and write requests for widths of multiple bytes. This can be used to read 16-bit battery status registers for example. - Remove some unused variables and #if 0'd debugging cruft. - Don't complain about a GPE query that fails due to AE_NOT_FOUND if the query method was _Q00.
* Add some debugging.msmith2001-01-311-35/+17
| | | | | | | | | Use acpi_EvaluateInteger where possible. Use FuncName rather than &FuncName when passing function addresses. Don't evaluate the _REG method when we attach to an address space - AcpiInstallAddressSpaceHandler does it for us.
* Axe an unused static softc.jhb2001-01-231-2/+0
|
* Change Embedded Controller lock to ACPI Global Lock.This is needed fortakawata2001-01-021-11/+2
| | | | mutual execution between BIOS and OS.
* Change priority of procedure queueing.takawata2000-12-201-2/+2
| | | | This is needed to next ACPICA import.
* Fix with debugging option.takawata2000-12-151-2/+2
| | | | Submitted by: haro@tk.kubota.co.jp
* Make Embedded Controller driver interrupt driven.takawata2000-12-141-19/+77
|
* - Convert a lot of homebrew debugging output to use the ACPI CA debuggingmsmith2000-12-081-15/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | infrastructure. It's not perfect, but it's a lot better than what we've been using so far. The following rules apply to this: o BSD component names should be capitalised o Layer names should be taken from the non-CA set for now. We may elect to add some new BSD-specific layers later. - Make it possible to turn off selective debugging flags or layers by listing them in debug.acpi.layer or debug.acpi.level prefixed with !. - Fully implement support for avoiding nodes in the ACPI namespace. Nodes may be listed in the debug.acpi.avoid environment variable; these nodes and all their children will be ignored (although still scanned over) by ACPI functions which scan the namespace. Multiple nodes can be specified, separated by whitespace. - Implement support for selectively disabling ACPI subsystem components via the debug.acpi.disable environment variable. The following components can be disabled: o bus creation/scanning of the ACPI 'bus' o children attachment of children to the ACPI 'bus' o button the acpi_button control-method button driver o ec the acpi_ec embedded-controller driver o isa acpi replacement of PnP BIOS for ISA device discovery o lid the control-method lid switch driver o pci pci root-bus discovery o processor CPU power/speed management o thermal system temperature detection and control o timer ACPI timecounter Multiple components may be disabled by specifying their name(s) separated by whitespace. - Add support for ioctl registration. ACPI subsystem components may register ioctl handlers with the /dev/acpi generic ioctl handler, allowing us to avoid the need for a multitude of /dev/acpi* control devices, etc.
* Update to work with the new ACPI CA snapshot.msmith2000-12-011-38/+3
| | | | | | | | | | - Use ACPI_PHYSICAL_ADDRESS - RSDT -> XSDT - FACP -> FADT - No APIC table support - Don't install a global EC handler; this has bad side-effects (it invokes _REG in *all* EC spaces in the namespace!) - Check for PCI bus instances already existing before adding them
* Initial FreeBSD OSPM (operating system power management) modules formsmith2000-10-281-0/+710
ACPICA. Most of these are still works in progress. Support exists for: - Fixed feature and control method power, lid and sleep buttons. - Detection of ISA PnP devices using ACPI namespace. - Detection of PCI root busses using ACPI namespace. - CPU throttling and sleep states (incomplete) - Thermal monitoring and cooling control (incomplete) - Interface to platform embedded controllers (mostly complete) - ACPI timer (incomplete) - Simple userland control of sleep states. - Shutdown and poweroff.
OpenPOWER on IntegriCloud