Skip to content

Commit

Permalink
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (26 commits)
  PM: Make suspend_device() static
  PCI ACPI: Fix comment describing acpi_pci_choose_state
  Hibernation: Handle DEBUG_PAGEALLOC on x86
  ACPI: fix build warning
  ACPI: TSC breaks atkbd suspend
  ACPI: remove is_processor_present prototype
  acer-wmi: Add DMI match for mail LED on Acer TravelMate 4200 series
  ACPI: sparse fix, replace macro with static function
  ACPI: thinkpad-acpi: add tablet-mode reporting
  ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes
  ACPI: thinkpad-acpi: improve thinkpad-acpi input device documentation
  ACPI: thinkpad-acpi: issue input events for tablet swivel events
  ACPI: thinkpad-acpi: make the video output feature optional
  ACPI: thinkpad-acpi: synchronize input device switches
  ACPI: thinkpad-acpi: always track input device open/close
  ACPI: thinkpad-acpi: trivial fix to documentation
  ACPI: thinkpad-acpi: trivial fix to module_desc typo
  intel_menlo: extract return values using PTR_ERR
  ACPI video: check for error from thermal_cooling_device_register
  ACPI thermal: extract return values using PTR_ERR
  ...
  • Loading branch information
Linus Torvalds committed Feb 22, 2008
2 parents e6364cd + 1f1519e commit 20f8d2a
Show file tree
Hide file tree
Showing 18 changed files with 321 additions and 123 deletions.
63 changes: 38 additions & 25 deletions Documentation/laptops/thinkpad-acpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Hot keys
procfs: /proc/acpi/ibm/hotkey
sysfs device attribute: hotkey_*

In a ThinkPad, the ACPI HKEY handler is responsible for comunicating
In a ThinkPad, the ACPI HKEY handler is responsible for communicating
some important events and also keyboard hot key presses to the operating
system. Enabling the hotkey functionality of thinkpad-acpi signals the
firmware that such a driver is present, and modifies how the ThinkPad
Expand Down Expand Up @@ -193,7 +193,7 @@ Not all bits in the mask can be modified. Not all bits that can be
modified do anything. Not all hot keys can be individually controlled
by the mask. Some models do not support the mask at all, and in those
models, hot keys cannot be controlled individually. The behaviour of
the mask is, therefore, higly dependent on the ThinkPad model.
the mask is, therefore, highly dependent on the ThinkPad model.

Note that unmasking some keys prevents their default behavior. For
example, if Fn+F5 is unmasked, that key will no longer enable/disable
Expand Down Expand Up @@ -288,7 +288,7 @@ sysfs notes:
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
ThinkPad volume mixer user interface semantics will be
enforced.

hotkey_poll_freq:
Expand All @@ -306,13 +306,20 @@ sysfs notes:
The recommended polling frequency is 10Hz.

hotkey_radio_sw:
if the ThinkPad has a hardware radio switch, this
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
disabled" position, and 1 if the switch is in the
"radios enabled" position.

This attribute has poll()/select() support.

hotkey_tablet_mode:
If the ThinkPad has tablet capabilities, this attribute
will read 0 if the ThinkPad is in normal mode, and
1 if the ThinkPad is in tablet mode.

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),
Expand All @@ -339,7 +346,7 @@ sysfs notes:
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
was successfully 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.
Expand Down Expand Up @@ -392,7 +399,7 @@ event code Key Notes
Lenovo: battery

0x1004 0x03 FN+F4 Sleep button (ACPI sleep button
semanthics, i.e. sleep-to-RAM).
semantics, i.e. sleep-to-RAM).
It is always generate some kind
of event, either the hot key
event or a ACPI sleep button
Expand All @@ -403,12 +410,12 @@ event code Key Notes
time passes.

0x1005 0x04 FN+F5 Radio. Enables/disables
the internal BlueTooth hardware
the internal Bluetooth hardware
and W-WAN card if left in control
of the firmware. Does not affect
the WLAN card.
Should be used to turn on/off all
radios (bluetooth+W-WAN+WLAN),
radios (Bluetooth+W-WAN+WLAN),
really.

0x1006 0x05 FN+F6 -
Expand All @@ -417,7 +424,7 @@ event code Key Notes
Do you feel lucky today?

0x1008 0x07 FN+F8 IBM: toggle screen expand
Lenovo: configure ultranav
Lenovo: configure UltraNav

0x1009 0x08 FN+F9 -
.. .. ..
Expand Down Expand Up @@ -447,7 +454,7 @@ event code Key Notes
0x1011 0x10 FN+END Brightness down. See brightness
up for details.

0x1012 0x11 FN+PGUP Thinklight toggle. This key is
0x1012 0x11 FN+PGUP ThinkLight toggle. This key is
always handled by the firmware,
even when unmasked.

