summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
AgeCommit message (Collapse)Author
2017-07-25fallback on _BIF properly when _BIX exists and returns a packageJoshua Stein
successfully but has an unexpected length, as on the X1C gen 5 tested by naddy
2017-07-22acpibat: look for _BIX first before falling back on _BIFJoshua Stein
ACPI 4.0 deprecated _BIF for battery status so some newer machines are exporting _BIX which extends _BIF's package with a few extra fields. When using _BIX, export the new discharge cycle count as a sensor. feedback from kettenis and anton ok deraadt
2017-07-20Start a list of isa(4) device names such that we can avoid printing themMark Kettenis
as "not configured". ok mikeb@, millert@, deraadt@
2017-06-30Fix a format string specifier error in a debug printf.Mike Larkin
Noticed and reported by Fasse: fasse dot f2 at gmail dot com Thanks.
2017-05-28Remove a redundant assignment introduced in revision 1.219 but favor theanton
assignment outside of the conditional. ok stsp@
2017-05-25Add a header with EFI/UEFI-related definitions for use by the kernel. ForMark Kettenis
now this only contains definitions for parsing the EFI memory map. I anticipate adding limited support for the EFI system table and some of the EFI runtime services, but not much more. ok mlarkin@, patrick@, tom@
2017-04-27track size of pss allocation, so that length can be passed to free(9)Theo de Raadt
ok mlarkin
2017-04-15Fix format string in ACPI_MEMDEBUG blockPhilip Guenther
From Anton Lindqvist (anton.lindqvist(at)gmail.com)
2017-04-08Sensors are run as callbacks inside tasks. During suspend a sensorTheo de Raadt
could be running inside a driver that will be force-detached, or due to tsleep end up disrupting the softstate/hardstate contract. At suspend time, quisce all these callbacks by waiting for completion. This issue has never been observed for real, but may be implicated in suspend/resume failures. ok kettenis guenther mlarkin
2017-04-08Two prototypes for acpi_maptable; merge to one placeTheo de Raadt
2017-04-07Simplify the size calculation for memset()Philip Guenther
From Anton Lindqvist (anton.lindqvist(at)gmail.com)
2017-04-02normalize order of arguments to if ()Theo de Raadt
2017-03-27Now that hibernate_alloc() only has clean success/failure, don'tTheo de Raadt
need to call hibernate_free() to clean up a partial mess. ok mlarkin kettenis
2017-03-13Don't attach on Apple hardware, asmc(4) is already providing anJoshua Stein
ambient light sensor. ok jung
2017-03-13Register for notifications on the subsystem (parent device) insteadJoshua Stein
of the HID device, gets SCI events working properly. But still keep ACPIDEV_POLL enabled just in case some systems never generate these, like acpibat does.
2017-03-13allow ramdisks to build; ok jcsTheo de Raadt
2017-03-12add const to struct cfattachJoerg Jung
ok jcs
2017-03-12try to attach acpisbs first and if successful, don't attach acpibatJoshua Stein
2017-03-11Revert 1.54, go back to always trying to enable burst modeJoshua Stein
Selectively enabling burst mode seems to have broken more machines than it helped. On MacBooks, EC_STAT_OBF occasionally won't show up when trying to read a byte of data when bursting hasn't been enabled, so acpiec_wait can spin forever. This again breaks on ECs that don't do burst at all, like the Chrome EC, but those are much more scarce than MacBooks at this time. A machine/bios-dependent check could be added later to disable bursting on certain machines. Discussed with deraadt
2017-03-07move a TODO to the topJoshua Stein
2017-03-02Add a new sysctl machdep.lidaction. The sysctl works as follows:Martin Natano
machdep.lidaction=0 # do nothing machdep.lidaction=1 # suspend machdep.lidaction=2 # hibernate lidsuspend is just an alias for lidaction, so if you change one, the other one will have the same value. The plan is to remove machdep.lidsuspend eventually when people have upgraded their /ets/sysctl.conf. discussed with deraadt, who came up with the new MIB name no objections mlarkin ok stsp halex jcs
2017-02-28Untangle abstract sleep modes from ACPI sleep states. This paves the wayMartin Natano
for further work in the area. idea and ok deraadt ok mlarkin
2017-02-25move vendor HIDs into their drivers, clean up some unused definesJoshua Stein
ok kettenis
2017-02-25attach acpithinkpad to LEN0268 HID found on newer thinkpadsJoshua Stein
2017-02-22fix timeout loopJoshua Stein
from Anton Lindqvist
2017-02-22add acpisbs, an acpi smart battery subsystem driver reading dataJoshua Stein
over smbus currently disabled because it conflicts with acpibat ok deraadt, kettenis
2017-02-16On Apple hardware, claim an OSI of Darwin and no other OSesJoshua Stein
The DSDT on at MacBooks takes many different and beneficial code paths when the OS reports to be Darwin, but due to the way it checks OSI, we can't just add Darwin to the aml_valid_osi array since later checks for Windows variants will supersede the Darwin check. Fixes suspend and keeps Thunderbolt ports powered up after resume. One regression is that the acpibat driver no longer attaches and will require an ACPI Smart Battery driver, which is in the works. Adapted from a similar change in the Linux kernel from 2014. ok deraadt
2017-02-07Test for NULL before dereferencing a pointer not after.Jonathan Gray
2017-01-14Revert aml_rdpciaddr changes; breaks several machines that were workingMark Kettenis
before.
2017-01-11Increase the size of the buffers used for _HID and _CID strings to beJonathan Gray
able to fit "Hyper_V_Gen_Counter_V1". ok mlarkin@ deraadt@
2017-01-10Hyper-V hosts make 64 bytes of entropy available to guests in the formJonathan Gray
of a OEM0 ACPI table. acpihve(4) feeds this data into the kernel entropy pool. This is less interesting for machines with rdrand, but there are still pre ivy bridge machines running Hyper-V (including parts of Azure). ok mikeb@ reyk@ deraadt@ mlarkin@
2017-01-08Make aml_rdpciaddr() work for for devices behind bridges. The code nowMark Kettenis
uses the mapping between AML nodes and PCI devices that we establish. Because _INIT methods may end up calling aml_rdpciaddr(), make sure we create that mapping early. Also handle devices that aren't actually present. These devices are now included in the mapping and reads will return an all-ones patterm whereas writes are a no-op.. ok mlarkin@
2016-12-23Add missing sentinel.Mark Kettenis
ok deraadt@
2016-12-18Remove comparison of array which is always non-NULL. Fixes clang warning.Mark Kettenis
ok jca@ (a while back)
2016-10-25Deduplicate the CRS parsing code and handle broken ACPI implementations.Paul Irofti
This change was prompted by a report from Ilya Kaliman where acpiec(4) failed to initialize on his Acer Aspire S7. Further investigations showed that the machine had 4 instead of 2 resources defined inside the EC device which is a violation of all existing ACPI revisions. We now handle such machines by using the aml resource parser directly, which lead to the removal of the existing one from acpiec.c, and ignoring extra resources (although they are reported in the dmesg). In the process I also done a couple of more style(9) fixes. Suggested by and ok guenther@
2016-10-25Add the resource index to aml_parse_resource() callback function.Paul Irofti
This is needed by an upcoming acpiec commit that handles machines breaking the current ACPI specifications. Change suggested by and ok kettenis@, guenther@
2016-10-21Add support for the ACPI timer opcode.Joris Vink
ok kettenis@
2016-10-04At acpithinkpad attach time determine the value of the mute, and deferTheo de Raadt
telling the audio subsystem about this later on in boot. (Mute state is maintained by the BIOS over a suspend, hibernate, reboot, etc -- this may be last missing piece of the puzzle we tore our hair out in Brisbane) diagnosis and code by Anton Lindqvist, ok ratchov
2016-09-27Print the type of operation space that failed as there seem to be more ofMike Larkin
these occurring recently.
2016-09-18If the APIC table (MADT) isn't present then ci_acpi_proc_id won't be setPhilip Guenther
when acpicpu tries to attach, leading to a NULL dereference. The ACPI processor object on the Dells where this was reported is bogus and useless anyway so apply the same test when deciding whether to attach to processor objects as acpicpu would when matching them to cpus. Problem reported by Eivind Eide (xenofil (at) gmail.com) and Johan Huldtgren (johan+openbsd-bugs (at) huldtgren.com). Testing by Eivind Eide. ok kettenis@ mlarkin@
2016-09-17Report a LAPIC address override entry in the dmesg if it doesn't matchPhilip Guenther
the normal one ok kettenis@ mlarkin@
2016-09-16Suppress debugging output about CSD entries that say nothing we care aboutPhilip Guenther
and improve the output for those we might. output examples from mikeb@ ok kettenis@
2016-09-07revert part of 1.18 which caused a regression with at least one ikbdJoshua Stein
device reported by Callum R. Davies
2016-09-03Write the system time back to the RTC every 30 minutes.Christian Weisgerber
This fixes the problem that long-running machines which were not shut down properly would reboot with a badly offset system time. hints and ok kettenis@
2016-09-02Remove unused argument in aml_showvalue().Paul Irofti
The second argument of aml_showvalue() was probably supposed to set the verbosity level through dnprintf() but in fact it does nothing. OK deraadt@
2016-09-01add iatp(4), a driver for the i2c touchpad and touchscreen found onJoshua Stein
the chromebook pixel
2016-09-01for broadwell HIDs, apply a magic write found in linux that isJoshua Stein
required in order to talk to certain i2c slave devices behind dwiic
2016-09-01- disable controller when we're done using itJoshua Stein
- read CLR_INTR register when disabling interrupts
2016-09-01- separate hid and ihidev attachment for upcoming driversJoshua Stein
- move power control into a dedicated function - sprinkle aml_freevalue
2016-08-31Don't put a device in the wake device list if _STA says it's not there.Mike Larkin
Fixes at least one machine that woke up from sleep / poweroff immediately. ok kettenis@, tested by kettenis and martijn@