aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/acpi/video_extension.txt
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2013-06-20 03:08:57 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-20 18:16:05 -0400
commit86393865f0c9f7002aa1fc2b8bdce11f3aefcebe (patch)
tree45deb041cd5782bced7a6876d91d76145c9bcb7f /Documentation/acpi/video_extension.txt
parent70e66e4df19167653aba95b4dacbcfd3254a4019 (diff)
ACPI / video: update video_extension.txt for backlight control
The ACPI video driver has changed a lot, and it doesn't export interfaces in /proc any more, so the documentation for it should be updated. This update focuses on ACPI video driver's backlight control. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'Documentation/acpi/video_extension.txt')
-rw-r--r--Documentation/acpi/video_extension.txt121
1 files changed, 95 insertions, 26 deletions
diff --git a/Documentation/acpi/video_extension.txt b/Documentation/acpi/video_extension.txt
index b2f9b1598ac2..78b32ac02466 100644
--- a/Documentation/acpi/video_extension.txt
+++ b/Documentation/acpi/video_extension.txt
@@ -8,30 +8,99 @@ defining the video POST device, retrieving EDID information or to
8setup a video output, etc. Note that this is an ref. implementation 8setup a video output, etc. Note that this is an ref. implementation
9only. It may or may not work for your integrated video device. 9only. It may or may not work for your integrated video device.
10 10
11Interfaces exposed to userland through /proc/acpi/video: 11The ACPI video driver does 3 things regarding backlight control:
12
13VGA/info : display the supported video bus device capability like Video ROM, CRT/LCD/TV.
14VGA/ROM : Used to get a copy of the display devices' ROM data (up to 4k).
15VGA/POST_info : Used to determine what options are implemented.
16VGA/POST : Used to get/set POST device.
17VGA/DOS : Used to get/set ownership of output switching:
18 Please refer ACPI spec B.4.1 _DOS
19VGA/CRT : CRT output
20VGA/LCD : LCD output
21VGA/TVO : TV output
22VGA/*/brightness : Used to get/set brightness of output device
23
24Notify event through /proc/acpi/event:
25
26#define ACPI_VIDEO_NOTIFY_SWITCH 0x80
27#define ACPI_VIDEO_NOTIFY_PROBE 0x81
28#define ACPI_VIDEO_NOTIFY_CYCLE 0x82
29#define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83
30#define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84
31
32#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x82
33#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x83
34#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x84
35#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x85
36#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x86
37 12
131 Export a sysfs interface for user space to control backlight level
14
15If the ACPI table has a video device, and acpi_backlight=vendor kernel
16command line is not present, the driver will register a backlight device
17and set the required backlight operation structure for it for the sysfs
18interface control. For every registered class device, there will be a
19directory named acpi_videoX under /sys/class/backlight.
20
21The backlight sysfs interface has a standard definition here:
22Documentation/ABI/stable/sysfs-class-backlight.
23
24And what ACPI video driver does is:
25actual_brightness: on read, control method _BQC will be evaluated to
26get the brightness level the firmware thinks it is at;
27bl_power: not implemented, will set the current brightness instead;
28brightness: on write, control method _BCM will run to set the requested
29brightness level;
30max_brightness: Derived from the _BCL package(see below);
31type: firmware
32
33Note that ACPI video backlight driver will always use index for
34brightness, actual_brightness and max_brightness. So if we have
35the following _BCL package:
36
37Method (_BCL, 0, NotSerialized)
38{
39 Return (Package (0x0C)
40 {
41 0x64,
42 0x32,
43 0x0A,
44 0x14,
45 0x1E,
46 0x28,
47 0x32,
48 0x3C,
49 0x46,
50 0x50,
51 0x5A,
52 0x64
53 })
54}
55
56The first two levels are for when laptop are on AC or on battery and are
57not used by Linux currently. The remaining 10 levels are supported levels
58that we can choose from. The applicable index values are from 0 (that
59corresponds to the 0x0A brightness value) to 9 (that corresponds to the
600x64 brightness value) inclusive. Each of those index values is regarded
61as a "brightness level" indicator. Thus from the user space perspective
62the range of available brightness levels is from 0 to 9 (max_brightness)
63inclusive.
64
652 Notify user space about hotkey event
66
67There are generally two cases for hotkey event reporting:
68i) For some laptops, when user presses the hotkey, a scancode will be
69 generated and sent to user space through the input device created by
70 the keyboard driver as a key type input event, with proper remap, the
71 following key code will appear to user space:
72
73 EV_KEY, KEY_BRIGHTNESSUP
74 EV_KEY, KEY_BRIGHTNESSDOWN
75 etc.
76
77For this case, ACPI video driver does not need to do anything(actually,
78it doesn't even know this happened).
79
80ii) For some laptops, the press of the hotkey will not generate the
81 scancode, instead, firmware will notify the video device ACPI node
82 about the event. The event value is defined in the ACPI spec. ACPI
83 video driver will generate an key type input event according to the
84 notify value it received and send the event to user space through the
85 input device it created:
86
87 event keycode
88 0x86 KEY_BRIGHTNESSUP
89 0x87 KEY_BRIGHTNESSDOWN
90 etc.
91
92so this would lead to the same effect as case i) now.
93
94Once user space tool receives this event, it can modify the backlight
95level through the sysfs interface.
96
973 Change backlight level in the kernel
98
99This works for machines covered by case ii) in Section 2. Once the driver
100received a notification, it will set the backlight level accordingly. This does
101not affect the sending of event to user space, they are always sent to user
102space regardless of whether or not the video module controls the backlight level
103directly. This behaviour can be controlled through the brightness_switch_enabled
104module parameter as documented in kernel-parameters.txt. It is recommended to
105disable this behaviour once a GUI environment starts up and wants to have full
106control of the backlight level.