diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-04-18 10:12:57 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-07-15 08:20:25 -0400 |
commit | b02f1651ff7758c4db0d759ab765d39986a79f5a (patch) | |
tree | c129ec86b6d244203d00066c4dc3d0b911e54d54 | |
parent | db9a0975a20c1f21c108b9d44545792d790593e4 (diff) |
docs: laptops: convert to ReST
Rename the laptops documentation files to ReST, add an
index for them and adjust in order to produce a nice html
output via the Sphinx build system.
At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
-rw-r--r-- | Documentation/ABI/testing/sysfs-block-device | 2 | ||||
-rw-r--r-- | Documentation/ABI/testing/sysfs-platform-asus-laptop | 2 | ||||
-rw-r--r-- | Documentation/admin-guide/kernel-parameters.txt | 2 | ||||
-rw-r--r-- | Documentation/laptops/asus-laptop.rst (renamed from Documentation/laptops/asus-laptop.txt) | 92 | ||||
-rw-r--r-- | Documentation/laptops/disk-shock-protection.rst (renamed from Documentation/laptops/disk-shock-protection.txt) | 32 | ||||
-rw-r--r-- | Documentation/laptops/index.rst | 17 | ||||
-rw-r--r-- | Documentation/laptops/laptop-mode.rst (renamed from Documentation/laptops/laptop-mode.txt) | 579 | ||||
-rw-r--r-- | Documentation/laptops/sony-laptop.rst (renamed from Documentation/laptops/sony-laptop.txt) | 58 | ||||
-rw-r--r-- | Documentation/laptops/sonypi.rst (renamed from Documentation/laptops/sonypi.txt) | 28 | ||||
-rw-r--r-- | Documentation/laptops/thinkpad-acpi.rst (renamed from Documentation/laptops/thinkpad-acpi.txt) | 363 | ||||
-rw-r--r-- | Documentation/laptops/toshiba_haps.rst (renamed from Documentation/laptops/toshiba_haps.txt) | 47 | ||||
-rw-r--r-- | Documentation/sysctl/vm.txt | 4 | ||||
-rw-r--r-- | MAINTAINERS | 2 | ||||
-rw-r--r-- | drivers/char/Kconfig | 2 | ||||
-rw-r--r-- | drivers/platform/x86/Kconfig | 4 |
15 files changed, 695 insertions, 539 deletions
diff --git a/Documentation/ABI/testing/sysfs-block-device b/Documentation/ABI/testing/sysfs-block-device index 82ef6eab042d..0d57bbb4fddc 100644 --- a/Documentation/ABI/testing/sysfs-block-device +++ b/Documentation/ABI/testing/sysfs-block-device | |||
@@ -45,7 +45,7 @@ Description: | |||
45 | - Values below -2 are rejected with -EINVAL | 45 | - Values below -2 are rejected with -EINVAL |
46 | 46 | ||
47 | For more information, see | 47 | For more information, see |
48 | Documentation/laptops/disk-shock-protection.txt | 48 | Documentation/laptops/disk-shock-protection.rst |
49 | 49 | ||
50 | 50 | ||
51 | What: /sys/block/*/device/ncq_prio_enable | 51 | What: /sys/block/*/device/ncq_prio_enable |
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop index cd9d667c3da2..d67fa4bafa70 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-laptop +++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop | |||
@@ -31,7 +31,7 @@ Description: | |||
31 | To control the LED display, use the following : | 31 | To control the LED display, use the following : |
32 | echo 0x0T000DDD > /sys/devices/platform/asus_laptop/ | 32 | echo 0x0T000DDD > /sys/devices/platform/asus_laptop/ |
33 | where T control the 3 letters display, and DDD the 3 digits display. | 33 | where T control the 3 letters display, and DDD the 3 digits display. |
34 | The DDD table can be found in Documentation/laptops/asus-laptop.txt | 34 | The DDD table can be found in Documentation/laptops/asus-laptop.rst |
35 | 35 | ||
36 | What: /sys/devices/platform/asus_laptop/bluetooth | 36 | What: /sys/devices/platform/asus_laptop/bluetooth |
37 | Date: January 2007 | 37 | Date: January 2007 |
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index ed104a44e8b2..a342dd5c95a9 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -4347,7 +4347,7 @@ | |||
4347 | Format: <integer> | 4347 | Format: <integer> |
4348 | 4348 | ||
4349 | sonypi.*= [HW] Sony Programmable I/O Control Device driver | 4349 | sonypi.*= [HW] Sony Programmable I/O Control Device driver |
4350 | See Documentation/laptops/sonypi.txt | 4350 | See Documentation/laptops/sonypi.rst |
4351 | 4351 | ||
4352 | spectre_v2= [X86] Control mitigation of Spectre variant 2 | 4352 | spectre_v2= [X86] Control mitigation of Spectre variant 2 |
4353 | (indirect branch speculation) vulnerability. | 4353 | (indirect branch speculation) vulnerability. |
diff --git a/Documentation/laptops/asus-laptop.txt b/Documentation/laptops/asus-laptop.rst index 5f2858712aa0..95176321a25a 100644 --- a/Documentation/laptops/asus-laptop.txt +++ b/Documentation/laptops/asus-laptop.rst | |||
@@ -1,6 +1,9 @@ | |||
1 | ================== | ||
1 | Asus Laptop Extras | 2 | Asus Laptop Extras |
3 | ================== | ||
2 | 4 | ||
3 | Version 0.1 | 5 | Version 0.1 |
6 | |||
4 | August 6, 2009 | 7 | August 6, 2009 |
5 | 8 | ||
6 | Corentin Chary <corentincj@iksaif.net> | 9 | Corentin Chary <corentincj@iksaif.net> |
@@ -10,11 +13,12 @@ http://acpi4asus.sf.net/ | |||
10 | It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or | 13 | It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or |
11 | VICTOR XP7210 for example). It makes all the extra buttons generate input | 14 | VICTOR XP7210 for example). It makes all the extra buttons generate input |
12 | events (like keyboards). | 15 | events (like keyboards). |
16 | |||
13 | On some models adds support for changing the display brightness and output, | 17 | On some models adds support for changing the display brightness and output, |
14 | switching the LCD backlight on and off, and most importantly, allows you to | 18 | switching the LCD backlight on and off, and most importantly, allows you to |
15 | blink those fancy LEDs intended for reporting mail and wireless status. | 19 | blink those fancy LEDs intended for reporting mail and wireless status. |
16 | 20 | ||
17 | This driver supercedes the old asus_acpi driver. | 21 | This driver supersedes the old asus_acpi driver. |
18 | 22 | ||
19 | Requirements | 23 | Requirements |
20 | ------------ | 24 | ------------ |
@@ -49,7 +53,7 @@ Usage | |||
49 | see some lines like this : | 53 | see some lines like this : |
50 | 54 | ||
51 | Asus Laptop Extras version 0.42 | 55 | Asus Laptop Extras version 0.42 |
52 | L2D model detected. | 56 | - L2D model detected. |
53 | 57 | ||
54 | If it is not the output you have on your laptop, send it (and the laptop's | 58 | If it is not the output you have on your laptop, send it (and the laptop's |
55 | DSDT) to me. | 59 | DSDT) to me. |
@@ -68,9 +72,12 @@ Usage | |||
68 | LEDs | 72 | LEDs |
69 | ---- | 73 | ---- |
70 | 74 | ||
71 | You can modify LEDs be echoing values to /sys/class/leds/asus::*/brightness : | 75 | You can modify LEDs be echoing values to `/sys/class/leds/asus/*/brightness`:: |
76 | |||
72 | echo 1 > /sys/class/leds/asus::mail/brightness | 77 | echo 1 > /sys/class/leds/asus::mail/brightness |
78 | |||
73 | will switch the mail LED on. | 79 | will switch the mail LED on. |
80 | |||
74 | You can also know if they are on/off by reading their content and use | 81 | You can also know if they are on/off by reading their content and use |
75 | kernel triggers like disk-activity or heartbeat. | 82 | kernel triggers like disk-activity or heartbeat. |
76 | 83 | ||
@@ -81,7 +88,7 @@ Backlight | |||
81 | /sys/class/backlight/asus-laptop/. Brightness Values are between 0 and 15. | 88 | /sys/class/backlight/asus-laptop/. Brightness Values are between 0 and 15. |
82 | 89 | ||
83 | Wireless devices | 90 | Wireless devices |
84 | --------------- | 91 | ---------------- |
85 | 92 | ||
86 | You can turn the internal Bluetooth adapter on/off with the bluetooth entry | 93 | You can turn the internal Bluetooth adapter on/off with the bluetooth entry |
87 | (only on models with Bluetooth). This usually controls the associated LED. | 94 | (only on models with Bluetooth). This usually controls the associated LED. |
@@ -93,18 +100,20 @@ Display switching | |||
93 | Note: the display switching code is currently considered EXPERIMENTAL. | 100 | Note: the display switching code is currently considered EXPERIMENTAL. |
94 | 101 | ||
95 | Switching works for the following models: | 102 | Switching works for the following models: |
96 | L3800C | 103 | |
97 | A2500H | 104 | - L3800C |
98 | L5800C | 105 | - A2500H |
99 | M5200N | 106 | - L5800C |
100 | W1000N (albeit with some glitches) | 107 | - M5200N |
101 | M6700R | 108 | - W1000N (albeit with some glitches) |
102 | A6JC | 109 | - M6700R |
103 | F3J | 110 | - A6JC |
111 | - F3J | ||
104 | 112 | ||
105 | Switching doesn't work for the following: | 113 | Switching doesn't work for the following: |
106 | M3700N | 114 | |
107 | L2X00D (locks the laptop under certain conditions) | 115 | - M3700N |
116 | - L2X00D (locks the laptop under certain conditions) | ||
108 | 117 | ||
109 | To switch the displays, echo values from 0 to 15 to | 118 | To switch the displays, echo values from 0 to 15 to |
110 | /sys/devices/platform/asus-laptop/display. The significance of those values | 119 | /sys/devices/platform/asus-laptop/display. The significance of those values |
@@ -113,48 +122,51 @@ Display switching | |||
113 | +-------+-----+-----+-----+-----+-----+ | 122 | +-------+-----+-----+-----+-----+-----+ |
114 | | Bin | Val | DVI | TV | CRT | LCD | | 123 | | Bin | Val | DVI | TV | CRT | LCD | |
115 | +-------+-----+-----+-----+-----+-----+ | 124 | +-------+-----+-----+-----+-----+-----+ |
116 | + 0000 + 0 + + + + + | 125 | | 0000 | 0 | | | | | |
117 | +-------+-----+-----+-----+-----+-----+ | 126 | +-------+-----+-----+-----+-----+-----+ |
118 | + 0001 + 1 + + + + X + | 127 | | 0001 | 1 | | | | X | |
119 | +-------+-----+-----+-----+-----+-----+ | 128 | +-------+-----+-----+-----+-----+-----+ |
120 | + 0010 + 2 + + + X + + | 129 | | 0010 | 2 | | | X | | |
121 | +-------+-----+-----+-----+-----+-----+ | 130 | +-------+-----+-----+-----+-----+-----+ |
122 | + 0011 + 3 + + + X + X + | 131 | | 0011 | 3 | | | X | X | |
123 | +-------+-----+-----+-----+-----+-----+ | 132 | +-------+-----+-----+-----+-----+-----+ |
124 | + 0100 + 4 + + X + + + | 133 | | 0100 | 4 | | X | | | |
125 | +-------+-----+-----+-----+-----+-----+ | 134 | +-------+-----+-----+-----+-----+-----+ |
126 | + 0101 + 5 + + X + + X + | 135 | | 0101 | 5 | | X | | X | |
127 | +-------+-----+-----+-----+-----+-----+ | 136 | +-------+-----+-----+-----+-----+-----+ |
128 | + 0110 + 6 + + X + X + + | 137 | | 0110 | 6 | | X | X | | |
129 | +-------+-----+-----+-----+-----+-----+ | 138 | +-------+-----+-----+-----+-----+-----+ |
130 | + 0111 + 7 + + X + X + X + | 139 | | 0111 | 7 | | X | X | X | |
131 | +-------+-----+-----+-----+-----+-----+ | 140 | +-------+-----+-----+-----+-----+-----+ |
132 | + 1000 + 8 + X + + + + | 141 | | 1000 | 8 | X | | | | |
133 | +-------+-----+-----+-----+-----+-----+ | 142 | +-------+-----+-----+-----+-----+-----+ |
134 | + 1001 + 9 + X + + + X + | 143 | | 1001 | 9 | X | | | X | |
135 | +-------+-----+-----+-----+-----+-----+ | 144 | +-------+-----+-----+-----+-----+-----+ |
136 | + 1010 + 10 + X + + X + + | 145 | | 1010 | 10 | X | | X | | |
137 | +-------+-----+-----+-----+-----+-----+ | 146 | +-------+-----+-----+-----+-----+-----+ |
138 | + 1011 + 11 + X + + X + X + | 147 | | 1011 | 11 | X | | X | X | |
139 | +-------+-----+-----+-----+-----+-----+ | 148 | +-------+-----+-----+-----+-----+-----+ |
140 | + 1100 + 12 + X + X + + + | 149 | | 1100 | 12 | X | X | | | |
141 | +-------+-----+-----+-----+-----+-----+ | 150 | +-------+-----+-----+-----+-----+-----+ |
142 | + 1101 + 13 + X + X + + X + | 151 | | 1101 | 13 | X | X | | X | |
143 | +-------+-----+-----+-----+-----+-----+ | 152 | +-------+-----+-----+-----+-----+-----+ |
144 | + 1110 + 14 + X + X + X + + | 153 | | 1110 | 14 | X | X | X | | |
145 | +-------+-----+-----+-----+-----+-----+ | 154 | +-------+-----+-----+-----+-----+-----+ |
146 | + 1111 + 15 + X + X + X + X + | 155 | | 1111 | 15 | X | X | X | X | |
147 | +-------+-----+-----+-----+-----+-----+ | 156 | +-------+-----+-----+-----+-----+-----+ |
148 | 157 | ||
149 | In most cases, the appropriate displays must be plugged in for the above | 158 | In most cases, the appropriate displays must be plugged in for the above |
150 | combinations to work. TV-Out may need to be initialized at boot time. | 159 | combinations to work. TV-Out may need to be initialized at boot time. |
151 | 160 | ||
152 | Debugging: | 161 | Debugging: |
162 | |||
153 | 1) Check whether the Fn+F8 key: | 163 | 1) Check whether the Fn+F8 key: |
164 | |||
154 | a) does not lock the laptop (try a boot with noapic / nolapic if it does) | 165 | a) does not lock the laptop (try a boot with noapic / nolapic if it does) |
155 | b) generates events (0x6n, where n is the value corresponding to the | 166 | b) generates events (0x6n, where n is the value corresponding to the |
156 | configuration above) | 167 | configuration above) |
157 | c) actually works | 168 | c) actually works |
169 | |||
158 | Record the disp value at every configuration. | 170 | Record the disp value at every configuration. |
159 | 2) Echo values from 0 to 15 to /sys/devices/platform/asus-laptop/display. | 171 | 2) Echo values from 0 to 15 to /sys/devices/platform/asus-laptop/display. |
160 | Record its value, note any change. If nothing changes, try a broader range, | 172 | Record its value, note any change. If nothing changes, try a broader range, |
@@ -164,7 +176,7 @@ Display switching | |||
164 | 176 | ||
165 | Note: on some machines (e.g. L3C), after the module has been loaded, only 0x6n | 177 | Note: on some machines (e.g. L3C), after the module has been loaded, only 0x6n |
166 | events are generated and no actual switching occurs. In such a case, a line | 178 | events are generated and no actual switching occurs. In such a case, a line |
167 | like: | 179 | like:: |
168 | 180 | ||
169 | echo $((10#$arg-60)) > /sys/devices/platform/asus-laptop/display | 181 | echo $((10#$arg-60)) > /sys/devices/platform/asus-laptop/display |
170 | 182 | ||
@@ -180,15 +192,16 @@ LED display | |||
180 | several items of information. | 192 | several items of information. |
181 | 193 | ||
182 | LED display works for the following models: | 194 | LED display works for the following models: |
183 | W1000N | ||
184 | W1J | ||
185 | 195 | ||
186 | To control the LED display, use the following : | 196 | - W1000N |
197 | - W1J | ||
198 | |||
199 | To control the LED display, use the following:: | ||
187 | 200 | ||
188 | echo 0x0T000DDD > /sys/devices/platform/asus-laptop/ | 201 | echo 0x0T000DDD > /sys/devices/platform/asus-laptop/ |
189 | 202 | ||
190 | where T control the 3 letters display, and DDD the 3 digits display, | 203 | where T control the 3 letters display, and DDD the 3 digits display, |
191 | according to the tables below. | 204 | according to the tables below:: |
192 | 205 | ||
193 | DDD (digits) | 206 | DDD (digits) |
194 | 000 to 999 = display digits | 207 | 000 to 999 = display digits |
@@ -208,8 +221,8 @@ LED display | |||
208 | For example "echo 0x01000001 >/sys/devices/platform/asus-laptop/ledd" | 221 | For example "echo 0x01000001 >/sys/devices/platform/asus-laptop/ledd" |
209 | would display "DVD001". | 222 | would display "DVD001". |
210 | 223 | ||
211 | Driver options: | 224 | Driver options |
212 | --------------- | 225 | -------------- |
213 | 226 | ||
214 | Options can be passed to the asus-laptop driver using the standard | 227 | Options can be passed to the asus-laptop driver using the standard |
215 | module argument syntax (<param>=<value> when passing the option to the | 228 | module argument syntax (<param>=<value> when passing the option to the |
@@ -219,6 +232,7 @@ Driver options: | |||
219 | wapf: WAPF defines the behavior of the Fn+Fx wlan key | 232 | wapf: WAPF defines the behavior of the Fn+Fx wlan key |
220 | The significance of values is yet to be found, but | 233 | The significance of values is yet to be found, but |
221 | most of the time: | 234 | most of the time: |
235 | |||
222 | - 0x0 should do nothing | 236 | - 0x0 should do nothing |
223 | - 0x1 should allow to control the device with Fn+Fx key. | 237 | - 0x1 should allow to control the device with Fn+Fx key. |
224 | - 0x4 should send an ACPI event (0x88) while pressing the Fn+Fx key | 238 | - 0x4 should send an ACPI event (0x88) while pressing the Fn+Fx key |
@@ -237,7 +251,7 @@ Unsupported models | |||
237 | - ASUS L7300G | 251 | - ASUS L7300G |
238 | - ASUS L8400 | 252 | - ASUS L8400 |
239 | 253 | ||
240 | Patches, Errors, Questions: | 254 | Patches, Errors, Questions |
241 | -------------------------- | 255 | -------------------------- |
242 | 256 | ||
243 | I appreciate any success or failure | 257 | I appreciate any success or failure |
@@ -253,5 +267,5 @@ Patches, Errors, Questions: | |||
253 | Any other comments or patches are also more than welcome. | 267 | Any other comments or patches are also more than welcome. |
254 | 268 | ||
255 | acpi4asus-user@lists.sourceforge.net | 269 | acpi4asus-user@lists.sourceforge.net |
256 | http://sourceforge.net/projects/acpi4asus | ||
257 | 270 | ||
271 | http://sourceforge.net/projects/acpi4asus | ||
diff --git a/Documentation/laptops/disk-shock-protection.txt b/Documentation/laptops/disk-shock-protection.rst index 0e6ba2663834..e97c5f78d8c3 100644 --- a/Documentation/laptops/disk-shock-protection.txt +++ b/Documentation/laptops/disk-shock-protection.rst | |||
@@ -1,17 +1,18 @@ | |||
1 | ========================== | ||
1 | Hard disk shock protection | 2 | Hard disk shock protection |
2 | ========================== | 3 | ========================== |
3 | 4 | ||
4 | Author: Elias Oltmanns <eo@nebensachen.de> | 5 | Author: Elias Oltmanns <eo@nebensachen.de> |
6 | |||
5 | Last modified: 2008-10-03 | 7 | Last modified: 2008-10-03 |
6 | 8 | ||
7 | 9 | ||
8 | 0. Contents | 10 | .. 0. Contents |
9 | ----------- | ||
10 | 11 | ||
11 | 1. Intro | 12 | 1. Intro |
12 | 2. The interface | 13 | 2. The interface |
13 | 3. References | 14 | 3. References |
14 | 4. CREDITS | 15 | 4. CREDITS |
15 | 16 | ||
16 | 17 | ||
17 | 1. Intro | 18 | 1. Intro |
@@ -36,8 +37,8 @@ that). | |||
36 | ---------------- | 37 | ---------------- |
37 | 38 | ||
38 | For each ATA device, the kernel exports the file | 39 | For each ATA device, the kernel exports the file |
39 | block/*/device/unload_heads in sysfs (here assumed to be mounted under | 40 | `block/*/device/unload_heads` in sysfs (here assumed to be mounted under |
40 | /sys). Access to /sys/block/*/device/unload_heads is denied with | 41 | /sys). Access to `/sys/block/*/device/unload_heads` is denied with |
41 | -EOPNOTSUPP if the device does not support the unload feature. | 42 | -EOPNOTSUPP if the device does not support the unload feature. |
42 | Otherwise, writing an integer value to this file will take the heads | 43 | Otherwise, writing an integer value to this file will take the heads |
43 | of the respective drive off the platter and block all I/O operations | 44 | of the respective drive off the platter and block all I/O operations |
@@ -54,18 +55,18 @@ cancel a previously set timeout and resume normal operation | |||
54 | immediately by specifying a timeout of 0. Values below -2 are rejected | 55 | immediately by specifying a timeout of 0. Values below -2 are rejected |
55 | with -EINVAL (see below for the special meaning of -1 and -2). If the | 56 | with -EINVAL (see below for the special meaning of -1 and -2). If the |
56 | timeout specified for a recent head park request has not yet expired, | 57 | timeout specified for a recent head park request has not yet expired, |
57 | reading from /sys/block/*/device/unload_heads will report the number | 58 | reading from `/sys/block/*/device/unload_heads` will report the number |
58 | of milliseconds remaining until normal operation will be resumed; | 59 | of milliseconds remaining until normal operation will be resumed; |
59 | otherwise, reading the unload_heads attribute will return 0. | 60 | otherwise, reading the unload_heads attribute will return 0. |
60 | 61 | ||
61 | For example, do the following in order to park the heads of drive | 62 | For example, do the following in order to park the heads of drive |
62 | /dev/sda and stop all I/O operations for five seconds: | 63 | /dev/sda and stop all I/O operations for five seconds:: |
63 | 64 | ||
64 | # echo 5000 > /sys/block/sda/device/unload_heads | 65 | # echo 5000 > /sys/block/sda/device/unload_heads |
65 | 66 | ||
66 | A simple | 67 | A simple:: |
67 | 68 | ||
68 | # cat /sys/block/sda/device/unload_heads | 69 | # cat /sys/block/sda/device/unload_heads |
69 | 70 | ||
70 | will show you how many milliseconds are left before normal operation | 71 | will show you how many milliseconds are left before normal operation |
71 | will be resumed. | 72 | will be resumed. |
@@ -112,9 +113,9 @@ unload_heads attribute. If you know that your device really does | |||
112 | support the unload feature (for instance, because the vendor of your | 113 | support the unload feature (for instance, because the vendor of your |
113 | laptop or the hard drive itself told you so), then you can tell the | 114 | laptop or the hard drive itself told you so), then you can tell the |
114 | kernel to enable the usage of this feature for that drive by writing | 115 | kernel to enable the usage of this feature for that drive by writing |
115 | the special value -1 to the unload_heads attribute: | 116 | the special value -1 to the unload_heads attribute:: |
116 | 117 | ||
117 | # echo -1 > /sys/block/sda/device/unload_heads | 118 | # echo -1 > /sys/block/sda/device/unload_heads |
118 | 119 | ||
119 | will enable the feature for /dev/sda, and giving -2 instead of -1 will | 120 | will enable the feature for /dev/sda, and giving -2 instead of -1 will |
120 | disable it again. | 121 | disable it again. |
@@ -135,6 +136,7 @@ for use. Please feel free to add projects that have been the victims | |||
135 | of my ignorance. | 136 | of my ignorance. |
136 | 137 | ||
137 | - http://www.thinkwiki.org/wiki/HDAPS | 138 | - http://www.thinkwiki.org/wiki/HDAPS |
139 | |||
138 | See this page for information about Linux support of the hard disk | 140 | See this page for information about Linux support of the hard disk |
139 | active protection system as implemented in IBM/Lenovo Thinkpads. | 141 | active protection system as implemented in IBM/Lenovo Thinkpads. |
140 | 142 | ||
diff --git a/Documentation/laptops/index.rst b/Documentation/laptops/index.rst new file mode 100644 index 000000000000..001a30910d09 --- /dev/null +++ b/Documentation/laptops/index.rst | |||
@@ -0,0 +1,17 @@ | |||
1 | :orphan: | ||
2 | |||
3 | ============== | ||
4 | Laptop Drivers | ||
5 | ============== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | asus-laptop | ||
11 | disk-shock-protection | ||
12 | laptop-mode | ||
13 | lg-laptop | ||
14 | sony-laptop | ||
15 | sonypi | ||
16 | thinkpad-acpi | ||
17 | toshiba_haps | ||
diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.rst index 1c707fc9b141..c984c4262f2e 100644 --- a/Documentation/laptops/laptop-mode.txt +++ b/Documentation/laptops/laptop-mode.rst | |||
@@ -1,8 +1,11 @@ | |||
1 | =============================================== | ||
1 | How to conserve battery power using laptop-mode | 2 | How to conserve battery power using laptop-mode |
2 | ----------------------------------------------- | 3 | =============================================== |
3 | 4 | ||
4 | Document Author: Bart Samwel (bart@samwel.tk) | 5 | Document Author: Bart Samwel (bart@samwel.tk) |
6 | |||
5 | Date created: January 2, 2004 | 7 | Date created: January 2, 2004 |
8 | |||
6 | Last modified: December 06, 2004 | 9 | Last modified: December 06, 2004 |
7 | 10 | ||
8 | Introduction | 11 | Introduction |
@@ -12,17 +15,16 @@ Laptop mode is used to minimize the time that the hard disk needs to be spun up, | |||
12 | to conserve battery power on laptops. It has been reported to cause significant | 15 | to conserve battery power on laptops. It has been reported to cause significant |
13 | power savings. | 16 | power savings. |
14 | 17 | ||
15 | Contents | 18 | .. Contents |
16 | -------- | ||
17 | 19 | ||
18 | * Introduction | 20 | * Introduction |
19 | * Installation | 21 | * Installation |
20 | * Caveats | 22 | * Caveats |
21 | * The Details | 23 | * The Details |
22 | * Tips & Tricks | 24 | * Tips & Tricks |
23 | * Control script | 25 | * Control script |
24 | * ACPI integration | 26 | * ACPI integration |
25 | * Monitoring tool | 27 | * Monitoring tool |
26 | 28 | ||
27 | 29 | ||
28 | Installation | 30 | Installation |
@@ -33,7 +35,7 @@ or anything. Simply install all the files included in this document, and | |||
33 | laptop mode will automatically be started when you're on battery. For | 35 | laptop mode will automatically be started when you're on battery. For |
34 | your convenience, a tarball containing an installer can be downloaded at: | 36 | your convenience, a tarball containing an installer can be downloaded at: |
35 | 37 | ||
36 | http://www.samwel.tk/laptop_mode/laptop_mode/ | 38 | http://www.samwel.tk/laptop_mode/laptop_mode/ |
37 | 39 | ||
38 | To configure laptop mode, you need to edit the configuration file, which is | 40 | To configure laptop mode, you need to edit the configuration file, which is |
39 | located in /etc/default/laptop-mode on Debian-based systems, or in | 41 | located in /etc/default/laptop-mode on Debian-based systems, or in |
@@ -209,7 +211,7 @@ Tips & Tricks | |||
209 | this on powerbooks too. I hope that this is a piece of information that | 211 | this on powerbooks too. I hope that this is a piece of information that |
210 | might be useful to the Laptop Mode patch or its users." | 212 | might be useful to the Laptop Mode patch or its users." |
211 | 213 | ||
212 | * In syslog.conf, you can prefix entries with a dash ``-'' to omit syncing the | 214 | * In syslog.conf, you can prefix entries with a dash `-` to omit syncing the |
213 | file after every logging. When you're using laptop-mode and your disk doesn't | 215 | file after every logging. When you're using laptop-mode and your disk doesn't |
214 | spin down, this is a likely culprit. | 216 | spin down, this is a likely culprit. |
215 | 217 | ||
@@ -233,83 +235,82 @@ configuration file | |||
233 | It should be installed as /etc/default/laptop-mode on Debian, and as | 235 | It should be installed as /etc/default/laptop-mode on Debian, and as |
234 | /etc/sysconfig/laptop-mode on Red Hat, SUSE, Mandrake, and other work-alikes. | 236 | /etc/sysconfig/laptop-mode on Red Hat, SUSE, Mandrake, and other work-alikes. |
235 | 237 | ||
236 | --------------------CONFIG FILE BEGIN------------------------------------------- | 238 | Config file:: |
237 | # Maximum time, in seconds, of hard drive spindown time that you are | 239 | |
238 | # comfortable with. Worst case, it's possible that you could lose this | 240 | # Maximum time, in seconds, of hard drive spindown time that you are |
239 | # amount of work if your battery fails you while in laptop mode. | 241 | # comfortable with. Worst case, it's possible that you could lose this |
240 | #MAX_AGE=600 | 242 | # amount of work if your battery fails you while in laptop mode. |
241 | 243 | #MAX_AGE=600 | |
242 | # Automatically disable laptop mode when the number of minutes of battery | 244 | |
243 | # that you have left goes below this threshold. | 245 | # Automatically disable laptop mode when the number of minutes of battery |
244 | MINIMUM_BATTERY_MINUTES=10 | 246 | # that you have left goes below this threshold. |
245 | 247 | MINIMUM_BATTERY_MINUTES=10 | |
246 | # Read-ahead, in 512-byte sectors. You can spin down the disk while playing MP3/OGG | 248 | |
247 | # by setting the disk readahead to 8MB (READAHEAD=16384). Effectively, the disk | 249 | # Read-ahead, in 512-byte sectors. You can spin down the disk while playing MP3/OGG |
248 | # will read a complete MP3 at once, and will then spin down while the MP3/OGG is | 250 | # by setting the disk readahead to 8MB (READAHEAD=16384). Effectively, the disk |
249 | # playing. | 251 | # will read a complete MP3 at once, and will then spin down while the MP3/OGG is |
250 | #READAHEAD=4096 | 252 | # playing. |
251 | 253 | #READAHEAD=4096 | |
252 | # Shall we remount journaled fs. with appropriate commit interval? (1=yes) | 254 | |
253 | #DO_REMOUNTS=1 | 255 | # Shall we remount journaled fs. with appropriate commit interval? (1=yes) |
254 | 256 | #DO_REMOUNTS=1 | |
255 | # And shall we add the "noatime" option to that as well? (1=yes) | 257 | |
256 | #DO_REMOUNT_NOATIME=1 | 258 | # And shall we add the "noatime" option to that as well? (1=yes) |
257 | 259 | #DO_REMOUNT_NOATIME=1 | |
258 | # Dirty synchronous ratio. At this percentage of dirty pages the process | 260 | |
259 | # which | 261 | # Dirty synchronous ratio. At this percentage of dirty pages the process |
260 | # calls write() does its own writeback | 262 | # which |
261 | #DIRTY_RATIO=40 | 263 | # calls write() does its own writeback |
262 | 264 | #DIRTY_RATIO=40 | |
263 | # | 265 | |
264 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been | 266 | # |
265 | # exceeded, the kernel will wake flusher threads which will then reduce the | 267 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been |
266 | # amount of dirty memory to dirty_background_ratio. Set this nice and low, | 268 | # exceeded, the kernel will wake flusher threads which will then reduce the |
267 | # so once some writeout has commenced, we do a lot of it. | 269 | # amount of dirty memory to dirty_background_ratio. Set this nice and low, |
268 | # | 270 | # so once some writeout has commenced, we do a lot of it. |
269 | #DIRTY_BACKGROUND_RATIO=5 | 271 | # |
270 | 272 | #DIRTY_BACKGROUND_RATIO=5 | |
271 | # kernel default dirty buffer age | 273 | |
272 | #DEF_AGE=30 | 274 | # kernel default dirty buffer age |
273 | #DEF_UPDATE=5 | 275 | #DEF_AGE=30 |
274 | #DEF_DIRTY_BACKGROUND_RATIO=10 | 276 | #DEF_UPDATE=5 |
275 | #DEF_DIRTY_RATIO=40 | 277 | #DEF_DIRTY_BACKGROUND_RATIO=10 |
276 | #DEF_XFS_AGE_BUFFER=15 | 278 | #DEF_DIRTY_RATIO=40 |
277 | #DEF_XFS_SYNC_INTERVAL=30 | 279 | #DEF_XFS_AGE_BUFFER=15 |
278 | #DEF_XFS_BUFD_INTERVAL=1 | 280 | #DEF_XFS_SYNC_INTERVAL=30 |
279 | 281 | #DEF_XFS_BUFD_INTERVAL=1 | |
280 | # This must be adjusted manually to the value of HZ in the running kernel | 282 | |
281 | # on 2.4, until the XFS people change their 2.4 external interfaces to work in | 283 | # This must be adjusted manually to the value of HZ in the running kernel |
282 | # centisecs. This can be automated, but it's a work in progress that still | 284 | # on 2.4, until the XFS people change their 2.4 external interfaces to work in |
283 | # needs# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for | 285 | # centisecs. This can be automated, but it's a work in progress that still |
284 | # external interfaces, and that is currently always set to 100. So you don't | 286 | # needs# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for |
285 | # need to change this on 2.6. | 287 | # external interfaces, and that is currently always set to 100. So you don't |
286 | #XFS_HZ=100 | 288 | # need to change this on 2.6. |
287 | 289 | #XFS_HZ=100 | |
288 | # Should the maximum CPU frequency be adjusted down while on battery? | 290 | |
289 | # Requires CPUFreq to be setup. | 291 | # Should the maximum CPU frequency be adjusted down while on battery? |
290 | # See Documentation/admin-guide/pm/cpufreq.rst for more info | 292 | # Requires CPUFreq to be setup. |
291 | #DO_CPU=0 | 293 | # See Documentation/admin-guide/pm/cpufreq.rst for more info |
292 | 294 | #DO_CPU=0 | |
293 | # When on battery what is the maximum CPU speed that the system should | 295 | |
294 | # use? Legal values are "slowest" for the slowest speed that your | 296 | # When on battery what is the maximum CPU speed that the system should |
295 | # CPU is able to operate at, or a value listed in: | 297 | # use? Legal values are "slowest" for the slowest speed that your |
296 | # /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies | 298 | # CPU is able to operate at, or a value listed in: |
297 | # Only applicable if DO_CPU=1. | 299 | # /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies |
298 | #CPU_MAXFREQ=slowest | 300 | # Only applicable if DO_CPU=1. |
299 | 301 | #CPU_MAXFREQ=slowest | |
300 | # Idle timeout for your hard drive (man hdparm for valid values, -S option) | 302 | |
301 | # Default is 2 hours on AC (AC_HD=244) and 20 seconds for battery (BATT_HD=4). | 303 | # Idle timeout for your hard drive (man hdparm for valid values, -S option) |
302 | #AC_HD=244 | 304 | # Default is 2 hours on AC (AC_HD=244) and 20 seconds for battery (BATT_HD=4). |
303 | #BATT_HD=4 | 305 | #AC_HD=244 |
304 | 306 | #BATT_HD=4 | |
305 | # The drives for which to adjust the idle timeout. Separate them by a space, | 307 | |
306 | # e.g. HD="/dev/hda /dev/hdb". | 308 | # The drives for which to adjust the idle timeout. Separate them by a space, |
307 | #HD="/dev/hda" | 309 | # e.g. HD="/dev/hda /dev/hdb". |
308 | 310 | #HD="/dev/hda" | |
309 | # Set the spindown timeout on a hard drive? | 311 | |
310 | #DO_HD=1 | 312 | # Set the spindown timeout on a hard drive? |
311 | 313 | #DO_HD=1 | |
312 | --------------------CONFIG FILE END--------------------------------------------- | ||
313 | 314 | ||
314 | 315 | ||
315 | Control script | 316 | Control script |
@@ -318,125 +319,126 @@ Control script | |||
318 | Please note that this control script works for the Linux 2.4 and 2.6 series (thanks | 319 | Please note that this control script works for the Linux 2.4 and 2.6 series (thanks |
319 | to Kiko Piris). | 320 | to Kiko Piris). |
320 | 321 | ||
321 | --------------------CONTROL SCRIPT BEGIN---------------------------------------- | 322 | Control script:: |
322 | #!/bin/bash | 323 | |
323 | 324 | #!/bin/bash | |
324 | # start or stop laptop_mode, best run by a power management daemon when | 325 | |
325 | # ac gets connected/disconnected from a laptop | 326 | # start or stop laptop_mode, best run by a power management daemon when |
326 | # | 327 | # ac gets connected/disconnected from a laptop |
327 | # install as /sbin/laptop_mode | 328 | # |
328 | # | 329 | # install as /sbin/laptop_mode |
329 | # Contributors to this script: Kiko Piris | 330 | # |
330 | # Bart Samwel | 331 | # Contributors to this script: Kiko Piris |
331 | # Micha Feigin | 332 | # Bart Samwel |
332 | # Andrew Morton | 333 | # Micha Feigin |
333 | # Herve Eychenne | 334 | # Andrew Morton |
334 | # Dax Kelson | 335 | # Herve Eychenne |
335 | # | 336 | # Dax Kelson |
336 | # Original Linux 2.4 version by: Jens Axboe | 337 | # |
337 | 338 | # Original Linux 2.4 version by: Jens Axboe | |
338 | ############################################################################# | 339 | |
339 | 340 | ############################################################################# | |
340 | # Source config | 341 | |
341 | if [ -f /etc/default/laptop-mode ] ; then | 342 | # Source config |
343 | if [ -f /etc/default/laptop-mode ] ; then | ||
342 | # Debian | 344 | # Debian |
343 | . /etc/default/laptop-mode | 345 | . /etc/default/laptop-mode |
344 | elif [ -f /etc/sysconfig/laptop-mode ] ; then | 346 | elif [ -f /etc/sysconfig/laptop-mode ] ; then |
345 | # Others | 347 | # Others |
346 | . /etc/sysconfig/laptop-mode | 348 | . /etc/sysconfig/laptop-mode |
347 | fi | 349 | fi |
348 | 350 | ||
349 | # Don't raise an error if the config file is incomplete | 351 | # Don't raise an error if the config file is incomplete |
350 | # set defaults instead: | 352 | # set defaults instead: |
351 | 353 | ||
352 | # Maximum time, in seconds, of hard drive spindown time that you are | 354 | # Maximum time, in seconds, of hard drive spindown time that you are |
353 | # comfortable with. Worst case, it's possible that you could lose this | 355 | # comfortable with. Worst case, it's possible that you could lose this |
354 | # amount of work if your battery fails you while in laptop mode. | 356 | # amount of work if your battery fails you while in laptop mode. |
355 | MAX_AGE=${MAX_AGE:-'600'} | 357 | MAX_AGE=${MAX_AGE:-'600'} |
356 | 358 | ||
357 | # Read-ahead, in kilobytes | 359 | # Read-ahead, in kilobytes |
358 | READAHEAD=${READAHEAD:-'4096'} | 360 | READAHEAD=${READAHEAD:-'4096'} |
359 | 361 | ||
360 | # Shall we remount journaled fs. with appropriate commit interval? (1=yes) | 362 | # Shall we remount journaled fs. with appropriate commit interval? (1=yes) |
361 | DO_REMOUNTS=${DO_REMOUNTS:-'1'} | 363 | DO_REMOUNTS=${DO_REMOUNTS:-'1'} |
362 | 364 | ||
363 | # And shall we add the "noatime" option to that as well? (1=yes) | 365 | # And shall we add the "noatime" option to that as well? (1=yes) |
364 | DO_REMOUNT_NOATIME=${DO_REMOUNT_NOATIME:-'1'} | 366 | DO_REMOUNT_NOATIME=${DO_REMOUNT_NOATIME:-'1'} |
365 | 367 | ||
366 | # Shall we adjust the idle timeout on a hard drive? | 368 | # Shall we adjust the idle timeout on a hard drive? |
367 | DO_HD=${DO_HD:-'1'} | 369 | DO_HD=${DO_HD:-'1'} |
368 | 370 | ||
369 | # Adjust idle timeout on which hard drive? | 371 | # Adjust idle timeout on which hard drive? |
370 | HD="${HD:-'/dev/hda'}" | 372 | HD="${HD:-'/dev/hda'}" |
371 | 373 | ||
372 | # spindown time for HD (hdparm -S values) | 374 | # spindown time for HD (hdparm -S values) |
373 | AC_HD=${AC_HD:-'244'} | 375 | AC_HD=${AC_HD:-'244'} |
374 | BATT_HD=${BATT_HD:-'4'} | 376 | BATT_HD=${BATT_HD:-'4'} |
375 | 377 | ||
376 | # Dirty synchronous ratio. At this percentage of dirty pages the process which | 378 | # Dirty synchronous ratio. At this percentage of dirty pages the process which |
377 | # calls write() does its own writeback | 379 | # calls write() does its own writeback |
378 | DIRTY_RATIO=${DIRTY_RATIO:-'40'} | 380 | DIRTY_RATIO=${DIRTY_RATIO:-'40'} |
379 | 381 | ||
380 | # cpu frequency scaling | 382 | # cpu frequency scaling |
381 | # See Documentation/admin-guide/pm/cpufreq.rst for more info | 383 | # See Documentation/admin-guide/pm/cpufreq.rst for more info |
382 | DO_CPU=${CPU_MANAGE:-'0'} | 384 | DO_CPU=${CPU_MANAGE:-'0'} |
383 | CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'} | 385 | CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'} |
384 | 386 | ||
385 | # | 387 | # |
386 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been | 388 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been |
387 | # exceeded, the kernel will wake flusher threads which will then reduce the | 389 | # exceeded, the kernel will wake flusher threads which will then reduce the |
388 | # amount of dirty memory to dirty_background_ratio. Set this nice and low, | 390 | # amount of dirty memory to dirty_background_ratio. Set this nice and low, |
389 | # so once some writeout has commenced, we do a lot of it. | 391 | # so once some writeout has commenced, we do a lot of it. |
390 | # | 392 | # |
391 | DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} | 393 | DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} |
392 | 394 | ||
393 | # kernel default dirty buffer age | 395 | # kernel default dirty buffer age |
394 | DEF_AGE=${DEF_AGE:-'30'} | 396 | DEF_AGE=${DEF_AGE:-'30'} |
395 | DEF_UPDATE=${DEF_UPDATE:-'5'} | 397 | DEF_UPDATE=${DEF_UPDATE:-'5'} |
396 | DEF_DIRTY_BACKGROUND_RATIO=${DEF_DIRTY_BACKGROUND_RATIO:-'10'} | 398 | DEF_DIRTY_BACKGROUND_RATIO=${DEF_DIRTY_BACKGROUND_RATIO:-'10'} |
397 | DEF_DIRTY_RATIO=${DEF_DIRTY_RATIO:-'40'} | 399 | DEF_DIRTY_RATIO=${DEF_DIRTY_RATIO:-'40'} |
398 | DEF_XFS_AGE_BUFFER=${DEF_XFS_AGE_BUFFER:-'15'} | 400 | DEF_XFS_AGE_BUFFER=${DEF_XFS_AGE_BUFFER:-'15'} |
399 | DEF_XFS_SYNC_INTERVAL=${DEF_XFS_SYNC_INTERVAL:-'30'} | 401 | DEF_XFS_SYNC_INTERVAL=${DEF_XFS_SYNC_INTERVAL:-'30'} |
400 | DEF_XFS_BUFD_INTERVAL=${DEF_XFS_BUFD_INTERVAL:-'1'} | 402 | DEF_XFS_BUFD_INTERVAL=${DEF_XFS_BUFD_INTERVAL:-'1'} |
401 | 403 | ||
402 | # This must be adjusted manually to the value of HZ in the running kernel | 404 | # This must be adjusted manually to the value of HZ in the running kernel |
403 | # on 2.4, until the XFS people change their 2.4 external interfaces to work in | 405 | # on 2.4, until the XFS people change their 2.4 external interfaces to work in |
404 | # centisecs. This can be automated, but it's a work in progress that still needs | 406 | # centisecs. This can be automated, but it's a work in progress that still needs |
405 | # some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external | 407 | # some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external |
406 | # interfaces, and that is currently always set to 100. So you don't need to | 408 | # interfaces, and that is currently always set to 100. So you don't need to |
407 | # change this on 2.6. | 409 | # change this on 2.6. |
408 | XFS_HZ=${XFS_HZ:-'100'} | 410 | XFS_HZ=${XFS_HZ:-'100'} |
409 | 411 | ||
410 | ############################################################################# | 412 | ############################################################################# |
411 | 413 | ||
412 | KLEVEL="$(uname -r | | 414 | KLEVEL="$(uname -r | |
413 | { | 415 | { |
414 | IFS='.' read a b c | 416 | IFS='.' read a b c |
415 | echo $a.$b | 417 | echo $a.$b |
416 | } | 418 | } |
417 | )" | 419 | )" |
418 | case "$KLEVEL" in | 420 | case "$KLEVEL" in |
419 | "2.4"|"2.6") | 421 | "2.4"|"2.6") |
420 | ;; | 422 | ;; |
421 | *) | 423 | *) |
422 | echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2 | 424 | echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2 |
423 | exit 1 | 425 | exit 1 |
424 | ;; | 426 | ;; |
425 | esac | 427 | esac |
426 | 428 | ||
427 | if [ ! -e /proc/sys/vm/laptop_mode ] ; then | 429 | if [ ! -e /proc/sys/vm/laptop_mode ] ; then |
428 | echo "Kernel is not patched with laptop_mode patch." >&2 | 430 | echo "Kernel is not patched with laptop_mode patch." >&2 |
429 | exit 1 | 431 | exit 1 |
430 | fi | 432 | fi |
431 | 433 | ||
432 | if [ ! -w /proc/sys/vm/laptop_mode ] ; then | 434 | if [ ! -w /proc/sys/vm/laptop_mode ] ; then |
433 | echo "You do not have enough privileges to enable laptop_mode." >&2 | 435 | echo "You do not have enough privileges to enable laptop_mode." >&2 |
434 | exit 1 | 436 | exit 1 |
435 | fi | 437 | fi |
436 | 438 | ||
437 | # Remove an option (the first parameter) of the form option=<number> from | 439 | # Remove an option (the first parameter) of the form option=<number> from |
438 | # a mount options string (the rest of the parameters). | 440 | # a mount options string (the rest of the parameters). |
439 | parse_mount_opts () { | 441 | parse_mount_opts () { |
440 | OPT="$1" | 442 | OPT="$1" |
441 | shift | 443 | shift |
442 | echo ",$*," | sed \ | 444 | echo ",$*," | sed \ |
@@ -444,11 +446,11 @@ parse_mount_opts () { | |||
444 | -e 's/,,*/,/g' \ | 446 | -e 's/,,*/,/g' \ |
445 | -e 's/^,//' \ | 447 | -e 's/^,//' \ |
446 | -e 's/,$//' | 448 | -e 's/,$//' |
447 | } | 449 | } |
448 | 450 | ||
449 | # Remove an option (the first parameter) without any arguments from | 451 | # Remove an option (the first parameter) without any arguments from |
450 | # a mount option string (the rest of the parameters). | 452 | # a mount option string (the rest of the parameters). |
451 | parse_nonumber_mount_opts () { | 453 | parse_nonumber_mount_opts () { |
452 | OPT="$1" | 454 | OPT="$1" |
453 | shift | 455 | shift |
454 | echo ",$*," | sed \ | 456 | echo ",$*," | sed \ |
@@ -456,20 +458,20 @@ parse_nonumber_mount_opts () { | |||
456 | -e 's/,,*/,/g' \ | 458 | -e 's/,,*/,/g' \ |
457 | -e 's/^,//' \ | 459 | -e 's/^,//' \ |
458 | -e 's/,$//' | 460 | -e 's/,$//' |
459 | } | 461 | } |
460 | 462 | ||
461 | # Find out the state of a yes/no option (e.g. "atime"/"noatime") in | 463 | # Find out the state of a yes/no option (e.g. "atime"/"noatime") in |
462 | # fstab for a given filesystem, and use this state to replace the | 464 | # fstab for a given filesystem, and use this state to replace the |
463 | # value of the option in another mount options string. The device | 465 | # value of the option in another mount options string. The device |
464 | # is the first argument, the option name the second, and the default | 466 | # is the first argument, the option name the second, and the default |
465 | # value the third. The remainder is the mount options string. | 467 | # value the third. The remainder is the mount options string. |
466 | # | 468 | # |
467 | # Example: | 469 | # Example: |
468 | # parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime | 470 | # parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime |
469 | # | 471 | # |
470 | # If fstab contains, say, "rw" for this filesystem, then the result | 472 | # If fstab contains, say, "rw" for this filesystem, then the result |
471 | # will be "defaults,atime". | 473 | # will be "defaults,atime". |
472 | parse_yesno_opts_wfstab () { | 474 | parse_yesno_opts_wfstab () { |
473 | L_DEV="$1" | 475 | L_DEV="$1" |
474 | OPT="$2" | 476 | OPT="$2" |
475 | DEF_OPT="$3" | 477 | DEF_OPT="$3" |
@@ -491,21 +493,21 @@ parse_yesno_opts_wfstab () { | |||
491 | # option not specified in fstab -- choose the default. | 493 | # option not specified in fstab -- choose the default. |
492 | echo "$PARSEDOPTS1,$DEF_OPT" | 494 | echo "$PARSEDOPTS1,$DEF_OPT" |
493 | fi | 495 | fi |
494 | } | 496 | } |
495 | 497 | ||
496 | # Find out the state of a numbered option (e.g. "commit=NNN") in | 498 | # Find out the state of a numbered option (e.g. "commit=NNN") in |
497 | # fstab for a given filesystem, and use this state to replace the | 499 | # fstab for a given filesystem, and use this state to replace the |
498 | # value of the option in another mount options string. The device | 500 | # value of the option in another mount options string. The device |
499 | # is the first argument, and the option name the second. The | 501 | # is the first argument, and the option name the second. The |
500 | # remainder is the mount options string in which the replacement | 502 | # remainder is the mount options string in which the replacement |
501 | # must be done. | 503 | # must be done. |
502 | # | 504 | # |
503 | # Example: | 505 | # Example: |
504 | # parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7 | 506 | # parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7 |
505 | # | 507 | # |
506 | # If fstab contains, say, "commit=3,rw" for this filesystem, then the | 508 | # If fstab contains, say, "commit=3,rw" for this filesystem, then the |
507 | # result will be "rw,commit=3". | 509 | # result will be "rw,commit=3". |
508 | parse_mount_opts_wfstab () { | 510 | parse_mount_opts_wfstab () { |
509 | L_DEV="$1" | 511 | L_DEV="$1" |
510 | OPT="$2" | 512 | OPT="$2" |
511 | shift 2 | 513 | shift 2 |
@@ -523,9 +525,9 @@ parse_mount_opts_wfstab () { | |||
523 | # option not specified in fstab: set it to 0 | 525 | # option not specified in fstab: set it to 0 |
524 | echo "$PARSEDOPTS1,$OPT=0" | 526 | echo "$PARSEDOPTS1,$OPT=0" |
525 | fi | 527 | fi |
526 | } | 528 | } |
527 | 529 | ||
528 | deduce_fstype () { | 530 | deduce_fstype () { |
529 | MP="$1" | 531 | MP="$1" |
530 | # My root filesystem unfortunately has | 532 | # My root filesystem unfortunately has |
531 | # type "unknown" in /etc/mtab. If we encounter | 533 | # type "unknown" in /etc/mtab. If we encounter |
@@ -538,13 +540,13 @@ deduce_fstype () { | |||
538 | exit 0 | 540 | exit 0 |
539 | fi | 541 | fi |
540 | done | 542 | done |
541 | } | 543 | } |
542 | 544 | ||
543 | if [ $DO_REMOUNT_NOATIME -eq 1 ] ; then | 545 | if [ $DO_REMOUNT_NOATIME -eq 1 ] ; then |
544 | NOATIME_OPT=",noatime" | 546 | NOATIME_OPT=",noatime" |
545 | fi | 547 | fi |
546 | 548 | ||
547 | case "$1" in | 549 | case "$1" in |
548 | start) | 550 | start) |
549 | AGE=$((100*$MAX_AGE)) | 551 | AGE=$((100*$MAX_AGE)) |
550 | XFS_AGE=$(($XFS_HZ*$MAX_AGE)) | 552 | XFS_AGE=$(($XFS_HZ*$MAX_AGE)) |
@@ -687,10 +689,9 @@ case "$1" in | |||
687 | exit 1 | 689 | exit 1 |
688 | ;; | 690 | ;; |
689 | 691 | ||
690 | esac | 692 | esac |
691 | 693 | ||
692 | exit 0 | 694 | exit 0 |
693 | --------------------CONTROL SCRIPT END------------------------------------------ | ||
694 | 695 | ||
695 | 696 | ||
696 | ACPI integration | 697 | ACPI integration |
@@ -701,78 +702,76 @@ kick off the laptop_mode script and run hdparm. The part that | |||
701 | automatically disables laptop mode when the battery is low was | 702 | automatically disables laptop mode when the battery is low was |
702 | written by Jan Topinski. | 703 | written by Jan Topinski. |
703 | 704 | ||
704 | -----------------/etc/acpi/events/ac_adapter BEGIN------------------------------ | 705 | /etc/acpi/events/ac_adapter:: |
705 | event=ac_adapter | 706 | |
706 | action=/etc/acpi/actions/ac.sh %e | 707 | event=ac_adapter |
707 | ----------------/etc/acpi/events/ac_adapter END--------------------------------- | 708 | action=/etc/acpi/actions/ac.sh %e |
709 | |||
710 | /etc/acpi/events/battery:: | ||
708 | 711 | ||
712 | event=battery.* | ||
713 | action=/etc/acpi/actions/battery.sh %e | ||
709 | 714 | ||
710 | -----------------/etc/acpi/events/battery BEGIN--------------------------------- | 715 | /etc/acpi/actions/ac.sh:: |
711 | event=battery.* | ||
712 | action=/etc/acpi/actions/battery.sh %e | ||
713 | ----------------/etc/acpi/events/battery END------------------------------------ | ||
714 | 716 | ||
717 | #!/bin/bash | ||
715 | 718 | ||
716 | ----------------/etc/acpi/actions/ac.sh BEGIN----------------------------------- | 719 | # ac on/offline event handler |
717 | #!/bin/bash | ||
718 | 720 | ||
719 | # ac on/offline event handler | 721 | status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/$2/state` |
720 | 722 | ||
721 | status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/$2/state` | 723 | case $status in |
724 | "on-line") | ||
725 | /sbin/laptop_mode stop | ||
726 | exit 0 | ||
727 | ;; | ||
728 | "off-line") | ||
729 | /sbin/laptop_mode start | ||
730 | exit 0 | ||
731 | ;; | ||
732 | esac | ||
722 | 733 | ||
723 | case $status in | ||
724 | "on-line") | ||
725 | /sbin/laptop_mode stop | ||
726 | exit 0 | ||
727 | ;; | ||
728 | "off-line") | ||
729 | /sbin/laptop_mode start | ||
730 | exit 0 | ||
731 | ;; | ||
732 | esac | ||
733 | ---------------------------/etc/acpi/actions/ac.sh END-------------------------- | ||
734 | 734 | ||
735 | /etc/acpi/actions/battery.sh:: | ||
735 | 736 | ||
736 | ---------------------------/etc/acpi/actions/battery.sh BEGIN------------------- | 737 | #! /bin/bash |
737 | #! /bin/bash | ||
738 | 738 | ||
739 | # Automatically disable laptop mode when the battery almost runs out. | 739 | # Automatically disable laptop mode when the battery almost runs out. |
740 | 740 | ||
741 | BATT_INFO=/proc/acpi/battery/$2/state | 741 | BATT_INFO=/proc/acpi/battery/$2/state |
742 | 742 | ||
743 | if [[ -f /proc/sys/vm/laptop_mode ]] | 743 | if [[ -f /proc/sys/vm/laptop_mode ]] |
744 | then | 744 | then |
745 | LM=`cat /proc/sys/vm/laptop_mode` | 745 | LM=`cat /proc/sys/vm/laptop_mode` |
746 | if [[ $LM -gt 0 ]] | 746 | if [[ $LM -gt 0 ]] |
747 | then | ||
748 | if [[ -f $BATT_INFO ]] | ||
749 | then | 747 | then |
750 | # Source the config file only now that we know we need | 748 | if [[ -f $BATT_INFO ]] |
751 | if [ -f /etc/default/laptop-mode ] ; then | 749 | then |
752 | # Debian | 750 | # Source the config file only now that we know we need |
753 | . /etc/default/laptop-mode | 751 | if [ -f /etc/default/laptop-mode ] ; then |
754 | elif [ -f /etc/sysconfig/laptop-mode ] ; then | 752 | # Debian |
755 | # Others | 753 | . /etc/default/laptop-mode |
756 | . /etc/sysconfig/laptop-mode | 754 | elif [ -f /etc/sysconfig/laptop-mode ] ; then |
757 | fi | 755 | # Others |
758 | MINIMUM_BATTERY_MINUTES=${MINIMUM_BATTERY_MINUTES:-'10'} | 756 | . /etc/sysconfig/laptop-mode |
759 | 757 | fi | |
760 | ACTION="`cat $BATT_INFO | grep charging | cut -c 26-`" | 758 | MINIMUM_BATTERY_MINUTES=${MINIMUM_BATTERY_MINUTES:-'10'} |
761 | if [[ ACTION -eq "discharging" ]] | 759 | |
762 | then | 760 | ACTION="`cat $BATT_INFO | grep charging | cut -c 26-`" |
763 | PRESENT_RATE=`cat $BATT_INFO | grep "present rate:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` | 761 | if [[ ACTION -eq "discharging" ]] |
764 | REMAINING=`cat $BATT_INFO | grep "remaining capacity:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` | 762 | then |
765 | fi | 763 | PRESENT_RATE=`cat $BATT_INFO | grep "present rate:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` |
766 | if (($REMAINING * 60 / $PRESENT_RATE < $MINIMUM_BATTERY_MINUTES)) | 764 | REMAINING=`cat $BATT_INFO | grep "remaining capacity:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` |
767 | then | 765 | fi |
768 | /sbin/laptop_mode stop | 766 | if (($REMAINING * 60 / $PRESENT_RATE < $MINIMUM_BATTERY_MINUTES)) |
769 | fi | 767 | then |
770 | else | 768 | /sbin/laptop_mode stop |
771 | logger -p daemon.warning "You are using laptop mode and your battery interface $BATT_INFO is missing. This may lead to loss of data when the battery runs out. Check kernel ACPI support and /proc/acpi/battery folder, and edit /etc/acpi/battery.sh to set BATT_INFO to the correct path." | 769 | fi |
770 | else | ||
771 | logger -p daemon.warning "You are using laptop mode and your battery interface $BATT_INFO is missing. This may lead to loss of data when the battery runs out. Check kernel ACPI support and /proc/acpi/battery folder, and edit /etc/acpi/battery.sh to set BATT_INFO to the correct path." | ||
772 | fi | ||
772 | fi | 773 | fi |
773 | fi | 774 | fi |
774 | fi | ||
775 | ---------------------------/etc/acpi/actions/battery.sh END-------------------- | ||
776 | 775 | ||
777 | 776 | ||
778 | Monitoring tool | 777 | Monitoring tool |
diff --git a/Documentation/laptops/sony-laptop.txt b/Documentation/laptops/sony-laptop.rst index 978b1e615155..9edcc7f6612f 100644 --- a/Documentation/laptops/sony-laptop.txt +++ b/Documentation/laptops/sony-laptop.rst | |||
@@ -1,7 +1,9 @@ | |||
1 | ========================================= | ||
1 | Sony Notebook Control Driver (SNC) Readme | 2 | Sony Notebook Control Driver (SNC) Readme |
2 | ----------------------------------------- | 3 | ========================================= |
3 | Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net> | 4 | |
4 | Copyright (C) 2007 Mattia Dongili <malattia@linux.it> | 5 | - Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net> |
6 | - Copyright (C) 2007 Mattia Dongili <malattia@linux.it> | ||
5 | 7 | ||
6 | This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the | 8 | This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the |
7 | Sony Vaio laptops. This driver mixes both devices functions under the same | 9 | Sony Vaio laptops. This driver mixes both devices functions under the same |
@@ -10,6 +12,7 @@ obsoleted by sony-laptop now. | |||
10 | 12 | ||
11 | Fn keys (hotkeys): | 13 | Fn keys (hotkeys): |
12 | ------------------ | 14 | ------------------ |
15 | |||
13 | Some models report hotkeys through the SNC or SPIC devices, such events are | 16 | Some models report hotkeys through the SNC or SPIC devices, such events are |
14 | reported both through the ACPI subsystem as acpi events and through the INPUT | 17 | reported both through the ACPI subsystem as acpi events and through the INPUT |
15 | subsystem. See the logs of /proc/bus/input/devices to find out what those | 18 | subsystem. See the logs of /proc/bus/input/devices to find out what those |
@@ -28,11 +31,14 @@ If your laptop model supports it, you will find sysfs files in the | |||
28 | /sys/class/backlight/sony/ | 31 | /sys/class/backlight/sony/ |
29 | directory. You will be able to query and set the current screen | 32 | directory. You will be able to query and set the current screen |
30 | brightness: | 33 | brightness: |
34 | |||
35 | ====================== ========================================= | ||
31 | brightness get/set screen brightness (an integer | 36 | brightness get/set screen brightness (an integer |
32 | between 0 and 7) | 37 | between 0 and 7) |
33 | actual_brightness reading from this file will query the HW | 38 | actual_brightness reading from this file will query the HW |
34 | to get real brightness value | 39 | to get real brightness value |
35 | max_brightness the maximum brightness value | 40 | max_brightness the maximum brightness value |
41 | ====================== ========================================= | ||
36 | 42 | ||
37 | 43 | ||
38 | Platform specific: | 44 | Platform specific: |
@@ -45,6 +51,8 @@ You then read/write integer values from/to those files by using | |||
45 | standard UNIX tools. | 51 | standard UNIX tools. |
46 | 52 | ||
47 | The files are: | 53 | The files are: |
54 | |||
55 | ====================== ========================================== | ||
48 | brightness_default screen brightness which will be set | 56 | brightness_default screen brightness which will be set |
49 | when the laptop will be rebooted | 57 | when the laptop will be rebooted |
50 | cdpower power on/off the internal CD drive | 58 | cdpower power on/off the internal CD drive |
@@ -53,21 +61,39 @@ The files are: | |||
53 | (only in debug mode) | 61 | (only in debug mode) |
54 | bluetoothpower power on/off the internal bluetooth device | 62 | bluetoothpower power on/off the internal bluetooth device |
55 | fanspeed get/set the fan speed | 63 | fanspeed get/set the fan speed |
64 | ====================== ========================================== | ||
56 | 65 | ||
57 | Note that some files may be missing if they are not supported | 66 | Note that some files may be missing if they are not supported |
58 | by your particular laptop model. | 67 | by your particular laptop model. |
59 | 68 | ||
60 | Example usage: | 69 | Example usage:: |
70 | |||
61 | # echo "1" > /sys/devices/platform/sony-laptop/brightness_default | 71 | # echo "1" > /sys/devices/platform/sony-laptop/brightness_default |
62 | sets the lowest screen brightness for the next and later reboots, | 72 | |
73 | sets the lowest screen brightness for the next and later reboots | ||
74 | |||
75 | :: | ||
76 | |||
63 | # echo "8" > /sys/devices/platform/sony-laptop/brightness_default | 77 | # echo "8" > /sys/devices/platform/sony-laptop/brightness_default |
64 | sets the highest screen brightness for the next and later reboots, | 78 | |
79 | sets the highest screen brightness for the next and later reboots | ||
80 | |||
81 | :: | ||
82 | |||
65 | # cat /sys/devices/platform/sony-laptop/brightness_default | 83 | # cat /sys/devices/platform/sony-laptop/brightness_default |
66 | retrieves the value. | 84 | |
85 | retrieves the value | ||
86 | |||
87 | :: | ||
67 | 88 | ||
68 | # echo "0" > /sys/devices/platform/sony-laptop/audiopower | 89 | # echo "0" > /sys/devices/platform/sony-laptop/audiopower |
69 | powers off the sound card, | 90 | |
91 | powers off the sound card | ||
92 | |||
93 | :: | ||
94 | |||
70 | # echo "1" > /sys/devices/platform/sony-laptop/audiopower | 95 | # echo "1" > /sys/devices/platform/sony-laptop/audiopower |
96 | |||
71 | powers on the sound card. | 97 | powers on the sound card. |
72 | 98 | ||
73 | 99 | ||
@@ -76,7 +102,8 @@ RFkill control: | |||
76 | More recent Vaio models expose a consistent set of ACPI methods to | 102 | More recent Vaio models expose a consistent set of ACPI methods to |
77 | control radio frequency emitting devices. If you are a lucky owner of | 103 | control radio frequency emitting devices. If you are a lucky owner of |
78 | such a laptop you will find the necessary rfkill devices under | 104 | such a laptop you will find the necessary rfkill devices under |
79 | /sys/class/rfkill. Check those starting with sony-* in | 105 | /sys/class/rfkill. Check those starting with sony-* in:: |
106 | |||
80 | # grep . /sys/class/rfkill/*/{state,name} | 107 | # grep . /sys/class/rfkill/*/{state,name} |
81 | 108 | ||
82 | 109 | ||
@@ -88,26 +115,29 @@ you are not afraid of any side effects doing strange things with | |||
88 | your ACPI BIOS could have on your laptop), load the driver and | 115 | your ACPI BIOS could have on your laptop), load the driver and |
89 | pass the option 'debug=1'. | 116 | pass the option 'debug=1'. |
90 | 117 | ||
91 | REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS. | 118 | REPEAT: |
119 | **DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.** | ||
92 | 120 | ||
93 | In your kernel logs you will find the list of all ACPI methods | 121 | In your kernel logs you will find the list of all ACPI methods |
94 | the SNC device has on your laptop. | 122 | the SNC device has on your laptop. |
95 | 123 | ||
96 | * For new models you will see a long list of meaningless method names, | 124 | * For new models you will see a long list of meaningless method names, |
97 | reading the DSDT table source should reveal that: | 125 | reading the DSDT table source should reveal that: |
126 | |||
98 | (1) the SNC device uses an internal capability lookup table | 127 | (1) the SNC device uses an internal capability lookup table |
99 | (2) SN00 is used to find values in the lookup table | 128 | (2) SN00 is used to find values in the lookup table |
100 | (3) SN06 and SN07 are used to call into the real methods based on | 129 | (3) SN06 and SN07 are used to call into the real methods based on |
101 | offsets you can obtain iterating the table using SN00 | 130 | offsets you can obtain iterating the table using SN00 |
102 | (4) SN02 used to enable events. | 131 | (4) SN02 used to enable events. |
132 | |||
103 | Some values in the capability lookup table are more or less known, see | 133 | Some values in the capability lookup table are more or less known, see |
104 | the code for all sony_call_snc_handle calls, others are more obscure. | 134 | the code for all sony_call_snc_handle calls, others are more obscure. |
105 | 135 | ||
106 | * For old models you can see the GCDP/GCDP methods used to pwer on/off | 136 | * For old models you can see the GCDP/GCDP methods used to pwer on/off |
107 | the CD drive, but there are others and they are usually different from | 137 | the CD drive, but there are others and they are usually different from |
108 | model to model. | 138 | model to model. |
109 | 139 | ||
110 | I HAVE NO IDEA WHAT THOSE METHODS DO. | 140 | **I HAVE NO IDEA WHAT THOSE METHODS DO.** |
111 | 141 | ||
112 | The sony-laptop driver creates, for some of those methods (the most | 142 | The sony-laptop driver creates, for some of those methods (the most |
113 | current ones found on several Vaio models), an entry under | 143 | current ones found on several Vaio models), an entry under |
diff --git a/Documentation/laptops/sonypi.txt b/Documentation/laptops/sonypi.rst index 606bdb9ce036..2a1975ed7ee4 100644 --- a/Documentation/laptops/sonypi.txt +++ b/Documentation/laptops/sonypi.rst | |||
@@ -1,11 +1,13 @@ | |||
1 | ================================================== | ||
1 | Sony Programmable I/O Control Device Driver Readme | 2 | Sony Programmable I/O Control Device Driver Readme |
2 | -------------------------------------------------- | 3 | ================================================== |
3 | Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> | 4 | |
4 | Copyright (C) 2001-2002 Alcôve <www.alcove.com> | 5 | - Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> |
5 | Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> | 6 | - Copyright (C) 2001-2002 Alcôve <www.alcove.com> |
6 | Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp> | 7 | - Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> |
7 | Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp> | 8 | - Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp> |
8 | Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> | 9 | - Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp> |
10 | - Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> | ||
9 | 11 | ||
10 | This driver enables access to the Sony Programmable I/O Control Device which | 12 | This driver enables access to the Sony Programmable I/O Control Device which |
11 | can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be | 13 | can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be |
@@ -14,6 +16,7 @@ sonypi device and are not supported at all by this driver. | |||
14 | 16 | ||
15 | It will give access (through a user space utility) to some events those laptops | 17 | It will give access (through a user space utility) to some events those laptops |
16 | generate, like: | 18 | generate, like: |
19 | |||
17 | - jogdial events (the small wheel on the side of Vaios) | 20 | - jogdial events (the small wheel on the side of Vaios) |
18 | - capture button events (only on Vaio Picturebook series) | 21 | - capture button events (only on Vaio Picturebook series) |
19 | - Fn keys | 22 | - Fn keys |
@@ -49,6 +52,7 @@ module argument syntax (<param>=<value> when passing the option to the | |||
49 | module or sonypi.<param>=<value> on the kernel boot line when sonypi is | 52 | module or sonypi.<param>=<value> on the kernel boot line when sonypi is |
50 | statically linked into the kernel). Those options are: | 53 | statically linked into the kernel). Those options are: |
51 | 54 | ||
55 | =============== ======================================================= | ||
52 | minor: minor number of the misc device /dev/sonypi, | 56 | minor: minor number of the misc device /dev/sonypi, |
53 | default is -1 (automatic allocation, see /proc/misc | 57 | default is -1 (automatic allocation, see /proc/misc |
54 | or kernel logs) | 58 | or kernel logs) |
@@ -86,6 +90,8 @@ statically linked into the kernel). Those options are: | |||
86 | will be tried. You can use the following bits to | 90 | will be tried. You can use the following bits to |
87 | construct your own event mask (from | 91 | construct your own event mask (from |
88 | drivers/char/sonypi.h): | 92 | drivers/char/sonypi.h): |
93 | |||
94 | ======================== ====== | ||
89 | SONYPI_JOGGER_MASK 0x0001 | 95 | SONYPI_JOGGER_MASK 0x0001 |
90 | SONYPI_CAPTURE_MASK 0x0002 | 96 | SONYPI_CAPTURE_MASK 0x0002 |
91 | SONYPI_FNKEY_MASK 0x0004 | 97 | SONYPI_FNKEY_MASK 0x0004 |
@@ -100,22 +106,24 @@ statically linked into the kernel). Those options are: | |||
100 | SONYPI_MEMORYSTICK_MASK 0x0800 | 106 | SONYPI_MEMORYSTICK_MASK 0x0800 |
101 | SONYPI_BATTERY_MASK 0x1000 | 107 | SONYPI_BATTERY_MASK 0x1000 |
102 | SONYPI_WIRELESS_MASK 0x2000 | 108 | SONYPI_WIRELESS_MASK 0x2000 |
109 | ======================== ====== | ||
103 | 110 | ||
104 | useinput: if set (which is the default) two input devices are | 111 | useinput: if set (which is the default) two input devices are |
105 | created, one which interprets the jogdial events as | 112 | created, one which interprets the jogdial events as |
106 | mouse events, the other one which acts like a | 113 | mouse events, the other one which acts like a |
107 | keyboard reporting the pressing of the special keys. | 114 | keyboard reporting the pressing of the special keys. |
115 | =============== ======================================================= | ||
108 | 116 | ||
109 | Module use: | 117 | Module use: |
110 | ----------- | 118 | ----------- |
111 | 119 | ||
112 | In order to automatically load the sonypi module on use, you can put those | 120 | In order to automatically load the sonypi module on use, you can put those |
113 | lines a configuration file in /etc/modprobe.d/: | 121 | lines a configuration file in /etc/modprobe.d/:: |
114 | 122 | ||
115 | alias char-major-10-250 sonypi | 123 | alias char-major-10-250 sonypi |
116 | options sonypi minor=250 | 124 | options sonypi minor=250 |
117 | 125 | ||
118 | This supposes the use of minor 250 for the sonypi device: | 126 | This supposes the use of minor 250 for the sonypi device:: |
119 | 127 | ||
120 | # mknod /dev/sonypi c 10 250 | 128 | # mknod /dev/sonypi c 10 250 |
121 | 129 | ||
@@ -148,5 +156,5 @@ Bugs: | |||
148 | http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2 | 156 | http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2 |
149 | 157 | ||
150 | - since all development was done by reverse engineering, there is | 158 | - since all development was done by reverse engineering, there is |
151 | _absolutely no guarantee_ that this driver will not crash your | 159 | *absolutely no guarantee* that this driver will not crash your |
152 | laptop. Permanently. | 160 | laptop. Permanently. |
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.rst index 75ef063622d2..19d52fc3c5e9 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.rst | |||
@@ -1,12 +1,15 @@ | |||
1 | ThinkPad ACPI Extras Driver | 1 | =========================== |
2 | ThinkPad ACPI Extras Driver | ||
3 | =========================== | ||
2 | 4 | ||
3 | Version 0.25 | 5 | Version 0.25 |
4 | October 16th, 2013 | ||
5 | 6 | ||
6 | Borislav Deianov <borislav@users.sf.net> | 7 | October 16th, 2013 |
7 | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | ||
8 | http://ibm-acpi.sf.net/ | ||
9 | 8 | ||
9 | - Borislav Deianov <borislav@users.sf.net> | ||
10 | - Henrique de Moraes Holschuh <hmh@hmh.eng.br> | ||
11 | |||
12 | http://ibm-acpi.sf.net/ | ||
10 | 13 | ||
11 | This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It | 14 | This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It |
12 | supports various features of these laptops which are accessible | 15 | supports various features of these laptops which are accessible |
@@ -91,7 +94,8 @@ yet ready or stabilized, it is expected that this interface will change, | |||
91 | and any and all userspace programs must deal with it. | 94 | and any and all userspace programs must deal with it. |
92 | 95 | ||
93 | 96 | ||
94 | Notes about the sysfs interface: | 97 | Notes about the sysfs interface |
98 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
95 | 99 | ||
96 | Unlike what was done with the procfs interface, correctness when talking | 100 | Unlike what was done with the procfs interface, correctness when talking |
97 | to the sysfs interfaces will be enforced, as will correctness in the | 101 | to the sysfs interfaces will be enforced, as will correctness in the |
@@ -129,6 +133,7 @@ Driver version | |||
129 | -------------- | 133 | -------------- |
130 | 134 | ||
131 | procfs: /proc/acpi/ibm/driver | 135 | procfs: /proc/acpi/ibm/driver |
136 | |||
132 | sysfs driver attribute: version | 137 | sysfs driver attribute: version |
133 | 138 | ||
134 | The driver name and version. No commands can be written to this file. | 139 | The driver name and version. No commands can be written to this file. |
@@ -141,9 +146,13 @@ sysfs driver attribute: interface_version | |||
141 | 146 | ||
142 | Version of the thinkpad-acpi sysfs interface, as an unsigned long | 147 | Version of the thinkpad-acpi sysfs interface, as an unsigned long |
143 | (output in hex format: 0xAAAABBCC), where: | 148 | (output in hex format: 0xAAAABBCC), where: |
144 | AAAA - major revision | 149 | |
145 | BB - minor revision | 150 | AAAA |
146 | CC - bugfix revision | 151 | - major revision |
152 | BB | ||
153 | - minor revision | ||
154 | CC | ||
155 | - bugfix revision | ||
147 | 156 | ||
148 | The sysfs interface version changelog for the driver can be found at the | 157 | The sysfs interface version changelog for the driver can be found at the |
149 | end of this document. Changes to the sysfs interface done by the kernel | 158 | end of this document. Changes to the sysfs interface done by the kernel |
@@ -170,6 +179,7 @@ Hot keys | |||
170 | -------- | 179 | -------- |
171 | 180 | ||
172 | procfs: /proc/acpi/ibm/hotkey | 181 | procfs: /proc/acpi/ibm/hotkey |
182 | |||
173 | sysfs device attribute: hotkey_* | 183 | sysfs device attribute: hotkey_* |
174 | 184 | ||
175 | In a ThinkPad, the ACPI HKEY handler is responsible for communicating | 185 | In a ThinkPad, the ACPI HKEY handler is responsible for communicating |
@@ -181,7 +191,7 @@ firmware will behave in many situations. | |||
181 | The driver enables the HKEY ("hot key") event reporting automatically | 191 | The driver enables the HKEY ("hot key") event reporting automatically |
182 | when loaded, and disables it when it is removed. | 192 | when loaded, and disables it when it is removed. |
183 | 193 | ||
184 | The driver will report HKEY events in the following format: | 194 | The driver will report HKEY events in the following format:: |
185 | 195 | ||
186 | ibm/hotkey HKEY 00000080 0000xxxx | 196 | ibm/hotkey HKEY 00000080 0000xxxx |
187 | 197 | ||
@@ -217,9 +227,10 @@ ThinkPads, it is still possible to support some extra hotkeys by | |||
217 | polling the "CMOS NVRAM" at least 10 times per second. The driver | 227 | polling the "CMOS NVRAM" at least 10 times per second. The driver |
218 | attempts to enables this functionality automatically when required. | 228 | attempts to enables this functionality automatically when required. |
219 | 229 | ||
220 | procfs notes: | 230 | procfs notes |
231 | ^^^^^^^^^^^^ | ||
221 | 232 | ||
222 | The following commands can be written to the /proc/acpi/ibm/hotkey file: | 233 | The following commands can be written to the /proc/acpi/ibm/hotkey file:: |
223 | 234 | ||
224 | echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys | 235 | echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys |
225 | echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys | 236 | echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys |
@@ -227,7 +238,7 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file: | |||
227 | echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask | 238 | echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask |
228 | 239 | ||
229 | The following commands have been deprecated and will cause the kernel | 240 | The following commands have been deprecated and will cause the kernel |
230 | to log a warning: | 241 | to log a warning:: |
231 | 242 | ||
232 | echo enable > /proc/acpi/ibm/hotkey -- does nothing | 243 | echo enable > /proc/acpi/ibm/hotkey -- does nothing |
233 | echo disable > /proc/acpi/ibm/hotkey -- returns an error | 244 | echo disable > /proc/acpi/ibm/hotkey -- returns an error |
@@ -237,7 +248,8 @@ maintain maximum bug-to-bug compatibility, it does not report any masks, | |||
237 | nor does it allow one to manipulate the hot key mask when the firmware | 248 | nor does it allow one to manipulate the hot key mask when the firmware |
238 | does not support masks at all, even if NVRAM polling is in use. | 249 | does not support masks at all, even if NVRAM polling is in use. |
239 | 250 | ||
240 | sysfs notes: | 251 | sysfs notes |
252 | ^^^^^^^^^^^ | ||
241 | 253 | ||
242 | hotkey_bios_enabled: | 254 | hotkey_bios_enabled: |
243 | DEPRECATED, WILL BE REMOVED SOON. | 255 | DEPRECATED, WILL BE REMOVED SOON. |
@@ -349,7 +361,8 @@ sysfs notes: | |||
349 | 361 | ||
350 | This attribute has poll()/select() support. | 362 | This attribute has poll()/select() support. |
351 | 363 | ||
352 | input layer notes: | 364 | input layer notes |
365 | ^^^^^^^^^^^^^^^^^ | ||
353 | 366 | ||
354 | A Hot key is mapped to a single input layer EV_KEY event, possibly | 367 | A Hot key is mapped to a single input layer EV_KEY event, possibly |
355 | followed by an EV_MSC MSC_SCAN event that shall contain that key's scan | 368 | followed by an EV_MSC MSC_SCAN event that shall contain that key's scan |
@@ -362,11 +375,13 @@ remapping KEY_UNKNOWN keys. | |||
362 | 375 | ||
363 | The events are available in an input device, with the following id: | 376 | The events are available in an input device, with the following id: |
364 | 377 | ||
365 | Bus: BUS_HOST | 378 | ============== ============================== |
366 | vendor: 0x1014 (PCI_VENDOR_ID_IBM) or | 379 | Bus BUS_HOST |
380 | vendor 0x1014 (PCI_VENDOR_ID_IBM) or | ||
367 | 0x17aa (PCI_VENDOR_ID_LENOVO) | 381 | 0x17aa (PCI_VENDOR_ID_LENOVO) |
368 | product: 0x5054 ("TP") | 382 | product 0x5054 ("TP") |
369 | version: 0x4101 | 383 | version 0x4101 |
384 | ============== ============================== | ||
370 | 385 | ||
371 | The version will have its LSB incremented if the keymap changes in a | 386 | The version will have its LSB incremented if the keymap changes in a |
372 | backwards-compatible way. The MSB shall always be 0x41 for this input | 387 | backwards-compatible way. The MSB shall always be 0x41 for this input |
@@ -380,9 +395,10 @@ backwards-compatible change for this input device. | |||
380 | 395 | ||
381 | Thinkpad-acpi Hot Key event map (version 0x4101): | 396 | Thinkpad-acpi Hot Key event map (version 0x4101): |
382 | 397 | ||
398 | ======= ======= ============== ============================================== | ||
383 | ACPI Scan | 399 | ACPI Scan |
384 | event code Key Notes | 400 | event code Key Notes |
385 | 401 | ======= ======= ============== ============================================== | |
386 | 0x1001 0x00 FN+F1 - | 402 | 0x1001 0x00 FN+F1 - |
387 | 403 | ||
388 | 0x1002 0x01 FN+F2 IBM: battery (rare) | 404 | 0x1002 0x01 FN+F2 IBM: battery (rare) |
@@ -426,7 +442,9 @@ event code Key Notes | |||
426 | or toggle screen expand | 442 | or toggle screen expand |
427 | 443 | ||
428 | 0x1009 0x08 FN+F9 - | 444 | 0x1009 0x08 FN+F9 - |
429 | .. .. .. | 445 | |
446 | ... ... ... ... | ||
447 | |||
430 | 0x100B 0x0A FN+F11 - | 448 | 0x100B 0x0A FN+F11 - |
431 | 449 | ||
432 | 0x100C 0x0B FN+F12 Sleep to disk. You are always | 450 | 0x100C 0x0B FN+F12 Sleep to disk. You are always |
@@ -480,8 +498,11 @@ event code Key Notes | |||
480 | 0x1018 0x17 THINKPAD ThinkPad/Access IBM/Lenovo key | 498 | 0x1018 0x17 THINKPAD ThinkPad/Access IBM/Lenovo key |
481 | 499 | ||
482 | 0x1019 0x18 unknown | 500 | 0x1019 0x18 unknown |
483 | .. .. .. | 501 | |
502 | ... ... ... | ||
503 | |||
484 | 0x1020 0x1F unknown | 504 | 0x1020 0x1F unknown |
505 | ======= ======= ============== ============================================== | ||
485 | 506 | ||
486 | The ThinkPad firmware does not allow one to differentiate when most hot | 507 | The ThinkPad firmware does not allow one to differentiate when most hot |
487 | keys are pressed or released (either that, or we don't know how to, yet). | 508 | keys are pressed or released (either that, or we don't know how to, yet). |
@@ -499,14 +520,17 @@ generate input device EV_KEY events. | |||
499 | In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW | 520 | In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW |
500 | events for switches: | 521 | events for switches: |
501 | 522 | ||
523 | ============== ============================================== | ||
502 | SW_RFKILL_ALL T60 and later hardware rfkill rocker switch | 524 | SW_RFKILL_ALL T60 and later hardware rfkill rocker switch |
503 | SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A | 525 | SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A |
526 | ============== ============================================== | ||
504 | 527 | ||
505 | Non hotkey ACPI HKEY event map: | 528 | Non hotkey ACPI HKEY event map |
506 | ------------------------------- | 529 | ------------------------------ |
507 | 530 | ||
508 | Events that are never propagated by the driver: | 531 | Events that are never propagated by the driver: |
509 | 532 | ||
533 | ====== ================================================== | ||
510 | 0x2304 System is waking up from suspend to undock | 534 | 0x2304 System is waking up from suspend to undock |
511 | 0x2305 System is waking up from suspend to eject bay | 535 | 0x2305 System is waking up from suspend to eject bay |
512 | 0x2404 System is waking up from hibernation to undock | 536 | 0x2404 System is waking up from hibernation to undock |
@@ -519,10 +543,12 @@ Events that are never propagated by the driver: | |||
519 | 0x6000 KEYBOARD: Numlock key pressed | 543 | 0x6000 KEYBOARD: Numlock key pressed |
520 | 0x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED) | 544 | 0x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED) |
521 | 0x7000 Radio Switch may have changed state | 545 | 0x7000 Radio Switch may have changed state |
546 | ====== ================================================== | ||
522 | 547 | ||
523 | 548 | ||
524 | Events that are propagated by the driver to userspace: | 549 | Events that are propagated by the driver to userspace: |
525 | 550 | ||
551 | ====== ===================================================== | ||
526 | 0x2313 ALARM: System is waking up from suspend because | 552 | 0x2313 ALARM: System is waking up from suspend because |
527 | the battery is nearly empty | 553 | the battery is nearly empty |
528 | 0x2413 ALARM: System is waking up from hibernation because | 554 | 0x2413 ALARM: System is waking up from hibernation because |
@@ -544,6 +570,7 @@ Events that are propagated by the driver to userspace: | |||
544 | 0x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED) | 570 | 0x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED) |
545 | 0x60C0 X1 Yoga 2016, Tablet mode status changed | 571 | 0x60C0 X1 Yoga 2016, Tablet mode status changed |
546 | 0x60F0 Thermal Transformation changed (GMTS, Windows) | 572 | 0x60F0 Thermal Transformation changed (GMTS, Windows) |
573 | ====== ===================================================== | ||
547 | 574 | ||
548 | Battery nearly empty alarms are a last resort attempt to get the | 575 | Battery nearly empty alarms are a last resort attempt to get the |
549 | operating system to hibernate or shutdown cleanly (0x2313), or shutdown | 576 | operating system to hibernate or shutdown cleanly (0x2313), or shutdown |
@@ -562,7 +589,8 @@ cycle, or a system shutdown. Obviously, something is very wrong if this | |||
562 | happens. | 589 | happens. |
563 | 590 | ||
564 | 591 | ||
565 | Brightness hotkey notes: | 592 | Brightness hotkey notes |
593 | ^^^^^^^^^^^^^^^^^^^^^^^ | ||
566 | 594 | ||
567 | Don't mess with the brightness hotkeys in a Thinkpad. If you want | 595 | Don't mess with the brightness hotkeys in a Thinkpad. If you want |
568 | notifications for OSD, use the sysfs backlight class event support. | 596 | notifications for OSD, use the sysfs backlight class event support. |
@@ -579,7 +607,9 @@ Bluetooth | |||
579 | --------- | 607 | --------- |
580 | 608 | ||
581 | procfs: /proc/acpi/ibm/bluetooth | 609 | procfs: /proc/acpi/ibm/bluetooth |
610 | |||
582 | sysfs device attribute: bluetooth_enable (deprecated) | 611 | sysfs device attribute: bluetooth_enable (deprecated) |
612 | |||
583 | sysfs rfkill class: switch "tpacpi_bluetooth_sw" | 613 | sysfs rfkill class: switch "tpacpi_bluetooth_sw" |
584 | 614 | ||
585 | This feature shows the presence and current state of a ThinkPad | 615 | This feature shows the presence and current state of a ThinkPad |
@@ -588,22 +618,25 @@ Bluetooth device in the internal ThinkPad CDC slot. | |||
588 | If the ThinkPad supports it, the Bluetooth state is stored in NVRAM, | 618 | If the ThinkPad supports it, the Bluetooth state is stored in NVRAM, |
589 | so it is kept across reboots and power-off. | 619 | so it is kept across reboots and power-off. |
590 | 620 | ||
591 | Procfs notes: | 621 | Procfs notes |
622 | ^^^^^^^^^^^^ | ||
592 | 623 | ||
593 | If Bluetooth is installed, the following commands can be used: | 624 | If Bluetooth is installed, the following commands can be used:: |
594 | 625 | ||
595 | echo enable > /proc/acpi/ibm/bluetooth | 626 | echo enable > /proc/acpi/ibm/bluetooth |
596 | echo disable > /proc/acpi/ibm/bluetooth | 627 | echo disable > /proc/acpi/ibm/bluetooth |
597 | 628 | ||
598 | Sysfs notes: | 629 | Sysfs notes |
630 | ^^^^^^^^^^^ | ||
599 | 631 | ||
600 | If the Bluetooth CDC card is installed, it can be enabled / | 632 | If the Bluetooth CDC card is installed, it can be enabled / |
601 | disabled through the "bluetooth_enable" thinkpad-acpi device | 633 | disabled through the "bluetooth_enable" thinkpad-acpi device |
602 | attribute, and its current status can also be queried. | 634 | attribute, and its current status can also be queried. |
603 | 635 | ||
604 | enable: | 636 | enable: |
605 | 0: disables Bluetooth / Bluetooth is disabled | 637 | |
606 | 1: enables Bluetooth / Bluetooth is enabled. | 638 | - 0: disables Bluetooth / Bluetooth is disabled |
639 | - 1: enables Bluetooth / Bluetooth is enabled. | ||
607 | 640 | ||
608 | Note: this interface has been superseded by the generic rfkill | 641 | Note: this interface has been superseded by the generic rfkill |
609 | class. It has been deprecated, and it will be removed in year | 642 | class. It has been deprecated, and it will be removed in year |
@@ -617,7 +650,7 @@ Video output control -- /proc/acpi/ibm/video | |||
617 | -------------------------------------------- | 650 | -------------------------------------------- |
618 | 651 | ||
619 | This feature allows control over the devices used for video output - | 652 | This feature allows control over the devices used for video output - |
620 | LCD, CRT or DVI (if available). The following commands are available: | 653 | LCD, CRT or DVI (if available). The following commands are available:: |
621 | 654 | ||
622 | echo lcd_enable > /proc/acpi/ibm/video | 655 | echo lcd_enable > /proc/acpi/ibm/video |
623 | echo lcd_disable > /proc/acpi/ibm/video | 656 | echo lcd_disable > /proc/acpi/ibm/video |
@@ -630,9 +663,10 @@ LCD, CRT or DVI (if available). The following commands are available: | |||
630 | echo expand_toggle > /proc/acpi/ibm/video | 663 | echo expand_toggle > /proc/acpi/ibm/video |
631 | echo video_switch > /proc/acpi/ibm/video | 664 | echo video_switch > /proc/acpi/ibm/video |
632 | 665 | ||
633 | NOTE: Access to this feature is restricted to processes owning the | 666 | NOTE: |
634 | CAP_SYS_ADMIN capability for safety reasons, as it can interact badly | 667 | Access to this feature is restricted to processes owning the |
635 | enough with some versions of X.org to crash it. | 668 | CAP_SYS_ADMIN capability for safety reasons, as it can interact badly |
669 | enough with some versions of X.org to crash it. | ||
636 | 670 | ||
637 | Each video output device can be enabled or disabled individually. | 671 | Each video output device can be enabled or disabled individually. |
638 | Reading /proc/acpi/ibm/video shows the status of each device. | 672 | Reading /proc/acpi/ibm/video shows the status of each device. |
@@ -665,18 +699,21 @@ ThinkLight control | |||
665 | ------------------ | 699 | ------------------ |
666 | 700 | ||
667 | procfs: /proc/acpi/ibm/light | 701 | procfs: /proc/acpi/ibm/light |
702 | |||
668 | sysfs attributes: as per LED class, for the "tpacpi::thinklight" LED | 703 | sysfs attributes: as per LED class, for the "tpacpi::thinklight" LED |
669 | 704 | ||
670 | procfs notes: | 705 | procfs notes |
706 | ^^^^^^^^^^^^ | ||
671 | 707 | ||
672 | The ThinkLight status can be read and set through the procfs interface. A | 708 | The ThinkLight status can be read and set through the procfs interface. A |
673 | few models which do not make the status available will show the ThinkLight | 709 | few models which do not make the status available will show the ThinkLight |
674 | status as "unknown". The available commands are: | 710 | status as "unknown". The available commands are:: |
675 | 711 | ||
676 | echo on > /proc/acpi/ibm/light | 712 | echo on > /proc/acpi/ibm/light |
677 | echo off > /proc/acpi/ibm/light | 713 | echo off > /proc/acpi/ibm/light |
678 | 714 | ||
679 | sysfs notes: | 715 | sysfs notes |
716 | ^^^^^^^^^^^ | ||
680 | 717 | ||
681 | The ThinkLight sysfs interface is documented by the LED class | 718 | The ThinkLight sysfs interface is documented by the LED class |
682 | documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name | 719 | documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name |
@@ -691,6 +728,7 @@ CMOS/UCMS control | |||
691 | ----------------- | 728 | ----------------- |
692 | 729 | ||
693 | procfs: /proc/acpi/ibm/cmos | 730 | procfs: /proc/acpi/ibm/cmos |
731 | |||
694 | sysfs device attribute: cmos_command | 732 | sysfs device attribute: cmos_command |
695 | 733 | ||
696 | This feature is mostly used internally by the ACPI firmware to keep the legacy | 734 | This feature is mostly used internally by the ACPI firmware to keep the legacy |
@@ -707,16 +745,16 @@ The range of valid cmos command numbers is 0 to 21, but not all have an | |||
707 | effect and the behavior varies from model to model. Here is the behavior | 745 | effect and the behavior varies from model to model. Here is the behavior |
708 | on the X40 (tpb is the ThinkPad Buttons utility): | 746 | on the X40 (tpb is the ThinkPad Buttons utility): |
709 | 747 | ||
710 | 0 - Related to "Volume down" key press | 748 | - 0 - Related to "Volume down" key press |
711 | 1 - Related to "Volume up" key press | 749 | - 1 - Related to "Volume up" key press |
712 | 2 - Related to "Mute on" key press | 750 | - 2 - Related to "Mute on" key press |
713 | 3 - Related to "Access IBM" key press | 751 | - 3 - Related to "Access IBM" key press |
714 | 4 - Related to "LCD brightness up" key press | 752 | - 4 - Related to "LCD brightness up" key press |
715 | 5 - Related to "LCD brightness down" key press | 753 | - 5 - Related to "LCD brightness down" key press |
716 | 11 - Related to "toggle screen expansion" key press/function | 754 | - 11 - Related to "toggle screen expansion" key press/function |
717 | 12 - Related to "ThinkLight on" | 755 | - 12 - Related to "ThinkLight on" |
718 | 13 - Related to "ThinkLight off" | 756 | - 13 - Related to "ThinkLight off" |
719 | 14 - Related to "ThinkLight" key press (toggle ThinkLight) | 757 | - 14 - Related to "ThinkLight" key press (toggle ThinkLight) |
720 | 758 | ||
721 | The cmos command interface is prone to firmware split-brain problems, as | 759 | The cmos command interface is prone to firmware split-brain problems, as |
722 | in newer ThinkPads it is just a compatibility layer. Do not use it, it is | 760 | in newer ThinkPads it is just a compatibility layer. Do not use it, it is |
@@ -748,9 +786,10 @@ are aware of the consequences are welcome to enabling it. | |||
748 | Audio mute and microphone mute LEDs are supported, but currently not | 786 | Audio mute and microphone mute LEDs are supported, but currently not |
749 | visible to userspace. They are used by the snd-hda-intel audio driver. | 787 | visible to userspace. They are used by the snd-hda-intel audio driver. |
750 | 788 | ||
751 | procfs notes: | 789 | procfs notes |
790 | ^^^^^^^^^^^^ | ||
752 | 791 | ||
753 | The available commands are: | 792 | The available commands are:: |
754 | 793 | ||
755 | echo '<LED number> on' >/proc/acpi/ibm/led | 794 | echo '<LED number> on' >/proc/acpi/ibm/led |
756 | echo '<LED number> off' >/proc/acpi/ibm/led | 795 | echo '<LED number> off' >/proc/acpi/ibm/led |
@@ -760,23 +799,24 @@ The <LED number> range is 0 to 15. The set of LEDs that can be | |||
760 | controlled varies from model to model. Here is the common ThinkPad | 799 | controlled varies from model to model. Here is the common ThinkPad |
761 | mapping: | 800 | mapping: |
762 | 801 | ||
763 | 0 - power | 802 | - 0 - power |
764 | 1 - battery (orange) | 803 | - 1 - battery (orange) |
765 | 2 - battery (green) | 804 | - 2 - battery (green) |
766 | 3 - UltraBase/dock | 805 | - 3 - UltraBase/dock |
767 | 4 - UltraBay | 806 | - 4 - UltraBay |
768 | 5 - UltraBase battery slot | 807 | - 5 - UltraBase battery slot |
769 | 6 - (unknown) | 808 | - 6 - (unknown) |
770 | 7 - standby | 809 | - 7 - standby |
771 | 8 - dock status 1 | 810 | - 8 - dock status 1 |
772 | 9 - dock status 2 | 811 | - 9 - dock status 2 |
773 | 10, 11 - (unknown) | 812 | - 10, 11 - (unknown) |
774 | 12 - thinkvantage | 813 | - 12 - thinkvantage |
775 | 13, 14, 15 - (unknown) | 814 | - 13, 14, 15 - (unknown) |
776 | 815 | ||
777 | All of the above can be turned on and off and can be made to blink. | 816 | All of the above can be turned on and off and can be made to blink. |
778 | 817 | ||
779 | sysfs notes: | 818 | sysfs notes |
819 | ^^^^^^^^^^^ | ||
780 | 820 | ||
781 | The ThinkPad LED sysfs interface is described in detail by the LED class | 821 | The ThinkPad LED sysfs interface is described in detail by the LED class |
782 | documentation, in Documentation/leds/leds-class.rst. | 822 | documentation, in Documentation/leds/leds-class.rst. |
@@ -815,7 +855,7 @@ The BEEP method is used internally by the ACPI firmware to provide | |||
815 | audible alerts in various situations. This feature allows the same | 855 | audible alerts in various situations. This feature allows the same |
816 | sounds to be triggered manually. | 856 | sounds to be triggered manually. |
817 | 857 | ||
818 | The commands are non-negative integer numbers: | 858 | The commands are non-negative integer numbers:: |
819 | 859 | ||
820 | echo <number> >/proc/acpi/ibm/beep | 860 | echo <number> >/proc/acpi/ibm/beep |
821 | 861 | ||
@@ -823,25 +863,26 @@ The valid <number> range is 0 to 17. Not all numbers trigger sounds | |||
823 | and the sounds vary from model to model. Here is the behavior on the | 863 | and the sounds vary from model to model. Here is the behavior on the |
824 | X40: | 864 | X40: |
825 | 865 | ||
826 | 0 - stop a sound in progress (but use 17 to stop 16) | 866 | - 0 - stop a sound in progress (but use 17 to stop 16) |
827 | 2 - two beeps, pause, third beep ("low battery") | 867 | - 2 - two beeps, pause, third beep ("low battery") |
828 | 3 - single beep | 868 | - 3 - single beep |
829 | 4 - high, followed by low-pitched beep ("unable") | 869 | - 4 - high, followed by low-pitched beep ("unable") |
830 | 5 - single beep | 870 | - 5 - single beep |
831 | 6 - very high, followed by high-pitched beep ("AC/DC") | 871 | - 6 - very high, followed by high-pitched beep ("AC/DC") |
832 | 7 - high-pitched beep | 872 | - 7 - high-pitched beep |
833 | 9 - three short beeps | 873 | - 9 - three short beeps |
834 | 10 - very long beep | 874 | - 10 - very long beep |
835 | 12 - low-pitched beep | 875 | - 12 - low-pitched beep |
836 | 15 - three high-pitched beeps repeating constantly, stop with 0 | 876 | - 15 - three high-pitched beeps repeating constantly, stop with 0 |
837 | 16 - one medium-pitched beep repeating constantly, stop with 17 | 877 | - 16 - one medium-pitched beep repeating constantly, stop with 17 |
838 | 17 - stop 16 | 878 | - 17 - stop 16 |
839 | 879 | ||
840 | 880 | ||
841 | Temperature sensors | 881 | Temperature sensors |
842 | ------------------- | 882 | ------------------- |
843 | 883 | ||
844 | procfs: /proc/acpi/ibm/thermal | 884 | procfs: /proc/acpi/ibm/thermal |
885 | |||
845 | sysfs device attributes: (hwmon "thinkpad") temp*_input | 886 | sysfs device attributes: (hwmon "thinkpad") temp*_input |
846 | 887 | ||
847 | Most ThinkPads include six or more separate temperature sensors but only | 888 | Most ThinkPads include six or more separate temperature sensors but only |
@@ -850,10 +891,14 @@ feature shows readings from up to eight different sensors on older | |||
850 | ThinkPads, and up to sixteen different sensors on newer ThinkPads. | 891 | ThinkPads, and up to sixteen different sensors on newer ThinkPads. |
851 | 892 | ||
852 | For example, on the X40, a typical output may be: | 893 | For example, on the X40, a typical output may be: |
853 | temperatures: 42 42 45 41 36 -128 33 -128 | 894 | |
895 | temperatures: | ||
896 | 42 42 45 41 36 -128 33 -128 | ||
854 | 897 | ||
855 | On the T43/p, a typical output may be: | 898 | On the T43/p, a typical output may be: |
856 | temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128 | 899 | |
900 | temperatures: | ||
901 | 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128 | ||
857 | 902 | ||
858 | The mapping of thermal sensors to physical locations varies depending on | 903 | The mapping of thermal sensors to physical locations varies depending on |
859 | system-board model (and thus, on ThinkPad model). | 904 | system-board model (and thus, on ThinkPad model). |
@@ -863,46 +908,53 @@ tries to track down these locations for various models. | |||
863 | 908 | ||
864 | Most (newer?) models seem to follow this pattern: | 909 | Most (newer?) models seem to follow this pattern: |
865 | 910 | ||
866 | 1: CPU | 911 | - 1: CPU |
867 | 2: (depends on model) | 912 | - 2: (depends on model) |
868 | 3: (depends on model) | 913 | - 3: (depends on model) |
869 | 4: GPU | 914 | - 4: GPU |
870 | 5: Main battery: main sensor | 915 | - 5: Main battery: main sensor |
871 | 6: Bay battery: main sensor | 916 | - 6: Bay battery: main sensor |
872 | 7: Main battery: secondary sensor | 917 | - 7: Main battery: secondary sensor |
873 | 8: Bay battery: secondary sensor | 918 | - 8: Bay battery: secondary sensor |
874 | 9-15: (depends on model) | 919 | - 9-15: (depends on model) |
875 | 920 | ||
876 | For the R51 (source: Thomas Gruber): | 921 | For the R51 (source: Thomas Gruber): |
877 | 2: Mini-PCI | 922 | |
878 | 3: Internal HDD | 923 | - 2: Mini-PCI |
924 | - 3: Internal HDD | ||
879 | 925 | ||
880 | For the T43, T43/p (source: Shmidoax/Thinkwiki.org) | 926 | For the T43, T43/p (source: Shmidoax/Thinkwiki.org) |
881 | http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p | 927 | http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p |
882 | 2: System board, left side (near PCMCIA slot), reported as HDAPS temp | 928 | |
883 | 3: PCMCIA slot | 929 | - 2: System board, left side (near PCMCIA slot), reported as HDAPS temp |
884 | 9: MCH (northbridge) to DRAM Bus | 930 | - 3: PCMCIA slot |
885 | 10: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI | 931 | - 9: MCH (northbridge) to DRAM Bus |
886 | card, under touchpad | 932 | - 10: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI |
887 | 11: Power regulator, underside of system board, below F2 key | 933 | card, under touchpad |
934 | - 11: Power regulator, underside of system board, below F2 key | ||
888 | 935 | ||
889 | The A31 has a very atypical layout for the thermal sensors | 936 | The A31 has a very atypical layout for the thermal sensors |
890 | (source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31) | 937 | (source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31) |
891 | 1: CPU | ||
892 | 2: Main Battery: main sensor | ||
893 | 3: Power Converter | ||
894 | 4: Bay Battery: main sensor | ||
895 | 5: MCH (northbridge) | ||
896 | 6: PCMCIA/ambient | ||
897 | 7: Main Battery: secondary sensor | ||
898 | 8: Bay Battery: secondary sensor | ||
899 | 938 | ||
939 | - 1: CPU | ||
940 | - 2: Main Battery: main sensor | ||
941 | - 3: Power Converter | ||
942 | - 4: Bay Battery: main sensor | ||
943 | - 5: MCH (northbridge) | ||
944 | - 6: PCMCIA/ambient | ||
945 | - 7: Main Battery: secondary sensor | ||
946 | - 8: Bay Battery: secondary sensor | ||
947 | |||
948 | |||
949 | Procfs notes | ||
950 | ^^^^^^^^^^^^ | ||
900 | 951 | ||
901 | Procfs notes: | ||
902 | Readings from sensors that are not available return -128. | 952 | Readings from sensors that are not available return -128. |
903 | No commands can be written to this file. | 953 | No commands can be written to this file. |
904 | 954 | ||
905 | Sysfs notes: | 955 | Sysfs notes |
956 | ^^^^^^^^^^^ | ||
957 | |||
906 | Sensors that are not available return the ENXIO error. This | 958 | Sensors that are not available return the ENXIO error. This |
907 | status may change at runtime, as there are hotplug thermal | 959 | status may change at runtime, as there are hotplug thermal |
908 | sensors, like those inside the batteries and docks. | 960 | sensors, like those inside the batteries and docks. |
@@ -921,6 +973,7 @@ ftp://ftp.suse.com/pub/people/trenn/sources/ec | |||
921 | 973 | ||
922 | Use it to determine the register holding the fan | 974 | Use it to determine the register holding the fan |
923 | speed on some models. To do that, do the following: | 975 | speed on some models. To do that, do the following: |
976 | |||
924 | - make sure the battery is fully charged | 977 | - make sure the battery is fully charged |
925 | - make sure the fan is running | 978 | - make sure the fan is running |
926 | - use above mentioned tool to read out the EC | 979 | - use above mentioned tool to read out the EC |
@@ -941,6 +994,7 @@ LCD brightness control | |||
941 | ---------------------- | 994 | ---------------------- |
942 | 995 | ||
943 | procfs: /proc/acpi/ibm/brightness | 996 | procfs: /proc/acpi/ibm/brightness |
997 | |||
944 | sysfs backlight device "thinkpad_screen" | 998 | sysfs backlight device "thinkpad_screen" |
945 | 999 | ||
946 | This feature allows software control of the LCD brightness on ThinkPad | 1000 | This feature allows software control of the LCD brightness on ThinkPad |
@@ -985,15 +1039,17 @@ brightness_enable=0 forces it to be disabled. brightness_enable=1 | |||
985 | forces it to be enabled when available, even if the standard ACPI | 1039 | forces it to be enabled when available, even if the standard ACPI |
986 | interface is also available. | 1040 | interface is also available. |
987 | 1041 | ||
988 | Procfs notes: | 1042 | Procfs notes |
1043 | ^^^^^^^^^^^^ | ||
989 | 1044 | ||
990 | The available commands are: | 1045 | The available commands are:: |
991 | 1046 | ||
992 | echo up >/proc/acpi/ibm/brightness | 1047 | echo up >/proc/acpi/ibm/brightness |
993 | echo down >/proc/acpi/ibm/brightness | 1048 | echo down >/proc/acpi/ibm/brightness |
994 | echo 'level <level>' >/proc/acpi/ibm/brightness | 1049 | echo 'level <level>' >/proc/acpi/ibm/brightness |
995 | 1050 | ||
996 | Sysfs notes: | 1051 | Sysfs notes |
1052 | ^^^^^^^^^^^ | ||
997 | 1053 | ||
998 | The interface is implemented through the backlight sysfs class, which is | 1054 | The interface is implemented through the backlight sysfs class, which is |
999 | poorly documented at this time. | 1055 | poorly documented at this time. |
@@ -1038,6 +1094,7 @@ Volume control (Console Audio control) | |||
1038 | -------------------------------------- | 1094 | -------------------------------------- |
1039 | 1095 | ||
1040 | procfs: /proc/acpi/ibm/volume | 1096 | procfs: /proc/acpi/ibm/volume |
1097 | |||
1041 | ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC" | 1098 | ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC" |
1042 | 1099 | ||
1043 | NOTE: by default, the volume control interface operates in read-only | 1100 | NOTE: by default, the volume control interface operates in read-only |
@@ -1053,7 +1110,8 @@ Software volume control should be done only in the main AC97/HDA | |||
1053 | mixer. | 1110 | mixer. |
1054 | 1111 | ||
1055 | 1112 | ||
1056 | About the ThinkPad Console Audio control: | 1113 | About the ThinkPad Console Audio control |
1114 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
1057 | 1115 | ||
1058 | ThinkPads have a built-in amplifier and muting circuit that drives the | 1116 | ThinkPads have a built-in amplifier and muting circuit that drives the |
1059 | console headphone and speakers. This circuit is after the main AC97 | 1117 | console headphone and speakers. This circuit is after the main AC97 |
@@ -1092,13 +1150,14 @@ normal key presses to the operating system (thinkpad-acpi is not | |||
1092 | involved). | 1150 | involved). |
1093 | 1151 | ||
1094 | 1152 | ||
1095 | The ThinkPad-ACPI volume control: | 1153 | The ThinkPad-ACPI volume control |
1154 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
1096 | 1155 | ||
1097 | The preferred way to interact with the Console Audio control is the | 1156 | The preferred way to interact with the Console Audio control is the |
1098 | ALSA interface. | 1157 | ALSA interface. |
1099 | 1158 | ||
1100 | The legacy procfs interface allows one to read the current state, | 1159 | The legacy procfs interface allows one to read the current state, |
1101 | and if volume control is enabled, accepts the following commands: | 1160 | and if volume control is enabled, accepts the following commands:: |
1102 | 1161 | ||
1103 | echo up >/proc/acpi/ibm/volume | 1162 | echo up >/proc/acpi/ibm/volume |
1104 | echo down >/proc/acpi/ibm/volume | 1163 | echo down >/proc/acpi/ibm/volume |
@@ -1137,13 +1196,15 @@ Fan control and monitoring: fan speed, fan enable/disable | |||
1137 | --------------------------------------------------------- | 1196 | --------------------------------------------------------- |
1138 | 1197 | ||
1139 | procfs: /proc/acpi/ibm/fan | 1198 | procfs: /proc/acpi/ibm/fan |
1140 | sysfs device attributes: (hwmon "thinkpad") fan1_input, pwm1, | 1199 | |
1141 | pwm1_enable, fan2_input | 1200 | sysfs device attributes: (hwmon "thinkpad") fan1_input, pwm1, pwm1_enable, fan2_input |
1201 | |||
1142 | sysfs hwmon driver attributes: fan_watchdog | 1202 | sysfs hwmon driver attributes: fan_watchdog |
1143 | 1203 | ||
1144 | NOTE NOTE NOTE: fan control operations are disabled by default for | 1204 | NOTE NOTE NOTE: |
1145 | safety reasons. To enable them, the module parameter "fan_control=1" | 1205 | fan control operations are disabled by default for |
1146 | must be given to thinkpad-acpi. | 1206 | safety reasons. To enable them, the module parameter "fan_control=1" |
1207 | must be given to thinkpad-acpi. | ||
1147 | 1208 | ||
1148 | This feature attempts to show the current fan speed, control mode and | 1209 | This feature attempts to show the current fan speed, control mode and |
1149 | other fan data that might be available. The speed is read directly | 1210 | other fan data that might be available. The speed is read directly |
@@ -1154,7 +1215,8 @@ value on other models. | |||
1154 | Some Lenovo ThinkPads support a secondary fan. This fan cannot be | 1215 | Some Lenovo ThinkPads support a secondary fan. This fan cannot be |
1155 | controlled separately, it shares the main fan control. | 1216 | controlled separately, it shares the main fan control. |
1156 | 1217 | ||
1157 | Fan levels: | 1218 | Fan levels |
1219 | ^^^^^^^^^^ | ||
1158 | 1220 | ||
1159 | Most ThinkPad fans work in "levels" at the firmware interface. Level 0 | 1221 | Most ThinkPad fans work in "levels" at the firmware interface. Level 0 |
1160 | stops the fan. The higher the level, the higher the fan speed, although | 1222 | stops the fan. The higher the level, the higher the fan speed, although |
@@ -1209,9 +1271,10 @@ therefore, not suitable to protect against fan mode changes made through | |||
1209 | means other than the "enable", "disable", and "level" procfs fan | 1271 | means other than the "enable", "disable", and "level" procfs fan |
1210 | commands, or the hwmon fan control sysfs interface. | 1272 | commands, or the hwmon fan control sysfs interface. |
1211 | 1273 | ||
1212 | Procfs notes: | 1274 | Procfs notes |
1275 | ^^^^^^^^^^^^ | ||
1213 | 1276 | ||
1214 | The fan may be enabled or disabled with the following commands: | 1277 | The fan may be enabled or disabled with the following commands:: |
1215 | 1278 | ||
1216 | echo enable >/proc/acpi/ibm/fan | 1279 | echo enable >/proc/acpi/ibm/fan |
1217 | echo disable >/proc/acpi/ibm/fan | 1280 | echo disable >/proc/acpi/ibm/fan |
@@ -1219,7 +1282,7 @@ The fan may be enabled or disabled with the following commands: | |||
1219 | Placing a fan on level 0 is the same as disabling it. Enabling a fan | 1282 | Placing a fan on level 0 is the same as disabling it. Enabling a fan |
1220 | will try to place it in a safe level if it is too slow or disabled. | 1283 | will try to place it in a safe level if it is too slow or disabled. |
1221 | 1284 | ||
1222 | The fan level can be controlled with the command: | 1285 | The fan level can be controlled with the command:: |
1223 | 1286 | ||
1224 | echo 'level <level>' > /proc/acpi/ibm/fan | 1287 | echo 'level <level>' > /proc/acpi/ibm/fan |
1225 | 1288 | ||
@@ -1231,7 +1294,7 @@ compatibility. | |||
1231 | 1294 | ||
1232 | On the X31 and X40 (and ONLY on those models), the fan speed can be | 1295 | On the X31 and X40 (and ONLY on those models), the fan speed can be |
1233 | controlled to a certain degree. Once the fan is running, it can be | 1296 | controlled to a certain degree. Once the fan is running, it can be |
1234 | forced to run faster or slower with the following command: | 1297 | forced to run faster or slower with the following command:: |
1235 | 1298 | ||
1236 | echo 'speed <speed>' > /proc/acpi/ibm/fan | 1299 | echo 'speed <speed>' > /proc/acpi/ibm/fan |
1237 | 1300 | ||
@@ -1241,13 +1304,14 @@ effect or the fan speed eventually settles somewhere in that range. The | |||
1241 | fan cannot be stopped or started with this command. This functionality | 1304 | fan cannot be stopped or started with this command. This functionality |
1242 | is incomplete, and not available through the sysfs interface. | 1305 | is incomplete, and not available through the sysfs interface. |
1243 | 1306 | ||
1244 | To program the safety watchdog, use the "watchdog" command. | 1307 | To program the safety watchdog, use the "watchdog" command:: |
1245 | 1308 | ||
1246 | echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan | 1309 | echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan |
1247 | 1310 | ||
1248 | If you want to disable the watchdog, use 0 as the interval. | 1311 | If you want to disable the watchdog, use 0 as the interval. |
1249 | 1312 | ||
1250 | Sysfs notes: | 1313 | Sysfs notes |
1314 | ^^^^^^^^^^^ | ||
1251 | 1315 | ||
1252 | The sysfs interface follows the hwmon subsystem guidelines for the most | 1316 | The sysfs interface follows the hwmon subsystem guidelines for the most |
1253 | part, and the exception is the fan safety watchdog. | 1317 | part, and the exception is the fan safety watchdog. |
@@ -1261,10 +1325,10 @@ to the firmware). | |||
1261 | Features not yet implemented by the driver return ENOSYS. | 1325 | Features not yet implemented by the driver return ENOSYS. |
1262 | 1326 | ||
1263 | hwmon device attribute pwm1_enable: | 1327 | hwmon device attribute pwm1_enable: |
1264 | 0: PWM offline (fan is set to full-speed mode) | 1328 | - 0: PWM offline (fan is set to full-speed mode) |
1265 | 1: Manual PWM control (use pwm1 to set fan level) | 1329 | - 1: Manual PWM control (use pwm1 to set fan level) |
1266 | 2: Hardware PWM control (EC "auto" mode) | 1330 | - 2: Hardware PWM control (EC "auto" mode) |
1267 | 3: reserved (Software PWM control, not implemented yet) | 1331 | - 3: reserved (Software PWM control, not implemented yet) |
1268 | 1332 | ||
1269 | Modes 0 and 2 are not supported by all ThinkPads, and the | 1333 | Modes 0 and 2 are not supported by all ThinkPads, and the |
1270 | driver is not always able to detect this. If it does know a | 1334 | driver is not always able to detect this. If it does know a |
@@ -1304,7 +1368,9 @@ WAN | |||
1304 | --- | 1368 | --- |
1305 | 1369 | ||
1306 | procfs: /proc/acpi/ibm/wan | 1370 | procfs: /proc/acpi/ibm/wan |
1371 | |||
1307 | sysfs device attribute: wwan_enable (deprecated) | 1372 | sysfs device attribute: wwan_enable (deprecated) |
1373 | |||
1308 | sysfs rfkill class: switch "tpacpi_wwan_sw" | 1374 | sysfs rfkill class: switch "tpacpi_wwan_sw" |
1309 | 1375 | ||
1310 | This feature shows the presence and current state of the built-in | 1376 | This feature shows the presence and current state of the built-in |
@@ -1316,22 +1382,24 @@ so it is kept across reboots and power-off. | |||
1316 | It was tested on a Lenovo ThinkPad X60. It should probably work on other | 1382 | It was tested on a Lenovo ThinkPad X60. It should probably work on other |
1317 | ThinkPad models which come with this module installed. | 1383 | ThinkPad models which come with this module installed. |
1318 | 1384 | ||
1319 | Procfs notes: | 1385 | Procfs notes |
1386 | ^^^^^^^^^^^^ | ||
1320 | 1387 | ||
1321 | If the W-WAN card is installed, the following commands can be used: | 1388 | If the W-WAN card is installed, the following commands can be used:: |
1322 | 1389 | ||
1323 | echo enable > /proc/acpi/ibm/wan | 1390 | echo enable > /proc/acpi/ibm/wan |
1324 | echo disable > /proc/acpi/ibm/wan | 1391 | echo disable > /proc/acpi/ibm/wan |
1325 | 1392 | ||
1326 | Sysfs notes: | 1393 | Sysfs notes |
1394 | ^^^^^^^^^^^ | ||
1327 | 1395 | ||
1328 | If the W-WAN card is installed, it can be enabled / | 1396 | If the W-WAN card is installed, it can be enabled / |
1329 | disabled through the "wwan_enable" thinkpad-acpi device | 1397 | disabled through the "wwan_enable" thinkpad-acpi device |
1330 | attribute, and its current status can also be queried. | 1398 | attribute, and its current status can also be queried. |
1331 | 1399 | ||
1332 | enable: | 1400 | enable: |
1333 | 0: disables WWAN card / WWAN card is disabled | 1401 | - 0: disables WWAN card / WWAN card is disabled |
1334 | 1: enables WWAN card / WWAN card is enabled. | 1402 | - 1: enables WWAN card / WWAN card is enabled. |
1335 | 1403 | ||
1336 | Note: this interface has been superseded by the generic rfkill | 1404 | Note: this interface has been superseded by the generic rfkill |
1337 | class. It has been deprecated, and it will be removed in year | 1405 | class. It has been deprecated, and it will be removed in year |
@@ -1354,7 +1422,8 @@ sysfs rfkill class: switch "tpacpi_uwb_sw" | |||
1354 | This feature exports an rfkill controller for the UWB device, if one is | 1422 | This feature exports an rfkill controller for the UWB device, if one is |
1355 | present and enabled in the BIOS. | 1423 | present and enabled in the BIOS. |
1356 | 1424 | ||
1357 | Sysfs notes: | 1425 | Sysfs notes |
1426 | ^^^^^^^^^^^ | ||
1358 | 1427 | ||
1359 | rfkill controller switch "tpacpi_uwb_sw": refer to | 1428 | rfkill controller switch "tpacpi_uwb_sw": refer to |
1360 | Documentation/rfkill.txt for details. | 1429 | Documentation/rfkill.txt for details. |
@@ -1368,11 +1437,11 @@ This sysfs attribute controls the keyboard "face" that will be shown on the | |||
1368 | Lenovo X1 Carbon 2nd gen (2014)'s adaptive keyboard. The value can be read | 1437 | Lenovo X1 Carbon 2nd gen (2014)'s adaptive keyboard. The value can be read |
1369 | and set. | 1438 | and set. |
1370 | 1439 | ||
1371 | 1 = Home mode | 1440 | - 1 = Home mode |
1372 | 2 = Web-browser mode | 1441 | - 2 = Web-browser mode |
1373 | 3 = Web-conference mode | 1442 | - 3 = Web-conference mode |
1374 | 4 = Function mode | 1443 | - 4 = Function mode |
1375 | 5 = Layflat mode | 1444 | - 5 = Layflat mode |
1376 | 1445 | ||
1377 | For more details about which buttons will appear depending on the mode, please | 1446 | For more details about which buttons will appear depending on the mode, please |
1378 | review the laptop's user guide: | 1447 | review the laptop's user guide: |
@@ -1382,13 +1451,13 @@ Multiple Commands, Module Parameters | |||
1382 | ------------------------------------ | 1451 | ------------------------------------ |
1383 | 1452 | ||
1384 | Multiple commands can be written to the proc files in one shot by | 1453 | Multiple commands can be written to the proc files in one shot by |
1385 | separating them with commas, for example: | 1454 | separating them with commas, for example:: |
1386 | 1455 | ||
1387 | echo enable,0xffff > /proc/acpi/ibm/hotkey | 1456 | echo enable,0xffff > /proc/acpi/ibm/hotkey |
1388 | echo lcd_disable,crt_enable > /proc/acpi/ibm/video | 1457 | echo lcd_disable,crt_enable > /proc/acpi/ibm/video |
1389 | 1458 | ||
1390 | Commands can also be specified when loading the thinkpad-acpi module, | 1459 | Commands can also be specified when loading the thinkpad-acpi module, |
1391 | for example: | 1460 | for example:: |
1392 | 1461 | ||
1393 | modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable | 1462 | modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable |
1394 | 1463 | ||
@@ -1397,14 +1466,16 @@ Enabling debugging output | |||
1397 | ------------------------- | 1466 | ------------------------- |
1398 | 1467 | ||
1399 | The module takes a debug parameter which can be used to selectively | 1468 | The module takes a debug parameter which can be used to selectively |
1400 | enable various classes of debugging output, for example: | 1469 | enable various classes of debugging output, for example:: |
1401 | 1470 | ||
1402 | modprobe thinkpad_acpi debug=0xffff | 1471 | modprobe thinkpad_acpi debug=0xffff |
1403 | 1472 | ||
1404 | will enable all debugging output classes. It takes a bitmask, so | 1473 | will enable all debugging output classes. It takes a bitmask, so |
1405 | to enable more than one output class, just add their values. | 1474 | to enable more than one output class, just add their values. |
1406 | 1475 | ||
1476 | ============= ====================================== | ||
1407 | Debug bitmask Description | 1477 | Debug bitmask Description |
1478 | ============= ====================================== | ||
1408 | 0x8000 Disclose PID of userspace programs | 1479 | 0x8000 Disclose PID of userspace programs |
1409 | accessing some functions of the driver | 1480 | accessing some functions of the driver |
1410 | 0x0001 Initialization and probing | 1481 | 0x0001 Initialization and probing |
@@ -1415,6 +1486,7 @@ to enable more than one output class, just add their values. | |||
1415 | 0x0010 Fan control | 1486 | 0x0010 Fan control |
1416 | 0x0020 Backlight brightness | 1487 | 0x0020 Backlight brightness |
1417 | 0x0040 Audio mixer/volume control | 1488 | 0x0040 Audio mixer/volume control |
1489 | ============= ====================================== | ||
1418 | 1490 | ||
1419 | There is also a kernel build option to enable more debugging | 1491 | There is also a kernel build option to enable more debugging |
1420 | information, which may be necessary to debug driver problems. | 1492 | information, which may be necessary to debug driver problems. |
@@ -1432,8 +1504,10 @@ the module parameter force_load=1. Regardless of whether this works or | |||
1432 | not, please contact ibm-acpi-devel@lists.sourceforge.net with a report. | 1504 | not, please contact ibm-acpi-devel@lists.sourceforge.net with a report. |
1433 | 1505 | ||
1434 | 1506 | ||
1435 | Sysfs interface changelog: | 1507 | Sysfs interface changelog |
1508 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
1436 | 1509 | ||
1510 | ========= =============================================================== | ||
1437 | 0x000100: Initial sysfs support, as a single platform driver and | 1511 | 0x000100: Initial sysfs support, as a single platform driver and |
1438 | device. | 1512 | device. |
1439 | 0x000200: Hot key support for 32 hot keys, and radio slider switch | 1513 | 0x000200: Hot key support for 32 hot keys, and radio slider switch |
@@ -1485,3 +1559,4 @@ Sysfs interface changelog: | |||
1485 | 0x030000: Thermal and fan sysfs attributes were moved to the hwmon | 1559 | 0x030000: Thermal and fan sysfs attributes were moved to the hwmon |
1486 | device instead of being attached to the backing platform | 1560 | device instead of being attached to the backing platform |
1487 | device. | 1561 | device. |
1562 | ========= =============================================================== | ||
diff --git a/Documentation/laptops/toshiba_haps.txt b/Documentation/laptops/toshiba_haps.rst index 0c1d88dedbde..11dfc428c080 100644 --- a/Documentation/laptops/toshiba_haps.txt +++ b/Documentation/laptops/toshiba_haps.rst | |||
@@ -1,18 +1,19 @@ | |||
1 | Kernel driver toshiba_haps | 1 | ==================================== |
2 | Toshiba HDD Active Protection Sensor | 2 | Toshiba HDD Active Protection Sensor |
3 | ==================================== | 3 | ==================================== |
4 | 4 | ||
5 | Kernel driver: toshiba_haps | ||
6 | |||
5 | Author: Azael Avalos <coproscefalo@gmail.com> | 7 | Author: Azael Avalos <coproscefalo@gmail.com> |
6 | 8 | ||
7 | 9 | ||
8 | 0. Contents | 10 | .. 0. Contents |
9 | ----------- | ||
10 | 11 | ||
11 | 1. Description | 12 | 1. Description |
12 | 2. Interface | 13 | 2. Interface |
13 | 3. Accelerometer axes | 14 | 3. Accelerometer axes |
14 | 4. Supported devices | 15 | 4. Supported devices |
15 | 5. Usage | 16 | 5. Usage |
16 | 17 | ||
17 | 18 | ||
18 | 1. Description | 19 | 1. Description |
@@ -32,17 +33,20 @@ file to set the desired protection level or sensor sensibility. | |||
32 | ------------ | 33 | ------------ |
33 | 34 | ||
34 | This device comes with 3 methods: | 35 | This device comes with 3 methods: |
35 | _STA - Checks existence of the device, returning Zero if the device does not | 36 | |
37 | ==== ===================================================================== | ||
38 | _STA Checks existence of the device, returning Zero if the device does not | ||
36 | exists or is not supported. | 39 | exists or is not supported. |
37 | PTLV - Sets the desired protection level. | 40 | PTLV Sets the desired protection level. |
38 | RSSS - Shuts down the HDD protection interface for a few seconds, | 41 | RSSS Shuts down the HDD protection interface for a few seconds, |
39 | then restores normal operation. | 42 | then restores normal operation. |
43 | ==== ===================================================================== | ||
40 | 44 | ||
41 | Note: | 45 | Note: |
42 | The presence of Solid State Drives (SSD) can make this driver to fail loading, | 46 | The presence of Solid State Drives (SSD) can make this driver to fail loading, |
43 | given the fact that such drives have no movable parts, and thus, not requiring | 47 | given the fact that such drives have no movable parts, and thus, not requiring |
44 | any "protection" as well as failing during the evaluation of the _STA method | 48 | any "protection" as well as failing during the evaluation of the _STA method |
45 | found under this device. | 49 | found under this device. |
46 | 50 | ||
47 | 51 | ||
48 | 3. Accelerometer axes | 52 | 3. Accelerometer axes |
@@ -66,11 +70,18 @@ conventional HDD and not only SSD, or a combination of both HDD and SSD. | |||
66 | -------- | 70 | -------- |
67 | 71 | ||
68 | The sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are: | 72 | The sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are: |
69 | protection_level - The protection_level is readable and writeable, and | 73 | |
74 | ================ ============================================================ | ||
75 | protection_level The protection_level is readable and writeable, and | ||
70 | provides a way to let userspace query the current protection | 76 | provides a way to let userspace query the current protection |
71 | level, as well as set the desired protection level, the | 77 | level, as well as set the desired protection level, the |
72 | available protection levels are: | 78 | available protection levels are: |
73 | 0 - Disabled | 1 - Low | 2 - Medium | 3 - High | 79 | |
74 | reset_protection - The reset_protection entry is writeable only, being "1" | 80 | ============ ======= ========== ======== |
81 | 0 - Disabled 1 - Low 2 - Medium 3 - High | ||
82 | ============ ======= ========== ======== | ||
83 | |||
84 | reset_protection The reset_protection entry is writeable only, being "1" | ||
75 | the only parameter it accepts, it is used to trigger | 85 | the only parameter it accepts, it is used to trigger |
76 | a reset of the protection interface. | 86 | a reset of the protection interface. |
87 | ================ ============================================================ | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 749322060f10..c5f0d44433a2 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -102,7 +102,7 @@ Changing this takes effect whenever an application requests memory. | |||
102 | block_dump | 102 | block_dump |
103 | 103 | ||
104 | block_dump enables block I/O debugging when set to a nonzero value. More | 104 | block_dump enables block I/O debugging when set to a nonzero value. More |
105 | information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. | 105 | information on block I/O debugging is in Documentation/laptops/laptop-mode.rst. |
106 | 106 | ||
107 | ============================================================== | 107 | ============================================================== |
108 | 108 | ||
@@ -286,7 +286,7 @@ shared memory segment using hugetlb page. | |||
286 | laptop_mode | 286 | laptop_mode |
287 | 287 | ||
288 | laptop_mode is a knob that controls "laptop mode". All the things that are | 288 | laptop_mode is a knob that controls "laptop mode". All the things that are |
289 | controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. | 289 | controlled by this knob are discussed in Documentation/laptops/laptop-mode.rst. |
290 | 290 | ||
291 | ============================================================== | 291 | ============================================================== |
292 | 292 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index c30b52c9049a..3ee73751f56c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -14888,7 +14888,7 @@ M: Mattia Dongili <malattia@linux.it> | |||
14888 | L: platform-driver-x86@vger.kernel.org | 14888 | L: platform-driver-x86@vger.kernel.org |
14889 | W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers | 14889 | W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers |
14890 | S: Maintained | 14890 | S: Maintained |
14891 | F: Documentation/laptops/sony-laptop.txt | 14891 | F: Documentation/laptops/sony-laptop.rst |
14892 | F: drivers/char/sonypi.c | 14892 | F: drivers/char/sonypi.c |
14893 | F: drivers/platform/x86/sony-laptop.c | 14893 | F: drivers/platform/x86/sony-laptop.c |
14894 | F: include/linux/sony-laptop.h | 14894 | F: include/linux/sony-laptop.h |
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 466ebd84ad17..bb734066075f 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -382,7 +382,7 @@ config SONYPI | |||
382 | Device which can be found in many (all ?) Sony Vaio laptops. | 382 | Device which can be found in many (all ?) Sony Vaio laptops. |
383 | 383 | ||
384 | If you have one of those laptops, read | 384 | If you have one of those laptops, read |
385 | <file:Documentation/laptops/sonypi.txt>, and say Y or M here. | 385 | <file:Documentation/laptops/sonypi.rst>, and say Y or M here. |
386 | 386 | ||
387 | To compile this driver as a module, choose M here: the | 387 | To compile this driver as a module, choose M here: the |
388 | module will be called sonypi. | 388 | module will be called sonypi. |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index cc29fe79c283..8f91d9ef8a7b 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
@@ -448,7 +448,7 @@ config SONY_LAPTOP | |||
448 | screen brightness control, Fn keys and allows powering on/off some | 448 | screen brightness control, Fn keys and allows powering on/off some |
449 | devices. | 449 | devices. |
450 | 450 | ||
451 | Read <file:Documentation/laptops/sony-laptop.txt> for more information. | 451 | Read <file:Documentation/laptops/sony-laptop.rst> for more information. |
452 | 452 | ||
453 | config SONYPI_COMPAT | 453 | config SONYPI_COMPAT |
454 | bool "Sonypi compatibility" | 454 | bool "Sonypi compatibility" |
@@ -500,7 +500,7 @@ config THINKPAD_ACPI | |||
500 | support for Fn-Fx key combinations, Bluetooth control, video | 500 | support for Fn-Fx key combinations, Bluetooth control, video |
501 | output switching, ThinkLight control, UltraBay eject and more. | 501 | output switching, ThinkLight control, UltraBay eject and more. |
502 | For more information about this driver see | 502 | For more information about this driver see |
503 | <file:Documentation/laptops/thinkpad-acpi.txt> and | 503 | <file:Documentation/laptops/thinkpad-acpi.rst> and |
504 | <http://ibm-acpi.sf.net/> . | 504 | <http://ibm-acpi.sf.net/> . |
505 | 505 | ||
506 | This driver was formerly known as ibm-acpi. | 506 | This driver was formerly known as ibm-acpi. |