summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
AgeCommit message (Collapse)Author
2024-10-30directly use dev_t for swdevt[], remove struct swdevtJonathan Gray
ok mpi@ miod@
2024-10-22put opening { on same line as struct nameJonathan Gray
ok claudio@
2024-10-09make attachments use pre-existing activate functions; ok deraadt@Jonathan Gray
2024-10-08set activate for ufshci_acpi and ufshci_fdtJonathan Gray
tested by mglocker@ with pci, acpi and fdt attachments ok mglocker@ deraadt@
2024-10-02Improve the heuristic for detecting i2c devices. On the x1e some of theMark Kettenis
USB controllers have an I2cSerialBusV2() (possibly defining a connection to some sort of eUSB2 to USB2 redriver chip) but are not i2c devices themselves. So check if a device has MMIO resources and assume it isn't a proper i2c device if it has those. Makes the Type-A ports on my vivobook work in acpi mode. ok patrick@, mlarkin@
2024-09-21We aren't ready to choose S0-over-S3 based upon the S0ix bit in FADT.Theo de Raadt
Some machines which work great in S3, don't work great in S0. Some people want to be able to force S0, mostly for testing purposes (or to notice improvements as changes are made in the tree). Provide a TEMPORARY method via machdep.lidaction=-1 which will be S0-suspend while =1 remains S3 suspend. This button will not remain long-term, but for now, and during 7.6, it will be better than nothing. ok ratchov kettenis
2024-09-20remove unneeded semicolons; checked by millert@Jonathan Gray
2024-09-04Push acpi(4) _CRS parsing down after matching skippable and ISA hardware IDs.James Hastings
ok kettenis@
2024-09-04Fix some spelling.Marcus Glocker
Input and ok jmc@, jsg@
2024-08-31If FADT_POWER_S0_IDLE_CAPABLE feature is found, prefer S0ix style over S3.Theo de Raadt
Commiting now so that tests can be done by more people before release. At the last moment, we can pull this change out.
2024-08-18Add Meteor Lake support.Mark Kettenis
ok jsg@
2024-08-18If FADT indicates FADT_POWER_S0_IDLE_CAPABLE, print "S0ix" insteadTheo de Raadt
of "S0" on the acpi: sleep states line. (In my view, this flag-bit announces that the hardware vendor + bios vendor + microsoft have agreed this machine has enough "features" that S0 suspend is about as good or better than S3, for various criteria). ok kettenis mlarkin
2024-08-15whitespaceTheo de Raadt
2024-08-13use ACPI _WAK upon resume. Such a huge oversight it is surprising thatTheo de Raadt
we've never noticed it before, maybe systems which depend on _WAK are rare. Still, this may improve S3 resume on some rare machines. ok kettenis
2024-08-12Revert the guts of rev 1.14. This ends up attempting to turn of powerMark Kettenis
resources for devices that aren't present. And that makes us run AML that clearly hasn't been tested by the vendors. And on my test laptop this no longer seems to make a meaningful difference in the power consumption during suspend-to-idle. ok deraadt@
2024-08-11delete correct ACPI_SST_WAKING, pointed out by kettenisTheo de Raadt
2024-08-11forgot the suspend-time duplication mentioned in 1.25Theo de Raadt
2024-08-11put ACPI_SST_WAKING in gosleep() where kettenis asked forTheo de Raadt
2024-08-10cleanup excessive calls to acpi_indicator at suspend time and resume timeTheo de Raadt
ok kettenis
2024-08-08Fix gasio access size.Mark Kettenis
2024-08-08Print suspend-to-idle debug info in a more concise matter.Mark Kettenis
ok mlarkin@, deraadt@
2024-08-08Make intelmpc(4) print information about the residency counters advertisedMark Kettenis
in the LPIT table. ok mlarkin@, deraadt@
2024-08-06Some laptops will generate an EC event shortly after we attempt to enterMark Kettenis
a low power S0 idle state. Since we register the EC GPE as a wakeup GPE this means we'll wake up immediately. Unfortunately we have to register that GPE as a wakeup GPE otherwise many laptops won't wake up when the user opens the lid (and some laptops won't wake up at all). So add some code to handle EC events while suspended and introduce the concept of wakeup AML notify handlers. Register the acpibtn(4) notify handlers as wakeup notify handlers such that we wake up. We'll go back to sleep immediately if we wake up for any other EC event. ok mlarkin@, deraadt@
2024-08-05Fix reporting if critical battery state.Mark Kettenis
ok jca@, mlarkin@
2024-08-04Add intelpmc(4), a driver for the power management controller found onMark Kettenis
various Intel SoCs. The driver takes care of calling the AML methods needed to enter low power idle states during suspend-to-idle (S0i). The driver also implements some debug code that prints the residency of various power states in dmesg. Based on some earlier code by jcs@ ok jcs@
2024-08-02Switch off unreferenced power resources in DVACT_POWERDOWN instead ofMark Kettenis
DVACT_SUSPEND. Fixes an issue with (un)hibernate where we don't attach xhci(4) controllers, which would make is turn the xhci(4) off inadvertedly because its power resource wasn't referenced. ok mlarkin@
2024-07-30Make the Samsung Galaxy Book4 Edge (x1e80100) boot in ACPI mode;Marcus Glocker
Until now the kernel did panic during early boot because we couldn't respond to the battery requests sent to the 0xa1 "bus". This (dummy) driver registers a 0xa1 region space very early, and responds with a static zero value to satisfy the battery requests on 0xa1, which let us boot successfully to multi-user. In the future this machine should be operated in FDT mode, and an improved AML parsing interface might make this workaround obsolete also for RAMDISK. Help and OK kettenis@, deraadt@
2024-07-15Make the touchpad on the Samsung Galaxy Book4 Edge work.Marcus Glocker
ok patrick@
2024-07-14Only match if we can find a corresponding cpu device. This means theJonathan Matthew
many extra ACPI0007 instances found in current generation servers no longer fill up dmesg with noise. ok kettenis@
2024-07-14For specific hids (currently only ACPI0007, acpicpu(4)), use a printJonathan Matthew
function that always returns QUIET so instances that don't get matched are not reported. ok kettenis@
2024-07-14In addition to setting the PCI power state, also run the appropriate _PSxMark Kettenis
method that matches the target state. ok deraadt@
2024-07-14Upon first suspend, turn off all power resources that haven't beenMark Kettenis
referenced. ok deraadt@
2024-07-04Support the ACPI GPIO pins necessary to support the keyboard, touchpadPatrick Wildt
and touchscreen on the Qualcomm Snapdragon X Elite (X1E80100) laptops Asus Vivobook S15 and Lenovo Yoga Slim 7x. ok kettenis@
2024-07-02Do not attach acpitz(4) if the _STA method indicates that a thermal zoneMark Kettenis
isn't present. While it isn't clear whether _STA applies to thermal zones according to the ACPI standard, this prevents issues on the Asus Vivobook S15. ok miod@, patrick@, deraadt@
2024-06-30remove struct acpi_parsestate, unused since dsdt.c rev 1.16Jonathan Gray
2024-06-29remove defines for acpi ioctls, unused since acpi.c rev 1.59Jonathan Gray
2024-06-29remove struct acpi_dev_rank, unused since acpi.c rev 1.144Jonathan Gray
2024-06-26return type on a dedicated line when declaring functionsJonathan Gray
ok mglocker@
2024-06-25Implement sleep button and EC events as wakeup events. Print the wakeupMark Kettenis
reason. ok mglocker@, deraadt@
2024-06-24Some machines send AC change notifications to acpibat(4). Forward thisMarcus Glocker
notification to acpiac(4), so that the AC status can be reflected correctly to programs like apm(8). This for example fixes the AC status on the Microsoft Surface Go 4. Help from kettenis@ ok deraadt@, kettenis@
2024-06-19Add PNP IDs to handle the X1E80100 (Snapdragon X Elite) USB controllers.Patrick Wildt
ok kettenis@
2024-06-19Add _HID for X1E80100 (Snapdragon X Elite) SoCs.Patrick Wildt
ok kettenis@
2024-06-11Avoid powering down PCI devices if we're rebooting. This makes someMark Kettenis
machines (e.g. the t410) unhappy. ok mglocker@
2024-06-07Make sure we select the deepest possible C-state during suspend-to-idle.Mark Kettenis
ok deraadt@, guenther@, mlarkin@, jsg@
2024-06-02Power down PCI devices in S0 as well. Needed for suspend-to-idle.Mark Kettenis
ok mglocker@
2024-05-29Implement the guts for "suspend-to-idle" on amd64. This enables suspendMark Kettenis
on machines that don't support S3. In its current state it doesn't save a lot of power, but this should improve over time. Implementation of wakeup methods is incomplete which means that some machine can't resume at the moment. ok mglocker@, mlarkin@, stsp@, deraadt@
2024-05-28Garbage collect sleep_abort(); it doesn't do anything useful anymore.Mark Kettenis
ok deraadt@, mlarkin@
2024-05-27Set sc_state to ACPI_STATE_S0 at the end of resume instead of at the startMark Kettenis
such that ACPI resume code can see what state we're resuming from. ok deraadt@
2024-05-14remove prototypes with no matching functionJonathan Gray
2024-05-13Ignore button events in the first 10 seconds after resume. On some ACPIMark Kettenis
implementations pressing the power button to wake up a machine will cause a power button notification to happen for that button press This would initiate a power down, which isn't the user's intent. Based on earlier diffs from deraadt@ and James Cook. ok mlarkin@, "I'm not opposed" cheloha@