Expand All @@ -469,7 +476,7 @@ event code Key Notes
key is always handled by the
firmware, even when unmasked.

0x1018 0x17 THINKPAD Thinkpad/Access IBM/Lenovo key
0x1018 0x17 THINKPAD ThinkPad/Access IBM/Lenovo key

0x1019 0x18 unknown
.. .. ..
Expand All @@ -488,9 +495,17 @@ If a key is mapped to KEY_UNKNOWN, it generates an input event that
includes an scan code. If a key is mapped to anything else, it will
generate input device EV_KEY events.

In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW
events for switches:

SW_RADIO T60 and later hardare rfkill rocker switch
SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A

Non hot-key ACPI HKEY event map:
0x5001 Lid closed
0x5002 Lid opened
0x5009 Tablet swivel: switched to tablet mode
0x500A Tablet swivel: switched to normal mode
0x7000 Radio Switch may have changed state

The above events are not propagated by the driver, except for legacy
Expand All @@ -505,9 +520,7 @@ 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
0x500B Tablet pen inserted into its storage bay
0x500C Tablet pen removed from its storage bay
0x5010 Brightness level changed (newer Lenovo BIOSes)

Expand Down Expand Up @@ -539,7 +552,7 @@ sysfs (it is read-only).
If the hotkey_report_mode module parameter is set to 1 or 2, it cannot
be changed later through sysfs (any writes will return -EPERM to signal
that hotkey_report_mode was locked. On 2.6.23 and later, where
hotkey_report_mode cannot be changed at all, writes will return -EACES).
hotkey_report_mode cannot be changed at all, writes will return -EACCES).

hotkey_report_mode set to 1 makes the driver export through the procfs
ACPI event interface all hot key presses (which are *also* sent to the
Expand Down Expand Up @@ -584,7 +597,7 @@ Sysfs notes:
0: disables Bluetooth / Bluetooth is disabled
1: enables Bluetooth / Bluetooth is enabled.

Note: this interface will be probably be superseeded by the
Note: this interface will be probably be superseded by the
generic rfkill class, so it is NOT to be considered stable yet.

Video output control -- /proc/acpi/ibm/video
Expand Down Expand Up @@ -791,12 +804,12 @@ on the X40 (tpb is the ThinkPad Buttons utility):
1 - Related to "Volume up" key press
2 - Related to "Mute on" key press
3 - Related to "Access IBM" key press
4 - Related to "LCD brightness up" key pess
4 - Related to "LCD brightness up" key press
5 - Related to "LCD brightness down" key press
11 - Related to "toggle screen expansion" key press/function
12 - Related to "ThinkLight on"
13 - Related to "ThinkLight off"
14 - Related to "ThinkLight" key press (toggle thinklight)
14 - Related to "ThinkLight" key press (toggle ThinkLight)

The cmos command interface is prone to firmware split-brain problems, as
in newer ThinkPads it is just a compatibility layer. Do not use it, it is
Expand Down Expand Up @@ -1024,7 +1037,7 @@ 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.
and CMOS. The driver tries to auto-detect 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
Expand Down Expand Up @@ -1266,8 +1279,8 @@ experimental=1 parameter when loading the module.
This feature shows the presence and current state of a W-WAN (Sierra
Wireless EV-DO) device.

It was tested on a Lenovo Thinkpad X60. It should probably work on other
Thinkpad models which come with this module installed.
It was tested on a Lenovo ThinkPad X60. It should probably work on other
ThinkPad models which come with this module installed.

Procfs notes:

Expand All @@ -1286,7 +1299,7 @@ Sysfs notes:
0: disables WWAN card / WWAN card is disabled
1: enables WWAN card / WWAN card is enabled.

Note: this interface will be probably be superseeded by the
Note: this interface will be probably be superseded by the
generic rfkill class, so it is NOT to be considered stable yet.

Multiple Commands, Module Parameters
Expand All @@ -1309,7 +1322,7 @@ Enabling debugging output
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
modprobe thinkpad_acpi debug=0xffff

will enable all debugging output classes. It takes a bitmask, so
to enable more than one output class, just add their values.
Expand Down Expand Up @@ -1356,7 +1369,7 @@ Sysfs interface changelog:
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
and proper hotkey_mask semantics (version 8 of the
NVRAM polling patch). Some development snapshots of
0.18 had an earlier version that did strange things
to hotkey_mask.
Expand Down
19 changes: 18 additions & 1 deletion arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,24 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
*/
cpa_fill_pool();
}
#endif

#ifdef CONFIG_HIBERNATION

