summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/thinkpad_acpi.c
AgeCommit message (Collapse)Author
2022-08-12thinkpad(4): Don't detach on shutdown.riastradh
There's no important state that needs to be recorded, or resources that need to be relinquished, so detach-on-shutdown isn't necessary. At the moment, detach-on-shutdown is actually harmful here: if shutdown is triggered by a sysmon power switch event, then config_detach will be called from the sysmon taskqueue, but thinkpad_detach has to wait for ACPI notifiers to finish running which means waiting for the sysmon taskqueue -> deadlock or crash. We should maybe arrange to do config_detach from a thread other than the sysmon taskqueue thread to avoid this class of problems -- but for now, thinkpad(4) has no reason to detach on shutdown anyway, so let's take the easy path. Note: There are many drivers that set DVF_DETACH_SHUTDOWN which probably shouldn't; the flag means the kernel _will_ detach on shutdown, not that it _may_. Even those that do need to record state or relinquish resources might be better served by pmf shutdown hooks which can skip freeing software resources for faster shutdown.
2021-12-31thinkpad(4): Omit workaround for acpiec_bus_read.riastradh
acpiec_bus_read now initializes the whole ACPI_INTEGER like its signature suggests, so we don't need to pick out the low bits of the result or carefully avoid undefined behaviour from uninitialized stack garbage.
2021-05-30thinkpad(4): Fix evaluation of MHKA on version 2 devices.riastradh
Need to pass an argument.
2021-05-29Add some more Thinkpad hotkeys.riastradh
2021-05-29thinkpad(4): Add dtrace probe for hotkey events.riastradh
2021-05-29thinkpad(4): Attach at LEN0268 with v2 Thinkpad hotkeys too.riastradh
2021-01-29Use acpi_compatible_match().thorpej
2020-05-17With the recent change of the EC address space handler, we no longer getmlelstv
an ACPI_INTEGER in host byte order but a byte sized buffer with little endian data. Extract only the low 8 bits from buffer to get the fan speed again.
2019-08-05 Fix undefined behavior in thinkpad_mask_init(). Found by kUBSan.msaitoh
2016-04-03Split toggles for bluetooth and wwan and use specific ACPI objectsmlelstv
where present. Also make driver detach on shutdown.
2015-04-23Update module dependencies for all the existing modules that depend on ↵pgoyette
sysmon components.
2013-03-30reverse the polarity of the extra key option, always enabling them.christos
2013-03-30Define THINKPAD_EXTENDED_HOTKEYS to enable more hotkeys on ThinkPads.christos
This has only been tested on a T61. XXX: Should we put THINKPAD_EXTENDED_HOTKEYS into a opt_*.h include (defflag) or just always enable it?
2012-11-24Match LEN0068 in thinkpad(4) too, as newer Thinkpads report.riastradh
Tested on a W530. Lots of stuff is missing, though.
2012-08-14Collect rnd(9) entropy from coretemp(4), acpibat(4), aibs(4), hpacel(4),jruoho
thinkpad(4), and aps(4).
2012-07-15add function switch to switch on/off "wireless WAN", aka GSM et al modemspz
not tested to actually work, extensively tested not to do any harm if you don't have a wwan
2011-06-20Initialize sensor state before trying to register.pgoyette
2011-06-06Don't update the value_{min,max} - these fields are not {low,high}-waterpgoyette
marks, and setting them without also updating the ENVSYS_FVALID_{MIN,MAX} flags is quite pointless.
2011-04-14Simplify a little. No functional change.jruoho
2011-04-14Use the common power resource code. Also add a comment explainingjruoho
what can happen if we do not power on the resource upon resume from S3.
2011-03-27Use wireless function key to toggle not only bluetooth but alsomlelstv
telephony (GPRS/UMTS/..) like other operating systems.
2011-02-16Use ioconf for the module declarations.jruoho
2011-01-18Use AcpiOsReadPort/AcpiOsWritePort instead of inb/outb so I can get rid ofjmcneill
of the i386 and x86_64 ifdefs.
2010-12-31Use "temperature #" and "fan speed #" rather than "TMP#" and "FAN#" for thejruoho
sensor names. Remove white space. No functional change.
2010-10-25Bump WARNS to 4.jruoho
2010-04-15As discussed with jmcneill@, install a global "bus notification handler"jruoho
that receives all notifications and deliver notifications to drivers via it.
2010-04-14No need to spread the ACPICA type system any more than is necessary:jruoho
UINT8 -> uint8_t and UINT32 -> uint32_t.
2010-03-05Remove <dev/acpi/acpica.h> from all files. It is included fromjruoho
<dev/acpi/acpivar.h>. Ditto for <dev/sysmon/sysmonvar.h>, <sys/bus.h>, <dev/pci/pcivar.h>, and <dev/isa/isavar.h>. Also nuke a lot of unused and invalid headers. Some of these are audibly provided by standard headers (namely <sys/param.h> and <sys/device.h>), some have nothing to do with ACPI devices (e.g. <sys/syslog.h>), and some are nonexistent local includes (e.g. "mpu_ym.h"). Moreoever, try to group the includes into their respective blocks. Tested with GENERIC and ALL (i386). No functional change.
2010-02-28Introduce support for ACPI kernel modules.jruoho
Tested on couple of laptops.
2010-02-24A pointer typedef entails trading too much flexibility to declare constdyoung
and non-const types, and the kernel uses both const and non-const PMF qualifiers and device suspensors, so change the pmf_qual_t and device_suspensor_t typedefs from "pointers to const" to non-pointer, non-const types.
2010-01-31Add a detachment routine. While here, clarify the initialization of sensors.jruoho
2010-01-30Add the _COMPONENT definition for ACPI_DEBUG.jruoho
2010-01-18Add definitions for volume keys.jruoho
ok jmcneill@
2010-01-08Expand PMF_FN_* macros.dyoung
2009-11-29Introduce acpi_eval_set_integer().cegger
Use it in various acpi drivers to simplify code. Patch presented on tech-kern@: http://mail-index.netbsd.org/tech-kern/2009/11/28/msg006552.html No comments. XXX Is there an acpi(9) manpage?
2009-09-25Use deviter_first()/deviter_next() instead of accessing alldevsdyoung
directly. Compile-tested, only.
2009-05-12struct cfdata * -> cfdata_t, no functional changes intended.cegger
2009-02-17Use aprint_debugjmcneill
2008-11-01Make the driver work (except for setting display brightness) on olderhans
machines by removing the check for the CMOS method from thinkpad_match. OK by jmcneill.
2008-10-18Add fan sensor support, from Thomas E. Spanjaardjmcneill
2008-05-05Use 2-clause license.jmcneill
2008-05-01Be consistent with #define<space-or-tab>.simonb
2008-04-26Use isareg constants in thinkpad_brightness_read where possiblejmcneill
2008-02-29Use PMF_FN_ARGS, PMF_FN_PROTO.dyoung
2008-01-28The Thinkpad T61/x61 family powers off the USB power resource on resumejmcneill
from S3 sleep. Until we get proper ACPI power resource support, simply call \\_SB.PCI0.LPC.EC.PUBS._ON() on resume if the method exists. Fixes kern/37279 by Steven M Bellovin.
2008-01-09Remove useless returns at the end of void functions.xtraeme
2007-12-22Move display switching out of the kernel; deliver this (and other) eventsjmcneill
to sysmon so a powerd script can handle them.
2007-12-22Add experimental display switching support.jmcneill
2007-12-22Only toggle bluetooth when the wireless button is pressed, simplifiesjmcneill
things and it seems I forgot that my laptop has a separate wifi switch.
2007-12-21Add support for the WLAN / Bluetooth switch.jmcneill