diff options
61 files changed, 1704 insertions, 374 deletions
diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl index 9ee6f3cbb414..60d6e0b81bd9 100644 --- a/Documentation/DocBook/deviceiobook.tmpl +++ b/Documentation/DocBook/deviceiobook.tmpl | |||
@@ -316,7 +316,7 @@ CPU B: spin_unlock_irqrestore(&dev_lock, flags) | |||
316 | 316 | ||
317 | <chapter id="pubfunctions"> | 317 | <chapter id="pubfunctions"> |
318 | <title>Public Functions Provided</title> | 318 | <title>Public Functions Provided</title> |
319 | !Iinclude/asm-x86/io_32.h | 319 | !Iarch/x86/include/asm/io_32.h |
320 | !Elib/iomap.c | 320 | !Elib/iomap.c |
321 | </chapter> | 321 | </chapter> |
322 | 322 | ||
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 9d0058e788e5..5818ff75786a 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -45,8 +45,8 @@ | |||
45 | </sect1> | 45 | </sect1> |
46 | 46 | ||
47 | <sect1><title>Atomic and pointer manipulation</title> | 47 | <sect1><title>Atomic and pointer manipulation</title> |
48 | !Iinclude/asm-x86/atomic_32.h | 48 | !Iarch/x86/include/asm/atomic_32.h |
49 | !Iinclude/asm-x86/unaligned.h | 49 | !Iarch/x86/include/asm/unaligned.h |
50 | </sect1> | 50 | </sect1> |
51 | 51 | ||
52 | <sect1><title>Delaying, scheduling, and timer routines</title> | 52 | <sect1><title>Delaying, scheduling, and timer routines</title> |
@@ -119,7 +119,7 @@ X!Ilib/string.c | |||
119 | !Elib/string.c | 119 | !Elib/string.c |
120 | </sect1> | 120 | </sect1> |
121 | <sect1><title>Bit Operations</title> | 121 | <sect1><title>Bit Operations</title> |
122 | !Iinclude/asm-x86/bitops.h | 122 | !Iarch/x86/include/asm/bitops.h |
123 | </sect1> | 123 | </sect1> |
124 | </chapter> | 124 | </chapter> |
125 | 125 | ||
@@ -155,7 +155,7 @@ X!Ilib/string.c | |||
155 | !Emm/slab.c | 155 | !Emm/slab.c |
156 | </sect1> | 156 | </sect1> |
157 | <sect1><title>User Space Memory Access</title> | 157 | <sect1><title>User Space Memory Access</title> |
158 | !Iinclude/asm-x86/uaccess_32.h | 158 | !Iarch/x86/include/asm/uaccess_32.h |
159 | !Earch/x86/lib/usercopy_32.c | 159 | !Earch/x86/lib/usercopy_32.c |
160 | </sect1> | 160 | </sect1> |
161 | <sect1><title>More Memory Management Functions</title> | 161 | <sect1><title>More Memory Management Functions</title> |
@@ -265,7 +265,7 @@ X!Earch/x86/kernel/mca_32.c | |||
265 | --> | 265 | --> |
266 | </sect2> | 266 | </sect2> |
267 | <sect2><title>MCA Bus DMA</title> | 267 | <sect2><title>MCA Bus DMA</title> |
268 | !Iinclude/asm-x86/mca_dma.h | 268 | !Iarch/x86/include/asm/mca_dma.h |
269 | </sect2> | 269 | </sect2> |
270 | </sect1> | 270 | </sect1> |
271 | </chapter> | 271 | </chapter> |
diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl index ae15d55350ec..a50d6cd58573 100644 --- a/Documentation/DocBook/kernel-hacking.tmpl +++ b/Documentation/DocBook/kernel-hacking.tmpl | |||
@@ -1239,7 +1239,7 @@ static struct block_device_operations opt_fops = { | |||
1239 | </para> | 1239 | </para> |
1240 | 1240 | ||
1241 | <para> | 1241 | <para> |
1242 | <filename>include/asm-x86/delay_32.h:</filename> | 1242 | <filename>arch/x86/include/asm/delay.h:</filename> |
1243 | </para> | 1243 | </para> |
1244 | <programlisting> | 1244 | <programlisting> |
1245 | #define ndelay(n) (__builtin_constant_p(n) ? \ | 1245 | #define ndelay(n) (__builtin_constant_p(n) ? \ |
@@ -1265,7 +1265,7 @@ static struct block_device_operations opt_fops = { | |||
1265 | </programlisting> | 1265 | </programlisting> |
1266 | 1266 | ||
1267 | <para> | 1267 | <para> |
1268 | <filename>include/asm-x86/uaccess_32.h:</filename> | 1268 | <filename>arch/x86/include/asm/uaccess_32.h:</filename> |
1269 | </para> | 1269 | </para> |
1270 | 1270 | ||
1271 | <programlisting> | 1271 | <programlisting> |
diff --git a/Documentation/DocBook/mcabook.tmpl b/Documentation/DocBook/mcabook.tmpl index 529a53dc1389..499eddc2d079 100644 --- a/Documentation/DocBook/mcabook.tmpl +++ b/Documentation/DocBook/mcabook.tmpl | |||
@@ -101,7 +101,7 @@ | |||
101 | 101 | ||
102 | <chapter id="dmafunctions"> | 102 | <chapter id="dmafunctions"> |
103 | <title>DMA Functions Provided</title> | 103 | <title>DMA Functions Provided</title> |
104 | !Iinclude/asm-x86/mca_dma.h | 104 | !Iarch/x86/include/asm/mca_dma.h |
105 | </chapter> | 105 | </chapter> |
106 | 106 | ||
107 | </book> | 107 | </book> |
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90 index e0d5206d1de3..0e8411710238 100644 --- a/Documentation/hwmon/lm90 +++ b/Documentation/hwmon/lm90 | |||
@@ -8,7 +8,7 @@ Supported chips: | |||
8 | Datasheet: Publicly available at the National Semiconductor website | 8 | Datasheet: Publicly available at the National Semiconductor website |
9 | http://www.national.com/pf/LM/LM90.html | 9 | http://www.national.com/pf/LM/LM90.html |
10 | * National Semiconductor LM89 | 10 | * National Semiconductor LM89 |
11 | Prefix: 'lm99' | 11 | Prefix: 'lm89' (no auto-detection) |
12 | Addresses scanned: I2C 0x4c and 0x4d | 12 | Addresses scanned: I2C 0x4c and 0x4d |
13 | Datasheet: Publicly available at the National Semiconductor website | 13 | Datasheet: Publicly available at the National Semiconductor website |
14 | http://www.national.com/mpf/LM/LM89.html | 14 | http://www.national.com/mpf/LM/LM89.html |
diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt new file mode 100644 index 000000000000..a10c3b6ba7c4 --- /dev/null +++ b/Documentation/input/elantech.txt | |||
@@ -0,0 +1,405 @@ | |||
1 | Elantech Touchpad Driver | ||
2 | ======================== | ||
3 | |||
4 | Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net> | ||
5 | |||
6 | Extra information for hardware version 1 found and | ||
7 | provided by Steve Havelka | ||
8 | |||
9 | Version 2 (EeePC) hardware support based on patches | ||
10 | received from Woody at Xandros and forwarded to me | ||
11 | by user StewieGriffin at the eeeuser.com forum | ||
12 | |||
13 | |||
14 | Contents | ||
15 | ~~~~~~~~ | ||
16 | |||
17 | 1. Introduction | ||
18 | 2. Extra knobs | ||
19 | 3. Hardware version 1 | ||
20 | 3.1 Registers | ||
21 | 3.2 Native relative mode 4 byte packet format | ||
22 | 3.3 Native absolute mode 4 byte packet format | ||
23 | 4. Hardware version 2 | ||
24 | 4.1 Registers | ||
25 | 4.2 Native absolute mode 6 byte packet format | ||
26 | 4.2.1 One finger touch | ||
27 | 4.2.2 Two finger touch | ||
28 | |||
29 | |||
30 | |||
31 | 1. Introduction | ||
32 | ~~~~~~~~~~~~ | ||
33 | |||
34 | Currently the Linux Elantech touchpad driver is aware of two different | ||
35 | hardware versions unimaginatively called version 1 and version 2. Version 1 | ||
36 | is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to | ||
37 | be introduced with the EeePC and uses 6 bytes per packet. | ||
38 | |||
39 | The driver tries to support both hardware versions and should be compatible | ||
40 | with the Xorg Synaptics touchpad driver and its graphical configuration | ||
41 | utilities. | ||
42 | |||
43 | Additionally the operation of the touchpad can be altered by adjusting the | ||
44 | contents of some of its internal registers. These registers are represented | ||
45 | by the driver as sysfs entries under /sys/bus/serio/drivers/psmouse/serio? | ||
46 | that can be read from and written to. | ||
47 | |||
48 | Currently only the registers for hardware version 1 are somewhat understood. | ||
49 | Hardware version 2 seems to use some of the same registers but it is not | ||
50 | known whether the bits in the registers represent the same thing or might | ||
51 | have changed their meaning. | ||
52 | |||
53 | On top of that, some register settings have effect only when the touchpad is | ||
54 | in relative mode and not in absolute mode. As the Linux Elantech touchpad | ||
55 | driver always puts the hardware into absolute mode not all information | ||
56 | mentioned below can be used immediately. But because there is no freely | ||
57 | available Elantech documentation the information is provided here anyway for | ||
58 | completeness sake. | ||
59 | |||
60 | |||
61 | ///////////////////////////////////////////////////////////////////////////// | ||
62 | |||
63 | |||
64 | 2. Extra knobs | ||
65 | ~~~~~~~~~~~ | ||
66 | |||
67 | Currently the Linux Elantech touchpad driver provides two extra knobs under | ||
68 | /sys/bus/serio/drivers/psmouse/serio? for the user. | ||
69 | |||
70 | * debug | ||
71 | |||
72 | Turn different levels of debugging ON or OFF. | ||
73 | |||
74 | By echoing "0" to this file all debugging will be turned OFF. | ||
75 | |||
76 | Currently a value of "1" will turn on some basic debugging and a value of | ||
77 | "2" will turn on packet debugging. For hardware version 1 the default is | ||
78 | OFF. For version 2 the default is "1". | ||
79 | |||
80 | Turning packet debugging on will make the driver dump every packet | ||
81 | received to the syslog before processing it. Be warned that this can | ||
82 | generate quite a lot of data! | ||
83 | |||
84 | * paritycheck | ||
85 | |||
86 | Turns parity checking ON or OFF. | ||
87 | |||
88 | By echoing "0" to this file parity checking will be turned OFF. Any | ||
89 | non-zero value will turn it ON. For hardware version 1 the default is ON. | ||
90 | For version 2 the default it is OFF. | ||
91 | |||
92 | Hardware version 1 provides basic data integrity verification by | ||
93 | calculating a parity bit for the last 3 bytes of each packet. The driver | ||
94 | can check these bits and reject any packet that appears corrupted. Using | ||
95 | this knob you can bypass that check. | ||
96 | |||
97 | It is not known yet whether hardware version 2 provides the same parity | ||
98 | bits. Hence checking is disabled by default. Currently even turning it on | ||
99 | will do nothing. | ||
100 | |||
101 | |||
102 | ///////////////////////////////////////////////////////////////////////////// | ||
103 | |||
104 | |||
105 | 3. Hardware version 1 | ||
106 | ================== | ||
107 | |||
108 | 3.1 Registers | ||
109 | ~~~~~~~~~ | ||
110 | |||
111 | By echoing a hexadecimal value to a register it contents can be altered. | ||
112 | |||
113 | For example: | ||
114 | |||
115 | echo -n 0x16 > reg_10 | ||
116 | |||
117 | * reg_10 | ||
118 | |||
119 | bit 7 6 5 4 3 2 1 0 | ||
120 | B C T D L A S E | ||
121 | |||
122 | E: 1 = enable smart edges unconditionally | ||
123 | S: 1 = enable smart edges only when dragging | ||
124 | A: 1 = absolute mode (needs 4 byte packets, see reg_11) | ||
125 | L: 1 = enable drag lock (see reg_22) | ||
126 | D: 1 = disable dynamic resolution | ||
127 | T: 1 = disable tapping | ||
128 | C: 1 = enable corner tap | ||
129 | B: 1 = swap left and right button | ||
130 | |||
131 | * reg_11 | ||
132 | |||
133 | bit 7 6 5 4 3 2 1 0 | ||
134 | 1 0 0 H V 1 F P | ||
135 | |||
136 | P: 1 = enable parity checking for relative mode | ||
137 | F: 1 = enable native 4 byte packet mode | ||
138 | V: 1 = enable vertical scroll area | ||
139 | H: 1 = enable horizontal scroll area | ||
140 | |||
141 | * reg_20 | ||
142 | |||
143 | single finger width? | ||
144 | |||
145 | * reg_21 | ||
146 | |||
147 | scroll area width (small: 0x40 ... wide: 0xff) | ||
148 | |||
149 | * reg_22 | ||
150 | |||
151 | drag lock time out (short: 0x14 ... long: 0xfe; | ||
152 | 0xff = tap again to release) | ||
153 | |||
154 | * reg_23 | ||
155 | |||
156 | tap make timeout? | ||
157 | |||
158 | * reg_24 | ||
159 | |||
160 | tap release timeout? | ||
161 | |||
162 | * reg_25 | ||
163 | |||
164 | smart edge cursor speed (0x02 = slow, 0x03 = medium, 0x04 = fast) | ||
165 | |||
166 | * reg_26 | ||
167 | |||
168 | smart edge activation area width? | ||
169 | |||
170 | |||
171 | 3.2 Native relative mode 4 byte packet format | ||
172 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
173 | |||
174 | byte 0: | ||
175 | bit 7 6 5 4 3 2 1 0 | ||
176 | c c p2 p1 1 M R L | ||
177 | |||
178 | L, R, M = 1 when Left, Right, Middle mouse button pressed | ||
179 | some models have M as byte 3 odd parity bit | ||
180 | when parity checking is enabled (reg_11, P = 1): | ||
181 | p1..p2 = byte 1 and 2 odd parity bit | ||
182 | c = 1 when corner tap detected | ||
183 | |||
184 | byte 1: | ||
185 | bit 7 6 5 4 3 2 1 0 | ||
186 | dx7 dx6 dx5 dx4 dx3 dx2 dx1 dx0 | ||
187 | |||
188 | dx7..dx0 = x movement; positive = right, negative = left | ||
189 | byte 1 = 0xf0 when corner tap detected | ||
190 | |||
191 | byte 2: | ||
192 | bit 7 6 5 4 3 2 1 0 | ||
193 | dy7 dy6 dy5 dy4 dy3 dy2 dy1 dy0 | ||
194 | |||
195 | dy7..dy0 = y movement; positive = up, negative = down | ||
196 | |||
197 | byte 3: | ||
198 | parity checking enabled (reg_11, P = 1): | ||
199 | |||
200 | bit 7 6 5 4 3 2 1 0 | ||
201 | w h n1 n0 ds3 ds2 ds1 ds0 | ||
202 | |||
203 | normally: | ||
204 | ds3..ds0 = scroll wheel amount and direction | ||
205 | positive = down or left | ||
206 | negative = up or right | ||
207 | when corner tap detected: | ||
208 | ds0 = 1 when top right corner tapped | ||
209 | ds1 = 1 when bottom right corner tapped | ||
210 | ds2 = 1 when bottom left corner tapped | ||
211 | ds3 = 1 when top left corner tapped | ||
212 | n1..n0 = number of fingers on touchpad | ||
213 | only models with firmware 2.x report this, models with | ||
214 | firmware 1.x seem to map one, two and three finger taps | ||
215 | directly to L, M and R mouse buttons | ||
216 | h = 1 when horizontal scroll action | ||
217 | w = 1 when wide finger touch? | ||
218 | |||
219 | otherwise (reg_11, P = 0): | ||
220 | |||
221 | bit 7 6 5 4 3 2 1 0 | ||
222 | ds7 ds6 ds5 ds4 ds3 ds2 ds1 ds0 | ||
223 | |||
224 | ds7..ds0 = vertical scroll amount and direction | ||
225 | negative = up | ||
226 | positive = down | ||
227 | |||
228 | |||
229 | 3.3 Native absolute mode 4 byte packet format | ||
230 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
231 | |||
232 | byte 0: | ||
233 | firmware version 1.x: | ||
234 | |||
235 | bit 7 6 5 4 3 2 1 0 | ||
236 | D U p1 p2 1 p3 R L | ||
237 | |||
238 | L, R = 1 when Left, Right mouse button pressed | ||
239 | p1..p3 = byte 1..3 odd parity bit | ||
240 | D, U = 1 when rocker switch pressed Up, Down | ||
241 | |||
242 | firmware version 2.x: | ||
243 | |||
244 | bit 7 6 5 4 3 2 1 0 | ||
245 | n1 n0 p2 p1 1 p3 R L | ||
246 | |||
247 | L, R = 1 when Left, Right mouse button pressed | ||
248 | p1..p3 = byte 1..3 odd parity bit | ||
249 | n1..n0 = number of fingers on touchpad | ||
250 | |||
251 | byte 1: | ||
252 | firmware version 1.x: | ||
253 | |||
254 | bit 7 6 5 4 3 2 1 0 | ||
255 | f 0 th tw x9 x8 y9 y8 | ||
256 | |||
257 | tw = 1 when two finger touch | ||
258 | th = 1 when three finger touch | ||
259 | f = 1 when finger touch | ||
260 | |||
261 | firmware version 2.x: | ||
262 | |||
263 | bit 7 6 5 4 3 2 1 0 | ||
264 | . . . . x9 x8 y9 y8 | ||
265 | |||
266 | byte 2: | ||
267 | bit 7 6 5 4 3 2 1 0 | ||
268 | x7 x6 x5 x4 x3 x2 x1 x0 | ||
269 | |||
270 | x9..x0 = absolute x value (horizontal) | ||
271 | |||
272 | byte 3: | ||
273 | bit 7 6 5 4 3 2 1 0 | ||
274 | y7 y6 y5 y4 y3 y2 y1 y0 | ||
275 | |||
276 | y9..y0 = absolute y value (vertical) | ||
277 | |||
278 | |||
279 | ///////////////////////////////////////////////////////////////////////////// | ||
280 | |||
281 | |||
282 | 4. Hardware version 2 | ||
283 | ================== | ||
284 | |||
285 | |||
286 | 4.1 Registers | ||
287 | ~~~~~~~~~ | ||
288 | |||
289 | By echoing a hexadecimal value to a register it contents can be altered. | ||
290 | |||
291 | For example: | ||
292 | |||
293 | echo -n 0x56 > reg_10 | ||
294 | |||
295 | * reg_10 | ||
296 | |||
297 | bit 7 6 5 4 3 2 1 0 | ||
298 | 0 1 0 1 0 1 D 0 | ||
299 | |||
300 | D: 1 = enable drag and drop | ||
301 | |||
302 | * reg_11 | ||
303 | |||
304 | bit 7 6 5 4 3 2 1 0 | ||
305 | 1 0 0 0 S 0 1 0 | ||
306 | |||
307 | S: 1 = enable vertical scroll | ||
308 | |||
309 | * reg_21 | ||
310 | |||
311 | unknown (0x00) | ||
312 | |||
313 | * reg_22 | ||
314 | |||
315 | drag and drop release time out (short: 0x70 ... long 0x7e; | ||
316 | 0x7f = never i.e. tap again to release) | ||
317 | |||
318 | |||
319 | 4.2 Native absolute mode 6 byte packet format | ||
320 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
321 | |||
322 | 4.2.1 One finger touch | ||
323 | ~~~~~~~~~~~~~~~~ | ||
324 | |||
325 | byte 0: | ||
326 | |||
327 | bit 7 6 5 4 3 2 1 0 | ||
328 | n1 n0 . . . . R L | ||
329 | |||
330 | L, R = 1 when Left, Right mouse button pressed | ||
331 | n1..n0 = numbers of fingers on touchpad | ||
332 | |||
333 | byte 1: | ||
334 | |||
335 | bit 7 6 5 4 3 2 1 0 | ||
336 | x15 x14 x13 x12 x11 x10 x9 x8 | ||
337 | |||
338 | byte 2: | ||
339 | |||
340 | bit 7 6 5 4 3 2 1 0 | ||
341 | x7 x6 x5 x4 x4 x2 x1 x0 | ||
342 | |||
343 | x15..x0 = absolute x value (horizontal) | ||
344 | |||
345 | byte 3: | ||
346 | |||
347 | bit 7 6 5 4 3 2 1 0 | ||
348 | . . . . . . . . | ||
349 | |||
350 | byte 4: | ||
351 | |||
352 | bit 7 6 5 4 3 2 1 0 | ||
353 | y15 y14 y13 y12 y11 y10 y8 y8 | ||
354 | |||
355 | byte 5: | ||
356 | |||
357 | bit 7 6 5 4 3 2 1 0 | ||
358 | y7 y6 y5 y4 y3 y2 y1 y0 | ||
359 | |||
360 | y15..y0 = absolute y value (vertical) | ||
361 | |||
362 | |||
363 | 4.2.2 Two finger touch | ||
364 | ~~~~~~~~~~~~~~~~ | ||
365 | |||
366 | byte 0: | ||
367 | |||
368 | bit 7 6 5 4 3 2 1 0 | ||
369 | n1 n0 ay8 ax8 . . R L | ||
370 | |||
371 | L, R = 1 when Left, Right mouse button pressed | ||
372 | n1..n0 = numbers of fingers on touchpad | ||
373 | |||
374 | byte 1: | ||
375 | |||
376 | bit 7 6 5 4 3 2 1 0 | ||
377 | ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 | ||
378 | |||
379 | ax8..ax0 = first finger absolute x value | ||
380 | |||
381 | byte 2: | ||
382 | |||
383 | bit 7 6 5 4 3 2 1 0 | ||
384 | ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 | ||
385 | |||
386 | ay8..ay0 = first finger absolute y value | ||
387 | |||
388 | byte 3: | ||
389 | |||
390 | bit 7 6 5 4 3 2 1 0 | ||
391 | . . by8 bx8 . . . . | ||
392 | |||
393 | byte 4: | ||
394 | |||
395 | bit 7 6 5 4 3 2 1 0 | ||
396 | bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 | ||
397 | |||
398 | bx8..bx0 = second finger absolute x value | ||
399 | |||
400 | byte 5: | ||
401 | |||
402 | bit 7 6 5 4 3 2 1 0 | ||
403 | by7 by8 by5 by4 by3 by2 by1 by0 | ||
404 | |||
405 | by8..by0 = second finger absolute y value | ||
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 28 | 3 | SUBLEVEL = 28 |
4 | EXTRAVERSION = -rc1 | 4 | EXTRAVERSION = -rc2 |
5 | NAME = Killer Bat of Doom | 5 | NAME = Killer Bat of Doom |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/drivers/Makefile b/drivers/Makefile index 2503f7b99b2f..fceb71a741c3 100644 --- a/drivers/Makefile +++ b/drivers/Makefile | |||
@@ -56,6 +56,7 @@ obj-$(CONFIG_MAC) += macintosh/ | |||
56 | obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ | 56 | obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ |
57 | obj-$(CONFIG_PARIDE) += block/paride/ | 57 | obj-$(CONFIG_PARIDE) += block/paride/ |
58 | obj-$(CONFIG_TC) += tc/ | 58 | obj-$(CONFIG_TC) += tc/ |
59 | obj-$(CONFIG_UWB) += uwb/ | ||
59 | obj-$(CONFIG_USB) += usb/ | 60 | obj-$(CONFIG_USB) += usb/ |
60 | obj-$(CONFIG_USB_MUSB_HDRC) += usb/musb/ | 61 | obj-$(CONFIG_USB_MUSB_HDRC) += usb/musb/ |
61 | obj-$(CONFIG_PCI) += usb/ | 62 | obj-$(CONFIG_PCI) += usb/ |
@@ -101,4 +102,3 @@ obj-$(CONFIG_SSB) += ssb/ | |||
101 | obj-$(CONFIG_VIRTIO) += virtio/ | 102 | obj-$(CONFIG_VIRTIO) += virtio/ |
102 | obj-$(CONFIG_REGULATOR) += regulator/ | 103 | obj-$(CONFIG_REGULATOR) += regulator/ |
103 | obj-$(CONFIG_STAGING) += staging/ | 104 | obj-$(CONFIG_STAGING) += staging/ |
104 | obj-$(CONFIG_UWB) += uwb/ | ||
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 9d568d417eaa..cb046c3fc3f2 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -262,6 +262,7 @@ static int acpi_lid_send_state(struct acpi_button *button) | |||
262 | return -ENODEV; | 262 | return -ENODEV; |
263 | /* input layer checks if event is redundant */ | 263 | /* input layer checks if event is redundant */ |
264 | input_report_switch(button->input, SW_LID, !state); | 264 | input_report_switch(button->input, SW_LID, !state); |
265 | input_sync(button->input); | ||
265 | return 0; | 266 | return 0; |
266 | } | 267 | } |
267 | 268 | ||
@@ -285,8 +286,8 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data) | |||
285 | input_report_key(input, keycode, 1); | 286 | input_report_key(input, keycode, 1); |
286 | input_sync(input); | 287 | input_sync(input); |
287 | input_report_key(input, keycode, 0); | 288 | input_report_key(input, keycode, 0); |
289 | input_sync(input); | ||
288 | } | 290 | } |
289 | input_sync(input); | ||
290 | 291 | ||
291 | acpi_bus_generate_proc_event(button->device, event, | 292 | acpi_bus_generate_proc_event(button->device, event, |
292 | ++button->pushed); | 293 | ++button->pushed); |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index dc98f7a6f2c4..dbcf260ea93f 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -38,7 +38,10 @@ | |||
38 | 38 | ||
39 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
40 | #endif | 40 | #endif |
41 | |||
42 | #ifdef CONFIG_X86 | ||
41 | #include <asm/cpufeature.h> | 43 | #include <asm/cpufeature.h> |
44 | #endif | ||
42 | 45 | ||
43 | #include <acpi/acpi_bus.h> | 46 | #include <acpi/acpi_bus.h> |
44 | #include <acpi/processor.h> | 47 | #include <acpi/processor.h> |
@@ -360,11 +363,13 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr) | |||
360 | * the BIOS is older than the CPU and does not know its frequencies | 363 | * the BIOS is older than the CPU and does not know its frequencies |
361 | */ | 364 | */ |
362 | update_bios: | 365 | update_bios: |
366 | #ifdef CONFIG_X86 | ||
363 | if (ACPI_SUCCESS(acpi_get_handle(pr->handle, "_PPC", &handle))){ | 367 | if (ACPI_SUCCESS(acpi_get_handle(pr->handle, "_PPC", &handle))){ |
364 | if(boot_cpu_has(X86_FEATURE_EST)) | 368 | if(boot_cpu_has(X86_FEATURE_EST)) |
365 | printk(KERN_WARNING FW_BUG "BIOS needs update for CPU " | 369 | printk(KERN_WARNING FW_BUG "BIOS needs update for CPU " |
366 | "frequency support\n"); | 370 | "frequency support\n"); |
367 | } | 371 | } |
372 | #endif | ||
368 | return result; | 373 | return result; |
369 | } | 374 | } |
370 | 375 | ||
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 26571bafb158..80c0868d0480 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -163,6 +163,8 @@ static void acpi_pm_end(void) | |||
163 | acpi_target_sleep_state = ACPI_STATE_S0; | 163 | acpi_target_sleep_state = ACPI_STATE_S0; |
164 | acpi_sleep_tts_switch(acpi_target_sleep_state); | 164 | acpi_sleep_tts_switch(acpi_target_sleep_state); |
165 | } | 165 | } |
166 | #else /* !CONFIG_ACPI_SLEEP */ | ||
167 | #define acpi_target_sleep_state ACPI_STATE_S0 | ||
166 | #endif /* CONFIG_ACPI_SLEEP */ | 168 | #endif /* CONFIG_ACPI_SLEEP */ |
167 | 169 | ||
168 | #ifdef CONFIG_SUSPEND | 170 | #ifdef CONFIG_SUSPEND |
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 2a632f8b7a05..66aac06f2ac5 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c | |||
@@ -371,6 +371,7 @@ static void bt_poll_rfkill(struct input_polled_dev *poll_dev) | |||
371 | RFKILL_STATE_HARD_BLOCKED); | 371 | RFKILL_STATE_HARD_BLOCKED); |
372 | input_report_switch(poll_dev->input, SW_RFKILL_ALL, | 372 | input_report_switch(poll_dev->input, SW_RFKILL_ALL, |
373 | new_rfk_state); | 373 | new_rfk_state); |
374 | input_sync(poll_dev->input); | ||
374 | } | 375 | } |
375 | } | 376 | } |
376 | 377 | ||
@@ -842,6 +843,7 @@ static int __init toshiba_acpi_init(void) | |||
842 | set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit); | 843 | set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit); |
843 | set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit); | 844 | set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit); |
844 | input_report_switch(toshiba_acpi.poll_dev->input, SW_RFKILL_ALL, TRUE); | 845 | input_report_switch(toshiba_acpi.poll_dev->input, SW_RFKILL_ALL, TRUE); |
846 | input_sync(toshiba_acpi.poll_dev->input); | ||
845 | 847 | ||
846 | ret = input_register_polled_device(toshiba_acpi.poll_dev); | 848 | ret = input_register_polled_device(toshiba_acpi.poll_dev); |
847 | if (ret) { | 849 | if (ret) { |
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 98821f97583c..b97aebd7aeb8 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
@@ -2071,12 +2071,13 @@ module_init(rs_init) | |||
2071 | module_exit(rs_exit) | 2071 | module_exit(rs_exit) |
2072 | 2072 | ||
2073 | 2073 | ||
2074 | #if defined(CONFIG_SERIAL_CONSOLE) && !defined(MODULE) | ||
2075 | |||
2074 | /* | 2076 | /* |
2075 | * ------------------------------------------------------------ | 2077 | * ------------------------------------------------------------ |
2076 | * Serial console driver | 2078 | * Serial console driver |
2077 | * ------------------------------------------------------------ | 2079 | * ------------------------------------------------------------ |
2078 | */ | 2080 | */ |
2079 | #ifdef CONFIG_SERIAL_CONSOLE | ||
2080 | 2081 | ||
2081 | static void amiga_serial_putc(char c) | 2082 | static void amiga_serial_putc(char c) |
2082 | { | 2083 | { |
@@ -2130,6 +2131,7 @@ static int __init amiserial_console_init(void) | |||
2130 | return 0; | 2131 | return 0; |
2131 | } | 2132 | } |
2132 | console_initcall(amiserial_console_init); | 2133 | console_initcall(amiserial_console_init); |
2133 | #endif | 2134 | |
2135 | #endif /* CONFIG_SERIAL_CONSOLE && !MODULE */ | ||
2134 | 2136 | ||
2135 | MODULE_LICENSE("GPL"); | 2137 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 43b8cefad2c6..b0438c4f0c30 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
36 | #include <linux/i7300_idle.h> | ||
36 | #include "ioatdma.h" | 37 | #include "ioatdma.h" |
37 | #include "ioatdma_registers.h" | 38 | #include "ioatdma_registers.h" |
38 | #include "ioatdma_hw.h" | 39 | #include "ioatdma_hw.h" |
@@ -171,8 +172,10 @@ static int ioat_dma_enumerate_channels(struct ioatdma_device *device) | |||
171 | xfercap_scale = readb(device->reg_base + IOAT_XFERCAP_OFFSET); | 172 | xfercap_scale = readb(device->reg_base + IOAT_XFERCAP_OFFSET); |
172 | xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale)); | 173 | xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale)); |
173 | 174 | ||
174 | #if CONFIG_I7300_IDLE_IOAT_CHANNEL | 175 | #ifdef CONFIG_I7300_IDLE_IOAT_CHANNEL |
175 | device->common.chancnt--; | 176 | if (i7300_idle_platform_probe(NULL, NULL) == 0) { |
177 | device->common.chancnt--; | ||
178 | } | ||
176 | #endif | 179 | #endif |
177 | for (i = 0; i < device->common.chancnt; i++) { | 180 | for (i = 0; i < device->common.chancnt; i++) { |
178 | ioat_chan = kzalloc(sizeof(*ioat_chan), GFP_KERNEL); | 181 | ioat_chan = kzalloc(sizeof(*ioat_chan), GFP_KERNEL); |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index f5999a91614e..b4fd8ca701a4 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -247,7 +247,6 @@ config HID_SUNPLUS | |||
247 | 247 | ||
248 | config THRUSTMASTER_FF | 248 | config THRUSTMASTER_FF |
249 | tristate "ThrustMaster devices support" | 249 | tristate "ThrustMaster devices support" |
250 | default m | ||
251 | depends on USB_HID | 250 | depends on USB_HID |
252 | select INPUT_FF_MEMLESS | 251 | select INPUT_FF_MEMLESS |
253 | help | 252 | help |
@@ -256,7 +255,6 @@ config THRUSTMASTER_FF | |||
256 | 255 | ||
257 | config ZEROPLUS_FF | 256 | config ZEROPLUS_FF |
258 | tristate "Zeroplus based game controller support" | 257 | tristate "Zeroplus based game controller support" |
259 | default m | ||
260 | depends on USB_HID | 258 | depends on USB_HID |
261 | select INPUT_FF_MEMLESS | 259 | select INPUT_FF_MEMLESS |
262 | help | 260 | help |
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index fd7f896b34f7..c6ab4ba60c52 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -312,13 +312,6 @@ static int apple_probe(struct hid_device *hdev, | |||
312 | unsigned int connect_mask = HID_CONNECT_DEFAULT; | 312 | unsigned int connect_mask = HID_CONNECT_DEFAULT; |
313 | int ret; | 313 | int ret; |
314 | 314 | ||
315 | /* return something else or move to hid layer? device will reside | ||
316 | allocated */ | ||
317 | if (id->bus == BUS_USB && (quirks & APPLE_IGNORE_MOUSE) && | ||
318 | to_usb_interface(hdev->dev.parent)->cur_altsetting-> | ||
319 | desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) | ||
320 | return -ENODEV; | ||
321 | |||
322 | asc = kzalloc(sizeof(*asc), GFP_KERNEL); | 315 | asc = kzalloc(sizeof(*asc), GFP_KERNEL); |
323 | if (asc == NULL) { | 316 | if (asc == NULL) { |
324 | dev_err(&hdev->dev, "can't alloc apple descriptor\n"); | 317 | dev_err(&hdev->dev, "can't alloc apple descriptor\n"); |
@@ -367,38 +360,32 @@ static const struct hid_device_id apple_devices[] = { | |||
367 | .driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL }, | 360 | .driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL }, |
368 | 361 | ||
369 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI), | 362 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI), |
370 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 363 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
371 | APPLE_IGNORE_MOUSE }, | ||
372 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO), | 364 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO), |
373 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 365 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
374 | APPLE_IGNORE_MOUSE }, | ||
375 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI), | 366 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI), |
376 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 367 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
377 | APPLE_IGNORE_MOUSE }, | ||
378 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO), | 368 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO), |
379 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 369 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
380 | APPLE_IGNORE_MOUSE | APPLE_ISO_KEYBOARD }, | 370 | APPLE_ISO_KEYBOARD }, |
381 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS), | 371 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS), |
382 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 372 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
383 | APPLE_IGNORE_MOUSE }, | ||
384 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI), | 373 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI), |
385 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 374 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
386 | APPLE_IGNORE_MOUSE }, | ||
387 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO), | 375 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO), |
388 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 376 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
389 | APPLE_IGNORE_MOUSE | APPLE_ISO_KEYBOARD }, | 377 | APPLE_ISO_KEYBOARD }, |
390 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS), | 378 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS), |
391 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 379 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
392 | APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, | 380 | APPLE_RDESC_JIS }, |
393 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI), | 381 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI), |
394 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 382 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
395 | APPLE_IGNORE_MOUSE }, | ||
396 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO), | 383 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO), |
397 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 384 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
398 | APPLE_IGNORE_MOUSE | APPLE_ISO_KEYBOARD }, | 385 | APPLE_ISO_KEYBOARD }, |
399 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS), | 386 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS), |
400 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 387 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
401 | APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS}, | 388 | APPLE_RDESC_JIS }, |
402 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI), | 389 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI), |
403 | .driver_data = APPLE_HAS_FN }, | 390 | .driver_data = APPLE_HAS_FN }, |
404 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO), | 391 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO), |
@@ -406,14 +393,12 @@ static const struct hid_device_id apple_devices[] = { | |||
406 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS), | 393 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS), |
407 | .driver_data = APPLE_HAS_FN }, | 394 | .driver_data = APPLE_HAS_FN }, |
408 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI), | 395 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI), |
409 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 396 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
410 | APPLE_IGNORE_MOUSE }, | ||
411 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO), | 397 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO), |
412 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 398 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
413 | APPLE_IGNORE_MOUSE }, | ||
414 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS), | 399 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS), |
415 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 400 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
416 | APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, | 401 | APPLE_RDESC_JIS }, |
417 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI), | 402 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI), |
418 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | 403 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
419 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO), | 404 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO), |
@@ -422,25 +407,21 @@ static const struct hid_device_id apple_devices[] = { | |||
422 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS), | 407 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS), |
423 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | 408 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
424 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), | 409 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), |
425 | .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE }, | 410 | .driver_data = APPLE_HAS_FN }, |
426 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO), | 411 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO), |
427 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD | | 412 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, |
428 | APPLE_IGNORE_MOUSE }, | ||
429 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS), | 413 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS), |
430 | .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, | 414 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
431 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI), | 415 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI), |
432 | .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE }, | 416 | .driver_data = APPLE_HAS_FN }, |
433 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO), | 417 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO), |
434 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD | | 418 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, |
435 | APPLE_IGNORE_MOUSE }, | ||
436 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS), | 419 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS), |
437 | .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, | 420 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
438 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), | 421 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), |
439 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 422 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
440 | APPLE_IGNORE_MOUSE }, | ||
441 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), | 423 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), |
442 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 424 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
443 | APPLE_IGNORE_MOUSE }, | ||
444 | 425 | ||
445 | /* Apple wireless Mighty Mouse */ | 426 | /* Apple wireless Mighty Mouse */ |
446 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c), | 427 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c), |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 721a36d97582..743e6f8cb202 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1264,6 +1264,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1264 | { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_SK8115) }, | 1264 | { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_SK8115) }, |
1265 | { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, | 1265 | { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, |
1266 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, | 1266 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, |
1267 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, | ||
1267 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, | 1268 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, |
1268 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, | 1269 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, |
1269 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, | 1270 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, |
@@ -1275,8 +1276,6 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1275 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KBD) }, | 1276 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KBD) }, |
1276 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD) }, | 1277 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD) }, |
1277 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500) }, | 1278 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500) }, |
1278 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_LX3) }, | ||
1279 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_V150) }, | ||
1280 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D) }, | 1279 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D) }, |
1281 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL) }, | 1280 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL) }, |
1282 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) }, | 1281 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) }, |
@@ -1295,6 +1294,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1295 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, | 1294 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, |
1296 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, | 1295 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, |
1297 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, | 1296 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, |
1297 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, | ||
1298 | { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, | 1298 | { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, |
1299 | 1299 | ||
1300 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) }, | 1300 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) }, |
@@ -1406,6 +1406,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1406 | { HID_USB_DEVICE(USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1) }, | 1406 | { HID_USB_DEVICE(USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1) }, |
1407 | { HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232) }, | 1407 | { HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232) }, |
1408 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM)}, | 1408 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM)}, |
1409 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM2)}, | ||
1409 | { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, | 1410 | { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, |
1410 | { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, | 1411 | { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, |
1411 | { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, | 1412 | { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, |
@@ -1541,6 +1542,40 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1541 | { } | 1542 | { } |
1542 | }; | 1543 | }; |
1543 | 1544 | ||
1545 | /** | ||
1546 | * hid_mouse_ignore_list - mouse devices which should not be handled by the hid layer | ||
1547 | * | ||
1548 | * There are composite devices for which we want to ignore only a certain | ||
1549 | * interface. This is a list of devices for which only the mouse interface will | ||
1550 | * be ignored. This allows a dedicated driver to take care of the interface. | ||
1551 | */ | ||
1552 | static const struct hid_device_id hid_mouse_ignore_list[] = { | ||
1553 | /* appletouch driver */ | ||
1554 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI) }, | ||
1555 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO) }, | ||
1556 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI) }, | ||
1557 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO) }, | ||
1558 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS) }, | ||
1559 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI) }, | ||
1560 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO) }, | ||
1561 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS) }, | ||
1562 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI) }, | ||
1563 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO) }, | ||
1564 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS) }, | ||
1565 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI) }, | ||
1566 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO) }, | ||
1567 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS) }, | ||
1568 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI) }, | ||
1569 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO) }, | ||
1570 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS) }, | ||
1571 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI) }, | ||
1572 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO) }, | ||
1573 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS) }, | ||
1574 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, | ||
1575 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, | ||
1576 | { } | ||
1577 | }; | ||
1578 | |||
1544 | static bool hid_ignore(struct hid_device *hdev) | 1579 | static bool hid_ignore(struct hid_device *hdev) |
1545 | { | 1580 | { |
1546 | switch (hdev->vendor) { | 1581 | switch (hdev->vendor) { |
@@ -1557,6 +1592,10 @@ static bool hid_ignore(struct hid_device *hdev) | |||
1557 | break; | 1592 | break; |
1558 | } | 1593 | } |
1559 | 1594 | ||
1595 | if (hdev->type == HID_TYPE_USBMOUSE && | ||
1596 | hid_match_id(hdev, hid_mouse_ignore_list)) | ||
1597 | return true; | ||
1598 | |||
1560 | return !!hid_match_id(hdev, hid_ignore_list); | 1599 | return !!hid_match_id(hdev, hid_ignore_list); |
1561 | } | 1600 | } |
1562 | 1601 | ||
diff --git a/drivers/hid/hid-gyration.c b/drivers/hid/hid-gyration.c index ac5120f542cc..04a0afec52ac 100644 --- a/drivers/hid/hid-gyration.c +++ b/drivers/hid/hid-gyration.c | |||
@@ -4,9 +4,9 @@ | |||
4 | * Copyright (c) 1999 Andreas Gal | 4 | * Copyright (c) 1999 Andreas Gal |
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | ||
8 | * Copyright (c) 2007 Paul Walmsley | 7 | * Copyright (c) 2007 Paul Walmsley |
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
9 | * Copyright (c) 2006-2008 Jiri Kosina | ||
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | 12 | /* |
@@ -40,6 +40,7 @@ static int gyration_input_mapping(struct hid_device *hdev, struct hid_input *hi, | |||
40 | case 0x025: gy_map_key_clear(KEY_PVR); break; | 40 | case 0x025: gy_map_key_clear(KEY_PVR); break; |
41 | case 0x046: gy_map_key_clear(KEY_MEDIA); break; | 41 | case 0x046: gy_map_key_clear(KEY_MEDIA); break; |
42 | case 0x047: gy_map_key_clear(KEY_MP3); break; | 42 | case 0x047: gy_map_key_clear(KEY_MP3); break; |
43 | case 0x048: gy_map_key_clear(KEY_MEDIA); break; | ||
43 | case 0x049: gy_map_key_clear(KEY_CAMERA); break; | 44 | case 0x049: gy_map_key_clear(KEY_CAMERA); break; |
44 | case 0x04a: gy_map_key_clear(KEY_VIDEO); break; | 45 | case 0x04a: gy_map_key_clear(KEY_VIDEO); break; |
45 | 46 | ||
@@ -68,6 +69,7 @@ static int gyration_event(struct hid_device *hdev, struct hid_field *field, | |||
68 | 69 | ||
69 | static const struct hid_device_id gyration_devices[] = { | 70 | static const struct hid_device_id gyration_devices[] = { |
70 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, | 71 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, |
72 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, | ||
71 | { } | 73 | { } |
72 | }; | 74 | }; |
73 | MODULE_DEVICE_TABLE(hid, gyration_devices); | 75 | MODULE_DEVICE_TABLE(hid, gyration_devices); |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index d9a1ba920c23..a0d6a6cb1842 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -89,6 +89,7 @@ | |||
89 | 89 | ||
90 | #define USB_VENDOR_ID_ASUS 0x0b05 | 90 | #define USB_VENDOR_ID_ASUS 0x0b05 |
91 | #define USB_DEVICE_ID_ASUS_LCM 0x1726 | 91 | #define USB_DEVICE_ID_ASUS_LCM 0x1726 |
92 | #define USB_DEVICE_ID_ASUS_LCM2 0x175b | ||
92 | 93 | ||
93 | #define USB_VENDOR_ID_ATEN 0x0557 | 94 | #define USB_VENDOR_ID_ATEN 0x0557 |
94 | #define USB_DEVICE_ID_ATEN_UC100KM 0x2004 | 95 | #define USB_DEVICE_ID_ATEN_UC100KM 0x2004 |
@@ -236,6 +237,7 @@ | |||
236 | 237 | ||
237 | #define USB_VENDOR_ID_GYRATION 0x0c16 | 238 | #define USB_VENDOR_ID_GYRATION 0x0c16 |
238 | #define USB_DEVICE_ID_GYRATION_REMOTE 0x0002 | 239 | #define USB_DEVICE_ID_GYRATION_REMOTE 0x0002 |
240 | #define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003 | ||
239 | 241 | ||
240 | #define USB_VENDOR_ID_HAPP 0x078b | 242 | #define USB_VENDOR_ID_HAPP 0x078b |
241 | #define USB_DEVICE_ID_UGCI_DRIVING 0x0010 | 243 | #define USB_DEVICE_ID_UGCI_DRIVING 0x0010 |
@@ -268,8 +270,6 @@ | |||
268 | #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 | 270 | #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 |
269 | 271 | ||
270 | #define USB_VENDOR_ID_LOGITECH 0x046d | 272 | #define USB_VENDOR_ID_LOGITECH 0x046d |
271 | #define USB_DEVICE_ID_LOGITECH_LX3 0xc044 | ||
272 | #define USB_DEVICE_ID_LOGITECH_V150 0xc047 | ||
273 | #define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101 | 273 | #define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101 |
274 | #define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110 | 274 | #define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110 |
275 | #define USB_DEVICE_ID_LOGITECH_HARMONY_LAST 0xc14f | 275 | #define USB_DEVICE_ID_LOGITECH_HARMONY_LAST 0xc14f |
@@ -350,6 +350,7 @@ | |||
350 | #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 | 350 | #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 |
351 | 351 | ||
352 | #define USB_VENDOR_ID_SONY 0x054c | 352 | #define USB_VENDOR_ID_SONY 0x054c |
353 | #define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE 0x024b | ||
353 | #define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268 | 354 | #define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268 |
354 | 355 | ||
355 | #define USB_VENDOR_ID_SOUNDGRAPH 0x15c2 | 356 | #define USB_VENDOR_ID_SOUNDGRAPH 0x15c2 |
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 406d8c82abf1..2bae340eafe2 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -287,11 +287,6 @@ static const struct hid_device_id lg_devices[] = { | |||
287 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500), | 287 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500), |
288 | .driver_data = LG_IGNORE_DOUBLED_WHEEL | LG_EXPANDED_KEYMAP }, | 288 | .driver_data = LG_IGNORE_DOUBLED_WHEEL | LG_EXPANDED_KEYMAP }, |
289 | 289 | ||
290 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_LX3), | ||
291 | .driver_data = LG_INVERT_HWHEEL }, | ||
292 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_V150), | ||
293 | .driver_data = LG_INVERT_HWHEEL }, | ||
294 | |||
295 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D), | 290 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D), |
296 | .driver_data = LG_NOGET }, | 291 | .driver_data = LG_NOGET }, |
297 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL), | 292 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL), |
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 3af8095a7de1..86e563b8d644 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -4,9 +4,9 @@ | |||
4 | * Copyright (c) 1999 Andreas Gal | 4 | * Copyright (c) 1999 Andreas Gal |
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | ||
8 | * Copyright (c) 2007 Paul Walmsley | 7 | * Copyright (c) 2007 Paul Walmsley |
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
9 | * Copyright (c) 2006-2008 Jiri Kosina | ||
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | 12 | /* |
@@ -23,6 +23,26 @@ | |||
23 | 23 | ||
24 | #include "hid-ids.h" | 24 | #include "hid-ids.h" |
25 | 25 | ||
26 | #define VAIO_RDESC_CONSTANT 0x0001 | ||
27 | |||
28 | struct sony_sc { | ||
29 | unsigned long quirks; | ||
30 | }; | ||
31 | |||
32 | /* Sony Vaio VGX has wrongly mouse pointer declared as constant */ | ||
33 | static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, | ||
34 | unsigned int rsize) | ||
35 | { | ||
36 | struct sony_sc *sc = hid_get_drvdata(hdev); | ||
37 | |||
38 | if ((sc->quirks & VAIO_RDESC_CONSTANT) && | ||
39 | rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) { | ||
40 | dev_info(&hdev->dev, "Fixing up Sony Vaio VGX report " | ||
41 | "descriptor\n"); | ||
42 | rdesc[55] = 0x06; | ||
43 | } | ||
44 | } | ||
45 | |||
26 | /* | 46 | /* |
27 | * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller | 47 | * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller |
28 | * to "operational". Without this, the ps3 controller will not report any | 48 | * to "operational". Without this, the ps3 controller will not report any |
@@ -56,6 +76,17 @@ static int sony_set_operational(struct hid_device *hdev) | |||
56 | static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | 76 | static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) |
57 | { | 77 | { |
58 | int ret; | 78 | int ret; |
79 | unsigned long quirks = id->driver_data; | ||
80 | struct sony_sc *sc; | ||
81 | |||
82 | sc = kzalloc(sizeof(*sc), GFP_KERNEL); | ||
83 | if (sc == NULL) { | ||
84 | dev_err(&hdev->dev, "can't alloc apple descriptor\n"); | ||
85 | return -ENOMEM; | ||
86 | } | ||
87 | |||
88 | sc->quirks = quirks; | ||
89 | hid_set_drvdata(hdev, sc); | ||
59 | 90 | ||
60 | ret = hid_parse(hdev); | 91 | ret = hid_parse(hdev); |
61 | if (ret) { | 92 | if (ret) { |
@@ -78,11 +109,20 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
78 | err_stop: | 109 | err_stop: |
79 | hid_hw_stop(hdev); | 110 | hid_hw_stop(hdev); |
80 | err_free: | 111 | err_free: |
112 | kfree(sc); | ||
81 | return ret; | 113 | return ret; |
82 | } | 114 | } |
83 | 115 | ||
116 | static void sony_remove(struct hid_device *hdev) | ||
117 | { | ||
118 | hid_hw_stop(hdev); | ||
119 | kfree(hid_get_drvdata(hdev)); | ||
120 | } | ||
121 | |||
84 | static const struct hid_device_id sony_devices[] = { | 122 | static const struct hid_device_id sony_devices[] = { |
85 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, | 123 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, |
124 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE), | ||
125 | .driver_data = VAIO_RDESC_CONSTANT }, | ||
86 | { } | 126 | { } |
87 | }; | 127 | }; |
88 | MODULE_DEVICE_TABLE(hid, sony_devices); | 128 | MODULE_DEVICE_TABLE(hid, sony_devices); |
@@ -91,6 +131,8 @@ static struct hid_driver sony_driver = { | |||
91 | .name = "sony", | 131 | .name = "sony", |
92 | .id_table = sony_devices, | 132 | .id_table = sony_devices, |
93 | .probe = sony_probe, | 133 | .probe = sony_probe, |
134 | .remove = sony_remove, | ||
135 | .report_fixup = sony_report_fixup, | ||
94 | }; | 136 | }; |
95 | 137 | ||
96 | static int sony_init(void) | 138 | static int sony_init(void) |
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index af3edb98df43..894d52e05bf9 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
@@ -264,6 +264,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd, | |||
264 | default: | 264 | default: |
265 | ret = -ENOTTY; | 265 | ret = -ENOTTY; |
266 | } | 266 | } |
267 | unlock_kernel(); | ||
267 | return ret; | 268 | return ret; |
268 | } | 269 | } |
269 | 270 | ||
@@ -403,7 +404,7 @@ out: | |||
403 | return result; | 404 | return result; |
404 | } | 405 | } |
405 | 406 | ||
406 | void __exit hidraw_exit(void) | 407 | void hidraw_exit(void) |
407 | { | 408 | { |
408 | dev_t dev_id = MKDEV(hidraw_major, 0); | 409 | dev_t dev_id = MKDEV(hidraw_major, 0); |
409 | 410 | ||
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 705a43cdeea4..42bdd83444c1 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -972,6 +972,9 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
972 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); | 972 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); |
973 | hid->product = le16_to_cpu(dev->descriptor.idProduct); | 973 | hid->product = le16_to_cpu(dev->descriptor.idProduct); |
974 | hid->name[0] = 0; | 974 | hid->name[0] = 0; |
975 | if (intf->cur_altsetting->desc.bInterfaceProtocol == | ||
976 | USB_INTERFACE_PROTOCOL_MOUSE) | ||
977 | hid->type = HID_TYPE_USBMOUSE; | ||
975 | 978 | ||
976 | if (dev->manufacturer) | 979 | if (dev->manufacturer) |
977 | strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); | 980 | strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); |
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index babd65dd46ad..3ac320785fc5 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -436,8 +436,7 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, | |||
436 | if (copy_to_user(user_arg, uref, sizeof(*uref))) | 436 | if (copy_to_user(user_arg, uref, sizeof(*uref))) |
437 | goto fault; | 437 | goto fault; |
438 | 438 | ||
439 | kfree(uref_multi); | 439 | goto goodreturn; |
440 | return 0; | ||
441 | 440 | ||
442 | default: | 441 | default: |
443 | if (cmd != HIDIOCGUSAGE && | 442 | if (cmd != HIDIOCGUSAGE && |
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index d9e7a49d6cbf..70bb854086df 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c | |||
@@ -178,7 +178,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
178 | { "+3.3V", 10, 0, 20, 1, 0 }, | 178 | { "+3.3V", 10, 0, 20, 1, 0 }, |
179 | { "5VSB", 11, 0, 30, 1, 0 }, | 179 | { "5VSB", 11, 0, 30, 1, 0 }, |
180 | { "CPU", 24, 1, 1, 1, 0 }, | 180 | { "CPU", 24, 1, 1, 1, 0 }, |
181 | { "System ", 25, 1, 1, 1, 0 }, | 181 | { "System", 25, 1, 1, 1, 0 }, |
182 | { "PWM", 26, 1, 1, 1, 0 }, | 182 | { "PWM", 26, 1, 1, 1, 0 }, |
183 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 183 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
184 | { "NB Fan", 33, 2, 60, 1, 0 }, | 184 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -200,7 +200,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
200 | { "+3.3V", 10, 0, 20, 1, 0 }, | 200 | { "+3.3V", 10, 0, 20, 1, 0 }, |
201 | { "5VSB", 11, 0, 30, 1, 0 }, | 201 | { "5VSB", 11, 0, 30, 1, 0 }, |
202 | { "CPU", 24, 1, 1, 1, 0 }, | 202 | { "CPU", 24, 1, 1, 1, 0 }, |
203 | { "System ", 25, 1, 1, 1, 0 }, | 203 | { "System", 25, 1, 1, 1, 0 }, |
204 | { "PWM1", 26, 1, 1, 1, 0 }, | 204 | { "PWM1", 26, 1, 1, 1, 0 }, |
205 | { "PWM2", 27, 1, 1, 1, 0 }, | 205 | { "PWM2", 27, 1, 1, 1, 0 }, |
206 | { "PWM3", 28, 1, 1, 1, 0 }, | 206 | { "PWM3", 28, 1, 1, 1, 0 }, |
@@ -229,7 +229,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
229 | { "+3.3V", 10, 0, 20, 1, 0 }, | 229 | { "+3.3V", 10, 0, 20, 1, 0 }, |
230 | { "5VSB", 11, 0, 30, 1, 0 }, | 230 | { "5VSB", 11, 0, 30, 1, 0 }, |
231 | { "CPU", 24, 1, 1, 1, 0 }, | 231 | { "CPU", 24, 1, 1, 1, 0 }, |
232 | { "System ", 25, 1, 1, 1, 0 }, | 232 | { "System", 25, 1, 1, 1, 0 }, |
233 | { "PWM", 26, 1, 1, 1, 0 }, | 233 | { "PWM", 26, 1, 1, 1, 0 }, |
234 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 234 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
235 | { "NB Fan", 33, 2, 60, 1, 0 }, | 235 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -250,7 +250,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
250 | { "+3.3V", 10, 0, 20, 1, 0 }, | 250 | { "+3.3V", 10, 0, 20, 1, 0 }, |
251 | { "5VSB", 11, 0, 30, 1, 0 }, | 251 | { "5VSB", 11, 0, 30, 1, 0 }, |
252 | { "CPU", 24, 1, 1, 1, 0 }, | 252 | { "CPU", 24, 1, 1, 1, 0 }, |
253 | { "System ", 25, 1, 1, 1, 0 }, | 253 | { "System", 25, 1, 1, 1, 0 }, |
254 | { "PWM", 26, 1, 1, 1, 0 }, | 254 | { "PWM", 26, 1, 1, 1, 0 }, |
255 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 255 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
256 | { "NB Fan", 33, 2, 60, 1, 0 }, | 256 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -342,7 +342,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
342 | { "+3.3V", 10, 0, 20, 1, 0 }, | 342 | { "+3.3V", 10, 0, 20, 1, 0 }, |
343 | { "5VSB", 11, 0, 30, 1, 0 }, | 343 | { "5VSB", 11, 0, 30, 1, 0 }, |
344 | { "CPU", 24, 1, 1, 1, 0 }, | 344 | { "CPU", 24, 1, 1, 1, 0 }, |
345 | { "System ", 25, 1, 1, 1, 0 }, | 345 | { "System", 25, 1, 1, 1, 0 }, |
346 | { "PWM1", 26, 1, 1, 1, 0 }, | 346 | { "PWM1", 26, 1, 1, 1, 0 }, |
347 | { "PWM2", 27, 1, 1, 1, 0 }, | 347 | { "PWM2", 27, 1, 1, 1, 0 }, |
348 | { "PWM3", 28, 1, 1, 1, 0 }, | 348 | { "PWM3", 28, 1, 1, 1, 0 }, |
@@ -371,7 +371,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
371 | { "+3.3V", 10, 0, 20, 1, 0 }, | 371 | { "+3.3V", 10, 0, 20, 1, 0 }, |
372 | { "5VSB", 11, 0, 30, 1, 0 }, | 372 | { "5VSB", 11, 0, 30, 1, 0 }, |
373 | { "CPU", 24, 1, 1, 1, 0 }, | 373 | { "CPU", 24, 1, 1, 1, 0 }, |
374 | { "System ", 25, 1, 1, 1, 0 }, | 374 | { "System", 25, 1, 1, 1, 0 }, |
375 | { "PWM", 26, 1, 1, 1, 0 }, | 375 | { "PWM", 26, 1, 1, 1, 0 }, |
376 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 376 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
377 | { "NB Fan", 33, 2, 60, 1, 0 }, | 377 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -402,7 +402,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
402 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, | 402 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, |
403 | { NULL, 0, 0, 0, 0, 0 } } | 403 | { NULL, 0, 0, 0, 0, 0 } } |
404 | }, | 404 | }, |
405 | { 0x0016, NULL /* AW9D-MAX, need DMI string */, { | 405 | { 0x0016, "AW9D-MAX (Intel i975-ICH7)", { |
406 | { "CPU Core", 0, 0, 10, 1, 0 }, | 406 | { "CPU Core", 0, 0, 10, 1, 0 }, |
407 | { "DDR2", 1, 0, 20, 1, 0 }, | 407 | { "DDR2", 1, 0, 20, 1, 0 }, |
408 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, | 408 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, |
@@ -416,7 +416,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
416 | { "+3.3V", 10, 0, 20, 1, 0 }, | 416 | { "+3.3V", 10, 0, 20, 1, 0 }, |
417 | { "5VSB", 11, 0, 30, 1, 0 }, | 417 | { "5VSB", 11, 0, 30, 1, 0 }, |
418 | { "CPU", 24, 1, 1, 1, 0 }, | 418 | { "CPU", 24, 1, 1, 1, 0 }, |
419 | { "System ", 25, 1, 1, 1, 0 }, | 419 | { "System", 25, 1, 1, 1, 0 }, |
420 | { "PWM1", 26, 1, 1, 1, 0 }, | 420 | { "PWM1", 26, 1, 1, 1, 0 }, |
421 | { "PWM2", 27, 1, 1, 1, 0 }, | 421 | { "PWM2", 27, 1, 1, 1, 0 }, |
422 | { "PWM3", 28, 1, 1, 1, 0 }, | 422 | { "PWM3", 28, 1, 1, 1, 0 }, |
@@ -446,7 +446,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
446 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, | 446 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, |
447 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, | 447 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, |
448 | { "CPU", 24, 1, 1, 1, 0 }, | 448 | { "CPU", 24, 1, 1, 1, 0 }, |
449 | { "System ", 26, 1, 1, 1, 0 }, | 449 | { "System", 26, 1, 1, 1, 0 }, |
450 | { "PWM", 27, 1, 1, 1, 0 }, | 450 | { "PWM", 27, 1, 1, 1, 0 }, |
451 | { "CPU FAN", 32, 2, 60, 1, 0 }, | 451 | { "CPU FAN", 32, 2, 60, 1, 0 }, |
452 | { "SYS FAN", 34, 2, 60, 1, 0 }, | 452 | { "SYS FAN", 34, 2, 60, 1, 0 }, |
@@ -469,7 +469,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
469 | { "+3.3V", 10, 0, 20, 1, 0 }, | 469 | { "+3.3V", 10, 0, 20, 1, 0 }, |
470 | { "5VSB", 11, 0, 30, 1, 0 }, | 470 | { "5VSB", 11, 0, 30, 1, 0 }, |
471 | { "CPU", 24, 1, 1, 1, 0 }, | 471 | { "CPU", 24, 1, 1, 1, 0 }, |
472 | { "System ", 25, 1, 1, 1, 0 }, | 472 | { "System", 25, 1, 1, 1, 0 }, |
473 | { "PWM Phase1", 26, 1, 1, 1, 0 }, | 473 | { "PWM Phase1", 26, 1, 1, 1, 0 }, |
474 | { "PWM Phase2", 27, 1, 1, 1, 0 }, | 474 | { "PWM Phase2", 27, 1, 1, 1, 0 }, |
475 | { "PWM Phase3", 28, 1, 1, 1, 0 }, | 475 | { "PWM Phase3", 28, 1, 1, 1, 0 }, |
@@ -487,7 +487,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
487 | { "DDR2", 13, 0, 20, 1, 0 }, | 487 | { "DDR2", 13, 0, 20, 1, 0 }, |
488 | { "DDR2 VTT", 14, 0, 10, 1, 0 }, | 488 | { "DDR2 VTT", 14, 0, 10, 1, 0 }, |
489 | { "CPU VTT", 3, 0, 20, 1, 0 }, | 489 | { "CPU VTT", 3, 0, 20, 1, 0 }, |
490 | { "NB 1.2V ", 4, 0, 10, 1, 0 }, | 490 | { "NB 1.2V", 4, 0, 10, 1, 0 }, |
491 | { "SB 1.5V", 6, 0, 10, 1, 0 }, | 491 | { "SB 1.5V", 6, 0, 10, 1, 0 }, |
492 | { "HyperTransport", 5, 0, 10, 1, 0 }, | 492 | { "HyperTransport", 5, 0, 10, 1, 0 }, |
493 | { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 }, | 493 | { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 }, |
@@ -496,7 +496,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
496 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, | 496 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, |
497 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, | 497 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, |
498 | { "CPU", 24, 1, 1, 1, 0 }, | 498 | { "CPU", 24, 1, 1, 1, 0 }, |
499 | { "System ", 25, 1, 1, 1, 0 }, | 499 | { "System", 25, 1, 1, 1, 0 }, |
500 | { "PWM Phase1", 26, 1, 1, 1, 0 }, | 500 | { "PWM Phase1", 26, 1, 1, 1, 0 }, |
501 | { "PWM Phase2", 27, 1, 1, 1, 0 }, | 501 | { "PWM Phase2", 27, 1, 1, 1, 0 }, |
502 | { "PWM Phase3", 28, 1, 1, 1, 0 }, | 502 | { "PWM Phase3", 28, 1, 1, 1, 0 }, |
@@ -523,8 +523,8 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
523 | { "+3.3V", 10, 0, 20, 1, 0 }, | 523 | { "+3.3V", 10, 0, 20, 1, 0 }, |
524 | { "5VSB", 11, 0, 30, 1, 0 }, | 524 | { "5VSB", 11, 0, 30, 1, 0 }, |
525 | { "CPU", 24, 1, 1, 1, 0 }, | 525 | { "CPU", 24, 1, 1, 1, 0 }, |
526 | { "System ", 25, 1, 1, 1, 0 }, | 526 | { "System", 25, 1, 1, 1, 0 }, |
527 | { "PWM ", 26, 1, 1, 1, 0 }, | 527 | { "PWM", 26, 1, 1, 1, 0 }, |
528 | { "PWM Phase2", 27, 1, 1, 1, 0 }, | 528 | { "PWM Phase2", 27, 1, 1, 1, 0 }, |
529 | { "PWM Phase3", 28, 1, 1, 1, 0 }, | 529 | { "PWM Phase3", 28, 1, 1, 1, 0 }, |
530 | { "PWM Phase4", 29, 1, 1, 1, 0 }, | 530 | { "PWM Phase4", 29, 1, 1, 1, 0 }, |
@@ -947,7 +947,7 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) | |||
947 | if (!abituguru3_motherboards[i].dmi_name) { | 947 | if (!abituguru3_motherboards[i].dmi_name) { |
948 | printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " | 948 | printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " |
949 | "not detected using DMI. Please send the output of " | 949 | "not detected using DMI. Please send the output of " |
950 | "\"dmidecode\" to the abituguru3 maintainer" | 950 | "\"dmidecode\" to the abituguru3 maintainer " |
951 | "(see MAINTAINERS)\n"); | 951 | "(see MAINTAINERS)\n"); |
952 | } | 952 | } |
953 | #endif | 953 | #endif |
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c index 3a0b63136479..b9a8ea30c99c 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c | |||
@@ -319,35 +319,24 @@ out: | |||
319 | } | 319 | } |
320 | 320 | ||
321 | /* | 321 | /* |
322 | * On this chip, voltages are given as a count of steps between a minimum | 322 | * Conversions |
323 | * and maximum voltage, not a direct voltage. | ||
324 | */ | 323 | */ |
325 | static const int volt_convert_table[][2] = { | 324 | |
326 | {2997, 3}, | 325 | /* IN are scaled acording to built-in resistors */ |
327 | {4395, 4}, | 326 | static const int adt7473_scaling[] = { /* .001 Volts */ |
327 | 2250, 3300 | ||
328 | }; | 328 | }; |
329 | #define SCALE(val, from, to) (((val) * (to) + ((from) / 2)) / (from)) | ||
329 | 330 | ||
330 | static int decode_volt(int volt_index, u8 raw) | 331 | static int decode_volt(int volt_index, u8 raw) |
331 | { | 332 | { |
332 | int cmax = volt_convert_table[volt_index][0]; | 333 | return SCALE(raw, 192, adt7473_scaling[volt_index]); |
333 | int cmin = volt_convert_table[volt_index][1]; | ||
334 | return ((raw * (cmax - cmin)) / 255) + cmin; | ||
335 | } | 334 | } |
336 | 335 | ||
337 | static u8 encode_volt(int volt_index, int cooked) | 336 | static u8 encode_volt(int volt_index, int cooked) |
338 | { | 337 | { |
339 | int cmax = volt_convert_table[volt_index][0]; | 338 | int raw = SCALE(cooked, adt7473_scaling[volt_index], 192); |
340 | int cmin = volt_convert_table[volt_index][1]; | 339 | return SENSORS_LIMIT(raw, 0, 255); |
341 | u8 x; | ||
342 | |||
343 | if (cooked > cmax) | ||
344 | cooked = cmax; | ||
345 | else if (cooked < cmin) | ||
346 | cooked = cmin; | ||
347 | |||
348 | x = ((cooked - cmin) * 255) / (cmax - cmin); | ||
349 | |||
350 | return x; | ||
351 | } | 340 | } |
352 | 341 | ||
353 | static ssize_t show_volt_min(struct device *dev, | 342 | static ssize_t show_volt_min(struct device *dev, |
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index c54eff92be4a..bfc296145bba 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c | |||
@@ -180,6 +180,7 @@ static struct vrm_model vrm_models[] = { | |||
180 | {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ | 180 | {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ |
181 | {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ | 181 | {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ |
182 | {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ | 182 | {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ |
183 | {X86_VENDOR_AMD, 0x10, ANY, ANY, 25}, /* NPT family 10h */ | ||
183 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ | 184 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ |
184 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ | 185 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ |
185 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ | 186 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ |
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 3edeebc0b835..96a701866726 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
@@ -12,9 +12,9 @@ | |||
12 | * made by National Semiconductor. Both have an increased remote | 12 | * made by National Semiconductor. Both have an increased remote |
13 | * temperature measurement accuracy (1 degree), and the LM99 | 13 | * temperature measurement accuracy (1 degree), and the LM99 |
14 | * additionally shifts remote temperatures (measured and limits) by 16 | 14 | * additionally shifts remote temperatures (measured and limits) by 16 |
15 | * degrees, which allows for higher temperatures measurement. The | 15 | * degrees, which allows for higher temperatures measurement. |
16 | * driver doesn't handle it since it can be done easily in user-space. | ||
17 | * Note that there is no way to differentiate between both chips. | 16 | * Note that there is no way to differentiate between both chips. |
17 | * When device is auto-detected, the driver will assume an LM99. | ||
18 | * | 18 | * |
19 | * This driver also supports the LM86, another sensor chip made by | 19 | * This driver also supports the LM86, another sensor chip made by |
20 | * National Semiconductor. It is exactly similar to the LM90 except it | 20 | * National Semiconductor. It is exactly similar to the LM90 except it |
@@ -169,8 +169,8 @@ static const struct i2c_device_id lm90_id[] = { | |||
169 | { "adt7461", adt7461 }, | 169 | { "adt7461", adt7461 }, |
170 | { "lm90", lm90 }, | 170 | { "lm90", lm90 }, |
171 | { "lm86", lm86 }, | 171 | { "lm86", lm86 }, |
172 | { "lm89", lm99 }, | 172 | { "lm89", lm86 }, |
173 | { "lm99", lm99 }, /* Missing temperature offset */ | 173 | { "lm99", lm99 }, |
174 | { "max6646", max6646 }, | 174 | { "max6646", max6646 }, |
175 | { "max6647", max6646 }, | 175 | { "max6647", max6646 }, |
176 | { "max6649", max6646 }, | 176 | { "max6649", max6646 }, |
@@ -366,6 +366,10 @@ static ssize_t show_temp8(struct device *dev, struct device_attribute *devattr, | |||
366 | else | 366 | else |
367 | temp = temp_from_s8(data->temp8[attr->index]); | 367 | temp = temp_from_s8(data->temp8[attr->index]); |
368 | 368 | ||
369 | /* +16 degrees offset for temp2 for the LM99 */ | ||
370 | if (data->kind == lm99 && attr->index == 3) | ||
371 | temp += 16000; | ||
372 | |||
369 | return sprintf(buf, "%d\n", temp); | 373 | return sprintf(buf, "%d\n", temp); |
370 | } | 374 | } |
371 | 375 | ||
@@ -385,6 +389,10 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr, | |||
385 | long val = simple_strtol(buf, NULL, 10); | 389 | long val = simple_strtol(buf, NULL, 10); |
386 | int nr = attr->index; | 390 | int nr = attr->index; |
387 | 391 | ||
392 | /* +16 degrees offset for temp2 for the LM99 */ | ||
393 | if (data->kind == lm99 && attr->index == 3) | ||
394 | val -= 16000; | ||
395 | |||
388 | mutex_lock(&data->update_lock); | 396 | mutex_lock(&data->update_lock); |
389 | if (data->kind == adt7461) | 397 | if (data->kind == adt7461) |
390 | data->temp8[nr] = temp_to_u8_adt7461(data, val); | 398 | data->temp8[nr] = temp_to_u8_adt7461(data, val); |
@@ -411,6 +419,10 @@ static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr, | |||
411 | else | 419 | else |
412 | temp = temp_from_s16(data->temp11[attr->index]); | 420 | temp = temp_from_s16(data->temp11[attr->index]); |
413 | 421 | ||
422 | /* +16 degrees offset for temp2 for the LM99 */ | ||
423 | if (data->kind == lm99 && attr->index <= 2) | ||
424 | temp += 16000; | ||
425 | |||
414 | return sprintf(buf, "%d\n", temp); | 426 | return sprintf(buf, "%d\n", temp); |
415 | } | 427 | } |
416 | 428 | ||
@@ -432,6 +444,10 @@ static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr, | |||
432 | long val = simple_strtol(buf, NULL, 10); | 444 | long val = simple_strtol(buf, NULL, 10); |
433 | int nr = attr->index; | 445 | int nr = attr->index; |
434 | 446 | ||
447 | /* +16 degrees offset for temp2 for the LM99 */ | ||
448 | if (data->kind == lm99 && attr->index <= 2) | ||
449 | val -= 16000; | ||
450 | |||
435 | mutex_lock(&data->update_lock); | 451 | mutex_lock(&data->update_lock); |
436 | if (data->kind == adt7461) | 452 | if (data->kind == adt7461) |
437 | data->temp11[nr] = temp_to_u16_adt7461(data, val); | 453 | data->temp11[nr] = temp_to_u16_adt7461(data, val); |
@@ -461,9 +477,15 @@ static ssize_t show_temphyst(struct device *dev, struct device_attribute *devatt | |||
461 | 477 | ||
462 | if (data->kind == adt7461) | 478 | if (data->kind == adt7461) |
463 | temp = temp_from_u8_adt7461(data, data->temp8[attr->index]); | 479 | temp = temp_from_u8_adt7461(data, data->temp8[attr->index]); |
480 | else if (data->kind == max6646) | ||
481 | temp = temp_from_u8(data->temp8[attr->index]); | ||
464 | else | 482 | else |
465 | temp = temp_from_s8(data->temp8[attr->index]); | 483 | temp = temp_from_s8(data->temp8[attr->index]); |
466 | 484 | ||
485 | /* +16 degrees offset for temp2 for the LM99 */ | ||
486 | if (data->kind == lm99 && attr->index == 3) | ||
487 | temp += 16000; | ||
488 | |||
467 | return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst)); | 489 | return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst)); |
468 | } | 490 | } |
469 | 491 | ||
@@ -473,12 +495,19 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy, | |||
473 | struct i2c_client *client = to_i2c_client(dev); | 495 | struct i2c_client *client = to_i2c_client(dev); |
474 | struct lm90_data *data = i2c_get_clientdata(client); | 496 | struct lm90_data *data = i2c_get_clientdata(client); |
475 | long val = simple_strtol(buf, NULL, 10); | 497 | long val = simple_strtol(buf, NULL, 10); |
476 | long hyst; | 498 | int temp; |
477 | 499 | ||
478 | mutex_lock(&data->update_lock); | 500 | mutex_lock(&data->update_lock); |
479 | hyst = temp_from_s8(data->temp8[2]) - val; | 501 | if (data->kind == adt7461) |
502 | temp = temp_from_u8_adt7461(data, data->temp8[2]); | ||
503 | else if (data->kind == max6646) | ||
504 | temp = temp_from_u8(data->temp8[2]); | ||
505 | else | ||
506 | temp = temp_from_s8(data->temp8[2]); | ||
507 | |||
508 | data->temp_hyst = hyst_to_reg(temp - val); | ||
480 | i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST, | 509 | i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST, |
481 | hyst_to_reg(hyst)); | 510 | data->temp_hyst); |
482 | mutex_unlock(&data->update_lock); | 511 | mutex_unlock(&data->update_lock); |
483 | return count; | 512 | return count; |
484 | } | 513 | } |
@@ -682,6 +711,15 @@ static int lm90_detect(struct i2c_client *new_client, int kind, | |||
682 | } else | 711 | } else |
683 | if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */ | 712 | if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */ |
684 | kind = lm99; | 713 | kind = lm99; |
714 | dev_info(&adapter->dev, | ||
715 | "Assuming LM99 chip at " | ||
716 | "0x%02x\n", address); | ||
717 | dev_info(&adapter->dev, | ||
718 | "If it is an LM89, pass " | ||
719 | "force_lm86=%d,0x%02x when " | ||
720 | "loading the lm90 driver\n", | ||
721 | i2c_adapter_id(adapter), | ||
722 | address); | ||
685 | } else | 723 | } else |
686 | if (address == 0x4C | 724 | if (address == 0x4C |
687 | && (chip_id & 0xF0) == 0x10) { /* LM86 */ | 725 | && (chip_id & 0xF0) == 0x10) { /* LM86 */ |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index d4d1b859d4f1..fc12bd412e3a 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -1968,7 +1968,7 @@ exit: | |||
1968 | return res; | 1968 | return res; |
1969 | } | 1969 | } |
1970 | 1970 | ||
1971 | static void __exit | 1971 | static void |
1972 | w83781d_isa_unregister(void) | 1972 | w83781d_isa_unregister(void) |
1973 | { | 1973 | { |
1974 | if (pdev) { | 1974 | if (pdev) { |
@@ -2017,7 +2017,7 @@ w83781d_isa_register(void) | |||
2017 | return 0; | 2017 | return 0; |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | static void __exit | 2020 | static void |
2021 | w83781d_isa_unregister(void) | 2021 | w83781d_isa_unregister(void) |
2022 | { | 2022 | { |
2023 | } | 2023 | } |
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c index 76bdc9a27f6f..2d848010499d 100644 --- a/drivers/ide/icside.c +++ b/drivers/ide/icside.c | |||
@@ -690,9 +690,9 @@ static int __init icside_init(void) | |||
690 | return ecard_register_driver(&icside_driver); | 690 | return ecard_register_driver(&icside_driver); |
691 | } | 691 | } |
692 | 692 | ||
693 | static void __exit icside_exit(void); | 693 | static void __exit icside_exit(void) |
694 | { | 694 | { |
695 | ecard_unregister_driver(&icside_driver); | 695 | ecard_remove_driver(&icside_driver); |
696 | } | 696 | } |
697 | 697 | ||
698 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); | 698 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); |
diff --git a/drivers/ide/rapide.c b/drivers/ide/rapide.c index 78d27d9ae430..d5003ca69801 100644 --- a/drivers/ide/rapide.c +++ b/drivers/ide/rapide.c | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #include <asm/ecard.h> | 12 | #include <asm/ecard.h> |
13 | 13 | ||
14 | static struct const ide_port_info rapide_port_info = { | 14 | static const struct ide_port_info rapide_port_info = { |
15 | .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, | 15 | .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, |
16 | }; | 16 | }; |
17 | 17 | ||
@@ -97,7 +97,7 @@ static int __init rapide_init(void) | |||
97 | 97 | ||
98 | static void __exit rapide_exit(void) | 98 | static void __exit rapide_exit(void) |
99 | { | 99 | { |
100 | ecard_unregister_driver(&rapide_driver); | 100 | ecard_remove_driver(&rapide_driver); |
101 | } | 101 | } |
102 | 102 | ||
103 | MODULE_LICENSE("GPL"); | 103 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig index f5b26dd579e4..108264de0ac9 100644 --- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig | |||
@@ -5,12 +5,13 @@ config I7300_IDLE_IOAT_CHANNEL | |||
5 | bool | 5 | bool |
6 | 6 | ||
7 | config I7300_IDLE | 7 | config I7300_IDLE |
8 | tristate "Intel chipset idle power saving driver" | 8 | tristate "Intel chipset idle memory power saving driver" |
9 | select I7300_IDLE_IOAT_CHANNEL | 9 | select I7300_IDLE_IOAT_CHANNEL |
10 | depends on X86_64 | 10 | depends on X86_64 && EXPERIMENTAL |
11 | help | 11 | help |
12 | Enable idle power savings with certain Intel server chipsets. | 12 | Enable memory power savings when idle with certain Intel server |
13 | The chipset must have I/O AT support, such as the Intel 7300. | 13 | chipsets. The chipset must have I/O AT support, such as the |
14 | The power savings depends on the type and quantity of DRAM devices. | 14 | Intel 7300. The power savings depends on the type and quantity of |
15 | DRAM devices. | ||
15 | 16 | ||
16 | endmenu | 17 | endmenu |
diff --git a/drivers/idle/i7300_idle.c b/drivers/idle/i7300_idle.c index 59d1bbc3cd3c..fb176f6ef9f8 100644 --- a/drivers/idle/i7300_idle.c +++ b/drivers/idle/i7300_idle.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/debugfs.h> | 26 | #include <linux/debugfs.h> |
27 | #include <linux/stop_machine.h> | 27 | #include <linux/stop_machine.h> |
28 | #include <linux/i7300_idle.h> | ||
28 | 29 | ||
29 | #include <asm/idle.h> | 30 | #include <asm/idle.h> |
30 | 31 | ||
@@ -34,6 +35,8 @@ | |||
34 | #define I7300_IDLE_DRIVER_VERSION "1.55" | 35 | #define I7300_IDLE_DRIVER_VERSION "1.55" |
35 | #define I7300_PRINT "i7300_idle:" | 36 | #define I7300_PRINT "i7300_idle:" |
36 | 37 | ||
38 | #define MAX_STOP_RETRIES 10 | ||
39 | |||
37 | static int debug; | 40 | static int debug; |
38 | module_param_named(debug, debug, uint, 0644); | 41 | module_param_named(debug, debug, uint, 0644); |
39 | MODULE_PARM_DESC(debug, "Enable debug printks in this driver"); | 42 | MODULE_PARM_DESC(debug, "Enable debug printks in this driver"); |
@@ -46,12 +49,12 @@ MODULE_PARM_DESC(debug, "Enable debug printks in this driver"); | |||
46 | * 0 = No throttling | 49 | * 0 = No throttling |
47 | * 1 = Throttle when > 4 activations per eval window (Maximum throttling) | 50 | * 1 = Throttle when > 4 activations per eval window (Maximum throttling) |
48 | * 2 = Throttle when > 8 activations | 51 | * 2 = Throttle when > 8 activations |
49 | * 168 = Throttle when > 168 activations (Minimum throttling) | 52 | * 168 = Throttle when > 672 activations (Minimum throttling) |
50 | */ | 53 | */ |
51 | #define MAX_THRTLWLIMIT 168 | 54 | #define MAX_THROTTLE_LOW_LIMIT 168 |
52 | static uint i7300_idle_thrtlowlm = 1; | 55 | static uint throttle_low_limit = 1; |
53 | module_param_named(thrtlwlimit, i7300_idle_thrtlowlm, uint, 0644); | 56 | module_param_named(throttle_low_limit, throttle_low_limit, uint, 0644); |
54 | MODULE_PARM_DESC(thrtlwlimit, | 57 | MODULE_PARM_DESC(throttle_low_limit, |
55 | "Value for THRTLOWLM activation field " | 58 | "Value for THRTLOWLM activation field " |
56 | "(0 = disable throttle, 1 = Max throttle, 168 = Min throttle)"); | 59 | "(0 = disable throttle, 1 = Max throttle, 168 = Min throttle)"); |
57 | 60 | ||
@@ -110,9 +113,9 @@ static int i7300_idle_ioat_start(void) | |||
110 | static void i7300_idle_ioat_stop(void) | 113 | static void i7300_idle_ioat_stop(void) |
111 | { | 114 | { |
112 | int i; | 115 | int i; |
113 | u8 sts; | 116 | u64 sts; |
114 | 117 | ||
115 | for (i = 0; i < 5; i++) { | 118 | for (i = 0; i < MAX_STOP_RETRIES; i++) { |
116 | writeb(IOAT_CHANCMD_RESET, | 119 | writeb(IOAT_CHANCMD_RESET, |
117 | ioat_chanbase + IOAT1_CHANCMD_OFFSET); | 120 | ioat_chanbase + IOAT1_CHANCMD_OFFSET); |
118 | 121 | ||
@@ -126,9 +129,10 @@ static void i7300_idle_ioat_stop(void) | |||
126 | 129 | ||
127 | } | 130 | } |
128 | 131 | ||
129 | if (i == 5) | 132 | if (i == MAX_STOP_RETRIES) { |
130 | dprintk("failed to suspend+reset I/O AT after 5 retries\n"); | 133 | dprintk("failed to stop I/O AT after %d retries\n", |
131 | 134 | MAX_STOP_RETRIES); | |
135 | } | ||
132 | } | 136 | } |
133 | 137 | ||
134 | /* Test I/O AT by copying 1024 byte from 2k to 1k */ | 138 | /* Test I/O AT by copying 1024 byte from 2k to 1k */ |
@@ -275,7 +279,7 @@ static void __exit i7300_idle_ioat_exit(void) | |||
275 | i7300_idle_ioat_stop(); | 279 | i7300_idle_ioat_stop(); |
276 | 280 | ||
277 | /* Wait for a while for the channel to halt before releasing */ | 281 | /* Wait for a while for the channel to halt before releasing */ |
278 | for (i = 0; i < 10; i++) { | 282 | for (i = 0; i < MAX_STOP_RETRIES; i++) { |
279 | writeb(IOAT_CHANCMD_RESET, | 283 | writeb(IOAT_CHANCMD_RESET, |
280 | ioat_chanbase + IOAT1_CHANCMD_OFFSET); | 284 | ioat_chanbase + IOAT1_CHANCMD_OFFSET); |
281 | 285 | ||
@@ -389,9 +393,9 @@ static void i7300_idle_start(void) | |||
389 | new_ctl = i7300_idle_thrtctl_saved & ~DIMM_THRTCTL_THRMHUNT; | 393 | new_ctl = i7300_idle_thrtctl_saved & ~DIMM_THRTCTL_THRMHUNT; |
390 | pci_write_config_byte(fbd_dev, DIMM_THRTCTL, new_ctl); | 394 | pci_write_config_byte(fbd_dev, DIMM_THRTCTL, new_ctl); |
391 | 395 | ||
392 | limit = i7300_idle_thrtlowlm; | 396 | limit = throttle_low_limit; |
393 | if (unlikely(limit > MAX_THRTLWLIMIT)) | 397 | if (unlikely(limit > MAX_THROTTLE_LOW_LIMIT)) |
394 | limit = MAX_THRTLWLIMIT; | 398 | limit = MAX_THROTTLE_LOW_LIMIT; |
395 | 399 | ||
396 | pci_write_config_byte(fbd_dev, DIMM_THRTLOW, limit); | 400 | pci_write_config_byte(fbd_dev, DIMM_THRTLOW, limit); |
397 | 401 | ||
@@ -440,7 +444,7 @@ static int i7300_idle_notifier(struct notifier_block *nb, unsigned long val, | |||
440 | static ktime_t idle_begin_time; | 444 | static ktime_t idle_begin_time; |
441 | static int time_init = 1; | 445 | static int time_init = 1; |
442 | 446 | ||
443 | if (!i7300_idle_thrtlowlm) | 447 | if (!throttle_low_limit) |
444 | return 0; | 448 | return 0; |
445 | 449 | ||
446 | if (unlikely(time_init)) { | 450 | if (unlikely(time_init)) { |
@@ -505,77 +509,8 @@ static struct notifier_block i7300_idle_nb = { | |||
505 | .notifier_call = i7300_idle_notifier, | 509 | .notifier_call = i7300_idle_notifier, |
506 | }; | 510 | }; |
507 | 511 | ||
508 | /* | ||
509 | * I/O AT controls (PCI bus 0 device 8 function 0) | ||
510 | * DIMM controls (PCI bus 0 device 16 function 1) | ||
511 | */ | ||
512 | #define IOAT_BUS 0 | ||
513 | #define IOAT_DEVFN PCI_DEVFN(8, 0) | ||
514 | #define MEMCTL_BUS 0 | ||
515 | #define MEMCTL_DEVFN PCI_DEVFN(16, 1) | ||
516 | |||
517 | struct fbd_ioat { | ||
518 | unsigned int vendor; | ||
519 | unsigned int ioat_dev; | ||
520 | }; | ||
521 | |||
522 | /* | ||
523 | * The i5000 chip-set has the same hooks as the i7300 | ||
524 | * but support is disabled by default because this driver | ||
525 | * has not been validated on that platform. | ||
526 | */ | ||
527 | #define SUPPORT_I5000 0 | ||
528 | |||
529 | static const struct fbd_ioat fbd_ioat_list[] = { | ||
530 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB}, | ||
531 | #if SUPPORT_I5000 | ||
532 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT}, | ||
533 | #endif | ||
534 | {0, 0} | ||
535 | }; | ||
536 | |||
537 | /* table of devices that work with this driver */ | ||
538 | static const struct pci_device_id pci_tbl[] = { | ||
539 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) }, | ||
540 | #if SUPPORT_I5000 | ||
541 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) }, | ||
542 | #endif | ||
543 | { } /* Terminating entry */ | ||
544 | }; | ||
545 | |||
546 | MODULE_DEVICE_TABLE(pci, pci_tbl); | 512 | MODULE_DEVICE_TABLE(pci, pci_tbl); |
547 | 513 | ||
548 | /* Check for known platforms with I/O-AT */ | ||
549 | static int __init i7300_idle_platform_probe(void) | ||
550 | { | ||
551 | int i; | ||
552 | |||
553 | fbd_dev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN); | ||
554 | if (!fbd_dev) | ||
555 | return -ENODEV; | ||
556 | |||
557 | for (i = 0; pci_tbl[i].vendor != 0; i++) { | ||
558 | if (fbd_dev->vendor == pci_tbl[i].vendor && | ||
559 | fbd_dev->device == pci_tbl[i].device) { | ||
560 | break; | ||
561 | } | ||
562 | } | ||
563 | if (pci_tbl[i].vendor == 0) | ||
564 | return -ENODEV; | ||
565 | |||
566 | ioat_dev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN); | ||
567 | if (!ioat_dev) | ||
568 | return -ENODEV; | ||
569 | |||
570 | for (i = 0; fbd_ioat_list[i].vendor != 0; i++) { | ||
571 | if (ioat_dev->vendor == fbd_ioat_list[i].vendor && | ||
572 | ioat_dev->device == fbd_ioat_list[i].ioat_dev) { | ||
573 | return 0; | ||
574 | } | ||
575 | } | ||
576 | return -ENODEV; | ||
577 | } | ||
578 | |||
579 | int stats_open_generic(struct inode *inode, struct file *fp) | 514 | int stats_open_generic(struct inode *inode, struct file *fp) |
580 | { | 515 | { |
581 | fp->private_data = inode->i_private; | 516 | fp->private_data = inode->i_private; |
@@ -617,7 +552,7 @@ static int __init i7300_idle_init(void) | |||
617 | cpus_clear(idle_cpumask); | 552 | cpus_clear(idle_cpumask); |
618 | total_us = 0; | 553 | total_us = 0; |
619 | 554 | ||
620 | if (i7300_idle_platform_probe()) | 555 | if (i7300_idle_platform_probe(&fbd_dev, &ioat_dev)) |
621 | return -ENODEV; | 556 | return -ENODEV; |
622 | 557 | ||
623 | if (i7300_idle_thrt_save()) | 558 | if (i7300_idle_thrt_save()) |
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index f488b6852baf..4e9934259775 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig | |||
@@ -25,8 +25,8 @@ config MOUSE_PS2 | |||
25 | mice with wheels and extra buttons, Microsoft, Logitech or Genius | 25 | mice with wheels and extra buttons, Microsoft, Logitech or Genius |
26 | compatible. | 26 | compatible. |
27 | 27 | ||
28 | Synaptics TouchPad users might be interested in a specialized | 28 | Synaptics, ALPS or Elantech TouchPad users might be interested |
29 | XFree86 driver at: | 29 | in a specialized Xorg/XFree86 driver at: |
30 | <http://w1.894.telia.com/~u89404340/touchpad/index.html> | 30 | <http://w1.894.telia.com/~u89404340/touchpad/index.html> |
31 | and a new version of GPM at: | 31 | and a new version of GPM at: |
32 | <http://www.geocities.com/dt_or/gpm/gpm.html> | 32 | <http://www.geocities.com/dt_or/gpm/gpm.html> |
@@ -87,6 +87,27 @@ config MOUSE_PS2_TRACKPOINT | |||
87 | 87 | ||
88 | If unsure, say Y. | 88 | If unsure, say Y. |
89 | 89 | ||
90 | config MOUSE_PS2_ELANTECH | ||
91 | bool "Elantech PS/2 protocol extension" | ||
92 | depends on MOUSE_PS2 | ||
93 | help | ||
94 | Say Y here if you have an Elantech PS/2 touchpad connected | ||
95 | to your system. | ||
96 | |||
97 | Note that if you enable this driver you will need an updated | ||
98 | X.org Synaptics driver that does not require ABS_PRESSURE | ||
99 | reports from the touchpad (i.e. post 1.5.0 version). You can | ||
100 | grab a patch for the driver here: | ||
101 | |||
102 | http://userweb.kernel.org/~dtor/synaptics-no-abspressure.patch | ||
103 | |||
104 | If unsure, say N. | ||
105 | |||
106 | This driver exposes some configuration registers via sysfs | ||
107 | entries. For further information, | ||
108 | see <file:Documentation/input/elantech.txt>. | ||
109 | |||
110 | |||
90 | config MOUSE_PS2_TOUCHKIT | 111 | config MOUSE_PS2_TOUCHKIT |
91 | bool "eGalax TouchKit PS/2 protocol extension" | 112 | bool "eGalax TouchKit PS/2 protocol extension" |
92 | depends on MOUSE_PS2 | 113 | depends on MOUSE_PS2 |
diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile index 8e6e69097801..96f1dd8037f8 100644 --- a/drivers/input/mouse/Makefile +++ b/drivers/input/mouse/Makefile | |||
@@ -21,6 +21,7 @@ obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o | |||
21 | psmouse-objs := psmouse-base.o synaptics.o | 21 | psmouse-objs := psmouse-base.o synaptics.o |
22 | 22 | ||
23 | psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o | 23 | psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o |
24 | psmouse-$(CONFIG_MOUSE_PS2_ELANTECH) += elantech.o | ||
24 | psmouse-$(CONFIG_MOUSE_PS2_OLPC) += hgpk.o | 25 | psmouse-$(CONFIG_MOUSE_PS2_OLPC) += hgpk.o |
25 | psmouse-$(CONFIG_MOUSE_PS2_LOGIPS2PP) += logips2pp.o | 26 | psmouse-$(CONFIG_MOUSE_PS2_LOGIPS2PP) += logips2pp.o |
26 | psmouse-$(CONFIG_MOUSE_PS2_LIFEBOOK) += lifebook.o | 27 | psmouse-$(CONFIG_MOUSE_PS2_LIFEBOOK) += lifebook.o |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c new file mode 100644 index 000000000000..b9a25d57bc5e --- /dev/null +++ b/drivers/input/mouse/elantech.c | |||
@@ -0,0 +1,674 @@ | |||
1 | /* | ||
2 | * Elantech Touchpad driver (v5) | ||
3 | * | ||
4 | * Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published | ||
8 | * by the Free Software Foundation. | ||
9 | * | ||
10 | * Trademarks are the property of their respective owners. | ||
11 | */ | ||
12 | |||
13 | #include <linux/delay.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/input.h> | ||
16 | #include <linux/serio.h> | ||
17 | #include <linux/libps2.h> | ||
18 | #include "psmouse.h" | ||
19 | #include "elantech.h" | ||
20 | |||
21 | #define elantech_debug(format, arg...) \ | ||
22 | do { \ | ||
23 | if (etd->debug) \ | ||
24 | printk(KERN_DEBUG format, ##arg); \ | ||
25 | } while (0) | ||
26 | |||
27 | /* | ||
28 | * Send a Synaptics style sliced query command | ||
29 | */ | ||
30 | static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, | ||
31 | unsigned char *param) | ||
32 | { | ||
33 | if (psmouse_sliced_command(psmouse, c) || | ||
34 | ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO)) { | ||
35 | pr_err("elantech.c: synaptics_send_cmd query 0x%02x failed.\n", c); | ||
36 | return -1; | ||
37 | } | ||
38 | |||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | * A retrying version of ps2_command | ||
44 | */ | ||
45 | static int elantech_ps2_command(struct psmouse *psmouse, | ||
46 | unsigned char *param, int command) | ||
47 | { | ||
48 | struct ps2dev *ps2dev = &psmouse->ps2dev; | ||
49 | struct elantech_data *etd = psmouse->private; | ||
50 | int rc; | ||
51 | int tries = ETP_PS2_COMMAND_TRIES; | ||
52 | |||
53 | do { | ||
54 | rc = ps2_command(ps2dev, param, command); | ||
55 | if (rc == 0) | ||
56 | break; | ||
57 | tries--; | ||
58 | elantech_debug("elantech.c: retrying ps2 command 0x%02x (%d).\n", | ||
59 | command, tries); | ||
60 | msleep(ETP_PS2_COMMAND_DELAY); | ||
61 | } while (tries > 0); | ||
62 | |||
63 | if (rc) | ||
64 | pr_err("elantech.c: ps2 command 0x%02x failed.\n", command); | ||
65 | |||
66 | return rc; | ||
67 | } | ||
68 | |||
69 | /* | ||
70 | * Send an Elantech style special command to read a value from a register | ||
71 | */ | ||
72 | static int elantech_read_reg(struct psmouse *psmouse, unsigned char reg, | ||
73 | unsigned char *val) | ||
74 | { | ||
75 | struct elantech_data *etd = psmouse->private; | ||
76 | unsigned char param[3]; | ||
77 | int rc = 0; | ||
78 | |||
79 | if (reg < 0x10 || reg > 0x26) | ||
80 | return -1; | ||
81 | |||
82 | if (reg > 0x11 && reg < 0x20) | ||
83 | return -1; | ||
84 | |||
85 | switch (etd->hw_version) { | ||
86 | case 1: | ||
87 | if (psmouse_sliced_command(psmouse, ETP_REGISTER_READ) || | ||
88 | psmouse_sliced_command(psmouse, reg) || | ||
89 | ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO)) { | ||
90 | rc = -1; | ||
91 | } | ||
92 | break; | ||
93 | |||
94 | case 2: | ||
95 | if (elantech_ps2_command(psmouse, NULL, ETP_PS2_CUSTOM_COMMAND) || | ||
96 | elantech_ps2_command(psmouse, NULL, ETP_REGISTER_READ) || | ||
97 | elantech_ps2_command(psmouse, NULL, ETP_PS2_CUSTOM_COMMAND) || | ||
98 | elantech_ps2_command(psmouse, NULL, reg) || | ||
99 | elantech_ps2_command(psmouse, param, PSMOUSE_CMD_GETINFO)) { | ||
100 | rc = -1; | ||
101 | } | ||
102 | break; | ||
103 | } | ||
104 | |||
105 | if (rc) | ||
106 | pr_err("elantech.c: failed to read register 0x%02x.\n", reg); | ||
107 | else | ||
108 | *val = param[0]; | ||
109 | |||
110 | return rc; | ||
111 | } | ||
112 | |||
113 | /* | ||
114 | * Send an Elantech style special command to write a register with a value | ||
115 | */ | ||
116 | static int elantech_write_reg(struct psmouse *psmouse, unsigned char reg, | ||
117 | unsigned char val) | ||
118 | { | ||
119 | struct elantech_data *etd = psmouse->private; | ||
120 | int rc = 0; | ||
121 | |||
122 | if (reg < 0x10 || reg > 0x26) | ||
123 | return -1; | ||
124 | |||
125 | if (reg > 0x11 && reg < 0x20) | ||
126 | return -1; | ||
127 | |||
128 | switch (etd->hw_version) { | ||
129 | case 1: | ||
130 | if (psmouse_sliced_command(psmouse, ETP_REGISTER_WRITE) || | ||
131 | psmouse_sliced_command(psmouse, reg) || | ||
132 | psmouse_sliced_command(psmouse, val) || | ||
133 | ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSCALE11)) { | ||
134 | rc = -1; | ||
135 | } | ||
136 | break; | ||
137 | |||
138 | case 2: | ||
139 | if (elantech_ps2_command(psmouse, NULL, ETP_PS2_CUSTOM_COMMAND) || | ||
140 | elantech_ps2_command(psmouse, NULL, ETP_REGISTER_WRITE) || | ||
141 | elantech_ps2_command(psmouse, NULL, ETP_PS2_CUSTOM_COMMAND) || | ||
142 | elantech_ps2_command(psmouse, NULL, reg) || | ||
143 | elantech_ps2_command(psmouse, NULL, ETP_PS2_CUSTOM_COMMAND) || | ||
144 | elantech_ps2_command(psmouse, NULL, val) || | ||
145 | elantech_ps2_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11)) { | ||
146 | rc = -1; | ||
147 | } | ||
148 | break; | ||
149 | } | ||
150 | |||
151 | if (rc) | ||
152 | pr_err("elantech.c: failed to write register 0x%02x with value 0x%02x.\n", | ||
153 | reg, val); | ||
154 | |||
155 | return rc; | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | * Dump a complete mouse movement packet to the syslog | ||
160 | */ | ||
161 | static void elantech_packet_dump(unsigned char *packet, int size) | ||
162 | { | ||
163 | int i; | ||
164 | |||
165 | printk(KERN_DEBUG "elantech.c: PS/2 packet ["); | ||
166 | for (i = 0; i < size; i++) | ||
167 | printk("%s0x%02x ", (i) ? ", " : " ", packet[i]); | ||
168 | printk("]\n"); | ||
169 | } | ||
170 | |||
171 | /* | ||
172 | * Interpret complete data packets and report absolute mode input events for | ||
173 | * hardware version 1. (4 byte packets) | ||
174 | */ | ||
175 | static void elantech_report_absolute_v1(struct psmouse *psmouse) | ||
176 | { | ||
177 | struct input_dev *dev = psmouse->dev; | ||
178 | struct elantech_data *etd = psmouse->private; | ||
179 | unsigned char *packet = psmouse->packet; | ||
180 | int fingers; | ||
181 | |||
182 | if (etd->fw_version_maj == 0x01) { | ||
183 | /* byte 0: D U p1 p2 1 p3 R L | ||
184 | byte 1: f 0 th tw x9 x8 y9 y8 */ | ||
185 | fingers = ((packet[1] & 0x80) >> 7) + | ||
186 | ((packet[1] & 0x30) >> 4); | ||
187 | } else { | ||
188 | /* byte 0: n1 n0 p2 p1 1 p3 R L | ||
189 | byte 1: 0 0 0 0 x9 x8 y9 y8 */ | ||
190 | fingers = (packet[0] & 0xc0) >> 6; | ||
191 | } | ||
192 | |||
193 | input_report_key(dev, BTN_TOUCH, fingers != 0); | ||
194 | |||
195 | /* byte 2: x7 x6 x5 x4 x3 x2 x1 x0 | ||
196 | byte 3: y7 y6 y5 y4 y3 y2 y1 y0 */ | ||
197 | if (fingers) { | ||
198 | input_report_abs(dev, ABS_X, | ||
199 | ((packet[1] & 0x0c) << 6) | packet[2]); | ||
200 | input_report_abs(dev, ABS_Y, ETP_YMAX_V1 - | ||
201 | (((packet[1] & 0x03) << 8) | packet[3])); | ||
202 | } | ||
203 | |||
204 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); | ||
205 | input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2); | ||
206 | input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3); | ||
207 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | ||
208 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | ||
209 | |||
210 | if ((etd->fw_version_maj == 0x01) && | ||
211 | (etd->capabilities & ETP_CAP_HAS_ROCKER)) { | ||
212 | /* rocker up */ | ||
213 | input_report_key(dev, BTN_FORWARD, packet[0] & 0x40); | ||
214 | /* rocker down */ | ||
215 | input_report_key(dev, BTN_BACK, packet[0] & 0x80); | ||
216 | } | ||
217 | |||
218 | input_sync(dev); | ||
219 | } | ||
220 | |||
221 | /* | ||
222 | * Interpret complete data packets and report absolute mode input events for | ||
223 | * hardware version 2. (6 byte packets) | ||
224 | */ | ||
225 | static void elantech_report_absolute_v2(struct psmouse *psmouse) | ||
226 | { | ||
227 | struct input_dev *dev = psmouse->dev; | ||
228 | unsigned char *packet = psmouse->packet; | ||
229 | int fingers, x1, y1, x2, y2; | ||
230 | |||
231 | /* byte 0: n1 n0 . . . . R L */ | ||
232 | fingers = (packet[0] & 0xc0) >> 6; | ||
233 | input_report_key(dev, BTN_TOUCH, fingers != 0); | ||
234 | |||
235 | switch (fingers) { | ||
236 | case 1: | ||
237 | /* byte 1: x15 x14 x13 x12 x11 x10 x9 x8 | ||
238 | byte 2: x7 x6 x5 x4 x4 x2 x1 x0 */ | ||
239 | input_report_abs(dev, ABS_X, (packet[1] << 8) | packet[2]); | ||
240 | /* byte 4: y15 y14 y13 y12 y11 y10 y8 y8 | ||
241 | byte 5: y7 y6 y5 y4 y3 y2 y1 y0 */ | ||
242 | input_report_abs(dev, ABS_Y, ETP_YMAX_V2 - | ||
243 | ((packet[4] << 8) | packet[5])); | ||
244 | break; | ||
245 | |||
246 | case 2: | ||
247 | /* The coordinate of each finger is reported separately with | ||
248 | a lower resolution for two finger touches */ | ||
249 | /* byte 0: . . ay8 ax8 . . . . | ||
250 | byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 */ | ||
251 | x1 = ((packet[0] & 0x10) << 4) | packet[1]; | ||
252 | /* byte 2: ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 */ | ||
253 | y1 = ETP_2FT_YMAX - (((packet[0] & 0x20) << 3) | packet[2]); | ||
254 | /* byte 3: . . by8 bx8 . . . . | ||
255 | byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 */ | ||
256 | x2 = ((packet[3] & 0x10) << 4) | packet[4]; | ||
257 | /* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */ | ||
258 | y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]); | ||
259 | /* For compatibility with the X Synaptics driver scale up one | ||
260 | coordinate and report as ordinary mouse movent */ | ||
261 | input_report_abs(dev, ABS_X, x1 << 2); | ||
262 | input_report_abs(dev, ABS_Y, y1 << 2); | ||
263 | /* For compatibility with the proprietary X Elantech driver | ||
264 | report both coordinates as hat coordinates */ | ||
265 | input_report_abs(dev, ABS_HAT0X, x1); | ||
266 | input_report_abs(dev, ABS_HAT0Y, y1); | ||
267 | input_report_abs(dev, ABS_HAT1X, x2); | ||
268 | input_report_abs(dev, ABS_HAT1Y, y2); | ||
269 | break; | ||
270 | } | ||
271 | |||
272 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); | ||
273 | input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2); | ||
274 | input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3); | ||
275 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | ||
276 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | ||
277 | |||
278 | input_sync(dev); | ||
279 | } | ||
280 | |||
281 | static int elantech_check_parity_v1(struct psmouse *psmouse) | ||
282 | { | ||
283 | struct elantech_data *etd = psmouse->private; | ||
284 | unsigned char *packet = psmouse->packet; | ||
285 | unsigned char p1, p2, p3; | ||
286 | |||
287 | /* Parity bits are placed differently */ | ||
288 | if (etd->fw_version_maj == 0x01) { | ||
289 | /* byte 0: D U p1 p2 1 p3 R L */ | ||
290 | p1 = (packet[0] & 0x20) >> 5; | ||
291 | p2 = (packet[0] & 0x10) >> 4; | ||
292 | } else { | ||
293 | /* byte 0: n1 n0 p2 p1 1 p3 R L */ | ||
294 | p1 = (packet[0] & 0x10) >> 4; | ||
295 | p2 = (packet[0] & 0x20) >> 5; | ||
296 | } | ||
297 | |||
298 | p3 = (packet[0] & 0x04) >> 2; | ||
299 | |||
300 | return etd->parity[packet[1]] == p1 && | ||
301 | etd->parity[packet[2]] == p2 && | ||
302 | etd->parity[packet[3]] == p3; | ||
303 | } | ||
304 | |||
305 | /* | ||
306 | * Process byte stream from mouse and handle complete packets | ||
307 | */ | ||
308 | static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse) | ||
309 | { | ||
310 | struct elantech_data *etd = psmouse->private; | ||
311 | |||
312 | if (psmouse->pktcnt < psmouse->pktsize) | ||
313 | return PSMOUSE_GOOD_DATA; | ||
314 | |||
315 | if (etd->debug > 1) | ||
316 | elantech_packet_dump(psmouse->packet, psmouse->pktsize); | ||
317 | |||
318 | switch (etd->hw_version) { | ||
319 | case 1: | ||
320 | if (etd->paritycheck && !elantech_check_parity_v1(psmouse)) | ||
321 | return PSMOUSE_BAD_DATA; | ||
322 | |||
323 | elantech_report_absolute_v1(psmouse); | ||
324 | break; | ||
325 | |||
326 | case 2: | ||
327 | /* We don't know how to check parity in protocol v2 */ | ||
328 | elantech_report_absolute_v2(psmouse); | ||
329 | break; | ||
330 | } | ||
331 | |||
332 | return PSMOUSE_FULL_PACKET; | ||
333 | } | ||
334 | |||
335 | /* | ||
336 | * Put the touchpad into absolute mode | ||
337 | */ | ||
338 | static int elantech_set_absolute_mode(struct psmouse *psmouse) | ||
339 | { | ||
340 | struct elantech_data *etd = psmouse->private; | ||
341 | unsigned char val; | ||
342 | int tries = ETP_READ_BACK_TRIES; | ||
343 | int rc = 0; | ||
344 | |||
345 | switch (etd->hw_version) { | ||
346 | case 1: | ||
347 | etd->reg_10 = 0x16; | ||
348 | etd->reg_11 = 0x8f; | ||
349 | if (elantech_write_reg(psmouse, 0x10, etd->reg_10) || | ||
350 | elantech_write_reg(psmouse, 0x11, etd->reg_11)) { | ||
351 | rc = -1; | ||
352 | } | ||
353 | break; | ||
354 | |||
355 | case 2: | ||
356 | /* Windows driver values */ | ||
357 | etd->reg_10 = 0x54; | ||
358 | etd->reg_11 = 0x88; /* 0x8a */ | ||
359 | etd->reg_21 = 0x60; /* 0x00 */ | ||
360 | if (elantech_write_reg(psmouse, 0x10, etd->reg_10) || | ||
361 | elantech_write_reg(psmouse, 0x11, etd->reg_11) || | ||
362 | elantech_write_reg(psmouse, 0x21, etd->reg_21)) { | ||
363 | rc = -1; | ||
364 | break; | ||
365 | } | ||
366 | /* | ||
367 | * Read back reg 0x10. The touchpad is probably initalising | ||
368 | * and not ready until we read back the value we just wrote. | ||
369 | */ | ||
370 | do { | ||
371 | rc = elantech_read_reg(psmouse, 0x10, &val); | ||
372 | if (rc == 0) | ||
373 | break; | ||
374 | tries--; | ||
375 | elantech_debug("elantech.c: retrying read (%d).\n", | ||
376 | tries); | ||
377 | msleep(ETP_READ_BACK_DELAY); | ||
378 | } while (tries > 0); | ||
379 | if (rc) | ||
380 | pr_err("elantech.c: failed to read back register 0x10.\n"); | ||
381 | break; | ||
382 | } | ||
383 | |||
384 | if (rc) | ||
385 | pr_err("elantech.c: failed to initialise registers.\n"); | ||
386 | |||
387 | return rc; | ||
388 | } | ||
389 | |||
390 | /* | ||
391 | * Set the appropriate event bits for the input subsystem | ||
392 | */ | ||
393 | static void elantech_set_input_params(struct psmouse *psmouse) | ||
394 | { | ||
395 | struct input_dev *dev = psmouse->dev; | ||
396 | struct elantech_data *etd = psmouse->private; | ||
397 | |||
398 | __set_bit(EV_KEY, dev->evbit); | ||
399 | __set_bit(EV_ABS, dev->evbit); | ||
400 | |||
401 | __set_bit(BTN_LEFT, dev->keybit); | ||
402 | __set_bit(BTN_RIGHT, dev->keybit); | ||
403 | |||
404 | __set_bit(BTN_TOUCH, dev->keybit); | ||
405 | __set_bit(BTN_TOOL_FINGER, dev->keybit); | ||
406 | __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); | ||
407 | __set_bit(BTN_TOOL_TRIPLETAP, dev->keybit); | ||
408 | |||
409 | switch (etd->hw_version) { | ||
410 | case 1: | ||
411 | /* Rocker button */ | ||
412 | if ((etd->fw_version_maj == 0x01) && | ||
413 | (etd->capabilities & ETP_CAP_HAS_ROCKER)) { | ||
414 | __set_bit(BTN_FORWARD, dev->keybit); | ||
415 | __set_bit(BTN_BACK, dev->keybit); | ||
416 | } | ||
417 | input_set_abs_params(dev, ABS_X, ETP_XMIN_V1, ETP_XMAX_V1, 0, 0); | ||
418 | input_set_abs_params(dev, ABS_Y, ETP_YMIN_V1, ETP_YMAX_V1, 0, 0); | ||
419 | break; | ||
420 | |||
421 | case 2: | ||
422 | input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0); | ||
423 | input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0); | ||
424 | input_set_abs_params(dev, ABS_HAT0X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0); | ||
425 | input_set_abs_params(dev, ABS_HAT0Y, ETP_2FT_YMIN, ETP_2FT_YMAX, 0, 0); | ||
426 | input_set_abs_params(dev, ABS_HAT1X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0); | ||
427 | input_set_abs_params(dev, ABS_HAT1Y, ETP_2FT_YMIN, ETP_2FT_YMAX, 0, 0); | ||
428 | break; | ||
429 | } | ||
430 | } | ||
431 | |||
432 | struct elantech_attr_data { | ||
433 | size_t field_offset; | ||
434 | unsigned char reg; | ||
435 | }; | ||
436 | |||
437 | /* | ||
438 | * Display a register value by reading a sysfs entry | ||
439 | */ | ||
440 | static ssize_t elantech_show_int_attr(struct psmouse *psmouse, void *data, | ||
441 | char *buf) | ||
442 | { | ||
443 | struct elantech_data *etd = psmouse->private; | ||
444 | struct elantech_attr_data *attr = data; | ||
445 | unsigned char *reg = (unsigned char *) etd + attr->field_offset; | ||
446 | int rc = 0; | ||
447 | |||
448 | if (attr->reg) | ||
449 | rc = elantech_read_reg(psmouse, attr->reg, reg); | ||
450 | |||
451 | return sprintf(buf, "0x%02x\n", (attr->reg && rc) ? -1 : *reg); | ||
452 | } | ||
453 | |||
454 | /* | ||
455 | * Write a register value by writing a sysfs entry | ||
456 | */ | ||
457 | static ssize_t elantech_set_int_attr(struct psmouse *psmouse, | ||
458 | void *data, const char *buf, size_t count) | ||
459 | { | ||
460 | struct elantech_data *etd = psmouse->private; | ||
461 | struct elantech_attr_data *attr = data; | ||
462 | unsigned char *reg = (unsigned char *) etd + attr->field_offset; | ||
463 | unsigned long value; | ||
464 | int err; | ||
465 | |||
466 | err = strict_strtoul(buf, 16, &value); | ||
467 | if (err) | ||
468 | return err; | ||
469 | |||
470 | if (value > 0xff) | ||
471 | return -EINVAL; | ||
472 | |||
473 | /* Do we need to preserve some bits for version 2 hardware too? */ | ||
474 | if (etd->hw_version == 1) { | ||
475 | if (attr->reg == 0x10) | ||
476 | /* Force absolute mode always on */ | ||
477 | value |= ETP_R10_ABSOLUTE_MODE; | ||
478 | else if (attr->reg == 0x11) | ||
479 | /* Force 4 byte mode always on */ | ||
480 | value |= ETP_R11_4_BYTE_MODE; | ||
481 | } | ||
482 | |||
483 | if (!attr->reg || elantech_write_reg(psmouse, attr->reg, value) == 0) | ||
484 | *reg = value; | ||
485 | |||
486 | return count; | ||
487 | } | ||
488 | |||
489 | #define ELANTECH_INT_ATTR(_name, _register) \ | ||
490 | static struct elantech_attr_data elantech_attr_##_name = { \ | ||
491 | .field_offset = offsetof(struct elantech_data, _name), \ | ||
492 | .reg = _register, \ | ||
493 | }; \ | ||
494 | PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO, \ | ||
495 | &elantech_attr_##_name, \ | ||
496 | elantech_show_int_attr, \ | ||
497 | elantech_set_int_attr) | ||
498 | |||
499 | ELANTECH_INT_ATTR(reg_10, 0x10); | ||
500 | ELANTECH_INT_ATTR(reg_11, 0x11); | ||
501 | ELANTECH_INT_ATTR(reg_20, 0x20); | ||
502 | ELANTECH_INT_ATTR(reg_21, 0x21); | ||
503 | ELANTECH_INT_ATTR(reg_22, 0x22); | ||
504 | ELANTECH_INT_ATTR(reg_23, 0x23); | ||
505 | ELANTECH_INT_ATTR(reg_24, 0x24); | ||
506 | ELANTECH_INT_ATTR(reg_25, 0x25); | ||
507 | ELANTECH_INT_ATTR(reg_26, 0x26); | ||
508 | ELANTECH_INT_ATTR(debug, 0); | ||
509 | ELANTECH_INT_ATTR(paritycheck, 0); | ||
510 | |||
511 | static struct attribute *elantech_attrs[] = { | ||
512 | &psmouse_attr_reg_10.dattr.attr, | ||
513 | &psmouse_attr_reg_11.dattr.attr, | ||
514 | &psmouse_attr_reg_20.dattr.attr, | ||
515 | &psmouse_attr_reg_21.dattr.attr, | ||
516 | &psmouse_attr_reg_22.dattr.attr, | ||
517 | &psmouse_attr_reg_23.dattr.attr, | ||
518 | &psmouse_attr_reg_24.dattr.attr, | ||
519 | &psmouse_attr_reg_25.dattr.attr, | ||
520 | &psmouse_attr_reg_26.dattr.attr, | ||
521 | &psmouse_attr_debug.dattr.attr, | ||
522 | &psmouse_attr_paritycheck.dattr.attr, | ||
523 | NULL | ||
524 | }; | ||
525 | |||
526 | static struct attribute_group elantech_attr_group = { | ||
527 | .attrs = elantech_attrs, | ||
528 | }; | ||
529 | |||
530 | /* | ||
531 | * Use magic knock to detect Elantech touchpad | ||
532 | */ | ||
533 | int elantech_detect(struct psmouse *psmouse, int set_properties) | ||
534 | { | ||
535 | struct ps2dev *ps2dev = &psmouse->ps2dev; | ||
536 | unsigned char param[3]; | ||
537 | |||
538 | ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS); | ||
539 | |||
540 | if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) || | ||
541 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || | ||
542 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || | ||
543 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || | ||
544 | ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { | ||
545 | pr_err("elantech.c: sending Elantech magic knock failed.\n"); | ||
546 | return -1; | ||
547 | } | ||
548 | |||
549 | /* | ||
550 | * Report this in case there are Elantech models that use a different | ||
551 | * set of magic numbers | ||
552 | */ | ||
553 | if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) { | ||
554 | pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", | ||
555 | param[0], param[1], param[2]); | ||
556 | return -1; | ||
557 | } | ||
558 | |||
559 | if (set_properties) { | ||
560 | psmouse->vendor = "Elantech"; | ||
561 | psmouse->name = "Touchpad"; | ||
562 | } | ||
563 | |||
564 | return 0; | ||
565 | } | ||
566 | |||
567 | /* | ||
568 | * Clean up sysfs entries when disconnecting | ||
569 | */ | ||
570 | static void elantech_disconnect(struct psmouse *psmouse) | ||
571 | { | ||
572 | sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, | ||
573 | &elantech_attr_group); | ||
574 | kfree(psmouse->private); | ||
575 | psmouse->private = NULL; | ||
576 | } | ||
577 | |||
578 | /* | ||
579 | * Put the touchpad back into absolute mode when reconnecting | ||
580 | */ | ||
581 | static int elantech_reconnect(struct psmouse *psmouse) | ||
582 | { | ||
583 | if (elantech_detect(psmouse, 0)) | ||
584 | return -1; | ||
585 | |||
586 | if (elantech_set_absolute_mode(psmouse)) { | ||
587 | pr_err("elantech.c: failed to put touchpad back into absolute mode.\n"); | ||
588 | return -1; | ||
589 | } | ||
590 | |||
591 | return 0; | ||
592 | } | ||
593 | |||
594 | /* | ||
595 | * Initialize the touchpad and create sysfs entries | ||
596 | */ | ||
597 | int elantech_init(struct psmouse *psmouse) | ||
598 | { | ||
599 | struct elantech_data *etd; | ||
600 | int i, error; | ||
601 | unsigned char param[3]; | ||
602 | |||
603 | etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); | ||
604 | psmouse->private = etd; | ||
605 | if (!etd) | ||
606 | return -1; | ||
607 | |||
608 | etd->parity[0] = 1; | ||
609 | for (i = 1; i < 256; i++) | ||
610 | etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; | ||
611 | |||
612 | /* | ||
613 | * Find out what version hardware this is | ||
614 | */ | ||
615 | if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { | ||
616 | pr_err("elantech.c: failed to query firmware version.\n"); | ||
617 | goto init_fail; | ||
618 | } | ||
619 | pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", | ||
620 | param[0], param[1], param[2]); | ||
621 | etd->fw_version_maj = param[0]; | ||
622 | etd->fw_version_min = param[2]; | ||
623 | |||
624 | /* | ||
625 | * Assume every version greater than this is new EeePC style | ||
626 | * hardware with 6 byte packets | ||
627 | */ | ||
628 | if (etd->fw_version_maj >= 0x02 && etd->fw_version_min >= 0x30) { | ||
629 | etd->hw_version = 2; | ||
630 | /* For now show extra debug information */ | ||
631 | etd->debug = 1; | ||
632 | /* Don't know how to do parity checking for version 2 */ | ||
633 | etd->paritycheck = 0; | ||
634 | } else { | ||
635 | etd->hw_version = 1; | ||
636 | etd->paritycheck = 1; | ||
637 | } | ||
638 | pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d\n", | ||
639 | etd->hw_version, etd->fw_version_maj, etd->fw_version_min); | ||
640 | |||
641 | if (synaptics_send_cmd(psmouse, ETP_CAPABILITIES_QUERY, param)) { | ||
642 | pr_err("elantech.c: failed to query capabilities.\n"); | ||
643 | goto init_fail; | ||
644 | } | ||
645 | pr_info("elantech.c: Synaptics capabilities query result 0x%02x, 0x%02x, 0x%02x.\n", | ||
646 | param[0], param[1], param[2]); | ||
647 | etd->capabilities = param[0]; | ||
648 | |||
649 | if (elantech_set_absolute_mode(psmouse)) { | ||
650 | pr_err("elantech.c: failed to put touchpad into absolute mode.\n"); | ||
651 | goto init_fail; | ||
652 | } | ||
653 | |||
654 | elantech_set_input_params(psmouse); | ||
655 | |||
656 | error = sysfs_create_group(&psmouse->ps2dev.serio->dev.kobj, | ||
657 | &elantech_attr_group); | ||
658 | if (error) { | ||
659 | pr_err("elantech.c: failed to create sysfs attributes, error: %d.\n", | ||
660 | error); | ||
661 | goto init_fail; | ||
662 | } | ||
663 | |||
664 | psmouse->protocol_handler = elantech_process_byte; | ||
665 | psmouse->disconnect = elantech_disconnect; | ||
666 | psmouse->reconnect = elantech_reconnect; | ||
667 | psmouse->pktsize = etd->hw_version == 2 ? 6 : 4; | ||
668 | |||
669 | return 0; | ||
670 | |||
671 | init_fail: | ||
672 | kfree(etd); | ||
673 | return -1; | ||
674 | } | ||
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h new file mode 100644 index 000000000000..bee282b540bc --- /dev/null +++ b/drivers/input/mouse/elantech.h | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * Elantech Touchpad driver (v5) | ||
3 | * | ||
4 | * Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published | ||
8 | * by the Free Software Foundation. | ||
9 | * | ||
10 | * Trademarks are the property of their respective owners. | ||
11 | */ | ||
12 | |||
13 | #ifndef _ELANTECH_H | ||
14 | #define _ELANTECH_H | ||
15 | |||
16 | /* | ||
17 | * Command values for Synaptics style queries | ||
18 | */ | ||
19 | #define ETP_FW_VERSION_QUERY 0x01 | ||
20 | #define ETP_CAPABILITIES_QUERY 0x02 | ||
21 | |||
22 | /* | ||
23 | * Command values for register reading or writing | ||
24 | */ | ||
25 | #define ETP_REGISTER_READ 0x10 | ||
26 | #define ETP_REGISTER_WRITE 0x11 | ||
27 | |||
28 | /* | ||
29 | * Hardware version 2 custom PS/2 command value | ||
30 | */ | ||
31 | #define ETP_PS2_CUSTOM_COMMAND 0xf8 | ||
32 | |||
33 | /* | ||
34 | * Times to retry a ps2_command and millisecond delay between tries | ||
35 | */ | ||
36 | #define ETP_PS2_COMMAND_TRIES 3 | ||
37 | #define ETP_PS2_COMMAND_DELAY 500 | ||
38 | |||
39 | /* | ||
40 | * Times to try to read back a register and millisecond delay between tries | ||
41 | */ | ||
42 | #define ETP_READ_BACK_TRIES 5 | ||
43 | #define ETP_READ_BACK_DELAY 2000 | ||
44 | |||
45 | /* | ||
46 | * Register bitmasks for hardware version 1 | ||
47 | */ | ||
48 | #define ETP_R10_ABSOLUTE_MODE 0x04 | ||
49 | #define ETP_R11_4_BYTE_MODE 0x02 | ||
50 | |||
51 | /* | ||
52 | * Capability bitmasks | ||
53 | */ | ||
54 | #define ETP_CAP_HAS_ROCKER 0x04 | ||
55 | |||
56 | /* | ||
57 | * One hard to find application note states that X axis range is 0 to 576 | ||
58 | * and Y axis range is 0 to 384 for harware version 1. | ||
59 | * Edge fuzz might be necessary because of bezel around the touchpad | ||
60 | */ | ||
61 | #define ETP_EDGE_FUZZ_V1 32 | ||
62 | |||
63 | #define ETP_XMIN_V1 ( 0 + ETP_EDGE_FUZZ_V1) | ||
64 | #define ETP_XMAX_V1 (576 - ETP_EDGE_FUZZ_V1) | ||
65 | #define ETP_YMIN_V1 ( 0 + ETP_EDGE_FUZZ_V1) | ||
66 | #define ETP_YMAX_V1 (384 - ETP_EDGE_FUZZ_V1) | ||
67 | |||
68 | /* | ||
69 | * It seems the resolution for hardware version 2 doubled. | ||
70 | * Hence the X and Y ranges are doubled too. | ||
71 | * The bezel around the pad also appears to be smaller | ||
72 | */ | ||
73 | #define ETP_EDGE_FUZZ_V2 8 | ||
74 | |||
75 | #define ETP_XMIN_V2 ( 0 + ETP_EDGE_FUZZ_V2) | ||
76 | #define ETP_XMAX_V2 (1152 - ETP_EDGE_FUZZ_V2) | ||
77 | #define ETP_YMIN_V2 ( 0 + ETP_EDGE_FUZZ_V2) | ||
78 | #define ETP_YMAX_V2 ( 768 - ETP_EDGE_FUZZ_V2) | ||
79 | |||
80 | /* | ||
81 | * For two finger touches the coordinate of each finger gets reported | ||
82 | * separately but with reduced resolution. | ||
83 | */ | ||
84 | #define ETP_2FT_FUZZ 4 | ||
85 | |||
86 | #define ETP_2FT_XMIN ( 0 + ETP_2FT_FUZZ) | ||
87 | #define ETP_2FT_XMAX (288 - ETP_2FT_FUZZ) | ||
88 | #define ETP_2FT_YMIN ( 0 + ETP_2FT_FUZZ) | ||
89 | #define ETP_2FT_YMAX (192 - ETP_2FT_FUZZ) | ||
90 | |||
91 | struct elantech_data { | ||
92 | unsigned char reg_10; | ||
93 | unsigned char reg_11; | ||
94 | unsigned char reg_20; | ||
95 | unsigned char reg_21; | ||
96 | unsigned char reg_22; | ||
97 | unsigned char reg_23; | ||
98 | unsigned char reg_24; | ||
99 | unsigned char reg_25; | ||
100 | unsigned char reg_26; | ||
101 | unsigned char debug; | ||
102 | unsigned char capabilities; | ||
103 | unsigned char fw_version_maj; | ||
104 | unsigned char fw_version_min; | ||
105 | unsigned char hw_version; | ||
106 | unsigned char paritycheck; | ||
107 | unsigned char parity[256]; | ||
108 | }; | ||
109 | |||
110 | #ifdef CONFIG_MOUSE_PS2_ELANTECH | ||
111 | int elantech_detect(struct psmouse *psmouse, int set_properties); | ||
112 | int elantech_init(struct psmouse *psmouse); | ||
113 | #else | ||
114 | static inline int elantech_detect(struct psmouse *psmouse, int set_properties) | ||
115 | { | ||
116 | return -ENOSYS; | ||
117 | } | ||
118 | static inline int elantech_init(struct psmouse *psmouse) | ||
119 | { | ||
120 | return -ENOSYS; | ||
121 | } | ||
122 | #endif /* CONFIG_MOUSE_PS2_ELANTECH */ | ||
123 | |||
124 | #endif | ||
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 126e977e199e..f8f86de694bb 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "lifebook.h" | 29 | #include "lifebook.h" |
30 | #include "trackpoint.h" | 30 | #include "trackpoint.h" |
31 | #include "touchkit_ps2.h" | 31 | #include "touchkit_ps2.h" |
32 | #include "elantech.h" | ||
32 | 33 | ||
33 | #define DRIVER_DESC "PS/2 mouse driver" | 34 | #define DRIVER_DESC "PS/2 mouse driver" |
34 | 35 | ||
@@ -650,6 +651,19 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
650 | max_proto = PSMOUSE_IMEX; | 651 | max_proto = PSMOUSE_IMEX; |
651 | } | 652 | } |
652 | 653 | ||
654 | /* | ||
655 | * Try Elantech touchpad. | ||
656 | */ | ||
657 | if (max_proto > PSMOUSE_IMEX && | ||
658 | elantech_detect(psmouse, set_properties) == 0) { | ||
659 | if (!set_properties || elantech_init(psmouse) == 0) | ||
660 | return PSMOUSE_ELANTECH; | ||
661 | /* | ||
662 | * Init failed, try basic relative protocols | ||
663 | */ | ||
664 | max_proto = PSMOUSE_IMEX; | ||
665 | } | ||
666 | |||
653 | if (max_proto > PSMOUSE_IMEX) { | 667 | if (max_proto > PSMOUSE_IMEX) { |
654 | if (genius_detect(psmouse, set_properties) == 0) | 668 | if (genius_detect(psmouse, set_properties) == 0) |
655 | return PSMOUSE_GENPS; | 669 | return PSMOUSE_GENPS; |
@@ -789,6 +803,15 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
789 | .detect = hgpk_detect, | 803 | .detect = hgpk_detect, |
790 | }, | 804 | }, |
791 | #endif | 805 | #endif |
806 | #ifdef CONFIG_MOUSE_PS2_ELANTECH | ||
807 | { | ||
808 | .type = PSMOUSE_ELANTECH, | ||
809 | .name = "ETPS/2", | ||
810 | .alias = "elantech", | ||
811 | .detect = elantech_detect, | ||
812 | .init = elantech_init, | ||
813 | }, | ||
814 | #endif | ||
792 | { | 815 | { |
793 | .type = PSMOUSE_CORTRON, | 816 | .type = PSMOUSE_CORTRON, |
794 | .name = "CortronPS/2", | 817 | .name = "CortronPS/2", |
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h index 8b608a1cdd12..54ed267894bd 100644 --- a/drivers/input/mouse/psmouse.h +++ b/drivers/input/mouse/psmouse.h | |||
@@ -90,6 +90,7 @@ enum psmouse_type { | |||
90 | PSMOUSE_TOUCHKIT_PS2, | 90 | PSMOUSE_TOUCHKIT_PS2, |
91 | PSMOUSE_CORTRON, | 91 | PSMOUSE_CORTRON, |
92 | PSMOUSE_HGPK, | 92 | PSMOUSE_HGPK, |
93 | PSMOUSE_ELANTECH, | ||
93 | PSMOUSE_AUTO /* This one should always be last */ | 94 | PSMOUSE_AUTO /* This one should always be last */ |
94 | }; | 95 | }; |
95 | 96 | ||
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index a321aea2c7b5..eec375cd10e6 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -135,6 +135,14 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = { | |||
135 | DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), | 135 | DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), |
136 | }, | 136 | }, |
137 | }, | 137 | }, |
138 | { | ||
139 | .ident = "Blue FB5601", | ||
140 | .matches = { | ||
141 | DMI_MATCH(DMI_SYS_VENDOR, "blue"), | ||
142 | DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"), | ||
143 | DMI_MATCH(DMI_PRODUCT_VERSION, "M606"), | ||
144 | }, | ||
145 | }, | ||
138 | { } | 146 | { } |
139 | }; | 147 | }; |
140 | 148 | ||
diff --git a/drivers/leds/leds-hp-disk.c b/drivers/leds/leds-hp-disk.c index 53a25b1c2dae..74645ab15660 100644 --- a/drivers/leds/leds-hp-disk.c +++ b/drivers/leds/leds-hp-disk.c | |||
@@ -49,7 +49,7 @@ static struct acpi_hpled adev; | |||
49 | 49 | ||
50 | static acpi_status hpled_acpi_write(acpi_handle handle, int reg) | 50 | static acpi_status hpled_acpi_write(acpi_handle handle, int reg) |
51 | { | 51 | { |
52 | unsigned long ret; /* Not used when writing */ | 52 | unsigned long long ret; /* Not used when writing */ |
53 | union acpi_object in_obj[1]; | 53 | union acpi_object in_obj[1]; |
54 | struct acpi_object_list args = { 1, in_obj }; | 54 | struct acpi_object_list args = { 1, in_obj }; |
55 | 55 | ||
diff --git a/drivers/md/md.c b/drivers/md/md.c index c1a837ca193c..b4162f6f1b79 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -222,6 +222,9 @@ static void mddev_put(mddev_t *mddev) | |||
222 | list_del(&mddev->all_mddevs); | 222 | list_del(&mddev->all_mddevs); |
223 | spin_unlock(&all_mddevs_lock); | 223 | spin_unlock(&all_mddevs_lock); |
224 | blk_cleanup_queue(mddev->queue); | 224 | blk_cleanup_queue(mddev->queue); |
225 | if (mddev->sysfs_state) | ||
226 | sysfs_put(mddev->sysfs_state); | ||
227 | mddev->sysfs_state = NULL; | ||
225 | kobject_put(&mddev->kobj); | 228 | kobject_put(&mddev->kobj); |
226 | } else | 229 | } else |
227 | spin_unlock(&all_mddevs_lock); | 230 | spin_unlock(&all_mddevs_lock); |
@@ -1459,6 +1462,8 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) | |||
1459 | kobject_del(&rdev->kobj); | 1462 | kobject_del(&rdev->kobj); |
1460 | goto fail; | 1463 | goto fail; |
1461 | } | 1464 | } |
1465 | rdev->sysfs_state = sysfs_get_dirent(rdev->kobj.sd, "state"); | ||
1466 | |||
1462 | list_add_rcu(&rdev->same_set, &mddev->disks); | 1467 | list_add_rcu(&rdev->same_set, &mddev->disks); |
1463 | bd_claim_by_disk(rdev->bdev, rdev->bdev->bd_holder, mddev->gendisk); | 1468 | bd_claim_by_disk(rdev->bdev, rdev->bdev->bd_holder, mddev->gendisk); |
1464 | return 0; | 1469 | return 0; |
@@ -1488,7 +1493,8 @@ static void unbind_rdev_from_array(mdk_rdev_t * rdev) | |||
1488 | printk(KERN_INFO "md: unbind<%s>\n", bdevname(rdev->bdev,b)); | 1493 | printk(KERN_INFO "md: unbind<%s>\n", bdevname(rdev->bdev,b)); |
1489 | rdev->mddev = NULL; | 1494 | rdev->mddev = NULL; |
1490 | sysfs_remove_link(&rdev->kobj, "block"); | 1495 | sysfs_remove_link(&rdev->kobj, "block"); |
1491 | 1496 | sysfs_put(rdev->sysfs_state); | |
1497 | rdev->sysfs_state = NULL; | ||
1492 | /* We need to delay this, otherwise we can deadlock when | 1498 | /* We need to delay this, otherwise we can deadlock when |
1493 | * writing to 'remove' to "dev/state". We also need | 1499 | * writing to 'remove' to "dev/state". We also need |
1494 | * to delay it due to rcu usage. | 1500 | * to delay it due to rcu usage. |
@@ -1923,8 +1929,8 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
1923 | 1929 | ||
1924 | err = 0; | 1930 | err = 0; |
1925 | } | 1931 | } |
1926 | if (!err) | 1932 | if (!err && rdev->sysfs_state) |
1927 | sysfs_notify(&rdev->kobj, NULL, "state"); | 1933 | sysfs_notify_dirent(rdev->sysfs_state); |
1928 | return err ? err : len; | 1934 | return err ? err : len; |
1929 | } | 1935 | } |
1930 | static struct rdev_sysfs_entry rdev_state = | 1936 | static struct rdev_sysfs_entry rdev_state = |
@@ -2019,7 +2025,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2019 | rdev->raid_disk = -1; | 2025 | rdev->raid_disk = -1; |
2020 | return err; | 2026 | return err; |
2021 | } else | 2027 | } else |
2022 | sysfs_notify(&rdev->kobj, NULL, "state"); | 2028 | sysfs_notify_dirent(rdev->sysfs_state); |
2023 | sprintf(nm, "rd%d", rdev->raid_disk); | 2029 | sprintf(nm, "rd%d", rdev->raid_disk); |
2024 | if (sysfs_create_link(&rdev->mddev->kobj, &rdev->kobj, nm)) | 2030 | if (sysfs_create_link(&rdev->mddev->kobj, &rdev->kobj, nm)) |
2025 | printk(KERN_WARNING | 2031 | printk(KERN_WARNING |
@@ -2036,7 +2042,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2036 | clear_bit(Faulty, &rdev->flags); | 2042 | clear_bit(Faulty, &rdev->flags); |
2037 | clear_bit(WriteMostly, &rdev->flags); | 2043 | clear_bit(WriteMostly, &rdev->flags); |
2038 | set_bit(In_sync, &rdev->flags); | 2044 | set_bit(In_sync, &rdev->flags); |
2039 | sysfs_notify(&rdev->kobj, NULL, "state"); | 2045 | sysfs_notify_dirent(rdev->sysfs_state); |
2040 | } | 2046 | } |
2041 | return len; | 2047 | return len; |
2042 | } | 2048 | } |
@@ -2770,7 +2776,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) | |||
2770 | if (err) | 2776 | if (err) |
2771 | return err; | 2777 | return err; |
2772 | else { | 2778 | else { |
2773 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 2779 | sysfs_notify_dirent(mddev->sysfs_state); |
2774 | return len; | 2780 | return len; |
2775 | } | 2781 | } |
2776 | } | 2782 | } |
@@ -3457,6 +3463,11 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data) | |||
3457 | disk->fops = &md_fops; | 3463 | disk->fops = &md_fops; |
3458 | disk->private_data = mddev; | 3464 | disk->private_data = mddev; |
3459 | disk->queue = mddev->queue; | 3465 | disk->queue = mddev->queue; |
3466 | /* Allow extended partitions. This makes the | ||
3467 | * 'mdp' device redundant, but we can really | ||
3468 | * remove it now. | ||
3469 | */ | ||
3470 | disk->flags |= GENHD_FL_EXT_DEVT; | ||
3460 | add_disk(disk); | 3471 | add_disk(disk); |
3461 | mddev->gendisk = disk; | 3472 | mddev->gendisk = disk; |
3462 | error = kobject_init_and_add(&mddev->kobj, &md_ktype, | 3473 | error = kobject_init_and_add(&mddev->kobj, &md_ktype, |
@@ -3465,8 +3476,10 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data) | |||
3465 | if (error) | 3476 | if (error) |
3466 | printk(KERN_WARNING "md: cannot register %s/md - name in use\n", | 3477 | printk(KERN_WARNING "md: cannot register %s/md - name in use\n", |
3467 | disk->disk_name); | 3478 | disk->disk_name); |
3468 | else | 3479 | else { |
3469 | kobject_uevent(&mddev->kobj, KOBJ_ADD); | 3480 | kobject_uevent(&mddev->kobj, KOBJ_ADD); |
3481 | mddev->sysfs_state = sysfs_get_dirent(mddev->kobj.sd, "array_state"); | ||
3482 | } | ||
3470 | return NULL; | 3483 | return NULL; |
3471 | } | 3484 | } |
3472 | 3485 | ||
@@ -3477,7 +3490,7 @@ static void md_safemode_timeout(unsigned long data) | |||
3477 | if (!atomic_read(&mddev->writes_pending)) { | 3490 | if (!atomic_read(&mddev->writes_pending)) { |
3478 | mddev->safemode = 1; | 3491 | mddev->safemode = 1; |
3479 | if (mddev->external) | 3492 | if (mddev->external) |
3480 | set_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags); | 3493 | sysfs_notify_dirent(mddev->sysfs_state); |
3481 | } | 3494 | } |
3482 | md_wakeup_thread(mddev->thread); | 3495 | md_wakeup_thread(mddev->thread); |
3483 | } | 3496 | } |
@@ -3578,7 +3591,7 @@ static int do_md_run(mddev_t * mddev) | |||
3578 | return -EINVAL; | 3591 | return -EINVAL; |
3579 | } | 3592 | } |
3580 | } | 3593 | } |
3581 | sysfs_notify(&rdev->kobj, NULL, "state"); | 3594 | sysfs_notify_dirent(rdev->sysfs_state); |
3582 | } | 3595 | } |
3583 | 3596 | ||
3584 | md_probe(mddev->unit, NULL, NULL); | 3597 | md_probe(mddev->unit, NULL, NULL); |
@@ -3740,7 +3753,7 @@ static int do_md_run(mddev_t * mddev) | |||
3740 | 3753 | ||
3741 | mddev->changed = 1; | 3754 | mddev->changed = 1; |
3742 | md_new_event(mddev); | 3755 | md_new_event(mddev); |
3743 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 3756 | sysfs_notify_dirent(mddev->sysfs_state); |
3744 | sysfs_notify(&mddev->kobj, NULL, "sync_action"); | 3757 | sysfs_notify(&mddev->kobj, NULL, "sync_action"); |
3745 | sysfs_notify(&mddev->kobj, NULL, "degraded"); | 3758 | sysfs_notify(&mddev->kobj, NULL, "degraded"); |
3746 | kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); | 3759 | kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); |
@@ -3767,7 +3780,7 @@ static int restart_array(mddev_t *mddev) | |||
3767 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 3780 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
3768 | md_wakeup_thread(mddev->thread); | 3781 | md_wakeup_thread(mddev->thread); |
3769 | md_wakeup_thread(mddev->sync_thread); | 3782 | md_wakeup_thread(mddev->sync_thread); |
3770 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 3783 | sysfs_notify_dirent(mddev->sysfs_state); |
3771 | return 0; | 3784 | return 0; |
3772 | } | 3785 | } |
3773 | 3786 | ||
@@ -3847,7 +3860,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
3847 | module_put(mddev->pers->owner); | 3860 | module_put(mddev->pers->owner); |
3848 | mddev->pers = NULL; | 3861 | mddev->pers = NULL; |
3849 | /* tell userspace to handle 'inactive' */ | 3862 | /* tell userspace to handle 'inactive' */ |
3850 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 3863 | sysfs_notify_dirent(mddev->sysfs_state); |
3851 | 3864 | ||
3852 | set_capacity(disk, 0); | 3865 | set_capacity(disk, 0); |
3853 | mddev->changed = 1; | 3866 | mddev->changed = 1; |
@@ -3933,7 +3946,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
3933 | mdname(mddev)); | 3946 | mdname(mddev)); |
3934 | err = 0; | 3947 | err = 0; |
3935 | md_new_event(mddev); | 3948 | md_new_event(mddev); |
3936 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 3949 | sysfs_notify_dirent(mddev->sysfs_state); |
3937 | out: | 3950 | out: |
3938 | return err; | 3951 | return err; |
3939 | } | 3952 | } |
@@ -4297,7 +4310,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
4297 | if (err) | 4310 | if (err) |
4298 | export_rdev(rdev); | 4311 | export_rdev(rdev); |
4299 | else | 4312 | else |
4300 | sysfs_notify(&rdev->kobj, NULL, "state"); | 4313 | sysfs_notify_dirent(rdev->sysfs_state); |
4301 | 4314 | ||
4302 | md_update_sb(mddev, 1); | 4315 | md_update_sb(mddev, 1); |
4303 | if (mddev->degraded) | 4316 | if (mddev->degraded) |
@@ -4938,7 +4951,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode, | |||
4938 | if (_IOC_TYPE(cmd) == MD_MAJOR && mddev->ro && mddev->pers) { | 4951 | if (_IOC_TYPE(cmd) == MD_MAJOR && mddev->ro && mddev->pers) { |
4939 | if (mddev->ro == 2) { | 4952 | if (mddev->ro == 2) { |
4940 | mddev->ro = 0; | 4953 | mddev->ro = 0; |
4941 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 4954 | sysfs_notify_dirent(mddev->sysfs_state); |
4942 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 4955 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
4943 | md_wakeup_thread(mddev->thread); | 4956 | md_wakeup_thread(mddev->thread); |
4944 | } else { | 4957 | } else { |
@@ -5612,7 +5625,7 @@ void md_write_start(mddev_t *mddev, struct bio *bi) | |||
5612 | spin_unlock_irq(&mddev->write_lock); | 5625 | spin_unlock_irq(&mddev->write_lock); |
5613 | } | 5626 | } |
5614 | if (did_change) | 5627 | if (did_change) |
5615 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 5628 | sysfs_notify_dirent(mddev->sysfs_state); |
5616 | wait_event(mddev->sb_wait, | 5629 | wait_event(mddev->sb_wait, |
5617 | !test_bit(MD_CHANGE_CLEAN, &mddev->flags) && | 5630 | !test_bit(MD_CHANGE_CLEAN, &mddev->flags) && |
5618 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); | 5631 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); |
@@ -5655,7 +5668,7 @@ int md_allow_write(mddev_t *mddev) | |||
5655 | mddev->safemode = 1; | 5668 | mddev->safemode = 1; |
5656 | spin_unlock_irq(&mddev->write_lock); | 5669 | spin_unlock_irq(&mddev->write_lock); |
5657 | md_update_sb(mddev, 0); | 5670 | md_update_sb(mddev, 0); |
5658 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 5671 | sysfs_notify_dirent(mddev->sysfs_state); |
5659 | } else | 5672 | } else |
5660 | spin_unlock_irq(&mddev->write_lock); | 5673 | spin_unlock_irq(&mddev->write_lock); |
5661 | 5674 | ||
@@ -6048,9 +6061,6 @@ void md_check_recovery(mddev_t *mddev) | |||
6048 | if (mddev->bitmap) | 6061 | if (mddev->bitmap) |
6049 | bitmap_daemon_work(mddev->bitmap); | 6062 | bitmap_daemon_work(mddev->bitmap); |
6050 | 6063 | ||
6051 | if (test_and_clear_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags)) | ||
6052 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | ||
6053 | |||
6054 | if (mddev->ro) | 6064 | if (mddev->ro) |
6055 | return; | 6065 | return; |
6056 | 6066 | ||
@@ -6103,7 +6113,7 @@ void md_check_recovery(mddev_t *mddev) | |||
6103 | mddev->safemode = 0; | 6113 | mddev->safemode = 0; |
6104 | spin_unlock_irq(&mddev->write_lock); | 6114 | spin_unlock_irq(&mddev->write_lock); |
6105 | if (did_change) | 6115 | if (did_change) |
6106 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 6116 | sysfs_notify_dirent(mddev->sysfs_state); |
6107 | } | 6117 | } |
6108 | 6118 | ||
6109 | if (mddev->flags) | 6119 | if (mddev->flags) |
@@ -6111,7 +6121,7 @@ void md_check_recovery(mddev_t *mddev) | |||
6111 | 6121 | ||
6112 | rdev_for_each(rdev, rtmp, mddev) | 6122 | rdev_for_each(rdev, rtmp, mddev) |
6113 | if (test_and_clear_bit(StateChanged, &rdev->flags)) | 6123 | if (test_and_clear_bit(StateChanged, &rdev->flags)) |
6114 | sysfs_notify(&rdev->kobj, NULL, "state"); | 6124 | sysfs_notify_dirent(rdev->sysfs_state); |
6115 | 6125 | ||
6116 | 6126 | ||
6117 | if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) && | 6127 | if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) && |
@@ -6221,7 +6231,7 @@ void md_check_recovery(mddev_t *mddev) | |||
6221 | 6231 | ||
6222 | void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev) | 6232 | void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev) |
6223 | { | 6233 | { |
6224 | sysfs_notify(&rdev->kobj, NULL, "state"); | 6234 | sysfs_notify_dirent(rdev->sysfs_state); |
6225 | wait_event_timeout(rdev->blocked_wait, | 6235 | wait_event_timeout(rdev->blocked_wait, |
6226 | !test_bit(Blocked, &rdev->flags), | 6236 | !test_bit(Blocked, &rdev->flags), |
6227 | msecs_to_jiffies(5000)); | 6237 | msecs_to_jiffies(5000)); |
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 5a79d2d4cdae..b550267c8d5e 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -103,8 +103,20 @@ config MFD_TC6393XB | |||
103 | help | 103 | help |
104 | Support for Toshiba Mobile IO Controller TC6393XB | 104 | Support for Toshiba Mobile IO Controller TC6393XB |
105 | 105 | ||
106 | config PMIC_DA903X | ||
107 | bool "Dialog Semiconductor DA9030/DA9034 PMIC Support" | ||
108 | depends on I2C=y | ||
109 | help | ||
110 | Say yes here to support for Dialog Semiconductor DA9030 (a.k.a | ||
111 | ARAVA) and DA9034 (a.k.a MICCO), these are Power Management IC | ||
112 | usually found on PXA processors-based platforms. This includes | ||
113 | the I2C driver and the core APIs _only_, you have to select | ||
114 | individual components like LCD backlight, voltage regulators, | ||
115 | LEDs and battery-charger under the corresponding menus. | ||
116 | |||
106 | config MFD_WM8400 | 117 | config MFD_WM8400 |
107 | tristate "Support Wolfson Microelectronics WM8400" | 118 | tristate "Support Wolfson Microelectronics WM8400" |
119 | depends on I2C | ||
108 | help | 120 | help |
109 | Support for the Wolfson Microelecronics WM8400 PMIC and audio | 121 | Support for the Wolfson Microelecronics WM8400 PMIC and audio |
110 | CODEC. This driver adds provides common support for accessing | 122 | CODEC. This driver adds provides common support for accessing |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 0acefe8aff87..9a5ad8af9116 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
@@ -30,3 +30,5 @@ ifeq ($(CONFIG_SA1100_ASSABET),y) | |||
30 | obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o | 30 | obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o |
31 | endif | 31 | endif |
32 | obj-$(CONFIG_UCB1400_CORE) += ucb1400_core.o | 32 | obj-$(CONFIG_UCB1400_CORE) += ucb1400_core.o |
33 | |||
34 | obj-$(CONFIG_PMIC_DA903X) += da903x.o \ No newline at end of file | ||
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 696cf3647ceb..2fadf323c696 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -391,6 +391,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) | |||
391 | static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) | 391 | static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) |
392 | { | 392 | { |
393 | struct mmci_host *host = mmc_priv(mmc); | 393 | struct mmci_host *host = mmc_priv(mmc); |
394 | unsigned long flags; | ||
394 | 395 | ||
395 | WARN_ON(host->mrq != NULL); | 396 | WARN_ON(host->mrq != NULL); |
396 | 397 | ||
@@ -402,7 +403,7 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
402 | return; | 403 | return; |
403 | } | 404 | } |
404 | 405 | ||
405 | spin_lock_irq(&host->lock); | 406 | spin_lock_irqsave(&host->lock, flags); |
406 | 407 | ||
407 | host->mrq = mrq; | 408 | host->mrq = mrq; |
408 | 409 | ||
@@ -411,7 +412,7 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
411 | 412 | ||
412 | mmci_start_command(host, mrq->cmd, 0); | 413 | mmci_start_command(host, mrq->cmd, 0); |
413 | 414 | ||
414 | spin_unlock_irq(&host->lock); | 415 | spin_unlock_irqrestore(&host->lock, flags); |
415 | } | 416 | } |
416 | 417 | ||
417 | static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | 418 | static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 2b4e975770f3..4b7cb389dc49 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1915,92 +1915,6 @@ static void rtl_disable_msi(struct pci_dev *pdev, struct rtl8169_private *tp) | |||
1915 | } | 1915 | } |
1916 | } | 1916 | } |
1917 | 1917 | ||
1918 | static int rtl_eeprom_read(struct pci_dev *pdev, int cap, int addr, __le32 *val) | ||
1919 | { | ||
1920 | int ret, count = 100; | ||
1921 | u16 status = 0; | ||
1922 | u32 value; | ||
1923 | |||
1924 | ret = pci_write_config_word(pdev, cap + PCI_VPD_ADDR, addr); | ||
1925 | if (ret < 0) | ||
1926 | return ret; | ||
1927 | |||
1928 | do { | ||
1929 | udelay(10); | ||
1930 | ret = pci_read_config_word(pdev, cap + PCI_VPD_ADDR, &status); | ||
1931 | if (ret < 0) | ||
1932 | return ret; | ||
1933 | } while (!(status & PCI_VPD_ADDR_F) && --count); | ||
1934 | |||
1935 | if (!(status & PCI_VPD_ADDR_F)) | ||
1936 | return -ETIMEDOUT; | ||
1937 | |||
1938 | ret = pci_read_config_dword(pdev, cap + PCI_VPD_DATA, &value); | ||
1939 | if (ret < 0) | ||
1940 | return ret; | ||
1941 | |||
1942 | *val = cpu_to_le32(value); | ||
1943 | |||
1944 | return 0; | ||
1945 | } | ||
1946 | |||
1947 | static void rtl_init_mac_address(struct rtl8169_private *tp, | ||
1948 | void __iomem *ioaddr) | ||
1949 | { | ||
1950 | struct pci_dev *pdev = tp->pci_dev; | ||
1951 | int vpd_cap; | ||
1952 | __le32 sig; | ||
1953 | u8 mac[8]; | ||
1954 | u8 cfg1; | ||
1955 | |||
1956 | cfg1 = RTL_R8(Config1); | ||
1957 | if (!(cfg1 & VPD)) { | ||
1958 | if (netif_msg_probe(tp)) | ||
1959 | dev_info(&pdev->dev, "VPD access disabled, enabling\n"); | ||
1960 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
1961 | RTL_W8(Config1, cfg1 | VPD); | ||
1962 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
1963 | } | ||
1964 | |||
1965 | vpd_cap = pci_find_capability(pdev, PCI_CAP_ID_VPD); | ||
1966 | if (!vpd_cap) | ||
1967 | return; | ||
1968 | |||
1969 | if (rtl_eeprom_read(pdev, vpd_cap, RTL_EEPROM_SIG_ADDR, &sig) < 0) | ||
1970 | return; | ||
1971 | |||
1972 | if ((sig & RTL_EEPROM_SIG_MASK) != RTL_EEPROM_SIG) { | ||
1973 | dev_info(&pdev->dev, "Missing EEPROM signature: %08x\n", sig); | ||
1974 | return; | ||
1975 | } | ||
1976 | |||
1977 | /* | ||
1978 | * MAC address is stored in EEPROM at offset 0x0e | ||
1979 | * Realtek says: "The VPD address does not have to be a DWORD-aligned | ||
1980 | * address as defined in the PCI 2.2 Specifications, but the VPD data | ||
1981 | * is always consecutive 4-byte data starting from the VPD address | ||
1982 | * specified." | ||
1983 | */ | ||
1984 | if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 || | ||
1985 | rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) { | ||
1986 | if (netif_msg_probe(tp)) { | ||
1987 | dev_warn(&pdev->dev, | ||
1988 | "reading MAC address from EEPROM failed\n"); | ||
1989 | } | ||
1990 | return; | ||
1991 | } | ||
1992 | |||
1993 | if (netif_msg_probe(tp)) { | ||
1994 | DECLARE_MAC_BUF(buf); | ||
1995 | |||
1996 | dev_info(&pdev->dev, "MAC address found in EEPROM: %s\n", | ||
1997 | print_mac(buf, mac)); | ||
1998 | } | ||
1999 | |||
2000 | if (is_valid_ether_addr(mac)) | ||
2001 | rtl_rar_set(tp, mac); | ||
2002 | } | ||
2003 | |||
2004 | static int __devinit | 1918 | static int __devinit |
2005 | rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | 1919 | rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
2006 | { | 1920 | { |
@@ -2178,8 +2092,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2178 | 2092 | ||
2179 | tp->mmio_addr = ioaddr; | 2093 | tp->mmio_addr = ioaddr; |
2180 | 2094 | ||
2181 | rtl_init_mac_address(tp, ioaddr); | ||
2182 | |||
2183 | /* Get MAC address */ | 2095 | /* Get MAC address */ |
2184 | for (i = 0; i < MAC_ADDR_LEN; i++) | 2096 | for (i = 0; i < MAC_ADDR_LEN; i++) |
2185 | dev->dev_addr[i] = RTL_R8(MAC0 + i); | 2097 | dev->dev_addr[i] = RTL_R8(MAC0 + i); |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index dfe7c8e1b185..b3a63edb6901 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -83,6 +83,9 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
83 | if (ACPI_FAILURE(status)) | 83 | if (ACPI_FAILURE(status)) |
84 | return status; | 84 | return status; |
85 | 85 | ||
86 | if (!output.length) | ||
87 | return AE_NULL_OBJECT; | ||
88 | |||
86 | out_obj = output.pointer; | 89 | out_obj = output.pointer; |
87 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 90 | if (out_obj->type != ACPI_TYPE_BUFFER) { |
88 | printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n"); | 91 | printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n"); |
diff --git a/fs/compat.c b/fs/compat.c index fe3c9bf87608..e5f49f538502 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1684,8 +1684,9 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
1684 | return -EFAULT; | 1684 | return -EFAULT; |
1685 | 1685 | ||
1686 | to = &end_time; | 1686 | to = &end_time; |
1687 | if (poll_select_set_timeout(to, tv.tv_sec, | 1687 | if (poll_select_set_timeout(to, |
1688 | tv.tv_usec * NSEC_PER_USEC)) | 1688 | tv.tv_sec + (tv.tv_usec / USEC_PER_SEC), |
1689 | (tv.tv_usec % USEC_PER_SEC) * NSEC_PER_USEC)) | ||
1689 | return -EINVAL; | 1690 | return -EINVAL; |
1690 | } | 1691 | } |
1691 | 1692 | ||
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 99368bda0261..aec5c13f6341 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -930,8 +930,15 @@ errxit: | |||
930 | * inside the main ready-list here. | 930 | * inside the main ready-list here. |
931 | */ | 931 | */ |
932 | for (nepi = ep->ovflist; (epi = nepi) != NULL; | 932 | for (nepi = ep->ovflist; (epi = nepi) != NULL; |
933 | nepi = epi->next, epi->next = EP_UNACTIVE_PTR) | 933 | nepi = epi->next, epi->next = EP_UNACTIVE_PTR) { |
934 | list_add_tail(&epi->rdllink, &ep->rdllist); | 934 | /* |
935 | * If the above loop quit with errors, the epoll item might still | ||
936 | * be linked to "txlist", and the list_splice() done below will | ||
937 | * take care of those cases. | ||
938 | */ | ||
939 | if (!ep_is_linked(&epi->rdllink)) | ||
940 | list_add_tail(&epi->rdllink, &ep->rdllist); | ||
941 | } | ||
935 | /* | 942 | /* |
936 | * We need to set back ep->ovflist to EP_UNACTIVE_PTR, so that after | 943 | * We need to set back ep->ovflist to EP_UNACTIVE_PTR, so that after |
937 | * releasing the lock, events will be queued in the normal way inside | 944 | * releasing the lock, events will be queued in the normal way inside |
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index 4c82531ea0a8..5853f4440af4 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c | |||
@@ -456,17 +456,8 @@ static int ext3_dx_readdir(struct file * filp, | |||
456 | if (info->extra_fname) { | 456 | if (info->extra_fname) { |
457 | if (call_filldir(filp, dirent, filldir, info->extra_fname)) | 457 | if (call_filldir(filp, dirent, filldir, info->extra_fname)) |
458 | goto finished; | 458 | goto finished; |
459 | |||
460 | info->extra_fname = NULL; | 459 | info->extra_fname = NULL; |
461 | info->curr_node = rb_next(info->curr_node); | 460 | goto next_node; |
462 | if (!info->curr_node) { | ||
463 | if (info->next_hash == ~0) { | ||
464 | filp->f_pos = EXT3_HTREE_EOF; | ||
465 | goto finished; | ||
466 | } | ||
467 | info->curr_hash = info->next_hash; | ||
468 | info->curr_minor_hash = 0; | ||
469 | } | ||
470 | } else if (!info->curr_node) | 461 | } else if (!info->curr_node) |
471 | info->curr_node = rb_first(&info->root); | 462 | info->curr_node = rb_first(&info->root); |
472 | 463 | ||
@@ -498,9 +489,14 @@ static int ext3_dx_readdir(struct file * filp, | |||
498 | info->curr_minor_hash = fname->minor_hash; | 489 | info->curr_minor_hash = fname->minor_hash; |
499 | if (call_filldir(filp, dirent, filldir, fname)) | 490 | if (call_filldir(filp, dirent, filldir, fname)) |
500 | break; | 491 | break; |
501 | 492 | next_node: | |
502 | info->curr_node = rb_next(info->curr_node); | 493 | info->curr_node = rb_next(info->curr_node); |
503 | if (!info->curr_node) { | 494 | if (info->curr_node) { |
495 | fname = rb_entry(info->curr_node, struct fname, | ||
496 | rb_hash); | ||
497 | info->curr_hash = fname->hash; | ||
498 | info->curr_minor_hash = fname->minor_hash; | ||
499 | } else { | ||
504 | if (info->next_hash == ~0) { | 500 | if (info->next_hash == ~0) { |
505 | filp->f_pos = EXT3_HTREE_EOF; | 501 | filp->f_pos = EXT3_HTREE_EOF; |
506 | break; | 502 | break; |
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 3ca6a2b7632d..fed5b610df5a 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -459,17 +459,8 @@ static int ext4_dx_readdir(struct file *filp, | |||
459 | if (info->extra_fname) { | 459 | if (info->extra_fname) { |
460 | if (call_filldir(filp, dirent, filldir, info->extra_fname)) | 460 | if (call_filldir(filp, dirent, filldir, info->extra_fname)) |
461 | goto finished; | 461 | goto finished; |
462 | |||
463 | info->extra_fname = NULL; | 462 | info->extra_fname = NULL; |
464 | info->curr_node = rb_next(info->curr_node); | 463 | goto next_node; |
465 | if (!info->curr_node) { | ||
466 | if (info->next_hash == ~0) { | ||
467 | filp->f_pos = EXT4_HTREE_EOF; | ||
468 | goto finished; | ||
469 | } | ||
470 | info->curr_hash = info->next_hash; | ||
471 | info->curr_minor_hash = 0; | ||
472 | } | ||
473 | } else if (!info->curr_node) | 464 | } else if (!info->curr_node) |
474 | info->curr_node = rb_first(&info->root); | 465 | info->curr_node = rb_first(&info->root); |
475 | 466 | ||
@@ -501,9 +492,14 @@ static int ext4_dx_readdir(struct file *filp, | |||
501 | info->curr_minor_hash = fname->minor_hash; | 492 | info->curr_minor_hash = fname->minor_hash; |
502 | if (call_filldir(filp, dirent, filldir, fname)) | 493 | if (call_filldir(filp, dirent, filldir, fname)) |
503 | break; | 494 | break; |
504 | 495 | next_node: | |
505 | info->curr_node = rb_next(info->curr_node); | 496 | info->curr_node = rb_next(info->curr_node); |
506 | if (!info->curr_node) { | 497 | if (info->curr_node) { |
498 | fname = rb_entry(info->curr_node, struct fname, | ||
499 | rb_hash); | ||
500 | info->curr_hash = fname->hash; | ||
501 | info->curr_minor_hash = fname->minor_hash; | ||
502 | } else { | ||
507 | if (info->next_hash == ~0) { | 503 | if (info->next_hash == ~0) { |
508 | filp->f_pos = EXT4_HTREE_EOF; | 504 | filp->f_pos = EXT4_HTREE_EOF; |
509 | break; | 505 | break; |
diff --git a/fs/select.c b/fs/select.c index 448e44001286..87df51eadcf2 100644 --- a/fs/select.c +++ b/fs/select.c | |||
@@ -519,8 +519,9 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | |||
519 | return -EFAULT; | 519 | return -EFAULT; |
520 | 520 | ||
521 | to = &end_time; | 521 | to = &end_time; |
522 | if (poll_select_set_timeout(to, tv.tv_sec, | 522 | if (poll_select_set_timeout(to, |
523 | tv.tv_usec * NSEC_PER_USEC)) | 523 | tv.tv_sec + (tv.tv_usec / USEC_PER_SEC), |
524 | (tv.tv_usec % USEC_PER_SEC) * NSEC_PER_USEC)) | ||
524 | return -EINVAL; | 525 | return -EINVAL; |
525 | } | 526 | } |
526 | 527 | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index f13bca2dd53b..5355ca4b939e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -417,6 +417,11 @@ struct hid_input { | |||
417 | struct input_dev *input; | 417 | struct input_dev *input; |
418 | }; | 418 | }; |
419 | 419 | ||
420 | enum hid_type { | ||
421 | HID_TYPE_OTHER = 0, | ||
422 | HID_TYPE_USBMOUSE | ||
423 | }; | ||
424 | |||
420 | struct hid_driver; | 425 | struct hid_driver; |
421 | struct hid_ll_driver; | 426 | struct hid_ll_driver; |
422 | 427 | ||
@@ -431,6 +436,7 @@ struct hid_device { /* device report descriptor */ | |||
431 | __u32 vendor; /* Vendor ID */ | 436 | __u32 vendor; /* Vendor ID */ |
432 | __u32 product; /* Product ID */ | 437 | __u32 product; /* Product ID */ |
433 | __u32 version; /* HID version */ | 438 | __u32 version; /* HID version */ |
439 | enum hid_type type; /* device type (mouse, kbd, ...) */ | ||
434 | unsigned country; /* HID country */ | 440 | unsigned country; /* HID country */ |
435 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; | 441 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; |
436 | 442 | ||
diff --git a/include/linux/i7300_idle.h b/include/linux/i7300_idle.h new file mode 100644 index 000000000000..05a80c44513c --- /dev/null +++ b/include/linux/i7300_idle.h | |||
@@ -0,0 +1,83 @@ | |||
1 | |||
2 | #ifndef I7300_IDLE_H | ||
3 | #define I7300_IDLE_H | ||
4 | |||
5 | #include <linux/pci.h> | ||
6 | |||
7 | /* | ||
8 | * I/O AT controls (PCI bus 0 device 8 function 0) | ||
9 | * DIMM controls (PCI bus 0 device 16 function 1) | ||
10 | */ | ||
11 | #define IOAT_BUS 0 | ||
12 | #define IOAT_DEVFN PCI_DEVFN(8, 0) | ||
13 | #define MEMCTL_BUS 0 | ||
14 | #define MEMCTL_DEVFN PCI_DEVFN(16, 1) | ||
15 | |||
16 | struct fbd_ioat { | ||
17 | unsigned int vendor; | ||
18 | unsigned int ioat_dev; | ||
19 | }; | ||
20 | |||
21 | /* | ||
22 | * The i5000 chip-set has the same hooks as the i7300 | ||
23 | * but support is disabled by default because this driver | ||
24 | * has not been validated on that platform. | ||
25 | */ | ||
26 | #define SUPPORT_I5000 0 | ||
27 | |||
28 | static const struct fbd_ioat fbd_ioat_list[] = { | ||
29 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB}, | ||
30 | #if SUPPORT_I5000 | ||
31 | {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT}, | ||
32 | #endif | ||
33 | {0, 0} | ||
34 | }; | ||
35 | |||
36 | /* table of devices that work with this driver */ | ||
37 | static const struct pci_device_id pci_tbl[] = { | ||
38 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) }, | ||
39 | #if SUPPORT_I5000 | ||
40 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) }, | ||
41 | #endif | ||
42 | { } /* Terminating entry */ | ||
43 | }; | ||
44 | |||
45 | /* Check for known platforms with I/O-AT */ | ||
46 | static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev, | ||
47 | struct pci_dev **ioat_dev) | ||
48 | { | ||
49 | int i; | ||
50 | struct pci_dev *memdev, *dmadev; | ||
51 | |||
52 | memdev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN); | ||
53 | if (!memdev) | ||
54 | return -ENODEV; | ||
55 | |||
56 | for (i = 0; pci_tbl[i].vendor != 0; i++) { | ||
57 | if (memdev->vendor == pci_tbl[i].vendor && | ||
58 | memdev->device == pci_tbl[i].device) { | ||
59 | break; | ||
60 | } | ||
61 | } | ||
62 | if (pci_tbl[i].vendor == 0) | ||
63 | return -ENODEV; | ||
64 | |||
65 | dmadev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN); | ||
66 | if (!dmadev) | ||
67 | return -ENODEV; | ||
68 | |||
69 | for (i = 0; fbd_ioat_list[i].vendor != 0; i++) { | ||
70 | if (dmadev->vendor == fbd_ioat_list[i].vendor && | ||
71 | dmadev->device == fbd_ioat_list[i].ioat_dev) { | ||
72 | if (fbd_dev) | ||
73 | *fbd_dev = memdev; | ||
74 | if (ioat_dev) | ||
75 | *ioat_dev = dmadev; | ||
76 | |||
77 | return 0; | ||
78 | } | ||
79 | } | ||
80 | return -ENODEV; | ||
81 | } | ||
82 | |||
83 | #endif | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c200b9a34aff..8fc909ef6787 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -115,6 +115,9 @@ struct mdk_rdev_s | |||
115 | * in superblock. | 115 | * in superblock. |
116 | */ | 116 | */ |
117 | struct work_struct del_work; /* used for delayed sysfs removal */ | 117 | struct work_struct del_work; /* used for delayed sysfs removal */ |
118 | |||
119 | struct sysfs_dirent *sysfs_state; /* handle for 'state' | ||
120 | * sysfs entry */ | ||
118 | }; | 121 | }; |
119 | 122 | ||
120 | struct mddev_s | 123 | struct mddev_s |
@@ -128,7 +131,6 @@ struct mddev_s | |||
128 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | 131 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ |
129 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | 132 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ |
130 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | 133 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ |
131 | #define MD_NOTIFY_ARRAY_STATE 3 /* atomic context wants to notify userspace */ | ||
132 | 134 | ||
133 | int ro; | 135 | int ro; |
134 | 136 | ||
@@ -239,6 +241,10 @@ struct mddev_s | |||
239 | sector_t resync_max; /* resync should pause | 241 | sector_t resync_max; /* resync should pause |
240 | * when it gets here */ | 242 | * when it gets here */ |
241 | 243 | ||
244 | struct sysfs_dirent *sysfs_state; /* handle for 'array_state' | ||
245 | * file in sysfs. | ||
246 | */ | ||
247 | |||
242 | spinlock_t write_lock; | 248 | spinlock_t write_lock; |
243 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ | 249 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ |
244 | atomic_t pending_writes; /* number of active superblock writes */ | 250 | atomic_t pending_writes; /* number of active superblock writes */ |
diff --git a/init/main.c b/init/main.c index 130d1a0eef11..7e117a231af1 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -768,6 +768,7 @@ static void __init do_initcalls(void) | |||
768 | static void __init do_basic_setup(void) | 768 | static void __init do_basic_setup(void) |
769 | { | 769 | { |
770 | rcu_init_sched(); /* needed by module_init stage. */ | 770 | rcu_init_sched(); /* needed by module_init stage. */ |
771 | init_workqueues(); | ||
771 | usermodehelper_init(); | 772 | usermodehelper_init(); |
772 | driver_init(); | 773 | driver_init(); |
773 | init_irq_proc(); | 774 | init_irq_proc(); |
@@ -851,8 +852,6 @@ static int __init kernel_init(void * unused) | |||
851 | 852 | ||
852 | cad_pid = task_pid(current); | 853 | cad_pid = task_pid(current); |
853 | 854 | ||
854 | init_workqueues(); | ||
855 | |||
856 | smp_prepare_cpus(setup_max_cpus); | 855 | smp_prepare_cpus(setup_max_cpus); |
857 | 856 | ||
858 | do_pre_smp_initcalls(); | 857 | do_pre_smp_initcalls(); |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 046c1609606b..35eebd5510c2 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -2104,7 +2104,7 @@ static void *cgroup_tasks_start(struct seq_file *s, loff_t *pos) | |||
2104 | down_read(&cgrp->pids_mutex); | 2104 | down_read(&cgrp->pids_mutex); |
2105 | if (pid) { | 2105 | if (pid) { |
2106 | int end = cgrp->pids_length; | 2106 | int end = cgrp->pids_length; |
2107 | int i; | 2107 | |
2108 | while (index < end) { | 2108 | while (index < end) { |
2109 | int mid = (index + end) / 2; | 2109 | int mid = (index + end) / 2; |
2110 | if (cgrp->tasks_pids[mid] == pid) { | 2110 | if (cgrp->tasks_pids[mid] == pid) { |
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 8aff79d90ddc..9bc4c00872c9 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c | |||
@@ -160,4 +160,4 @@ static int __init stop_machine_init(void) | |||
160 | stop_machine_work = alloc_percpu(struct work_struct); | 160 | stop_machine_work = alloc_percpu(struct work_struct); |
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
163 | early_initcall(stop_machine_init); | 163 | core_initcall(stop_machine_init); |
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index 7d82be07fa1d..646c7121dbc0 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -16,7 +16,7 @@ config NL80211 | |||
16 | 16 | ||
17 | config WIRELESS_OLD_REGULATORY | 17 | config WIRELESS_OLD_REGULATORY |
18 | bool "Old wireless static regulatory definitions" | 18 | bool "Old wireless static regulatory definitions" |
19 | default n | 19 | default y |
20 | ---help--- | 20 | ---help--- |
21 | This option enables the old static regulatory information | 21 | This option enables the old static regulatory information |
22 | and uses it within the new framework. This is available | 22 | and uses it within the new framework. This is available |
@@ -40,11 +40,10 @@ config WIRELESS_OLD_REGULATORY | |||
40 | ieee80211_regdom module parameter. This is being phased out and you | 40 | ieee80211_regdom module parameter. This is being phased out and you |
41 | should stop using them ASAP. | 41 | should stop using them ASAP. |
42 | 42 | ||
43 | Say N unless you cannot install a new userspace application | 43 | Say Y unless you have installed a new userspace application. |
44 | or have one currently depending on the ieee80211_regdom module | 44 | Also say Y if have one currently depending on the ieee80211_regdom |
45 | parameter and cannot port it to use the new userspace interfaces. | 45 | module parameter and cannot port it to use the new userspace |
46 | 46 | interfaces. | |
47 | This is scheduled for removal for 2.6.29. | ||
48 | 47 | ||
49 | config WIRELESS_EXT | 48 | config WIRELESS_EXT |
50 | bool "Wireless extensions" | 49 | bool "Wireless extensions" |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index b91cf241a539..830d9eae11f9 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -852,8 +852,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) | |||
852 | 852 | ||
853 | } | 853 | } |
854 | 854 | ||
855 | if (modules_sym) | 855 | sym_clear_all_valid(); |
856 | sym_calc_value(modules_sym); | ||
857 | 856 | ||
858 | if (mode != def_random) | 857 | if (mode != def_random) |
859 | return; | 858 | return; |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 44ee94d2ab76..a53e2fc8dfb5 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1648,7 +1648,7 @@ sub dump_function($$) { | |||
1648 | $prototype =~ s/^noinline +//; | 1648 | $prototype =~ s/^noinline +//; |
1649 | $prototype =~ s/__devinit +//; | 1649 | $prototype =~ s/__devinit +//; |
1650 | $prototype =~ s/__init +//; | 1650 | $prototype =~ s/__init +//; |
1651 | $prototype =~ s/^#define\s+//; #ak added | 1651 | $prototype =~ s/^#\s*define\s+//; #ak added |
1652 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; | 1652 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; |
1653 | 1653 | ||
1654 | # Yes, this truly is vile. We are looking for: | 1654 | # Yes, this truly is vile. We are looking for: |
@@ -1764,13 +1764,13 @@ sub process_state3_function($$) { | |||
1764 | 1764 | ||
1765 | $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line | 1765 | $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line |
1766 | 1766 | ||
1767 | if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) { | 1767 | if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#\s*define/)) { |
1768 | # do nothing | 1768 | # do nothing |
1769 | } | 1769 | } |
1770 | elsif ($x =~ /([^\{]*)/) { | 1770 | elsif ($x =~ /([^\{]*)/) { |
1771 | $prototype .= $1; | 1771 | $prototype .= $1; |
1772 | } | 1772 | } |
1773 | if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) { | 1773 | if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) { |
1774 | $prototype =~ s@/\*.*?\*/@@gos; # strip comments. | 1774 | $prototype =~ s@/\*.*?\*/@@gos; # strip comments. |
1775 | $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. | 1775 | $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. |
1776 | $prototype =~ s@^\s+@@gos; # strip leading spaces | 1776 | $prototype =~ s@^\s+@@gos; # strip leading spaces |