bool kernel_page_present(struct page *page)
{
unsigned int level;
pte_t *pte;

if (PageHighMem(page))
return false;

pte = lookup_address((unsigned long)page_address(page), &level);
return (pte_val(*pte) & _PAGE_PRESENT);
}

#endif /* CONFIG_HIBERNATION */

#endif /* CONFIG_DEBUG_PAGEALLOC */

/*
* The testcases use internal knowledge of the implementation that shouldn't
Expand Down
6 changes: 5 additions & 1 deletion drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,11 @@ int __init acpi_ec_ecdt_probe(void)
boot_ec->command_addr = ecdt_ptr->control.address;
boot_ec->data_addr = ecdt_ptr->data.address;
boot_ec->gpe = ecdt_ptr->gpe;
boot_ec->handle = ACPI_ROOT_OBJECT;
if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id,
&boot_ec->handle))) {
pr_info("Failed to locate handle for boot EC\n");
boot_ec->handle = ACPI_ROOT_OBJECT;
}
} else {
/* This workaround is needed only on some broken machines,
* which require early EC, but fail to provide ECDT */
Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/executer/exregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ acpi_ex_pci_config_space_handler(u32 function,
acpi_status status = AE_OK;
struct acpi_pci_id *pci_id;
u16 pci_register;
u32 value32;

ACPI_FUNCTION_TRACE(ex_pci_config_space_handler);

Expand All @@ -364,9 +365,9 @@ acpi_ex_pci_config_space_handler(u32 function,
switch (function) {
case ACPI_READ:

*value = 0;
status = acpi_os_read_pci_configuration(pci_id, pci_register,
value, bit_width);
&value32, bit_width);
*value = value32;
break;

case ACPI_WRITE:
Expand Down
30 changes: 18 additions & 12 deletions drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,28 @@ static int acpi_fan_add(struct acpi_device *device)

cdev = thermal_cooling_device_register("Fan", device,
&fan_cooling_ops);
if (cdev)
if (IS_ERR(cdev)) {
result = PTR_ERR(cdev);
goto end;
}
if (cdev) {
printk(KERN_INFO PREFIX
"%s is registered as cooling_device%d\n",
device->dev.bus_id, cdev->id);
else
goto end;
acpi_driver_data(device) = cdev;
result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj,
"thermal_cooling");
if (result)
return result;

result = sysfs_create_link(&cdev->device.kobj, &device->dev.kobj,
"device");
if (result)
return result;
acpi_driver_data(device) = cdev;
result = sysfs_create_link(&device->dev.kobj,
&cdev->device.kobj,
"thermal_cooling");
if (result)
return result;

result = sysfs_create_link(&cdev->device.kobj,
&device->dev.kobj,
"device");
if (result)
return result;
}

result = acpi_fan_add_fs(device);
if (result)
Expand Down
39 changes: 22 additions & 17 deletions drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,21 +670,26 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)

pr->cdev = thermal_cooling_device_register("Processor", device,
&processor_cooling_ops);
if (pr->cdev)
if (IS_ERR(pr->cdev)) {
result = PTR_ERR(pr->cdev);
goto end;
}
if (pr->cdev) {
printk(KERN_INFO PREFIX
"%s is registered as cooling_device%d\n",
device->dev.bus_id, pr->cdev->id);
else
goto end;

result = sysfs_create_link(&device->dev.kobj, &pr->cdev->device.kobj,
"thermal_cooling");
if (result)
return result;
result = sysfs_create_link(&pr->cdev->device.kobj, &device->dev.kobj,
"device");
if (result)
return result;
result = sysfs_create_link(&device->dev.kobj,
&pr->cdev->device.kobj,
"thermal_cooling");
if (result)
return result;
result = sysfs_create_link(&pr->cdev->device.kobj,
&device->dev.kobj,
"device");
if (result)
return result;
}

if (pr->flags.throttling) {
printk(KERN_INFO PREFIX "%s [%s] (supports",
Expand Down Expand Up @@ -809,10 +814,12 @@ static int acpi_processor_remove(struct acpi_device *device, int type)

acpi_processor_remove_fs(device);

sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
sysfs_remove_link(&pr->cdev->device.kobj, "device");
thermal_cooling_device_unregister(pr->cdev);
pr->cdev = NULL;
if (pr->cdev) {
sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
sysfs_remove_link(&pr->cdev->device.kobj, "device");
thermal_cooling_device_unregister(pr->cdev);
pr->cdev = NULL;
}

processors[pr->id] = NULL;

Expand All @@ -826,8 +833,6 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
* Acpi processor hotplug support *
****************************************************************************/

static int is_processor_present(acpi_handle handle);

static int is_processor_present(acpi_handle handle)
{
acpi_status status;
Expand Down
Loading

0 comments on commit 20f8d2a

Please sign in to comment.