]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - Documentation/thinkpad-acpi.txt
clockevent: simplify list operations
[linux-2.6-omap-h63xx.git] / Documentation / thinkpad-acpi.txt
index 3b95bbacc77505d46c0b9154b632f654b0eedb66..6c2477754a2a35025e8c837740693275d2df8f21 100644 (file)
@@ -1,7 +1,7 @@
                     ThinkPad ACPI Extras Driver
 
-                            Version 0.16
-                          August 2nd, 2007
+                            Version 0.19
+                         January 06th, 2008
 
                Borislav Deianov <borislav@users.sf.net>
              Henrique de Moraes Holschuh <hmh@hmh.eng.br>
@@ -215,6 +215,11 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file:
        ... any other 8-hex-digit mask ...
        echo reset > /proc/acpi/ibm/hotkey -- restore the original mask
 
+The procfs interface does not support NVRAM polling control.  So as to
+maintain maximum bug-to-bug compatibility, it does not report any masks,
+nor does it allow one to manipulate the hot key mask when the firmware
+does not support masks at all, even if NVRAM polling is in use.
+
 sysfs notes:
 
        hotkey_bios_enabled:
@@ -231,17 +236,26 @@ sysfs notes:
                to this value.
 
        hotkey_enable:
-               Enables/disables the hot keys feature, and reports
-               current status of the hot keys feature.
+               Enables/disables the hot keys feature in the ACPI
+               firmware, and reports current status of the hot keys
+               feature.  Has no effect on the NVRAM hot key polling
+               functionality.
 
                0: disables the hot keys feature / feature disabled
                1: enables the hot keys feature / feature enabled
 
        hotkey_mask:
-               bit mask to enable driver-handling and ACPI event
-               generation for each hot key (see above).  Returns the
-               current status of the hot keys mask, and allows one to
-               modify it.
+               bit mask to enable driver-handling (and depending on
+               the firmware, ACPI event generation) for each hot key
+               (see above).  Returns the current status of the hot keys
+               mask, and allows one to modify it.
+
+               Note: when NVRAM polling is active, the firmware mask
+               will be different from the value returned by
+               hotkey_mask.  The driver will retain enabled bits for
+               hotkeys that are under NVRAM polling even if the
+               firmware refuses them, and will not set these bits on
+               the firmware hot key mask.
 
        hotkey_all_mask:
                bit mask that should enable event reporting for all
@@ -257,12 +271,48 @@ sysfs notes:
                handled by the firmware anyway.  Echo it to
                hotkey_mask above, to use.
 
+       hotkey_source_mask:
+               bit mask that selects which hot keys will the driver
+               poll the NVRAM for.  This is auto-detected by the driver
+               based on the capabilities reported by the ACPI firmware,
+               but it can be overridden at runtime.
+
+               Hot keys whose bits are set in both hotkey_source_mask
+               and also on hotkey_mask are polled for in NVRAM.  Only a
+               few hot keys are available through CMOS NVRAM polling.
+
+               Warning: when in NVRAM mode, the volume up/down/mute
+               keys are synthesized according to changes in the mixer,
+               so you have to use volume up or volume down to unmute,
+               as per the ThinkPad volume mixer user interface.  When
+               in ACPI event mode, volume up/down/mute are reported as
+               separate events, but this behaviour may be corrected in
+               future releases of this driver, in which case the
+               ThinkPad volume mixer user interface semanthics will be
+               enforced.
+
+       hotkey_poll_freq:
+               frequency in Hz for hot key polling. It must be between
+               0 and 25 Hz.  Polling is only carried out when strictly
+               needed.
+
+               Setting hotkey_poll_freq to zero disables polling, and
+               will cause hot key presses that require NVRAM polling
+               to never be reported.
+
+               Setting hotkey_poll_freq too low will cause repeated
+               pressings of the same hot key to be misreported as a
+               single key press, or to not even be detected at all.
+               The recommended polling frequency is 10Hz.
+
        hotkey_radio_sw:
                if the ThinkPad has a hardware radio switch, this
                attribute will read 0 if the switch is in the "radios
                disabled" postition, and 1 if the switch is in the
                "radios enabled" position.
 
