summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
AgeCommit message (Collapse)Author
2016-04-02Make the gpio intr_establish callback return an int so the same functionJonathan Gray
pointer can be used with gpio and acpi intr_establish. ok kettenis@
2016-03-30Hook up the gpio interrupt on devices that use it for card detection.Mark Kettenis
Makes the SD card slot on machines based on Intel's Bay Trail SoC fully functional. ok jsg@
2016-03-30Add support for gpio-based interrupts.Mark Kettenis
ok jsg@
2016-03-29Print address and irq in the same way as sdhc(4)and bytgpio(4).Mark Kettenis
2016-03-29Check if a device is present (using _STA) in acpi_foundhid. This preventsMark Kettenis
us from reporting devices as "not configured" that aren't actually present, and allows us to remove duplicated code from several drivers. ok deraadt@, ok jsg@
2016-03-29Implement a cleaner way to prevent acpivout(4) from attaching if we haveMark Kettenis
a platform-specific method of controlling the backlight. ok millert@, mlarkin@, jung@
2016-03-28Replace 0 with NULL.Mark Kettenis
2016-03-28Adding each and every new acpi device driver to acpi_foundhid() isMark Kettenis
gettinga bit of the burden. And it really isn't how our autoconf framework is supposed to work for busses that can be enumerated. All the drivers already check for a matching _HID in their attach function. So we can just drop the checks in acpi_foundhid() and let the drivers sort themselves out. Print a "not configured" line for devices for which we don't attach adriver. This may be a bit much as there are devices for which we will not have a driver. This will be removed if it causes too much dmesg spam. ok deraadt@, mlarkin@
2016-03-28Match based on _HID instead of the driver name.Mark Kettenis
ok mlarkin@
2016-03-28Add support for card detect through a GPIO signal.Mark Kettenis
2016-03-28Add bytgpio(4) a driver for the gpio controllers found on Intel's Bay TrailMark Kettenis
SoC.
2016-03-28Add infrastructure that allows gpio drivers to register themselves withMark Kettenis
the acpi framework such that we can start adding supportfor GPIO resources.
2016-03-28Add definitions for GPIO resources.Mark Kettenis
2016-03-17Replace curcpu_is_idle() by cpu_is_idle() and use it instead of rollingMartin Pieuchot
our own. From Michal Mazurek, ok mmcc@
2016-03-14Correct the value of SRT_ENDTAG: it was documented incorrectly in earlyPhilip Guenther
ACPI specs. With the correct value, it can now be used in a few places instead of hardcoding 0x79. ok kettenis@
2016-03-02Claim to be more versions of windows for _OSI checks.Jonathan Gray
2001.1 SP1 Windows Server 2003 SP1 2006.1 Windows Server 2008 2006 SP1 Windows Vista SP1 2006 SP2 Windows Vista SP2 2015 Windows 10 ok kettenis@
2016-01-22Zero the local structs holding crs information before parsing _CRS.Jonathan Gray
This avoids reading uninitialised memory when expected value types are not present, as is currently the case with gpio signalled interrupts, and could also be the case with buggy aml. Without this change under certain conditions on the ideapad 100s (such as a ramdisk kernel or generic kernel compiled with -O0) ihidev would incorrectly attach to a bogus ioapic interrupt. ok kettenis@
2016-01-17fix an off-by-one that could result in read operations not readingJoshua Stein
the last byte, depending on the timing
2016-01-17dwiic_i2c_{read,write} -> dwiic_{read,write}Joshua Stein
2016-01-17Take acpi_foundhid() outside of #ifndef SMALL_KERNEL so the ramdiskJonathan Gray
kernel can find and attach dwiic(4) and sdhc(4).
2016-01-17remove an unused global variableJonathan Gray
2016-01-15In dwiic_acpi_foundhid() treat _STA missing as if all the bitsJonathan Gray
were set as per the acpi spec. ok kettenis@
2016-01-15Check _STA method to see whether te device is actually present. If not, makeMark Kettenis
the match function return 0 to prevent the driver from attaching.
2016-01-14Attach dwiic(4) on the Intel Bay Trail i2c controllers as well.Mark Kettenis
2016-01-14Several fixes for dwiic(4).Mark Kettenis
* Properly map bus space; using BUS_SPACE_MAP_PREFATCHABLE is not agood idea as it may lead to reordering or merging of register writes in the store buffer. * Properly implement the iic(4) operations in dwiic_i2c_exec(). * Keep timings set up by the firmware if the SSCN and FMCN methods aren't available. ok jcs@
2016-01-13Change aml_find_node() such that it only walks down the tree and doesn'tMark Kettenis
traverse sideways. This seems to be what all callersexpect it to do, and fixes a bug in dwiic(4) where it would try to access i2c devices on busses they're not attached to. If there is any fallout from this change, the right thing to do is probably to make sure callers pass the right node. While there, change the return type to void, as the return value was useless and none of the callers looked at it. ok mlarkin@
2016-01-13Don't confuse the HID descriptor address (which really is an office into theMark Kettenis
register space of the i2c device) with the i2c address. For i2c busses enumerated by ACPI we get the address from the I2C Serial Bus Connection Resource Descriptor returned by the _CRS methide of the i2c device. Pass the HID descriptor address in the ia_size member. ok jcs@
2016-01-13Add data structures and defines for Generic and I2C Serial Bus ConnectionMark Kettenis
descriptors. ok jcs@
2016-01-12rename new i2c_attach_args fields to avoid conflict with cpp magic inTheo de Raadt
isavar.h (a few parts of the tree include both) ok jcs
2016-01-12Improve emulation of PM registers on Hardware-redcued ACPI by emulatingMark Kettenis
SPL_TYPx, SLP_EN and WAK_STS using the new SLEEP_STATUS_REG and SLEEP_CONTROL_REG registers. Makes the transition into S5 (powerdown) work on the ASUS X205TA. ok deraadt@, mlarkin@
2016-01-12Add dwiic, a driver for the Synopsys DesignWare i2c controller foundJoshua Stein
on the Samsung ATIV Book 9 laptop. This initial version only supports ACPI config/attachment. Add ihidev, a HID-over-i2c driver largely based on uhidev. dwiic handles attaching ihidev devices found in ACPI. Add ims, a HID-over-i2c mouse/trackpad driver to get basic cursor and button functionality from HID-compliant i2c trackpads. ok kettenis deraadt
2016-01-11Make sdhc(4) attach to hardware IDs "80860F14" and "PNP0FFF".Mark Kettenis
2016-01-11Only include sdhc_acpi.c if shdc* at acpi? is included in the kernel config.Mark Kettenis
2016-01-11Add glue to make sdhc(4) attach to acpi(4). Needed to support the SD hostMark Kettenis
controllers integrated on Intel's Bay Trail SoCs.
2016-01-10Introduce acpi_intr_establish(9), an API to establish interrupt handlers forMark Kettenis
"platform" devices that attach to acpi(4). ok mlarkin@, deraadt@
2016-01-10Add thinkpad tablet dock/undock ACPI events.Stefan Sperling
ok deraadt kettenis
2016-01-09Initial support for Hardware-Reduced ACPI. This skips the legacy mode checksMark Kettenis
by emulating the PM_CNT register such that SCI_EN is always enabled. It also skip attaching acpitimer(4) since the relevant registers are no longer there. ok deraadt@, mlarkin@
2016-01-09Add HW_REDUCED_ACPI and LOW_POWER_S0_IDLE_CAPABLE FADT flags.Mark Kettenis
2016-01-09Rename LR_24BIT, LR_32BIT and LR_32BITFIXED to LR_MEM24, LR_MEM32 andMark Kettenis
LR_MEM32FIXED to better match the names used in the specification. Add lr_m32fixed to union acpi_resource. ok jcs@
2016-01-07Use a resune hook to re-evaluate the "_LID" status upon resume.Martin Pieuchot
This fixes the lid sensor for machines, like the x220, that do not generate an event when the lid opens. ok kettenis@, deraadt@
2016-01-06Follow the spec and check the SCI_EN bit to see if ACPI has alreadyMark Kettenis
been enabled and don't bother enabling it again if it is. This should fix systems that don't implement legacy mode and therefore set ACPI_ENABLE and ACPI_DISABLE to zero. ok mlarkin@, yasuoka@
2015-12-29Remove NULL-checks before free().mmcc
ok tb@
2015-12-23add aml_freevalue in a couple places, avoid storing a result thatJoshua Stein
would need to be freed in a couple other places with deraadt
2015-12-17Add display brightness support. This is available on the last few generationsMark Kettenis
of Thinkpads (x220 and later) and using means the brightness level is coordinated properly with the firmware. This gets rid of the surprising brightness changes that would sometimes happen if you used the brightness keys or if the firmware decided to reset the brightness level for some other reason. ok tedu@, jung@, naddy@
2015-12-16Don't attempt to get the ThinkLight state if neither the KLCG nor the MLCGMark Kettenis
methods are present. Should fix the panic that occurs on older ThinkPads (such as the x201) when you press the ThinkLight key.
2015-12-14Handle the keyboard backlight found on newer Thinkpads. Doesn't handle theMark Kettenis
machines that have both the keyboard backlight and the thinklight (x230, t430) quite right yet. ok jung@ (for a slightly different version of this diff)
2015-12-13Hook up the ThinkLight to the keyboard backlight support code.Mark Kettenis
For now this only supports the true ThinkLight. Support for the keyboard backlight found on the most recent ThinkPads will follow soon. ok jung@
2015-12-13Sort button defines.Mark Kettenis
2015-11-23Back out the CRITICAL change, turn it back from 10% to 25%. SomeReyk Floeter
people with old/broken batteries didn't like this change, and the underlying heuristics are wrong.
2015-11-22The "CRITICAL" APM battery level, that is exported/faked by the ACPIReyk Floeter
stack, is currently set to 25%. With 25% battery left, a typical modern laptop will have at least one hour runtime left. It is an arbitrary value, and other APM power layers in the kernel set CRITICAL to something like 5% or 10%, so set it to 10% for now. OK mlarkin@