aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/thinkpad-acpi.txt
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-09-04 10:13:15 -0400
committerLen Brown <len.brown@intel.com>2007-09-17 00:58:19 -0400
commitff80f1370f2eff7dd7a828cf2416bf7be697247e (patch)
tree752fbf04cfc7f347e26a16050cb554051bc13dc6 /Documentation/thinkpad-acpi.txt
parent0d4cbb5e7f60b2f1a4d8b7f6ea4cc264262c7a01 (diff)
ACPI: thinkpad-acpi: revert new 2.6.23 CONFIG_THINKPAD_ACPI_INPUT_ENABLED option
Revert new 2.6.23 CONFIG_THINKPAD_ACPI_INPUT_ENABLED Kconfig option because it would create a legacy we don't want to support. CONFIG_THINKPAD_ACPI_INPUT_ENABLED was added to try to fix an issue that is now moot with the addition of the netlink ACPI event report interface to the ACPI core. Now that ACPI core can send events over netlink, we can use a different strategy to keep backwards compatibility with older userspace, without the need for the CONFIG_THINKPAD_ACPI_INPUT_ENABLED games. And it arrived before CONFIG_THINKPAD_ACPI_INPUT_ENABLED made it to a stable mainline kernel, even, which is Good. This patch is in sync with some changes to thinkpad-acpi backports, that will keep things sane for userspace across different combinations of kernel versions, thinkpad-acpi backports (or the lack thereof), and userspace capabilities: Unless a module parameter is used, thinkpad-acpi will now behave in such a way that it will work well (by default) with userspace that still uses only the old ACPI procfs event interface and doesn't care for thinkpad-acpi input devices. It will also always work well with userspace that has been updated to use both the thinkpad-acpi input devices, and ACPI core netlink event interface, regardless of any module parameter. The module parameter was added to allow thinkpad-acpi to work with userspace that has been partially updated to use thinkpad-acpi input devices, but not the new ACPI core netlink event interface. To use this mode of hot key reporting, one has to specify the hotkey_report_mode=2 module parameter. The thinkpad-acpi driver exports the value of hotkey_report_mode through sysfs, as well. thinkpad-acpi backports to older kernels, that do not support the new ACPI core netlink interface, have code to allow userspace to switch hotkey_report_mode at runtime through sysfs. This capability will not be provided in mainline thinkpad-acpi as it is not needed there. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Michael S. Tsirkin <mst@dev.mellanox.co.il> Cc: Hugh Dickins <hugh@veritas.com> Cc: Richard Hughes <hughsient@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'Documentation/thinkpad-acpi.txt')
-rw-r--r--Documentation/thinkpad-acpi.txt92
1 files changed, 75 insertions, 17 deletions
diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
index eb2f5986e1eb..ca89711f1584 100644
--- a/Documentation/thinkpad-acpi.txt
+++ b/Documentation/thinkpad-acpi.txt
@@ -161,20 +161,22 @@ system. Enabling the hotkey functionality of thinkpad-acpi signals the
161firmware that such a driver is present, and modifies how the ThinkPad 161firmware that such a driver is present, and modifies how the ThinkPad
162firmware will behave in many situations. 162firmware will behave in many situations.
163 163
164The driver enables the hot key feature automatically when loaded. The
165feature can later be disabled and enabled back at runtime. The driver
166will also restore the hot key feature to its previous state and mask
167when it is unloaded.
168
164When the hotkey feature is enabled and the hot key mask is set (see 169When the hotkey feature is enabled and the hot key mask is set (see
165below), the various hot keys either generate ACPI events in the 170below), the driver will report HKEY events in the following format:
166following format:
167 171
168 ibm/hotkey HKEY 00000080 0000xxxx 172 ibm/hotkey HKEY 00000080 0000xxxx
169 173
170or events over the input layer. The input layer support accepts the 174Some of these events refer to hot key presses, but not all.
171standard IOCTLs to remap the keycodes assigned to each hotkey.
172 175
173When the input device is open, the driver will suppress any ACPI hot key 176The driver will generate events over the input layer for hot keys and
174events that get translated into a meaningful input layer event, in order 177radio switches, and over the ACPI netlink layer for other events. The
175to avoid sending duplicate events to userspace. Hot keys that are 178input layer support accepts the standard IOCTLs to remap the keycodes
176mapped to KEY_RESERVED in the keymap are not translated, and will always 179assigned to each hot key.
177generate an ACPI ibm/hotkey HKEY event, and no input layer events.
178 180
179The hot key bit mask allows some control over which hot keys generate 181The hot key bit mask allows some control over which hot keys generate
180events. If a key is "masked" (bit set to 0 in the mask), the firmware 182events. If a key is "masked" (bit set to 0 in the mask), the firmware
@@ -256,6 +258,20 @@ sysfs notes:
256 disabled" postition, and 1 if the switch is in the 258 disabled" postition, and 1 if the switch is in the
257 "radios enabled" position. 259 "radios enabled" position.
258 260
261 hotkey_report_mode:
262 Returns the state of the procfs ACPI event report mode
263 filter for hot keys. If it is set to 1 (the default),
264 all hot key presses are reported both through the input
265 layer and also as ACPI events through procfs (but not
266 through netlink). If it is set to 2, hot key presses
267 are reported only through the input layer.
268
269 This attribute is read-only in kernels 2.6.23 or later,
270 and read-write on earlier kernels.
271
272 May return -EPERM (write access locked out by module
273 parameter) or -EACCES (read-only).
274
259input layer notes: 275input layer notes:
260 276
261A Hot key is mapped to a single input layer EV_KEY event, possibly 277A Hot key is mapped to a single input layer EV_KEY event, possibly
@@ -393,21 +409,63 @@ unknown by the driver if the ThinkPad firmware triggered these events on
393hot key press or release, but the firmware will do it for either one, not 409hot key press or release, but the firmware will do it for either one, not
394both. 410both.
395 411
396If a key is mapped to KEY_RESERVED, it generates no input events at all, 412If a key is mapped to KEY_RESERVED, it generates no input events at all.
397and it may generate a legacy thinkpad-acpi ACPI hotkey event.
398
399If a key is mapped to KEY_UNKNOWN, it generates an input event that 413If a key is mapped to KEY_UNKNOWN, it generates an input event that
400includes an scan code, and it may also generate a legacy thinkpad-acpi 414includes an scan code. If a key is mapped to anything else, it will
401ACPI hotkey event. 415generate input device EV_KEY events.
402
403If a key is mapped to anything else, it will only generate legacy
404thinkpad-acpi ACPI hotkey events if nobody has opened the input device.
405 416
406Non hot-key ACPI HKEY event map: 417Non hot-key ACPI HKEY event map:
4070x5001 Lid closed 4180x5001 Lid closed
4080x5002 Lid opened 4190x5002 Lid opened
4090x7000 Radio Switch may have changed state 4200x7000 Radio Switch may have changed state
410 421
422The above events are not propagated by the driver, except for legacy
423compatibility purposes when hotkey_report_mode is set to 1.
424
425Compatibility notes:
426
427ibm-acpi and thinkpad-acpi 0.15 (mainline kernels before 2.6.23) never
428supported the input layer, and sent events over the procfs ACPI event
429interface.
430
431To avoid sending duplicate events over the input layer and the ACPI
432event interface, thinkpad-acpi 0.16 implements a module parameter
433(hotkey_report_mode), and also a sysfs device attribute with the same
434name.
435
436Make no mistake here: userspace is expected to switch to using the input
437layer interface of thinkpad-acpi, together with the ACPI netlink event
438interface in kernels 2.6.23 and later, or with the ACPI procfs event
439interface in kernels 2.6.22 and earlier.
440
441If no hotkey_report_mode module parameter is specified (or it is set to
442zero), the driver defaults to mode 1 (see below), and on kernels 2.6.22
443and earlier, also allows one to change the hotkey_report_mode through
444sysfs. In kernels 2.6.23 and later, where the netlink ACPI event
445interface is available, hotkey_report_mode cannot be changed through
446sysfs (it is read-only).
447
448If the hotkey_report_mode module parameter is set to 1 or 2, it cannot
449be changed later through sysfs (any writes will return -EPERM to signal
450that hotkey_report_mode was locked. On 2.6.23 and later, where
451hotkey_report_mode cannot be changed at all, writes will return -EACES).
452
453hotkey_report_mode set to 1 makes the driver export through the procfs
454ACPI event interface all hot key presses (which are *also* sent to the
455input layer). This is a legacy compatibility behaviour, and it is also
456the default mode of operation for the driver.
457
458hotkey_report_mode set to 2 makes the driver filter out the hot key
459presses from the procfs ACPI event interface, so these events will only
460be sent through the input layer. Userspace that has been updated to use
461the thinkpad-acpi input layer interface should set hotkey_report_mode to
4622.
463
464Hot key press events are never sent to the ACPI netlink event interface.
465Really up-to-date userspace under kernel 2.6.23 and later is to use the
466netlink interface and the input layer interface, and don't bother at all
467with hotkey_report_mode.
468
411 469
412Bluetooth 470Bluetooth
413--------- 471---------