+               This attribute has poll()/select() support.
+
        hotkey_report_mode:
                Returns the state of the procfs ACPI event report mode
                filter for hot keys.  If it is set to 1 (the default),
@@ -277,6 +327,25 @@ sysfs notes:
                May return -EPERM (write access locked out by module
                parameter) or -EACCES (read-only).
 
+       wakeup_reason:
+               Set to 1 if the system is waking up because the user
+               requested a bay ejection.  Set to 2 if the system is
+               waking up because the user requested the system to
+               undock.  Set to zero for normal wake-ups or wake-ups
+               due to unknown reasons.
+
+               This attribute has poll()/select() support.
+
+       wakeup_hotunplug_complete:
+               Set to 1 if the system was waken up because of an
+               undock or bay ejection request, and that request
+               was sucessfully completed.  At this point, it might
+               be useful to send the system back to sleep, at the
+               user's choice.  Refer to HKEY events 0x4003 and
+               0x3003, below.
+
+               This attribute has poll()/select() support.
+
 input layer notes:
 
 A Hot key is mapped to a single input layer EV_KEY event, possibly
@@ -427,6 +496,23 @@ Non hot-key ACPI HKEY event map:
 The above events are not propagated by the driver, except for legacy
 compatibility purposes when hotkey_report_mode is set to 1.
 
+0x2304         System is waking up from suspend to undock
+0x2305         System is waking up from suspend to eject bay
+0x2404         System is waking up from hibernation to undock
+0x2405         System is waking up from hibernation to eject bay
+
+The above events are never propagated by the driver.
+
+0x3003         Bay ejection (see 0x2x05) complete, can sleep again
+0x4003         Undocked (see 0x2x04), can sleep again
+0x5009         Tablet swivel: switched to tablet mode
+0x500A         Tablet swivel: switched to normal mode
+0x500B         Tablet pen insterted into its storage bay
+0x500C         Tablet pen removed from its storage bay
+0x5010         Brightness level changed (newer Lenovo BIOSes)
+
+The above events are propagated by the driver.
+
 Compatibility notes:
 
 ibm-acpi and thinkpad-acpi 0.15 (mainline kernels before 2.6.23) never
@@ -923,19 +1009,34 @@ sysfs backlight device "thinkpad_screen"
 This feature allows software control of the LCD brightness on ThinkPad
 models which don't have a hardware brightness slider.
 
-It has some limitations: the LCD backlight cannot be actually turned on or off
-by this interface, and in many ThinkPad models, the "dim while on battery"
-functionality will be enabled by the BIOS when this interface is used, and
-cannot be controlled.
-
-The backlight control has eight levels, ranging from 0 to 7.  Some of the
-levels may not be distinct.
-
-There are two interfaces to the firmware for brightness control, EC and CMOS.
-To select which one should be used, use the brightness_mode module parameter:
-brightness_mode=1 selects EC mode, brightness_mode=2 selects CMOS mode,
-brightness_mode=3 selects both EC and CMOS.  The driver tries to autodetect
-which interface to use.
+It has some limitations: the LCD backlight cannot be actually turned on or
+off by this interface, and in many ThinkPad models, the "dim while on
+battery" functionality will be enabled by the BIOS when this interface is
+used, and cannot be controlled.
+
+On IBM (and some of the earlier Lenovo) ThinkPads, the backlight control
+has eight brightness levels, ranging from 0 to 7.  Some of the levels
+may not be distinct.  Later Lenovo models that implement the ACPI
+display backlight brightness control methods have 16 levels, ranging
+from 0 to 15.
+
+There are two interfaces to the firmware for direct brightness control,
+EC and CMOS.  To select which one should be used, use the
+brightness_mode module parameter: brightness_mode=1 selects EC mode,
+brightness_mode=2 selects CMOS mode, brightness_mode=3 selects both EC
+and CMOS.  The driver tries to autodetect which interface to use.
+
+When display backlight brightness controls are available through the
+standard ACPI interface, it is best to use it instead of this direct
+ThinkPad-specific interface.  The driver will disable its native
+backlight brightness control interface if it detects that the standard
+ACPI interface is available in the ThinkPad.
+
+The brightness_enable module parameter can be used to control whether
+the LCD brightness control feature will be enabled when available.
+brightness_enable=0 forces it to be disabled.  brightness_enable=1
+forces it to be enabled when available, even if the standard ACPI
+interface is also available.
 
 Procfs notes:
 
