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: (68 commits)
  ACPI: replace kmalloc+memset with kzalloc
  ACPI: Add support for acpi_load_table/acpi_unload_table_id
  fbdev: update after backlight argument change
  ACPI: video: Add dev argument for backlight_device_register
  ACPI: Implement acpi_video_get_next_level()
  ACPI: Kconfig - depend on PM rather than selecting it
  ACPI: fix NULL check in drivers/acpi/osl.c
  ACPI: make drivers/acpi/ec.c:ec_ecdt static
  ACPI: prevent processor module from loading on failures
  ACPI: fix single linked list manipulation
  ACPI: ibm_acpi: allow clean removal
  ACPI: fix git automerge failure
  ACPI: ibm_acpi: respond to workqueue update
  ACPI: dock: add uevent to indicate change in device status
  ACPI: ec: Lindent once again
  ACPI: ec: Change #define to enums there possible.
  ACPI: ec: Style changes.
  ACPI: ec: Acquire Global Lock under EC mutex.
  ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead.
  ACPI: ec: Rename gpe_bit to gpe
  ...
  • Loading branch information
Linus Torvalds committed Dec 23, 2006
2 parents dab6df6 + 36bcbec commit 18ed1c0
Show file tree
Hide file tree
Showing 59 changed files with 1,930 additions and 836 deletions.
151 changes: 120 additions & 31 deletions Documentation/ibm-acpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -398,25 +398,67 @@ Temperature sensors -- /proc/acpi/ibm/thermal

Most ThinkPads include six or more separate temperature sensors but
only expose the CPU temperature through the standard ACPI methods.
This feature shows readings from up to eight different sensors. Some
readings may not be valid, e.g. may show large negative values. For
example, on the X40, a typical output may be:
This feature shows readings from up to eight different sensors on older
ThinkPads, and it has experimental support for up to sixteen different
sensors on newer ThinkPads. Readings from sensors that are not available
return -128.

No commands can be written to this file.

EXPERIMENTAL: The 16-sensors feature is marked EXPERIMENTAL because the
implementation directly accesses hardware registers and may not work as
expected. USE WITH CAUTION! To use this feature, you need to supply the
experimental=1 parameter when loading the module. When EXPERIMENTAL
mode is enabled, reading the first 8 sensors on newer ThinkPads will
also use an new experimental thermal sensor access mode.

For example, on the X40, a typical output may be:
temperatures: 42 42 45 41 36 -128 33 -128

Thomas Gruber took his R51 apart and traced all six active sensors in
his laptop (the location of sensors may vary on other models):
EXPERIMENTAL: On the T43/p, a typical output may be:
temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128

The mapping of thermal sensors to physical locations varies depending on
system-board model (and thus, on ThinkPad model).

http://thinkwiki.org/wiki/Thermal_Sensors is a public wiki page that
tries to track down these locations for various models.

Most (newer?) models seem to follow this pattern:

1: CPU
2: Mini PCI Module
3: HDD
2: (depends on model)
3: (depends on model)
4: GPU
5: Battery
6: N/A
7: Battery
8: N/A
5: Main battery: main sensor
6: Bay battery: main sensor
7: Main battery: secondary sensor
8: Bay battery: secondary sensor
9-15: (depends on model)

For the R51 (source: Thomas Gruber):
2: Mini-PCI
3: Internal HDD

For the T43, T43/p (source: Shmidoax/Thinkwiki.org)
http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p
2: System board, left side (near PCMCIA slot), reported as HDAPS temp
3: PCMCIA slot
9: MCH (northbridge) to DRAM Bus
10: ICH (southbridge), under Mini-PCI card, under touchpad
11: Power regulator, underside of system board, below F2 key

The A31 has a very atypical layout for the thermal sensors
(source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31)
1: CPU
2: Main Battery: main sensor
3: Power Converter
4: Bay Battery: main sensor
5: MCH (northbridge)
6: PCMCIA/ambient
7: Main Battery: secondary sensor
8: Bay Battery: secondary sensor

No commands can be written to this file.

EXPERIMENTAL: Embedded controller register dump -- /proc/acpi/ibm/ecdump
------------------------------------------------------------------------
Expand Down Expand Up @@ -529,27 +571,57 @@ directly accesses hardware registers and may not work as expected. USE
WITH CAUTION! To use this feature, you need to supply the
experimental=1 parameter when loading the module.

This feature attempts to show the current fan speed. The speed is read
directly from the hardware registers of the embedded controller. This
is known to work on later R, T and X series ThinkPads but may show a
bogus value on other models.
This feature attempts to show the current fan speed, control mode and
other fan data that might be available. The speed is read directly
from the hardware registers of the embedded controller. This is known
to work on later R, T and X series ThinkPads but may show a bogus
value on other models.

