summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
AgeCommit message (Collapse)Author
2020-02-20Replace field f_isfd with field f_flags in struct filterops to allowVisa Hankala
adding more filter properties without cluttering the struct. OK mpi@, anton@
2020-02-18Cleanup <sys/kthread.h> and <sys/proc.h> includes.Martin Pieuchot
Do not include <sys/kthread.h> where it is not needed and stop including <sys/proc.h> in it. ok visa@, anton@
2020-02-08On the Lenovo X395 acpivout(4) does not attach since there isPatrick Wildt
no _BQC method. But we need it to attach, since it provides the events for the brightness keys. Thus, make acpivout(4) attach enough to register the event handler, but return early so that it doesn't register itself as ws_[gs]et_param. ok kettenis@
2020-01-28Make acpivout(4) call ws_[gs]et_param instead of directlyPatrick Wildt
calling the ACPI methods. On some machines, like my X395, those ACPI methods don't allow changing the brightness, so this allows acpivout(4) to e.g. use amdgpu(4)'s code. In comparison to the previously committed and backed out version we now schedule the brightness change on the ACPI task queue so that we don't run into any recursive locking issues. Additionally the diff has been modified according to the recent commit where we make sure that a 5% brightness change does not result in the same brightness level. ok jcs@ kn@
2020-01-27Send APM_POWER_CHANGE events to userland after refreshing battery infoJeremie Courreges-Anglas
Tested by and ok jcs@
2020-01-26In amdgpio_pin_intr() disable pins a pending interrupt is seen for whichJonathan Gray
have no interrupt handler registered. Avoids interrupt storm on Matebook D reported by brynet@ From James Hastings. ok kettenis@ brynet@
2020-01-14Fix screen brightness adjustment through function keyskn
Not all machines provide levels that scale linearly, e.g. an ThinkPad X230 has 16 levels of exponential scale that end with [50, 67, 100]. Make acpivout_find_brightness() return the BCL's index instead of its value such that acpivout_brightness_step() is able to fall back to the lower next value by index in case the 5% heuristic fails. Tested by Tracey Emery with an T470s OK patrick jcs
2020-01-09Convert sleeps of 1sec or more to tsleep_nsec(9).Martin Pieuchot
ok bluhm@
2020-01-06Allow ipmi(4) to attach using mmio. Use the IPMI revision provided by theMark Kettenis
_SRV method if present. tested by sthen@ ok jmatthew@
2019-12-31Use C99 designated initializers with struct filterops. In addition,Visa Hankala
make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
2019-12-31Convert infinite sleeps to {m,t}sleep_nsec(9).Martin Pieuchot
ok kn@
2019-12-31include sys/sensors.h for sensor useJonathan Gray
don't depend on indirect inclusion from acpidev.h
2019-12-23Add amdgpio(4), a driver for the GPIO controller found on newer AMDMark Kettenis
AMD SoCs/chipsets. From James Hastings
2019-12-14Revert previous. When we get an ACPI notification we already have thePatrick Wildt
ACPI lock and when we call our own ws_[gs]et_param functions we cannot take the lock again, because it's non-recursive. Thus we need to find another way, like not taking the lock if we already have it. But the solutions need to be discussed first, so back it out in the meantime.
2019-12-13Make acpivout(4) call ws_[gs]et_param instead of directlyPatrick Wildt
calling the ACPI methods. On some machines, like my X395, those ACPI methods don't allow changing the brightness, so this allows acpivout(4) to e.g. use amdgpu(4)'s code. ok kettenis@
2019-10-21On newer ThinkPads reporting HKEY version > 1, don't claim wsconsJoshua Stein
backlight controls so that acpivout can. This allows using all of the fine-grained backlight BCL steps defined in ACPI (usually 100) instead of the dozen or so available through acpithinkpad's proprietary ACPI or CMOS interfaces. This is also needed for future amdgpu work.
2019-10-21When incrementing or decrementing screen brightness, don't justJoshua Stein
adjust by 1 BCL level as there may be 100 levels. Find the next brightness level that is at least 5% up or down and use that. ok kettenis
2019-10-16Add a few newer _OSI strings to the parser.Mike Larkin
Early in the release cycle is the right time to do this. "yes please" jcs@. ok deraadt@
2019-10-16Remove trailing whitespace from a lineMike Larkin
2019-10-13Move ws_get_param/ws_set_param into wsdisplay code.Mark Kettenis
ok deraadt@, jsg@
2019-10-12Print version number.Mark Kettenis
ok patrick@
2019-10-10Make reading past the end of an AML array not a panic.Mike Larkin
Several machines have broken AML which reads past the end the end of an array. Previously this was an aml_die/panic. acpica just warns on such accesses, so this diff makes us do the same. ok kettenis, jcs, deraadt
2019-10-10Remove trailing whitespaceMike Larkin
2019-09-07Revert acpipci(4) changes. Too many systems are broken. We'll try againMark Kettenis
after 6.6 as been released. The acpireg.h change stays behind.
2019-08-28Use ACPI information to attach PCI busses like we do on arm64. There are aMark Kettenis
few additional quirks though, and attaching the PCI busses is delayed to replicate the existing code more closely. That may be changed in the future. Also tweak how we handle MSI support and respect to ACPI flag that says we shouldn't attempt to use MSIs. Some fallout is expected. ok patrick@
2019-08-27On amd64 the bootup and resume paths for SP/BP/SP were not performingTheo de Raadt
msr/pat, clock-startup, firmware upgrade, fpu initialization, and cpu soft-state initialization in the same order. That kind of chaos is crazy and fragile. Improve the acpi resume call sequence and unify order of the operations.
2019-08-13Reorganize the ipmi(4) code a bit in anticipation of adding SSIF support:Mark Kettenis
- Put function prototypes in more logical places. - Inroduce a ipmi_attach_common() function. - Move all the SMBIOS related code to the end of the file and only compile it in on amd64 & i386. ok jmatthew@ and deraadt@
2019-08-04Add support for X-Gene/eMAG variant.Mark Kettenis
2019-08-04Implement smbios support on arm64.Mark Kettenis
ok deraadt@, jsg@
2019-07-31dwiic_acpi: handle GPIO interrupts when we have no appropriate driverJoshua Stein
Avoid printing a confusing "irq 0" message in this case.
2019-07-31aml_find_node: perform callback on matched direct-child nodes beforeJoshua Stein
recursing into child devices looking for matches. This ensures that when walking nodes with acpi_inidev, a method like \_SB_.PCI0._INI will be executed before \_SB_.PCI0.I2C1.TPL1._INI. This matches how ACPICA walks nodes and a commonly-used DSDT template assumes that \OSYS has been initialized in \_SB_.PCI0._INI before being used by other device _INI methods. This should also help to execute \_INI and \_SB_._INI first, if present, which ACPICA does explicitly. Tested in snaps, ok deraadt
2019-07-31The ACPI 3 spec says the ToHexString and ToDec(imal)StringJoshua Stein
operators can take a data argument of Integer, String, or Buffer types, not just Integer. ok kettenis, deraadt
2019-07-22Even when polling is requested, install ihidev's interrupt handlerJoshua Stein
If an interrupt is received, turn off polling and rely on interrupts. This may happen after S3 resume. Also properly shut down polling during suspend and start it up again on resume only after dwiic is back in action.
2019-07-16don't bother reading default timing parameters if they're just goingJoshua Stein
to be overridden from ACPI
2019-07-02acpi_set_gpehandler: turn edge arg into flags, add support forJoshua Stein
passing GPE_DIRECT which directly executes the supplied callback and clears a level interrupt rather than going through acpi_taskq which can be slow when other driver callbacks are in the queue. This should not be used for GPE handlers that need to do anything ACPI-related. ok kettenis
2019-06-24Add glkgpio(4), a driver for the GPIO controllers found on Intel's GeminiMark Kettenis
Lake SoC. From James Hastings.
2019-06-17Add aplgpio(4) a driver for the gpio controllers found on Intel's ApolloPatrick Wildt
Lake SoC. From James Hastings ok kettenis@
2019-06-10Print proper ACPI version number.Mark Kettenis
ok mlarkin@
2019-06-08When establishing the mapping between ACPI device nodes and PCI devices,Mark Kettenis
skip PCI host bridges and devices that aren't there. ok patrick@
2019-06-07Introduce acpi_getsta() and use it to eliminate some duplicated code.Mark Kettenis
ok patrick@
2019-05-15unrevert, i missed deraadt's commit with the proper fixTed Unangst
noticed by deraadt
2019-05-15revert previous, since it makes jmc's machine print an extra newline.Ted Unangst
several printfs here seem to have mismatched newlines?
2019-05-15if \n is added in attach, then tpm_init() should skip it.Theo de Raadt
2019-05-13print a newline for attach. from f holopTed Unangst
2019-05-12Make sure the extended PM register descriptions actually exist beforeMark Kettenis
using them. Fixes machines with ancient ACPI 1.0 (such as recent hypervisors). ok deraadt@
2019-05-12Add support for mapping ACPI PM registers using the "extended" gasioMark Kettenis
representation from the FADT. Mostly fixes the Lanner NCA-1510. ok lteo@, mlarkin@, deraadt@
2019-05-11Fix incorrect error message.Lawrence Teo
ok kettenis@
2019-05-09Measure poll interval with monotonic clock. ok jcs@cheloha
2019-05-08free size. the allocation is the header plus the length.Ted Unangst
2019-04-23Add support for ccp(4) at acpi(4).Mark Kettenis
ok deraadt@