@@ -947,11 +1048,11 @@ Procfs notes:
 
 Sysfs notes:
 
-The interface is implemented through the backlight sysfs class, which is poorly
-documented at this time.
+The interface is implemented through the backlight sysfs class, which is
+poorly documented at this time.
 
-Locate the thinkpad_screen device under /sys/class/backlight, and inside it
-there will be the following attributes:
+Locate the thinkpad_screen device under /sys/class/backlight, and inside
+it there will be the following attributes:
 
        max_brightness:
                Reads the maximum brightness the hardware can be set to.
@@ -961,17 +1062,19 @@ there will be the following attributes:
                Reads what brightness the screen is set to at this instant.
 
        brightness:
-               Writes request the driver to change brightness to the given
-               value.  Reads will tell you what brightness the driver is trying
-               to set the display to when "power" is set to zero and the display
-               has not been dimmed by a kernel power management event.
+               Writes request the driver to change brightness to the
+               given value.  Reads will tell you what brightness the
+               driver is trying to set the display to when "power" is set
+               to zero and the display has not been dimmed by a kernel
+               power management event.
 
        power:
-               power management mode, where 0 is "display on", and 1 to 3 will
-               dim the display backlight to brightness level 0 because
-               thinkpad-acpi cannot really turn the backlight off.  Kernel
-               power management events can temporarily increase the current
-               power management level, i.e. they can dim the display.
+               power management mode, where 0 is "display on", and 1 to 3
+               will dim the display backlight to brightness level 0
+               because thinkpad-acpi cannot really turn the backlight
+               off.  Kernel power management events can temporarily
+               increase the current power management level, i.e. they can
+               dim the display.
 
 
 Volume control -- /proc/acpi/ibm/volume
@@ -1035,7 +1138,7 @@ enable it if necessary to avoid overheating.
 
 An enabled fan in level "auto" may stop spinning if the EC decides the
 ThinkPad is cool enough and doesn't need the extra airflow.  This is
-normal, and the EC will spin the fan up if the varios thermal readings
+normal, and the EC will spin the fan up if the various thermal readings
 rise too much.
 
 On the X40, this seems to depend on the CPU and HDD temperatures.
@@ -1203,7 +1306,7 @@ for example:
 Enabling debugging output
 -------------------------
 
-The module takes a debug paramater which can be used to selectively
+The module takes a debug parameter which can be used to selectively
 enable various classes of debugging output, for example:
 
         modprobe ibm_acpi debug=0xffff
@@ -1246,3 +1349,17 @@ Sysfs interface changelog:
                and the hwmon class for libsensors4 (lm-sensors 3)
                compatibility.  Moved all hwmon attributes to this
                new platform device.
+
+0x020100:      Marker for thinkpad-acpi with hot key NVRAM polling
+               support.  If you must, use it to know you should not
+               start an userspace NVRAM poller (allows to detect when
+               NVRAM is compiled out by the user because it is
+               unneeded/undesired in the first place).
+0x020101:      Marker for thinkpad-acpi with hot key NVRAM polling
+               and proper hotkey_mask semanthics (version 8 of the
+               NVRAM polling patch).  Some development snapshots of
+               0.18 had an earlier version that did strange things
+               to hotkey_mask.
+
+0x020200:      Add poll()/select() support to the following attributes:
+               hotkey_radio_sw, wakeup_hotunplug_complete, wakeup_reason