Most ThinkPad fans work in "levels". Level 0 stops the fan. The higher
the level, the higher the fan speed, although adjacent levels often map
to the same fan speed. 7 is the highest level, where the fan reaches
the maximum recommended speed. Level "auto" means the EC changes the
fan level according to some internal algorithm, usually based on
readings from the thermal sensors. Level "disengaged" means the EC
disables the speed-locked closed-loop fan control, and drives the fan as
fast as it can go, which might exceed hardware limits, so use this level
with caution.

The fan usually ramps up or down slowly from one speed to another,
and it is normal for the EC to take several seconds to react to fan
commands.

The fan may be enabled or disabled with the following commands:

echo enable >/proc/acpi/ibm/fan
echo disable >/proc/acpi/ibm/fan

Placing a fan on level 0 is the same as disabling it. Enabling a fan
will try to place it in a safe level if it is too slow or disabled.

WARNING WARNING WARNING: do not leave the fan disabled unless you are
monitoring the temperature sensor readings and you are ready to enable
it if necessary to avoid overheating.
monitoring all of the temperature sensor readings and you are ready to
enable it if necessary to avoid overheating.

The fan only runs if it's enabled *and* the various temperature
sensors which control it read high enough. On the X40, this seems to
depend on the CPU and HDD temperatures. Specifically, the fan is
turned on when either the CPU temperature climbs to 56 degrees or the
HDD temperature climbs to 46 degrees. The fan is turned off when the
CPU temperature drops to 49 degrees and the HDD temperature drops to
41 degrees. These thresholds cannot currently be controlled.
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
rise too much.

On the X40, this seems to depend on the CPU and HDD temperatures.
Specifically, the fan is turned on when either the CPU temperature
climbs to 56 degrees or the HDD temperature climbs to 46 degrees. The
fan is turned off when the CPU temperature drops to 49 degrees and the
HDD temperature drops to 41 degrees. These thresholds cannot
currently be controlled.

The fan level can be controlled with the command:

echo 'level <level>' > /proc/acpi/ibm/thermal

Where <level> is an integer from 0 to 7, or one of the words "auto"
or "disengaged" (without the quotes). Not all ThinkPads support the
"auto" and "disengaged" levels.

On the X31 and X40 (and ONLY on those models), the fan speed can be
controlled to a certain degree. Once the fan is running, it can be
Expand All @@ -562,12 +634,9 @@ about 3700 to about 7350. Values outside this range either do not have
any effect or the fan speed eventually settles somewhere in that
range. The fan cannot be stopped or started with this command.

On the 570, temperature readings are not available through this
feature and the fan control works a little differently. The fan speed
is reported in levels from 0 (off) to 7 (max) and can be controlled
with the following command:

echo 'level <level>' > /proc/acpi/ibm/thermal
The ThinkPad's ACPI DSDT code will reprogram the fan on its own when
certain conditions are met. It will override any fan programming done
through ibm-acpi.

EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan
---------------------------------------
Expand Down Expand Up @@ -601,6 +670,26 @@ example:

modprobe ibm_acpi hotkey=enable,0xffff video=auto_disable

The ibm-acpi kernel driver can be programmed to revert the fan level
to a safe setting if userspace does not issue one of the fan commands:
"enable", "disable", "level" or "watchdog" within a configurable
ammount of time. To do this, use the "watchdog" command.

echo 'watchdog <interval>' > /proc/acpi/ibm/fan

Interval is the ammount of time in seconds to wait for one of the
above mentioned fan commands before reseting the fan level to a safe
one. If set to zero, the watchdog is disabled (default). When the
watchdog timer runs out, it does the exact equivalent of the "enable"
fan command.

Note that the watchdog timer stops after it enables the fan. It will
be rearmed again automatically (using the same interval) when one of
the above mentioned fan commands is received. The fan watchdog is,
therefore, not suitable to protect against fan mode changes made
through means other than the "enable", "disable", and "level" fan
commands.


Example Configuration
---------------------
Expand Down
9 changes: 9 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,15 @@ W: http://www.ia64-linux.org/
T: git kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git
S: Maintained

IBM ACPI EXTRAS DRIVER
P: Henrique de Moraes Holschuh
M: ibm-acpi@hmh.eng.br
L: ibm-acpi-devel@lists.sourceforge.net
W: http://ibm-acpi.sourceforge.net
W: http://thinkwiki.org/wiki/Ibm-acpi
T: git repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
S: Maintained

