Skip to content

Commit 288f02b

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (117 commits) ACPI processor: Fix section mismatch for processor_add() ACPI: Add platform-wide _OSC support. ACPI: cleanup pci_root _OSC code. ACPI: Add a generic API for _OSC -v2 msi-wmi: depend on backlight and fix corner-cases problems msi-wmi: switch to using input sparse keymap library msi-wmi: replace one-condition switch-case with if statement msi-wmi: remove unused field 'instance' in key_entry structure msi-wmi: remove custom runtime debug implementation msi-wmi: rework init msi-wmi: remove useless includes X86 drivers: Introduce msi-wmi driver Toshiba Bluetooth Enabling driver (RFKill handler v3) ACPI: fix for lapic_timer_propagate_broadcast() acpi_pad: squish warning ACPI: dock: minor whitespace and style cleanups ACPI: dock: add struct dock_station * directly to platform device data ACPI: dock: dock_add - hoist up platform_device_register_simple() ACPI: dock: remove global 'dock_device_name' ACPI: dock: combine add|alloc_dock_dependent_device (v2) ...
2 parents 8aedf8a + aa96ce0 commit 288f02b

66 files changed

Lines changed: 4126 additions & 1725 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Linux ACPI Custom Control Method How To
2+
=======================================
3+
4+
Written by Zhang Rui <rui.zhang@intel.com>
5+
6+
7+
Linux supports customizing ACPI control methods at runtime.
8+
9+
Users can use this to
10+
1. override an existing method which may not work correctly,
11+
or just for debugging purposes.
12+
2. insert a completely new method in order to create a missing
13+
method such as _OFF, _ON, _STA, _INI, etc.
14+
For these cases, it is far simpler to dynamically install a single
15+
control method rather than override the entire DSDT, because kernel
16+
rebuild/reboot is not needed and test result can be got in minutes.
17+
18+
Note: Only ACPI METHOD can be overridden, any other object types like
19+
"Device", "OperationRegion", are not recognized.
20+
Note: The same ACPI control method can be overridden for many times,
21+
and it's always the latest one that used by Linux/kernel.
22+
23+
1. override an existing method
24+
a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT,
25+
just run "cat /sys/firmware/acpi/tables/DSDT > /tmp/dsdt.dat"
26+
b) disassemble the table by running "iasl -d dsdt.dat".
27+
c) rewrite the ASL code of the method and save it in a new file,
28+
d) package the new file (psr.asl) to an ACPI table format.
29+
Here is an example of a customized \_SB._AC._PSR method,
30+
31+
DefinitionBlock ("", "SSDT", 1, "", "", 0x20080715)
32+
{
33+
External (ACON)
34+
35+
Method (\_SB_.AC._PSR, 0, NotSerialized)
36+
{
37+
Store ("In AC _PSR", Debug)
38+
Return (ACON)
39+
}
40+
}
41+
Note that the full pathname of the method in ACPI namespace
42+
should be used.
43+
And remember to use "External" to declare external objects.
44+
e) assemble the file to generate the AML code of the method.
45+
e.g. "iasl psr.asl" (psr.aml is generated as a result)
46+
f) mount debugfs by "mount -t debugfs none /sys/kernel/debug"
47+
g) override the old method via the debugfs by running
48+
"cat /tmp/psr.aml > /sys/kernel/debug/acpi/custom_method"
49+
50+
2. insert a new method
51+
This is easier than overriding an existing method.
52+
We just need to create the ASL code of the method we want to
53+
insert and then follow the step c) ~ g) in section 1.
54+
55+
3. undo your changes
56+
The "undo" operation is not supported for a new inserted method
57+
right now, i.e. we can not remove a method currently.
58+
For an overrided method, in order to undo your changes, please
59+
save a copy of the method original ASL code in step c) section 1,
60+
and redo step c) ~ g) to override the method with the original one.
61+
62+
63+
Note: We can use a kernel with multiple custom ACPI method running,
64+
But each individual write to debugfs can implement a SINGLE
65+
method override. i.e. if we want to insert/override multiple
66+
ACPI methods, we need to redo step c) ~ g) for multiple times.

‎Documentation/feature-removal-schedule.txt‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,3 +474,22 @@ Why: Obsoleted by the adt7475 driver.
474474
Who: Jean Delvare <khali@linux-fr.org>
475475

476476
---------------------------
477+
What: Support for lcd_switch and display_get in asus-laptop driver
478+
When: March 2010
479+
Why: These two features use non-standard interfaces. There are the
480+
only features that really need multiple path to guess what's
481+
the right method name on a specific laptop.
482+
483+
Removing them will allow to remove a lot of code an significantly
484+
clean the drivers.
485+
486+
This will affect the backlight code which won't be able to know
487+
if the backlight is on or off. The platform display file will also be
488+
write only (like the one in eeepc-laptop).
489+
490+
This should'nt affect a lot of user because they usually know
491+
when their display is on or off.
492+
493+
Who: Corentin Chary <corentin.chary@gmail.com>
494+
495+
----------------------------

‎Documentation/laptops/thinkpad-acpi.txt‎

Lines changed: 64 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ThinkPad ACPI Extras Driver
22

3-
Version 0.23
4-
April 10th, 2009
3+
Version 0.24
4+
December 11th, 2009
55

66
Borislav Deianov <borislav@users.sf.net>
77
Henrique de Moraes Holschuh <hmh@hmh.eng.br>
@@ -460,6 +460,8 @@ event code Key Notes
460460
For Lenovo ThinkPads with a new
461461
BIOS, it has to be handled either
462462
by the ACPI OSI, or by userspace.
463+
The driver does the right thing,
464+
never mess with this.
463465
0x1011 0x10 FN+END Brightness down. See brightness
464466
up for details.
465467

@@ -582,46 +584,15 @@ with hotkey_report_mode.
582584

583585
Brightness hotkey notes:
584586

585-
These are the current sane choices for brightness key mapping in
586-
thinkpad-acpi:
587+
Don't mess with the brightness hotkeys in a Thinkpad. If you want
588+
notifications for OSD, use the sysfs backlight class event support.
587589

588-
For IBM and Lenovo models *without* ACPI backlight control (the ones on
589-
which thinkpad-acpi will autoload its backlight interface by default,
590-
and on which ACPI video does not export a backlight interface):
591-
592-
1. Don't enable or map the brightness hotkeys in thinkpad-acpi, as
593-
these older firmware versions unfortunately won't respect the hotkey
594-
mask for brightness keys anyway, and always reacts to them. This
595-
usually work fine, unless X.org drivers are doing something to block
596-
the BIOS. In that case, use (3) below. This is the default mode of
597-
operation.
598-
599-
2. Enable the hotkeys, but map them to something else that is NOT
600-
KEY_BRIGHTNESS_UP/DOWN or any other keycode that would cause
601-
userspace to try to change the backlight level, and use that as an
602-
on-screen-display hint.
603-
604-
3. IF AND ONLY IF X.org drivers find a way to block the firmware from
605-
automatically changing the brightness, enable the hotkeys and map
606-
them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN, and feed that to
607-
something that calls xbacklight. thinkpad-acpi will not be able to
608-
change brightness in that case either, so you should disable its
609-
backlight interface.
610-
611-
For Lenovo models *with* ACPI backlight control:
612-
613-
1. Load up ACPI video and use that. ACPI video will report ACPI
614-
events for brightness change keys. Do not mess with thinkpad-acpi
615-
defaults in this case. thinkpad-acpi should not have anything to do
616-
with backlight events in a scenario where ACPI video is loaded:
617-
brightness hotkeys must be disabled, and the backlight interface is
618-
to be kept disabled as well. This is the default mode of operation.
619-
620-
2. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi,
621-
and map them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN. Process
622-
these keys on userspace somehow (e.g. by calling xbacklight).
623-
The driver will do this automatically if it detects that ACPI video
624-
has been disabled.
590+
The driver will issue KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN events
591+
automatically for the cases were userspace has to do something to
592+
implement brightness changes. When you override these events, you will
593+
either fail to handle properly the ThinkPads that require explicit
594+
action to change backlight brightness, or the ThinkPads that require
595+
that no action be taken to work properly.
625596

626597

627598
Bluetooth
@@ -1121,25 +1092,61 @@ WARNING:
11211092
its level up and down at every change.
11221093

11231094

1124-
Volume control -- /proc/acpi/ibm/volume
1125-
---------------------------------------
1095+
Volume control
1096+
--------------
1097+
1098+
procfs: /proc/acpi/ibm/volume
1099+
ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC"
1100+
1101+
NOTE: by default, the volume control interface operates in read-only
1102+
mode, as it is supposed to be used for on-screen-display purposes.
1103+
The read/write mode can be enabled through the use of the
1104+
"volume_control=1" module parameter.
11261105

1127-
This feature allows volume control on ThinkPad models which don't have
1128-
a hardware volume knob. The available commands are:
1106+
NOTE: distros are urged to not enable volume_control by default, this
1107+
should be done by the local admin only. The ThinkPad UI is for the
1108+
console audio control to be done through the volume keys only, and for
1109+
the desktop environment to just provide on-screen-display feedback.
1110+
Software volume control should be done only in the main AC97/HDA
1111+
mixer.
1112+
1113+
This feature allows volume control on ThinkPad models with a digital
1114+
volume knob (when available, not all models have it), as well as
1115+
mute/unmute control. The available commands are:
11291116

11301117
echo up >/proc/acpi/ibm/volume
11311118
echo down >/proc/acpi/ibm/volume
11321119
echo mute >/proc/acpi/ibm/volume
1120+
echo unmute >/proc/acpi/ibm/volume
11331121
echo 'level <level>' >/proc/acpi/ibm/volume
11341122

1135-
The <level> number range is 0 to 15 although not all of them may be
1123+
The <level> number range is 0 to 14 although not all of them may be
11361124
distinct. The unmute the volume after the mute command, use either the
1137-
up or down command (the level command will not unmute the volume).
1125+
up or down command (the level command will not unmute the volume), or
1126+
the unmute command.
1127+
11381128
The current volume level and mute state is shown in the file.
11391129