SN-IA64 (Itanium) SUB-PLATFORM
P: Jes Sorensen
M: jes@sgi.com
Expand Down
22 changes: 22 additions & 0 deletions arch/i386/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,3 +1327,25 @@ static int __init setup_acpi_sci(char *s)
return 0;
}
early_param("acpi_sci", setup_acpi_sci);

int __acpi_acquire_global_lock(unsigned int *lock)
{
unsigned int old, new, val;
do {
old = *lock;
new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
val = cmpxchg(lock, old, new);
} while (unlikely (val != old));
return (new < 3) ? -1 : 0;
}

int __acpi_release_global_lock(unsigned int *lock)
{
unsigned int old, new, val;
do {
old = *lock;
new = old & ~0x3;
val = cmpxchg(lock, old, new);
} while (unlikely (val != old));
return old & 0x1;
}
4 changes: 1 addition & 3 deletions arch/ia64/kernel/cpufreq/acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,10 @@ acpi_cpufreq_cpu_init (

dprintk("acpi_cpufreq_cpu_init\n");

data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
if (!data)
return (-ENOMEM);

memset(data, 0, sizeof(struct cpufreq_acpi_io));

acpi_io_data[cpu] = data;

result = acpi_processor_register_performance(&data->acpi_data, cpu);
Expand Down
17 changes: 16 additions & 1 deletion drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config ACPI
bool "ACPI Support"
depends on IA64 || X86
depends on PCI
select PM
depends on PM
default y
---help---
Advanced Configuration and Power Interface (ACPI) support for
Expand Down Expand Up @@ -97,6 +97,7 @@ config ACPI_BATTERY

config ACPI_BUTTON
tristate "Button"
depends on INPUT
default y
help
This driver handles events on the power, sleep and lid buttons.
Expand Down Expand Up @@ -172,6 +173,7 @@ config ACPI_NUMA
config ACPI_ASUS
tristate "ASUS/Medion Laptop Extras"
depends on X86
select BACKLIGHT_CLASS_DEVICE
---help---
This driver provides support for extra features of ACPI-compatible
ASUS laptops. As some of Medion laptops are made by ASUS, it may also
Expand Down Expand Up @@ -200,6 +202,7 @@ config ACPI_ASUS
config ACPI_IBM
tristate "IBM ThinkPad Laptop Extras"
depends on X86
select BACKLIGHT_CLASS_DEVICE
---help---
This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds
support for Fn-Fx key combinations, Bluetooth control, video
Expand All @@ -222,9 +225,21 @@ config ACPI_IBM_DOCK

If you are not sure, say N here.

config ACPI_IBM_BAY
bool "Legacy Removable Bay Support"
depends on ACPI_IBM
depends on ACPI_BAY=n
default n
---help---
Allows the ibm_acpi driver to handle removable bays.
This support is obsoleted by CONFIG_ACPI_BAY.

If you are not sure, say N here.

config ACPI_TOSHIBA
tristate "Toshiba Laptop Extras"
depends on X86
select BACKLIGHT_CLASS_DEVICE
---help---
This driver adds support for access to certain system settings
on "legacy free" Toshiba laptops. These laptops can be recognized by
Expand Down
9 changes: 4 additions & 5 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static struct proc_dir_entry *acpi_ac_dir;

static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_ac *ac = (struct acpi_ac *)seq->private;
struct acpi_ac *ac = seq->private;


if (!ac)
Expand Down Expand Up @@ -187,7 +187,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)

static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_ac *ac = (struct acpi_ac *)data;
struct acpi_ac *ac = data;
struct acpi_device *device = NULL;


Expand Down Expand Up @@ -221,10 +221,9 @@ static int acpi_ac_add(struct acpi_device *device)
if (!device)
return -EINVAL;

ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL);
if (!ac)
return -ENOMEM;
memset(ac, 0, sizeof(struct acpi_ac));

ac->device = device;
strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
Expand Down Expand Up @@ -269,7 +268,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return -EINVAL;

ac = (struct acpi_ac *)acpi_driver_data(device);
ac = acpi_driver_data(device);

status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify);
Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,9 @@ static int acpi_memory_device_add(struct acpi_device *device)
if (!device)
return -EINVAL;

mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
mem_device = kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
if (!mem_device)
return -ENOMEM;
memset(mem_device, 0, sizeof(struct acpi_memory_device));

INIT_LIST_HEAD(&mem_device->res_list);
mem_device->device = device;
Expand Down Expand Up @@ -429,7 +428,7 @@ static int acpi_memory_device_remove(struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return -EINVAL;

mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
mem_device = acpi_driver_data(device);
kfree(mem_device);

return 0;
Expand Down
Loading

0 comments on commit 18ed1c0

Please sign in to comment.