1140-
The ALSA mixer interface to this feature is still missing, but patches
1141-
to add it exist. That problem should be addressed in the not so
1142-
distant future.
1130+
You can use the volume_capabilities parameter to tell the driver
1131+
whether your thinkpad has volume control or mute-only control:
1132+
volume_capabilities=1 for mixers with mute and volume control,
1133+
volume_capabilities=2 for mixers with only mute control.
1134+
1135+
If the driver misdetects the capabilities for your ThinkPad model,
1136+
please report this to ibm-acpi-devel@lists.sourceforge.net, so that we
1137+
can update the driver.
1138+
1139+
There are two strategies for volume control. To select which one
1140+
should be used, use the volume_mode module parameter: volume_mode=1
1141+
selects EC mode, and volume_mode=3 selects EC mode with NVRAM backing
1142+
(so that volume/mute changes are remembered across shutdown/reboot).
1143+
1144+
The driver will operate in volume_mode=3 by default. If that does not
1145+
work well on your ThinkPad model, please report this to
1146+
ibm-acpi-devel@lists.sourceforge.net.
1147+
1148+
The driver supports the standard ALSA module parameters. If the ALSA
1149+
mixer is disabled, the driver will disable all volume functionality.
11431150

11441151

11451152
Fan control and monitoring: fan speed, fan enable/disable
@@ -1405,6 +1412,7 @@ to enable more than one output class, just add their values.
14051412
0x0008 HKEY event interface, hotkeys
14061413
0x0010 Fan control
14071414
0x0020 Backlight brightness
1415+
0x0040 Audio mixer/volume control
14081416

14091417
There is also a kernel build option to enable more debugging
14101418
information, which may be necessary to debug driver problems.
@@ -1465,3 +1473,9 @@ Sysfs interface changelog:
14651473
and it is always able to disable hot keys. Very old
14661474
thinkpads are properly supported. hotkey_bios_mask
14671475
is deprecated and marked for removal.
1476+
1477+
0x020600: Marker for backlight change event support.
1478+
1479+
0x020700: Support for mute-only mixers.
1480+
Volume control in read-only mode by default.
1481+
Marker for ALSA mixer support.

‎Documentation/thermal/sysfs-api.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ passive
206206
passive trip point for the zone. Activation is done by polling with
207207
an interval of 1 second.
208208
Unit: millidegrees Celsius
209+
Valid values: 0 (disabled) or greater than 1000
209210
RW, Optional
210211

211212
*****************************

‎arch/x86/kernel/acpi/cstate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
4848
* P4, Core and beyond CPUs
4949
*/
5050
if (c->x86_vendor == X86_VENDOR_INTEL &&
51-
(c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 14)))
51+
(c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 0x0f)))
5252
flags->bm_control = 0;
5353
}
5454
EXPORT_SYMBOL(acpi_processor_power_init_bm_check);

‎drivers/acpi/acpi_pad.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ static void round_robin_cpu(unsigned int tsk_index)
100100
struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits);
101101
cpumask_var_t tmp;
102102
int cpu;
103-
unsigned long min_weight = -1, preferred_cpu;
103+
unsigned long min_weight = -1;
104+
unsigned long uninitialized_var(preferred_cpu);
104105

105106
if (!alloc_cpumask_var(&tmp, GFP_KERNEL))
106107
return;

‎drivers/acpi/acpica/acnamesp.h‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data,
296296
acpi_status validate_status,
297297
union acpi_operand_object **return_object_ptr);
298298

299+
void
300+
acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
301+
u8 package_type,
302+
union acpi_operand_object *obj_desc);
303+
299304
/*
300305
* nssearch - Namespace searching and entry
301306
*/
@@ -354,9 +359,7 @@ acpi_ns_externalize_name(u32 internal_name_length,
354359
const char *internal_name,
355360
u32 * converted_name_length, char **converted_name);
356361

357-
struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle);
358-
359-
acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node);
362+
struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle);
360363

361364
void acpi_ns_terminate(void);
362365

‎drivers/acpi/acpica/acobject.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ struct acpi_object_method {
180180
u8 sync_level;
181181
union acpi_operand_object *mutex;
182182
u8 *aml_start;
183-
ACPI_INTERNAL_METHOD implementation;
183+
union {
184+
ACPI_INTERNAL_METHOD implementation;
185+
union acpi_operand_object *handler;
186+
} extra;
187+
184188
u32 aml_length;
185189
u8 thread_count;
186190
acpi_owner_id owner_id;

‎drivers/acpi/acpica/dsmethod.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
414414
/* Invoke an internal method if necessary */
415415

416416
if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
417-
status = obj_desc->method.implementation(next_walk_state);
417+
status = obj_desc->method.extra.implementation(next_walk_state);
418418
if (status == AE_OK) {
419419
status = AE_CTRL_TERMINATE;
420420
}

0 commit comments

Comments
 (0)