diff options
Diffstat (limited to 'drivers')
102 files changed, 1198 insertions, 1347 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 1423b0c0cd2e..a0a178dd189c 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -174,6 +174,15 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
174 | break; | 174 | break; |
175 | case POWER_SUPPLY_PROP_CURRENT_NOW: | 175 | case POWER_SUPPLY_PROP_CURRENT_NOW: |
176 | val->intval = battery->current_now * 1000; | 176 | val->intval = battery->current_now * 1000; |
177 | /* if power units are mW, convert to mA by | ||
178 | dividing by current voltage (mV/1000) */ | ||
179 | if (!battery->power_unit) { | ||
180 | if (battery->voltage_now) { | ||
181 | val->intval /= battery->voltage_now; | ||
182 | val->intval *= 1000; | ||
183 | } else | ||
184 | val->intval = -1; | ||
185 | } | ||
177 | break; | 186 | break; |
178 | case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: | 187 | case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: |
179 | case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: | 188 | case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index ea92bac42c53..09c69806c1fc 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
@@ -176,16 +176,6 @@ static int __init dmi_enable_osi_linux(const struct dmi_system_id *d) | |||
176 | acpi_dmi_osi_linux(1, d); /* enable */ | 176 | acpi_dmi_osi_linux(1, d); /* enable */ |
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | static int __init dmi_disable_osi_linux(const struct dmi_system_id *d) | ||
180 | { | ||
181 | acpi_dmi_osi_linux(0, d); /* disable */ | ||
182 | return 0; | ||
183 | } | ||
184 | static int __init dmi_unknown_osi_linux(const struct dmi_system_id *d) | ||
185 | { | ||
186 | acpi_dmi_osi_linux(-1, d); /* unknown */ | ||
187 | return 0; | ||
188 | } | ||
189 | static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) | 179 | static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) |
190 | { | 180 | { |
191 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | 181 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); |
@@ -193,295 +183,21 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) | |||
193 | return 0; | 183 | return 0; |
194 | } | 184 | } |
195 | 185 | ||
196 | /* | ||
197 | * Most BIOS that invoke OSI(Linux) do nothing with it. | ||
198 | * But some cause Linux to break. | ||
199 | * Only a couple use it to make Linux run better. | ||
200 | * | ||
201 | * Thus, Linux should continue to disable OSI(Linux) by default, | ||
202 | * should continue to discourage BIOS writers from using it, and | ||
203 | * should whitelist the few existing systems that require it. | ||
204 | * | ||
205 | * If it appears clear a vendor isn't using OSI(Linux) | ||
206 | * for anything constructive, blacklist them by name to disable | ||
207 | * unnecessary dmesg warnings on all of their products. | ||
208 | */ | ||
209 | |||
210 | static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | 186 | static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { |
211 | /* | ||
212 | * Disable OSI(Linux) warnings on all "Acer, inc." | ||
213 | * | ||
214 | * _OSI(Linux) disables the latest Windows BIOS code: | ||
215 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3100"), | ||
216 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5050"), | ||
217 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"), | ||
218 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5580"), | ||
219 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 3010"), | ||
220 | * _OSI(Linux) effect unknown: | ||
221 | * DMI_MATCH(DMI_PRODUCT_NAME, "Ferrari 5000"), | ||
222 | */ | ||
223 | /* | ||
224 | * note that dmi_check_system() uses strstr() | ||
225 | * to match sub-strings rather than !strcmp(), | ||
226 | * so "Acer" below matches "Acer, inc." above. | ||
227 | */ | ||
228 | /* | ||
229 | * Disable OSI(Linux) warnings on all "Acer" | ||
230 | * | ||
231 | * _OSI(Linux) effect unknown: | ||
232 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), | ||
233 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720Z"), | ||
234 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 5520"), | ||
235 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 6460"), | ||
236 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 7510"), | ||
237 | * | ||
238 | * _OSI(Linux) is a NOP: | ||
239 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"), | ||
240 | * DMI_MATCH(DMI_PRODUCT_NAME, "Extensa 5220"), | ||
241 | */ | ||
242 | { | ||
243 | .callback = dmi_disable_osi_linux, | ||
244 | .ident = "Acer", | ||
245 | .matches = { | ||
246 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
247 | }, | ||
248 | }, | ||
249 | /* | ||
250 | * Disable OSI(Linux) warnings on all "Apple Computer, Inc." | ||
251 | * Disable OSI(Linux) warnings on all "Apple Inc." | ||
252 | * | ||
253 | * _OSI(Linux) confirmed to be a NOP: | ||
254 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), | ||
255 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"), | ||
256 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2"), | ||
257 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3,1"), | ||
258 | * _OSI(Linux) effect unknown: | ||
259 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacPro2,1"), | ||
260 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro1,1"), | ||
261 | */ | ||
262 | { | ||
263 | .callback = dmi_disable_osi_linux, | ||
264 | .ident = "Apple", | ||
265 | .matches = { | ||
266 | DMI_MATCH(DMI_SYS_VENDOR, "Apple"), | ||
267 | }, | ||
268 | }, | ||
269 | /* | ||
270 | * Disable OSI(Linux) warnings on all "BenQ" | ||
271 | * | ||
272 | * _OSI(Linux) confirmed to be a NOP: | ||
273 | * DMI_MATCH(DMI_PRODUCT_NAME, "Joybook S31"), | ||
274 | */ | ||
275 | { | ||
276 | .callback = dmi_disable_osi_linux, | ||
277 | .ident = "BenQ", | ||
278 | .matches = { | ||
279 | DMI_MATCH(DMI_SYS_VENDOR, "BenQ"), | ||
280 | }, | ||
281 | }, | ||
282 | /* | ||
283 | * Disable OSI(Linux) warnings on all "Clevo Co." | ||
284 | * | ||
285 | * _OSI(Linux) confirmed to be a NOP: | ||
286 | * DMI_MATCH(DMI_PRODUCT_NAME, "M570RU"), | ||
287 | */ | ||
288 | { | ||
289 | .callback = dmi_disable_osi_linux, | ||
290 | .ident = "Clevo", | ||
291 | .matches = { | ||
292 | DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."), | ||
293 | }, | ||
294 | }, | ||
295 | /* | ||
296 | * Disable OSI(Linux) warnings on all "COMPAL" | ||
297 | * | ||
298 | * _OSI(Linux) confirmed to be a NOP: | ||
299 | * DMI_MATCH(DMI_BOARD_NAME, "HEL8X"), | ||
300 | * _OSI(Linux) unknown effect: | ||
301 | * DMI_MATCH(DMI_BOARD_NAME, "IFL91"), | ||
302 | */ | ||
303 | { | ||
304 | .callback = dmi_disable_osi_linux, | ||
305 | .ident = "Compal", | ||
306 | .matches = { | ||
307 | DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"), | ||
308 | }, | ||
309 | }, | ||
310 | { /* OSI(Linux) touches USB, unknown side-effect */ | ||
311 | .callback = dmi_disable_osi_linux, | ||
312 | .ident = "Dell Dimension 5150", | ||
313 | .matches = { | ||
314 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
315 | DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM051"), | ||
316 | }, | ||
317 | }, | ||
318 | { /* OSI(Linux) is a NOP */ | ||
319 | .callback = dmi_disable_osi_linux, | ||
320 | .ident = "Dell i1501", | ||
321 | .matches = { | ||
322 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
323 | DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1501"), | ||
324 | }, | ||
325 | }, | ||
326 | { /* OSI(Linux) effect unknown */ | ||
327 | .callback = dmi_unknown_osi_linux, | ||
328 | .ident = "Dell Latitude D830", | ||
329 | .matches = { | ||
330 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
331 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D830"), | ||
332 | }, | ||
333 | }, | ||
334 | { /* OSI(Linux) effect unknown */ | ||
335 | .callback = dmi_unknown_osi_linux, | ||
336 | .ident = "Dell OptiPlex GX620", | ||
337 | .matches = { | ||
338 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
339 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX620"), | ||
340 | }, | ||
341 | }, | ||
342 | { /* OSI(Linux) causes some USB initialization to not run */ | ||
343 | .callback = dmi_unknown_osi_linux, | ||
344 | .ident = "Dell OptiPlex 755", | ||
345 | .matches = { | ||
346 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
347 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 755"), | ||
348 | }, | ||
349 | }, | ||
350 | { /* OSI(Linux) effect unknown */ | ||
351 | .callback = dmi_unknown_osi_linux, | ||
352 | .ident = "Dell PE 1900", | ||
353 | .matches = { | ||
354 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
355 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1900"), | ||
356 | }, | ||
357 | }, | ||
358 | { /* OSI(Linux) is a NOP */ | ||
359 | .callback = dmi_unknown_osi_linux, | ||
360 | .ident = "Dell PE 1950", | ||
361 | .matches = { | ||
362 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
363 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"), | ||
364 | }, | ||
365 | }, | ||
366 | { /* OSI(Linux) is a NOP */ | ||
367 | .callback = dmi_disable_osi_linux, | ||
368 | .ident = "Dell PE R200", | ||
369 | .matches = { | ||
370 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
371 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R200"), | ||
372 | }, | ||
373 | }, | ||
374 | { /* OSI(Linux) touches USB */ | ||
375 | .callback = dmi_disable_osi_linux, | ||
376 | .ident = "Dell PR 390", | ||
377 | .matches = { | ||
378 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
379 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 390"), | ||
380 | }, | ||
381 | }, | ||
382 | { /* OSI(Linux) touches USB */ | ||
383 | .callback = dmi_unknown_osi_linux, | ||
384 | .ident = "Dell PR 390", | ||
385 | .matches = { | ||
386 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
387 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 690"), | ||
388 | }, | ||
389 | }, | ||
390 | { /* OSI(Linux) unknown - ASL looks benign, but may effect dock/SMM */ | ||
391 | .callback = dmi_unknown_osi_linux, | ||
392 | .ident = "Dell PR M4300", | ||
393 | .matches = { | ||
394 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
395 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision M4300"), | ||
396 | }, | ||
397 | }, | ||
398 | { /* OSI(Linux) is a NOP */ | ||
399 | .callback = dmi_disable_osi_linux, | ||
400 | .ident = "Dell Vostro 1000", | ||
401 | .matches = { | ||
402 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
403 | DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1000"), | ||
404 | }, | ||
405 | }, | ||
406 | { /* OSI(Linux) effect unknown */ | ||
407 | .callback = dmi_unknown_osi_linux, | ||
408 | .ident = "Dell PE SC440", | ||
409 | .matches = { | ||
410 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
411 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge SC440"), | ||
412 | }, | ||
413 | }, | ||
414 | { /* OSI(Linux) effect unknown */ | ||
415 | .callback = dmi_unknown_osi_linux, | ||
416 | .ident = "Dialogue Flybook V5", | ||
417 | .matches = { | ||
418 | DMI_MATCH(DMI_SYS_VENDOR, "Dialogue Technology Corporation"), | ||
419 | DMI_MATCH(DMI_PRODUCT_NAME, "Flybook V5"), | ||
420 | }, | ||
421 | }, | ||
422 | /* | ||
423 | * Disable OSI(Linux) warnings on all "FUJITSU SIEMENS" | ||
424 | * | ||
425 | * _OSI(Linux) disables latest Windows BIOS code: | ||
426 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 2510"), | ||
427 | * _OSI(Linux) confirmed to be a NOP: | ||
428 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1536"), | ||
429 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1556"), | ||
430 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 1546"), | ||
431 | * DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), | ||
432 | * _OSI(Linux) unknown effect: | ||
433 | * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo M1425"), | ||
434 | * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo Si 1520"), | ||
435 | */ | ||
436 | { | ||
437 | .callback = dmi_disable_osi_linux, | ||
438 | .ident = "Fujitsu Siemens", | ||
439 | .matches = { | ||
440 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | ||
441 | }, | ||
442 | }, | ||
443 | { | 187 | { |
444 | .callback = dmi_disable_osi_vista, | 188 | .callback = dmi_disable_osi_vista, |
445 | .ident = "Fujitsu Siemens", | 189 | .ident = "Fujitsu Siemens", |
446 | .matches = { | 190 | .matches = { |
447 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | 191 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), |
448 | DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), | 192 | DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), |
449 | }, | 193 | }, |
450 | }, | 194 | }, |
195 | |||
451 | /* | 196 | /* |
452 | * Disable OSI(Linux) warnings on all "Hewlett-Packard" | 197 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. |
453 | * | 198 | * Linux ignores it, except for the machines enumerated below. |
454 | * _OSI(Linux) confirmed to be a NOP: | ||
455 | * .ident = "HP Pavilion tx 1000" | ||
456 | * DMI_MATCH(DMI_BOARD_NAME, "30BF"), | ||
457 | * .ident = "HP Pavilion dv2000" | ||
458 | * DMI_MATCH(DMI_BOARD_NAME, "30B5"), | ||
459 | * .ident = "HP Pavilion dv5000", | ||
460 | * DMI_MATCH(DMI_BOARD_NAME, "30A7"), | ||
461 | * .ident = "HP Pavilion dv6300 30BC", | ||
462 | * DMI_MATCH(DMI_BOARD_NAME, "30BC"), | ||
463 | * .ident = "HP Pavilion dv6000", | ||
464 | * DMI_MATCH(DMI_BOARD_NAME, "30B7"), | ||
465 | * DMI_MATCH(DMI_BOARD_NAME, "30B8"), | ||
466 | * .ident = "HP Pavilion dv9000", | ||
467 | * DMI_MATCH(DMI_BOARD_NAME, "30B9"), | ||
468 | * .ident = "HP Pavilion dv9500", | ||
469 | * DMI_MATCH(DMI_BOARD_NAME, "30CB"), | ||
470 | * .ident = "HP/Compaq Presario C500", | ||
471 | * DMI_MATCH(DMI_BOARD_NAME, "30C6"), | ||
472 | * .ident = "HP/Compaq Presario F500", | ||
473 | * DMI_MATCH(DMI_BOARD_NAME, "30D3"), | ||
474 | * _OSI(Linux) unknown effect: | ||
475 | * .ident = "HP Pavilion dv6500", | ||
476 | * DMI_MATCH(DMI_BOARD_NAME, "30D0"), | ||
477 | */ | 199 | */ |
478 | { | 200 | |
479 | .callback = dmi_disable_osi_linux, | ||
480 | .ident = "Hewlett-Packard", | ||
481 | .matches = { | ||
482 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
483 | }, | ||
484 | }, | ||
485 | /* | 201 | /* |
486 | * Lenovo has a mix of systems OSI(Linux) situations | 202 | * Lenovo has a mix of systems OSI(Linux) situations |
487 | * and thus we can not wildcard the vendor. | 203 | * and thus we can not wildcard the vendor. |
@@ -519,113 +235,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
519 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"), | 235 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"), |
520 | }, | 236 | }, |
521 | }, | 237 | }, |
522 | { | ||
523 | .callback = dmi_disable_osi_linux, | ||
524 | .ident = "Lenovo 3000 V100", | ||
525 | .matches = { | ||
526 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
527 | DMI_MATCH(DMI_PRODUCT_VERSION, "LENOVO3000 V100"), | ||
528 | }, | ||
529 | }, | ||
530 | { | ||
531 | .callback = dmi_disable_osi_linux, | ||
532 | .ident = "Lenovo 3000 N100", | ||
533 | .matches = { | ||
534 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
535 | DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"), | ||
536 | }, | ||
537 | }, | ||
538 | /* | ||
539 | * Disable OSI(Linux) warnings on all "LG Electronics" | ||
540 | * | ||
541 | * _OSI(Linux) confirmed to be a NOP: | ||
542 | * DMI_MATCH(DMI_PRODUCT_NAME, "P1-J150B"), | ||
543 | * with DMI_MATCH(DMI_BOARD_NAME, "ROCKY"), | ||
544 | * | ||
545 | * unknown: | ||
546 | * DMI_MATCH(DMI_PRODUCT_NAME, "S1-MDGDG"), | ||
547 | * with DMI_MATCH(DMI_BOARD_NAME, "ROCKY"), | ||
548 | */ | ||
549 | { | ||
550 | .callback = dmi_disable_osi_linux, | ||
551 | .ident = "LG", | ||
552 | .matches = { | ||
553 | DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), | ||
554 | }, | ||
555 | }, | ||
556 | /* NEC - OSI(Linux) effect unknown */ | ||
557 | { | ||
558 | .callback = dmi_unknown_osi_linux, | ||
559 | .ident = "NEC VERSA M360", | ||
560 | .matches = { | ||
561 | DMI_MATCH(DMI_SYS_VENDOR, "NEC Computers SAS"), | ||
562 | DMI_MATCH(DMI_PRODUCT_NAME, "NEC VERSA M360"), | ||
563 | }, | ||
564 | }, | ||
565 | /* Panasonic */ | ||
566 | { | ||
567 | .callback = dmi_unknown_osi_linux, | ||
568 | .ident = "Panasonic", | ||
569 | .matches = { | ||
570 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), | ||
571 | /* Toughbook CF-52 */ | ||
572 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-52CCABVBG"), | ||
573 | }, | ||
574 | }, | ||
575 | /* | ||
576 | * Disable OSI(Linux) warnings on all "Samsung Electronics" | ||
577 | * | ||
578 | * OSI(Linux) disables PNP0C32 and other BIOS code for Windows: | ||
579 | * DMI_MATCH(DMI_PRODUCT_NAME, "R40P/R41P"), | ||
580 | * DMI_MATCH(DMI_PRODUCT_NAME, "R59P/R60P/R61P"), | ||
581 | */ | ||
582 | { | ||
583 | .callback = dmi_disable_osi_linux, | ||
584 | .ident = "Samsung", | ||
585 | .matches = { | ||
586 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
587 | }, | ||
588 | }, | ||
589 | /* | ||
590 | * Disable OSI(Linux) warnings on all "Sony Corporation" | ||
591 | * | ||
592 | * _OSI(Linux) is a NOP: | ||
593 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NR11S_S"), | ||
594 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ38GP_C"), | ||
595 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ650N"), | ||
596 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-TZ21MN_N"), | ||
597 | * _OSI(Linux) unknown effect: | ||
598 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ11M"), | ||
599 | */ | ||
600 | { | ||
601 | .callback = dmi_disable_osi_linux, | ||
602 | .ident = "Sony", | ||
603 | .matches = { | ||
604 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
605 | }, | ||
606 | }, | ||
607 | /* | ||
608 | * Disable OSI(Linux) warnings on all "TOSHIBA" | ||
609 | * | ||
610 | * _OSI(Linux) breaks sound (bugzilla 7787): | ||
611 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P100"), | ||
612 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P105"), | ||
613 | * _OSI(Linux) is a NOP: | ||
614 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A100"), | ||
615 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A210"), | ||
616 | * _OSI(Linux) unknown effect: | ||
617 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A135"), | ||
618 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A200"), | ||
619 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P205"), | ||
620 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U305"), | ||
621 | */ | ||
622 | { | ||
623 | .callback = dmi_disable_osi_linux, | ||
624 | .ident = "Toshiba", | ||
625 | .matches = { | ||
626 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
627 | }, | ||
628 | }, | ||
629 | {} | 238 | {} |
630 | }; | 239 | }; |
631 | 240 | ||
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index cf41f9fc24a7..30f3ef236ecb 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -219,7 +219,8 @@ static void gpe_transaction(struct acpi_ec *ec, u8 status) | |||
219 | goto unlock; | 219 | goto unlock; |
220 | err: | 220 | err: |
221 | /* false interrupt, state didn't change */ | 221 | /* false interrupt, state didn't change */ |
222 | ++ec->curr->irq_count; | 222 | if (in_interrupt()) |
223 | ++ec->curr->irq_count; | ||
223 | unlock: | 224 | unlock: |
224 | spin_unlock_irqrestore(&ec->curr_lock, flags); | 225 | spin_unlock_irqrestore(&ec->curr_lock, flags); |
225 | } | 226 | } |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 4be252145cb4..c8111424dcb8 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
36 | #include <linux/kmod.h> | 36 | #include <linux/kmod.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/dmi.h> | ||
39 | #include <linux/workqueue.h> | 38 | #include <linux/workqueue.h> |
40 | #include <linux/nmi.h> | 39 | #include <linux/nmi.h> |
41 | #include <linux/acpi.h> | 40 | #include <linux/acpi.h> |
@@ -97,54 +96,44 @@ static DEFINE_SPINLOCK(acpi_res_lock); | |||
97 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; | 96 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; |
98 | 97 | ||
99 | /* | 98 | /* |
100 | * "Ode to _OSI(Linux)" | 99 | * The story of _OSI(Linux) |
101 | * | 100 | * |
102 | * osi_linux -- Control response to BIOS _OSI(Linux) query. | 101 | * From pre-history through Linux-2.6.22, |
102 | * Linux responded TRUE upon a BIOS OSI(Linux) query. | ||
103 | * | 103 | * |
104 | * As Linux evolves, the features that it supports change. | 104 | * Unfortunately, reference BIOS writers got wind of this |
105 | * So an OSI string such as "Linux" is not specific enough | 105 | * and put OSI(Linux) in their example code, quickly exposing |
106 | * to be useful across multiple versions of Linux. It | 106 | * this string as ill-conceived and opening the door to |
107 | * doesn't identify any particular feature, interface, | 107 | * an un-bounded number of BIOS incompatibilities. |
108 | * or even any particular version of Linux... | ||
109 | * | 108 | * |
110 | * Unfortunately, Linux-2.6.22 and earlier responded "yes" | 109 | * For example, OSI(Linux) was used on resume to re-POST a |
111 | * to a BIOS _OSI(Linux) query. When | 110 | * video card on one system, because Linux at that time |
112 | * a reference mobile BIOS started using it, its use | 111 | * could not do a speedy restore in its native driver. |
113 | * started to spread to many vendor platforms. | 112 | * But then upon gaining quick native restore capability, |
114 | * As it is not supportable, we need to halt that spread. | 113 | * Linux has no way to tell the BIOS to skip the time-consuming |
114 | * POST -- putting Linux at a permanent performance disadvantage. | ||
115 | * On another system, the BIOS writer used OSI(Linux) | ||
116 | * to infer native OS support for IPMI! On other systems, | ||
117 | * OSI(Linux) simply got in the way of Linux claiming to | ||
118 | * be compatible with other operating systems, exposing | ||
119 | * BIOS issues such as skipped device initialization. | ||
115 | * | 120 | * |
116 | * Today, most BIOS references to _OSI(Linux) are noise -- | 121 | * So "Linux" turned out to be a really poor chose of |
117 | * they have no functional effect and are just dead code | 122 | * OSI string, and from Linux-2.6.23 onward we respond FALSE. |
118 | * carried over from the reference BIOS. | ||
119 | * | ||
120 | * The next most common case is that _OSI(Linux) harms Linux, | ||
121 | * usually by causing the BIOS to follow paths that are | ||
122 | * not tested during Windows validation. | ||
123 | * | ||
124 | * Finally, there is a short list of platforms | ||
125 | * where OSI(Linux) benefits Linux. | ||
126 | * | ||
127 | * In Linux-2.6.23, OSI(Linux) is first disabled by default. | ||
128 | * DMI is used to disable the dmesg warning about OSI(Linux) | ||
129 | * on platforms where it is known to have no effect. | ||
130 | * But a dmesg warning remains for systems where | ||
131 | * we do not know if OSI(Linux) is good or bad for the system. | ||
132 | * DMI is also used to enable OSI(Linux) for the machines | ||
133 | * that are known to need it. | ||
134 | * | 123 | * |
135 | * BIOS writers should NOT query _OSI(Linux) on future systems. | 124 | * BIOS writers should NOT query _OSI(Linux) on future systems. |
136 | * It will be ignored by default, and to get Linux to | 125 | * Linux will complain on the console when it sees it, and return FALSE. |
137 | * not ignore it will require a kernel source update to | 126 | * To get Linux to return TRUE for your system will require |
138 | * add a DMI entry, or a boot-time "acpi_osi=Linux" invocation. | 127 | * a kernel source update to add a DMI entry, |
128 | * or boot with "acpi_osi=Linux" | ||
139 | */ | 129 | */ |
140 | #define OSI_LINUX_ENABLE 0 | ||
141 | 130 | ||
142 | static struct osi_linux { | 131 | static struct osi_linux { |
143 | unsigned int enable:1; | 132 | unsigned int enable:1; |
144 | unsigned int dmi:1; | 133 | unsigned int dmi:1; |
145 | unsigned int cmdline:1; | 134 | unsigned int cmdline:1; |
146 | unsigned int known:1; | 135 | unsigned int known:1; |
147 | } osi_linux = { OSI_LINUX_ENABLE, 0, 0, 0}; | 136 | } osi_linux = { 0, 0, 0, 0}; |
148 | 137 | ||
149 | static void __init acpi_request_region (struct acpi_generic_address *addr, | 138 | static void __init acpi_request_region (struct acpi_generic_address *addr, |
150 | unsigned int length, char *desc) | 139 | unsigned int length, char *desc) |
@@ -1296,34 +1285,6 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) | |||
1296 | return (AE_OK); | 1285 | return (AE_OK); |
1297 | } | 1286 | } |
1298 | 1287 | ||
1299 | /** | ||
1300 | * acpi_dmi_dump - dump DMI slots needed for blacklist entry | ||
1301 | * | ||
1302 | * Returns 0 on success | ||
1303 | */ | ||
1304 | static int acpi_dmi_dump(void) | ||
1305 | { | ||
1306 | |||
1307 | if (!dmi_available) | ||
1308 | return -1; | ||
1309 | |||
1310 | printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n", | ||
1311 | dmi_get_system_info(DMI_SYS_VENDOR)); | ||
1312 | printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n", | ||
1313 | dmi_get_system_info(DMI_PRODUCT_NAME)); | ||
1314 | printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n", | ||
1315 | dmi_get_system_info(DMI_PRODUCT_VERSION)); | ||
1316 | printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n", | ||
1317 | dmi_get_system_info(DMI_BOARD_NAME)); | ||
1318 | printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n", | ||
1319 | dmi_get_system_info(DMI_BIOS_VENDOR)); | ||
1320 | printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n", | ||
1321 | dmi_get_system_info(DMI_BIOS_DATE)); | ||
1322 | |||
1323 | return 0; | ||
1324 | } | ||
1325 | |||
1326 | |||
1327 | /****************************************************************************** | 1288 | /****************************************************************************** |
1328 | * | 1289 | * |
1329 | * FUNCTION: acpi_os_validate_interface | 1290 | * FUNCTION: acpi_os_validate_interface |
@@ -1350,21 +1311,6 @@ acpi_os_validate_interface (char *interface) | |||
1350 | osi_linux.cmdline ? " via cmdline" : | 1311 | osi_linux.cmdline ? " via cmdline" : |
1351 | osi_linux.dmi ? " via DMI" : ""); | 1312 | osi_linux.dmi ? " via DMI" : ""); |
1352 | 1313 | ||
1353 | if (!osi_linux.dmi) { | ||
1354 | if (acpi_dmi_dump()) | ||
1355 | printk(KERN_NOTICE PREFIX | ||
1356 | "[please extract dmidecode output]\n"); | ||
1357 | printk(KERN_NOTICE PREFIX | ||
1358 | "Please send DMI info above to " | ||
1359 | "linux-acpi@vger.kernel.org\n"); | ||
1360 | } | ||
1361 | if (!osi_linux.known && !osi_linux.cmdline) { | ||
1362 | printk(KERN_NOTICE PREFIX | ||
1363 | "If \"acpi_osi=%sLinux\" works better, " | ||
1364 | "please notify linux-acpi@vger.kernel.org\n", | ||
1365 | osi_linux.enable ? "!" : ""); | ||
1366 | } | ||
1367 | |||
1368 | if (osi_linux.enable) | 1314 | if (osi_linux.enable) |
1369 | return AE_OK; | 1315 | return AE_OK; |
1370 | } | 1316 | } |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index bd5253ee5c85..39b7233c3485 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -751,16 +751,6 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
751 | if (!acpi_match_device_ids(device, button_device_ids)) | 751 | if (!acpi_match_device_ids(device, button_device_ids)) |
752 | device->wakeup.flags.run_wake = 1; | 752 | device->wakeup.flags.run_wake = 1; |
753 | 753 | ||
754 | /* | ||
755 | * Don't set Power button GPE as run_wake | ||
756 | * if Fixed Power button is used | ||
757 | */ | ||
758 | if (!strcmp(device->pnp.hardware_id, "PNP0C0C") && | ||
759 | !(acpi_gbl_FADT.flags & ACPI_FADT_POWER_BUTTON)) { | ||
760 | device->wakeup.flags.run_wake = 0; | ||
761 | device->wakeup.flags.valid = 0; | ||
762 | } | ||
763 | |||
764 | end: | 754 | end: |
765 | if (ACPI_FAILURE(status)) | 755 | if (ACPI_FAILURE(status)) |
766 | device->flags.wake_capable = 0; | 756 | device->flags.wake_capable = 0; |
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 80c0868d0480..28a691cc625e 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -90,6 +90,18 @@ void __init acpi_old_suspend_ordering(void) | |||
90 | old_suspend_ordering = true; | 90 | old_suspend_ordering = true; |
91 | } | 91 | } |
92 | 92 | ||
93 | /* | ||
94 | * According to the ACPI specification the BIOS should make sure that ACPI is | ||
95 | * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, | ||
96 | * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI | ||
97 | * on such systems during resume. Unfortunately that doesn't help in | ||
98 | * particularly pathological cases in which SCI_EN has to be set directly on | ||
99 | * resume, although the specification states very clearly that this flag is | ||
100 | * owned by the hardware. The set_sci_en_on_resume variable will be set in such | ||
101 | * cases. | ||
102 | */ | ||
103 | static bool set_sci_en_on_resume; | ||
104 | |||
93 | /** | 105 | /** |
94 | * acpi_pm_disable_gpes - Disable the GPEs. | 106 | * acpi_pm_disable_gpes - Disable the GPEs. |
95 | */ | 107 | */ |
@@ -235,7 +247,11 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
235 | } | 247 | } |
236 | 248 | ||
237 | /* If ACPI is not enabled by the BIOS, we need to enable it here. */ | 249 | /* If ACPI is not enabled by the BIOS, we need to enable it here. */ |
238 | acpi_enable(); | 250 | if (set_sci_en_on_resume) |
251 | acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1); | ||
252 | else | ||
253 | acpi_enable(); | ||
254 | |||
239 | /* Reprogram control registers and execute _BFS */ | 255 | /* Reprogram control registers and execute _BFS */ |
240 | acpi_leave_sleep_state_prep(acpi_state); | 256 | acpi_leave_sleep_state_prep(acpi_state); |
241 | 257 | ||
@@ -323,6 +339,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d) | |||
323 | return 0; | 339 | return 0; |
324 | } | 340 | } |
325 | 341 | ||
342 | static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d) | ||
343 | { | ||
344 | set_sci_en_on_resume = true; | ||
345 | return 0; | ||
346 | } | ||
347 | |||
326 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | 348 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { |
327 | { | 349 | { |
328 | .callback = init_old_suspend_ordering, | 350 | .callback = init_old_suspend_ordering, |
@@ -340,6 +362,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
340 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), | 362 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), |
341 | }, | 363 | }, |
342 | }, | 364 | }, |
365 | { | ||
366 | .callback = init_set_sci_en_on_resume, | ||
367 | .ident = "Apple MacBook 1,1", | ||
368 | .matches = { | ||
369 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), | ||
370 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), | ||
371 | }, | ||
372 | }, | ||
373 | { | ||
374 | .callback = init_set_sci_en_on_resume, | ||
375 | .ident = "Apple MacMini 1,1", | ||
376 | .matches = { | ||
377 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), | ||
378 | DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), | ||
379 | }, | ||
380 | }, | ||
343 | {}, | 381 | {}, |
344 | }; | 382 | }; |
345 | #endif /* CONFIG_SUSPEND */ | 383 | #endif /* CONFIG_SUSPEND */ |
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 66aac06f2ac5..25f531d892de 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c | |||
@@ -848,8 +848,6 @@ static int __init toshiba_acpi_init(void) | |||
848 | ret = input_register_polled_device(toshiba_acpi.poll_dev); | 848 | ret = input_register_polled_device(toshiba_acpi.poll_dev); |
849 | if (ret) { | 849 | if (ret) { |
850 | printk(MY_ERR "unable to register kill-switch input device\n"); | 850 | printk(MY_ERR "unable to register kill-switch input device\n"); |
851 | rfkill_free(toshiba_acpi.rfk_dev); | ||
852 | toshiba_acpi.rfk_dev = NULL; | ||
853 | toshiba_acpi_exit(); | 851 | toshiba_acpi_exit(); |
854 | return ret; | 852 | return ret; |
855 | } | 853 | } |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e827be36ee8d..f844941089bb 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -259,34 +259,26 @@ acpi_evaluate_integer(acpi_handle handle, | |||
259 | struct acpi_object_list *arguments, unsigned long long *data) | 259 | struct acpi_object_list *arguments, unsigned long long *data) |
260 | { | 260 | { |
261 | acpi_status status = AE_OK; | 261 | acpi_status status = AE_OK; |
262 | union acpi_object *element; | 262 | union acpi_object element; |
263 | struct acpi_buffer buffer = { 0, NULL }; | 263 | struct acpi_buffer buffer = { 0, NULL }; |
264 | 264 | ||
265 | |||
266 | if (!data) | 265 | if (!data) |
267 | return AE_BAD_PARAMETER; | 266 | return AE_BAD_PARAMETER; |
268 | 267 | ||
269 | element = kzalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); | ||
270 | if (!element) | ||
271 | return AE_NO_MEMORY; | ||
272 | |||
273 | buffer.length = sizeof(union acpi_object); | 268 | buffer.length = sizeof(union acpi_object); |
274 | buffer.pointer = element; | 269 | buffer.pointer = &element; |
275 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); | 270 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); |
276 | if (ACPI_FAILURE(status)) { | 271 | if (ACPI_FAILURE(status)) { |
277 | acpi_util_eval_error(handle, pathname, status); | 272 | acpi_util_eval_error(handle, pathname, status); |
278 | kfree(element); | ||
279 | return status; | 273 | return status; |
280 | } | 274 | } |
281 | 275 | ||
282 | if (element->type != ACPI_TYPE_INTEGER) { | 276 | if (element.type != ACPI_TYPE_INTEGER) { |
283 | acpi_util_eval_error(handle, pathname, AE_BAD_DATA); | 277 | acpi_util_eval_error(handle, pathname, AE_BAD_DATA); |
284 | kfree(element); | ||
285 | return AE_BAD_DATA; | 278 | return AE_BAD_DATA; |
286 | } | 279 | } |
287 | 280 | ||
288 | *data = element->integer.value; | 281 | *data = element.integer.value; |
289 | kfree(element); | ||
290 | 282 | ||
291 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); | 283 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); |
292 | 284 | ||
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 12de1fdaa6c6..9364dc554257 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -2847,7 +2847,7 @@ static void do_cciss_request(struct request_queue *q) | |||
2847 | h->maxSG = seg; | 2847 | h->maxSG = seg; |
2848 | 2848 | ||
2849 | #ifdef CCISS_DEBUG | 2849 | #ifdef CCISS_DEBUG |
2850 | printk(KERN_DEBUG "cciss: Submitting %d sectors in %d segments\n", | 2850 | printk(KERN_DEBUG "cciss: Submitting %lu sectors in %d segments\n", |
2851 | creq->nr_sectors, seg); | 2851 | creq->nr_sectors, seg); |
2852 | #endif /* CCISS_DEBUG */ | 2852 | #endif /* CCISS_DEBUG */ |
2853 | 2853 | ||
@@ -3197,7 +3197,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3197 | 3197 | ||
3198 | c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */ | 3198 | c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */ |
3199 | #ifdef CCISS_DEBUG | 3199 | #ifdef CCISS_DEBUG |
3200 | printk("address 0 = %x\n", c->paddr); | 3200 | printk("address 0 = %lx\n", c->paddr); |
3201 | #endif /* CCISS_DEBUG */ | 3201 | #endif /* CCISS_DEBUG */ |
3202 | c->vaddr = remap_pci_mem(c->paddr, 0x250); | 3202 | c->vaddr = remap_pci_mem(c->paddr, 0x250); |
3203 | 3203 | ||
@@ -3224,7 +3224,8 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3224 | #endif /* CCISS_DEBUG */ | 3224 | #endif /* CCISS_DEBUG */ |
3225 | cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr); | 3225 | cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr); |
3226 | #ifdef CCISS_DEBUG | 3226 | #ifdef CCISS_DEBUG |
3227 | printk("cfg base address index = %x\n", cfg_base_addr_index); | 3227 | printk("cfg base address index = %llx\n", |
3228 | (unsigned long long)cfg_base_addr_index); | ||
3228 | #endif /* CCISS_DEBUG */ | 3229 | #endif /* CCISS_DEBUG */ |
3229 | if (cfg_base_addr_index == -1) { | 3230 | if (cfg_base_addr_index == -1) { |
3230 | printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n"); | 3231 | printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n"); |
@@ -3234,7 +3235,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3234 | 3235 | ||
3235 | cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET); | 3236 | cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET); |
3236 | #ifdef CCISS_DEBUG | 3237 | #ifdef CCISS_DEBUG |
3237 | printk("cfg offset = %x\n", cfg_offset); | 3238 | printk("cfg offset = %llx\n", (unsigned long long)cfg_offset); |
3238 | #endif /* CCISS_DEBUG */ | 3239 | #endif /* CCISS_DEBUG */ |
3239 | c->cfgtable = remap_pci_mem(pci_resource_start(pdev, | 3240 | c->cfgtable = remap_pci_mem(pci_resource_start(pdev, |
3240 | cfg_base_addr_index) + | 3241 | cfg_base_addr_index) + |
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 0f004b65ec03..03f95ec08f59 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c | |||
@@ -27,7 +27,7 @@ | |||
27 | static int uninorth_rev; | 27 | static int uninorth_rev; |
28 | static int is_u3; | 28 | static int is_u3; |
29 | 29 | ||
30 | static char __devinitdata *aperture = NULL; | 30 | static char *aperture = NULL; |
31 | 31 | ||
32 | static int uninorth_fetch_size(void) | 32 | static int uninorth_fetch_size(void) |
33 | { | 33 | { |
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index 44e5d60f517e..4b10770fa937 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c | |||
@@ -3739,7 +3739,7 @@ static int stli_getbrdnr(void) | |||
3739 | * do is go probing around in the usual places hoping we can find it. | 3739 | * do is go probing around in the usual places hoping we can find it. |
3740 | */ | 3740 | */ |
3741 | 3741 | ||
3742 | static int stli_findeisabrds(void) | 3742 | static int __init stli_findeisabrds(void) |
3743 | { | 3743 | { |
3744 | struct stlibrd *brdp; | 3744 | struct stlibrd *brdp; |
3745 | unsigned int iobase, eid, i; | 3745 | unsigned int iobase, eid, i; |
@@ -3935,7 +3935,7 @@ static struct stlibrd *stli_allocbrd(void) | |||
3935 | * can find. | 3935 | * can find. |
3936 | */ | 3936 | */ |
3937 | 3937 | ||
3938 | static int stli_initbrds(void) | 3938 | static int __init stli_initbrds(void) |
3939 | { | 3939 | { |
3940 | struct stlibrd *brdp, *nxtbrdp; | 3940 | struct stlibrd *brdp, *nxtbrdp; |
3941 | struct stlconf conf; | 3941 | struct stlconf conf; |
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index b6ad3ac5916e..24607669a52b 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -1357,7 +1357,7 @@ static int hw_supports(struct device *dev, __be32 desc_hdr_template) | |||
1357 | return ret; | 1357 | return ret; |
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | static int __devexit talitos_remove(struct of_device *ofdev) | 1360 | static int talitos_remove(struct of_device *ofdev) |
1361 | { | 1361 | { |
1362 | struct device *dev = &ofdev->dev; | 1362 | struct device *dev = &ofdev->dev; |
1363 | struct talitos_private *priv = dev_get_drvdata(dev); | 1363 | struct talitos_private *priv = dev_get_drvdata(dev); |
@@ -1622,7 +1622,7 @@ static struct of_platform_driver talitos_driver = { | |||
1622 | .name = "talitos", | 1622 | .name = "talitos", |
1623 | .match_table = talitos_match, | 1623 | .match_table = talitos_match, |
1624 | .probe = talitos_probe, | 1624 | .probe = talitos_probe, |
1625 | .remove = __devexit_p(talitos_remove), | 1625 | .remove = talitos_remove, |
1626 | }; | 1626 | }; |
1627 | 1627 | ||
1628 | static int __init talitos_init(void) | 1628 | static int __init talitos_init(void) |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index faa1cc66e9cf..82020abc329e 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -1134,7 +1134,7 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip) | |||
1134 | continue; | 1134 | continue; |
1135 | 1135 | ||
1136 | is_out = test_bit(FLAG_IS_OUT, &gdesc->flags); | 1136 | is_out = test_bit(FLAG_IS_OUT, &gdesc->flags); |
1137 | seq_printf(s, " gpio-%-3d (%-12s) %s %s", | 1137 | seq_printf(s, " gpio-%-3d (%-20.20s) %s %s", |
1138 | gpio, gdesc->label, | 1138 | gpio, gdesc->label, |
1139 | is_out ? "out" : "in ", | 1139 | is_out ? "out" : "in ", |
1140 | chip->get | 1140 | chip->get |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 3ab1e9cc4692..996097acb5e7 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -305,6 +305,8 @@ static void drm_cleanup(struct drm_device * dev) | |||
305 | return; | 305 | return; |
306 | } | 306 | } |
307 | 307 | ||
308 | drm_vblank_cleanup(dev); | ||
309 | |||
308 | drm_lastclose(dev); | 310 | drm_lastclose(dev); |
309 | 311 | ||
310 | if (drm_core_has_MTRR(dev) && drm_core_has_AGP(dev) && | 312 | if (drm_core_has_MTRR(dev) && drm_core_has_AGP(dev) && |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 15c8dabc3e97..1e787f894b3c 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -94,7 +94,7 @@ static void vblank_disable_fn(unsigned long arg) | |||
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | static void drm_vblank_cleanup(struct drm_device *dev) | 97 | void drm_vblank_cleanup(struct drm_device *dev) |
98 | { | 98 | { |
99 | /* Bail if the driver didn't call drm_vblank_init() */ | 99 | /* Bail if the driver didn't call drm_vblank_init() */ |
100 | if (dev->num_crtcs == 0) | 100 | if (dev->num_crtcs == 0) |
@@ -278,8 +278,6 @@ int drm_irq_uninstall(struct drm_device * dev) | |||
278 | 278 | ||
279 | free_irq(dev->pdev->irq, dev); | 279 | free_irq(dev->pdev->irq, dev); |
280 | 280 | ||
281 | drm_vblank_cleanup(dev); | ||
282 | |||
283 | return 0; | 281 | return 0; |
284 | } | 282 | } |
285 | EXPORT_SYMBOL(drm_irq_uninstall); | 283 | EXPORT_SYMBOL(drm_irq_uninstall); |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 0d215e38606a..ba89b42f790a 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -856,6 +856,13 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
856 | 856 | ||
857 | spin_lock_init(&dev_priv->user_irq_lock); | 857 | spin_lock_init(&dev_priv->user_irq_lock); |
858 | 858 | ||
859 | ret = drm_vblank_init(dev, I915_NUM_PIPE); | ||
860 | |||
861 | if (ret) { | ||
862 | (void) i915_driver_unload(dev); | ||
863 | return ret; | ||
864 | } | ||
865 | |||
859 | return ret; | 866 | return ret; |
860 | } | 867 | } |
861 | 868 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index ef1c0b8f8d07..0a4f39b9a0ec 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -47,6 +47,8 @@ enum pipe { | |||
47 | PIPE_B, | 47 | PIPE_B, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | #define I915_NUM_PIPE 2 | ||
51 | |||
50 | /* Interface history: | 52 | /* Interface history: |
51 | * | 53 | * |
52 | * 1.1: Original. | 54 | * 1.1: Original. |
@@ -132,6 +134,7 @@ typedef struct drm_i915_private { | |||
132 | int user_irq_refcount; | 134 | int user_irq_refcount; |
133 | /** Cached value of IMR to avoid reads in updating the bitfield */ | 135 | /** Cached value of IMR to avoid reads in updating the bitfield */ |
134 | u32 irq_mask_reg; | 136 | u32 irq_mask_reg; |
137 | u32 pipestat[2]; | ||
135 | 138 | ||
136 | int tex_lru_log_granularity; | 139 | int tex_lru_log_granularity; |
137 | int allow_batchbuffer; | 140 | int allow_batchbuffer; |
@@ -147,6 +150,7 @@ typedef struct drm_i915_private { | |||
147 | u32 saveDSPBCNTR; | 150 | u32 saveDSPBCNTR; |
148 | u32 saveDSPARB; | 151 | u32 saveDSPARB; |
149 | u32 saveRENDERSTANDBY; | 152 | u32 saveRENDERSTANDBY; |
153 | u32 saveHWS; | ||
150 | u32 savePIPEACONF; | 154 | u32 savePIPEACONF; |
151 | u32 savePIPEBCONF; | 155 | u32 savePIPEBCONF; |
152 | u32 savePIPEASRC; | 156 | u32 savePIPEASRC; |
@@ -446,6 +450,13 @@ extern int i915_vblank_swap(struct drm_device *dev, void *data, | |||
446 | struct drm_file *file_priv); | 450 | struct drm_file *file_priv); |
447 | extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask); | 451 | extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask); |
448 | 452 | ||
453 | void | ||
454 | i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); | ||
455 | |||
456 | void | ||
457 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); | ||
458 | |||
459 | |||
449 | /* i915_mem.c */ | 460 | /* i915_mem.c */ |
450 | extern int i915_mem_alloc(struct drm_device *dev, void *data, | 461 | extern int i915_mem_alloc(struct drm_device *dev, void *data, |
451 | struct drm_file *file_priv); | 462 | struct drm_file *file_priv); |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6b4a2bd20640..54bb0d0e49b8 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include "i915_drv.h" | 31 | #include "i915_drv.h" |
32 | #include <linux/swap.h> | 32 | #include <linux/swap.h> |
33 | 33 | ||
34 | #define I915_GEM_GPU_DOMAINS (~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT)) | ||
35 | |||
34 | static int | 36 | static int |
35 | i915_gem_object_set_domain(struct drm_gem_object *obj, | 37 | i915_gem_object_set_domain(struct drm_gem_object *obj, |
36 | uint32_t read_domains, | 38 | uint32_t read_domains, |
@@ -83,20 +85,14 @@ int | |||
83 | i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, | 85 | i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, |
84 | struct drm_file *file_priv) | 86 | struct drm_file *file_priv) |
85 | { | 87 | { |
86 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
87 | struct drm_i915_gem_get_aperture *args = data; | 88 | struct drm_i915_gem_get_aperture *args = data; |
88 | struct drm_i915_gem_object *obj_priv; | ||
89 | 89 | ||
90 | if (!(dev->driver->driver_features & DRIVER_GEM)) | 90 | if (!(dev->driver->driver_features & DRIVER_GEM)) |
91 | return -ENODEV; | 91 | return -ENODEV; |
92 | 92 | ||
93 | args->aper_size = dev->gtt_total; | 93 | args->aper_size = dev->gtt_total; |
94 | args->aper_available_size = args->aper_size; | 94 | args->aper_available_size = (args->aper_size - |
95 | 95 | atomic_read(&dev->pin_memory)); | |
96 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { | ||
97 | if (obj_priv->pin_count > 0) | ||
98 | args->aper_available_size -= obj_priv->obj->size; | ||
99 | } | ||
100 | 96 | ||
101 | return 0; | 97 | return 0; |
102 | } | 98 | } |
@@ -1870,17 +1866,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, | |||
1870 | 1866 | ||
1871 | for (i = 0; i < args->buffer_count; i++) { | 1867 | for (i = 0; i < args->buffer_count; i++) { |
1872 | struct drm_gem_object *obj = object_list[i]; | 1868 | struct drm_gem_object *obj = object_list[i]; |
1873 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
1874 | |||
1875 | if (obj_priv->gtt_space == NULL) { | ||
1876 | /* We evicted the buffer in the process of validating | ||
1877 | * our set of buffers in. We could try to recover by | ||
1878 | * kicking them everything out and trying again from | ||
1879 | * the start. | ||
1880 | */ | ||
1881 | ret = -ENOMEM; | ||
1882 | goto err; | ||
1883 | } | ||
1884 | 1869 | ||
1885 | /* make sure all previous memory operations have passed */ | 1870 | /* make sure all previous memory operations have passed */ |
1886 | ret = i915_gem_object_set_domain(obj, | 1871 | ret = i915_gem_object_set_domain(obj, |
@@ -2299,29 +2284,52 @@ i915_gem_idle(struct drm_device *dev) | |||
2299 | 2284 | ||
2300 | i915_gem_retire_requests(dev); | 2285 | i915_gem_retire_requests(dev); |
2301 | 2286 | ||
2302 | /* Active and flushing should now be empty as we've | 2287 | if (!dev_priv->mm.wedged) { |
2303 | * waited for a sequence higher than any pending execbuffer | 2288 | /* Active and flushing should now be empty as we've |
2304 | */ | 2289 | * waited for a sequence higher than any pending execbuffer |
2305 | BUG_ON(!list_empty(&dev_priv->mm.active_list)); | 2290 | */ |
2306 | BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); | 2291 | WARN_ON(!list_empty(&dev_priv->mm.active_list)); |
2292 | WARN_ON(!list_empty(&dev_priv->mm.flushing_list)); | ||
2293 | /* Request should now be empty as we've also waited | ||
2294 | * for the last request in the list | ||
2295 | */ | ||
2296 | WARN_ON(!list_empty(&dev_priv->mm.request_list)); | ||
2297 | } | ||
2307 | 2298 | ||
2308 | /* Request should now be empty as we've also waited | 2299 | /* Empty the active and flushing lists to inactive. If there's |
2309 | * for the last request in the list | 2300 | * anything left at this point, it means that we're wedged and |
2301 | * nothing good's going to happen by leaving them there. So strip | ||
2302 | * the GPU domains and just stuff them onto inactive. | ||
2310 | */ | 2303 | */ |
2311 | BUG_ON(!list_empty(&dev_priv->mm.request_list)); | 2304 | while (!list_empty(&dev_priv->mm.active_list)) { |
2305 | struct drm_i915_gem_object *obj_priv; | ||
2312 | 2306 | ||
2313 | /* Move all buffers out of the GTT. */ | 2307 | obj_priv = list_first_entry(&dev_priv->mm.active_list, |
2308 | struct drm_i915_gem_object, | ||
2309 | list); | ||
2310 | obj_priv->obj->write_domain &= ~I915_GEM_GPU_DOMAINS; | ||
2311 | i915_gem_object_move_to_inactive(obj_priv->obj); | ||
2312 | } | ||
2313 | |||
2314 | while (!list_empty(&dev_priv->mm.flushing_list)) { | ||
2315 | struct drm_i915_gem_object *obj_priv; | ||
2316 | |||
2317 | obj_priv = list_first_entry(&dev_priv->mm.active_list, | ||
2318 | struct drm_i915_gem_object, | ||
2319 | list); | ||
2320 | obj_priv->obj->write_domain &= ~I915_GEM_GPU_DOMAINS; | ||
2321 | i915_gem_object_move_to_inactive(obj_priv->obj); | ||
2322 | } | ||
2323 | |||
2324 | |||
2325 | /* Move all inactive buffers out of the GTT. */ | ||
2314 | ret = i915_gem_evict_from_list(dev, &dev_priv->mm.inactive_list); | 2326 | ret = i915_gem_evict_from_list(dev, &dev_priv->mm.inactive_list); |
2327 | WARN_ON(!list_empty(&dev_priv->mm.inactive_list)); | ||
2315 | if (ret) { | 2328 | if (ret) { |
2316 | mutex_unlock(&dev->struct_mutex); | 2329 | mutex_unlock(&dev->struct_mutex); |
2317 | return ret; | 2330 | return ret; |
2318 | } | 2331 | } |
2319 | 2332 | ||
2320 | BUG_ON(!list_empty(&dev_priv->mm.active_list)); | ||
2321 | BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); | ||
2322 | BUG_ON(!list_empty(&dev_priv->mm.inactive_list)); | ||
2323 | BUG_ON(!list_empty(&dev_priv->mm.request_list)); | ||
2324 | |||
2325 | i915_gem_cleanup_ringbuffer(dev); | 2333 | i915_gem_cleanup_ringbuffer(dev); |
2326 | mutex_unlock(&dev->struct_mutex); | 2334 | mutex_unlock(&dev->struct_mutex); |
2327 | 2335 | ||
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 82752d6177a4..fe3d9cc72bf5 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -33,11 +33,23 @@ | |||
33 | 33 | ||
34 | #define MAX_NOPID ((u32)~0) | 34 | #define MAX_NOPID ((u32)~0) |
35 | 35 | ||
36 | /** These are the interrupts used by the driver */ | 36 | /** |
37 | #define I915_INTERRUPT_ENABLE_MASK (I915_USER_INTERRUPT | \ | 37 | * Interrupts that are always left unmasked. |
38 | I915_ASLE_INTERRUPT | \ | 38 | * |
39 | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \ | 39 | * Since pipe events are edge-triggered from the PIPESTAT register to IIR, |
40 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) | 40 | * we leave them always unmasked in IMR and then control enabling them through |
41 | * PIPESTAT alone. | ||
42 | */ | ||
43 | #define I915_INTERRUPT_ENABLE_FIX (I915_ASLE_INTERRUPT | \ | ||
44 | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \ | ||
45 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) | ||
46 | |||
47 | /** Interrupts that we mask and unmask at runtime. */ | ||
48 | #define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT) | ||
49 | |||
50 | /** These are all of the interrupts used by the driver */ | ||
51 | #define I915_INTERRUPT_ENABLE_MASK (I915_INTERRUPT_ENABLE_FIX | \ | ||
52 | I915_INTERRUPT_ENABLE_VAR) | ||
41 | 53 | ||
42 | void | 54 | void |
43 | i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask) | 55 | i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask) |
@@ -59,6 +71,41 @@ i915_disable_irq(drm_i915_private_t *dev_priv, u32 mask) | |||
59 | } | 71 | } |
60 | } | 72 | } |
61 | 73 | ||
74 | static inline u32 | ||
75 | i915_pipestat(int pipe) | ||
76 | { | ||
77 | if (pipe == 0) | ||
78 | return PIPEASTAT; | ||
79 | if (pipe == 1) | ||
80 | return PIPEBSTAT; | ||
81 | BUG_ON(1); | ||
82 | } | ||
83 | |||
84 | void | ||
85 | i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) | ||
86 | { | ||
87 | if ((dev_priv->pipestat[pipe] & mask) != mask) { | ||
88 | u32 reg = i915_pipestat(pipe); | ||
89 | |||
90 | dev_priv->pipestat[pipe] |= mask; | ||
91 | /* Enable the interrupt, clear any pending status */ | ||
92 | I915_WRITE(reg, dev_priv->pipestat[pipe] | (mask >> 16)); | ||
93 | (void) I915_READ(reg); | ||
94 | } | ||
95 | } | ||
96 | |||
97 | void | ||
98 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) | ||
99 | { | ||
100 | if ((dev_priv->pipestat[pipe] & mask) != 0) { | ||
101 | u32 reg = i915_pipestat(pipe); | ||
102 | |||
103 | dev_priv->pipestat[pipe] &= ~mask; | ||
104 | I915_WRITE(reg, dev_priv->pipestat[pipe]); | ||
105 | (void) I915_READ(reg); | ||
106 | } | ||
107 | } | ||
108 | |||
62 | /** | 109 | /** |
63 | * i915_pipe_enabled - check if a pipe is enabled | 110 | * i915_pipe_enabled - check if a pipe is enabled |
64 | * @dev: DRM device | 111 | * @dev: DRM device |
@@ -121,80 +168,102 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
121 | { | 168 | { |
122 | struct drm_device *dev = (struct drm_device *) arg; | 169 | struct drm_device *dev = (struct drm_device *) arg; |
123 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 170 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
124 | u32 iir; | 171 | u32 iir, new_iir; |
125 | u32 pipea_stats, pipeb_stats; | 172 | u32 pipea_stats, pipeb_stats; |
173 | u32 vblank_status; | ||
174 | u32 vblank_enable; | ||
126 | int vblank = 0; | 175 | int vblank = 0; |
176 | unsigned long irqflags; | ||
177 | int irq_received; | ||
178 | int ret = IRQ_NONE; | ||
127 | 179 | ||
128 | atomic_inc(&dev_priv->irq_received); | 180 | atomic_inc(&dev_priv->irq_received); |
129 | 181 | ||
130 | if (dev->pdev->msi_enabled) | ||
131 | I915_WRITE(IMR, ~0); | ||
132 | iir = I915_READ(IIR); | 182 | iir = I915_READ(IIR); |
133 | 183 | ||
134 | if (iir == 0) { | 184 | if (IS_I965G(dev)) { |
135 | if (dev->pdev->msi_enabled) { | 185 | vblank_status = I915_START_VBLANK_INTERRUPT_STATUS; |
136 | I915_WRITE(IMR, dev_priv->irq_mask_reg); | 186 | vblank_enable = PIPE_START_VBLANK_INTERRUPT_ENABLE; |
137 | (void) I915_READ(IMR); | 187 | } else { |
138 | } | 188 | vblank_status = I915_VBLANK_INTERRUPT_STATUS; |
139 | return IRQ_NONE; | 189 | vblank_enable = I915_VBLANK_INTERRUPT_ENABLE; |
140 | } | 190 | } |
141 | 191 | ||
142 | /* | 192 | for (;;) { |
143 | * Clear the PIPE(A|B)STAT regs before the IIR otherwise | 193 | irq_received = iir != 0; |
144 | * we may get extra interrupts. | 194 | |
145 | */ | 195 | /* Can't rely on pipestat interrupt bit in iir as it might |
146 | if (iir & I915_DISPLAY_PIPE_A_EVENT_INTERRUPT) { | 196 | * have been cleared after the pipestat interrupt was received. |
197 | * It doesn't set the bit in iir again, but it still produces | ||
198 | * interrupts (for non-MSI). | ||
199 | */ | ||
200 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | ||
147 | pipea_stats = I915_READ(PIPEASTAT); | 201 | pipea_stats = I915_READ(PIPEASTAT); |
148 | if (!(dev_priv->vblank_pipe & DRM_I915_VBLANK_PIPE_A)) | 202 | pipeb_stats = I915_READ(PIPEBSTAT); |
149 | pipea_stats &= ~(PIPE_START_VBLANK_INTERRUPT_ENABLE | | 203 | /* |
150 | PIPE_VBLANK_INTERRUPT_ENABLE); | 204 | * Clear the PIPE(A|B)STAT regs before the IIR |
151 | else if (pipea_stats & (PIPE_START_VBLANK_INTERRUPT_STATUS| | 205 | */ |
152 | PIPE_VBLANK_INTERRUPT_STATUS)) { | 206 | if (pipea_stats & 0x8000ffff) { |
207 | I915_WRITE(PIPEASTAT, pipea_stats); | ||
208 | irq_received = 1; | ||
209 | } | ||
210 | |||
211 | if (pipeb_stats & 0x8000ffff) { | ||
212 | I915_WRITE(PIPEBSTAT, pipeb_stats); | ||
213 | irq_received = 1; | ||
214 | } | ||
215 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | ||
216 | |||
217 | if (!irq_received) | ||
218 | break; | ||
219 | |||
220 | ret = IRQ_HANDLED; | ||
221 | |||
222 | I915_WRITE(IIR, iir); | ||
223 | new_iir = I915_READ(IIR); /* Flush posted writes */ | ||
224 | |||
225 | if (dev_priv->sarea_priv) | ||
226 | dev_priv->sarea_priv->last_dispatch = | ||
227 | READ_BREADCRUMB(dev_priv); | ||
228 | |||
229 | if (iir & I915_USER_INTERRUPT) { | ||
230 | dev_priv->mm.irq_gem_seqno = i915_get_gem_seqno(dev); | ||
231 | DRM_WAKEUP(&dev_priv->irq_queue); | ||
232 | } | ||
233 | |||
234 | if (pipea_stats & vblank_status) { | ||
153 | vblank++; | 235 | vblank++; |
154 | drm_handle_vblank(dev, 0); | 236 | drm_handle_vblank(dev, 0); |
155 | } | 237 | } |
156 | 238 | ||
157 | I915_WRITE(PIPEASTAT, pipea_stats); | 239 | if (pipeb_stats & vblank_status) { |
158 | } | ||
159 | if (iir & I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) { | ||
160 | pipeb_stats = I915_READ(PIPEBSTAT); | ||
161 | /* Ack the event */ | ||
162 | I915_WRITE(PIPEBSTAT, pipeb_stats); | ||
163 | |||
164 | /* The vblank interrupt gets enabled even if we didn't ask for | ||
165 | it, so make sure it's shut down again */ | ||
166 | if (!(dev_priv->vblank_pipe & DRM_I915_VBLANK_PIPE_B)) | ||
167 | pipeb_stats &= ~(PIPE_START_VBLANK_INTERRUPT_ENABLE | | ||
168 | PIPE_VBLANK_INTERRUPT_ENABLE); | ||
169 | else if (pipeb_stats & (PIPE_START_VBLANK_INTERRUPT_STATUS| | ||
170 | PIPE_VBLANK_INTERRUPT_STATUS)) { | ||
171 | vblank++; | 240 | vblank++; |
172 | drm_handle_vblank(dev, 1); | 241 | drm_handle_vblank(dev, 1); |
173 | } | 242 | } |
174 | 243 | ||
175 | if (pipeb_stats & I915_LEGACY_BLC_EVENT_STATUS) | 244 | if ((pipeb_stats & I915_LEGACY_BLC_EVENT_STATUS) || |
245 | (iir & I915_ASLE_INTERRUPT)) | ||
176 | opregion_asle_intr(dev); | 246 | opregion_asle_intr(dev); |
177 | I915_WRITE(PIPEBSTAT, pipeb_stats); | ||
178 | } | ||
179 | |||
180 | I915_WRITE(IIR, iir); | ||
181 | if (dev->pdev->msi_enabled) | ||
182 | I915_WRITE(IMR, dev_priv->irq_mask_reg); | ||
183 | (void) I915_READ(IIR); /* Flush posted writes */ | ||
184 | |||
185 | if (dev_priv->sarea_priv) | ||
186 | dev_priv->sarea_priv->last_dispatch = | ||
187 | READ_BREADCRUMB(dev_priv); | ||
188 | 247 | ||
189 | if (iir & I915_USER_INTERRUPT) { | 248 | /* With MSI, interrupts are only generated when iir |
190 | dev_priv->mm.irq_gem_seqno = i915_get_gem_seqno(dev); | 249 | * transitions from zero to nonzero. If another bit got |
191 | DRM_WAKEUP(&dev_priv->irq_queue); | 250 | * set while we were handling the existing iir bits, then |
251 | * we would never get another interrupt. | ||
252 | * | ||
253 | * This is fine on non-MSI as well, as if we hit this path | ||
254 | * we avoid exiting the interrupt handler only to generate | ||
255 | * another one. | ||
256 | * | ||
257 | * Note that for MSI this could cause a stray interrupt report | ||
258 | * if an interrupt landed in the time between writing IIR and | ||
259 | * the posting read. This should be rare enough to never | ||
260 | * trigger the 99% of 100,000 interrupts test for disabling | ||
261 | * stray interrupts. | ||
262 | */ | ||
263 | iir = new_iir; | ||
192 | } | 264 | } |
193 | 265 | ||
194 | if (iir & I915_ASLE_INTERRUPT) | 266 | return ret; |
195 | opregion_asle_intr(dev); | ||
196 | |||
197 | return IRQ_HANDLED; | ||
198 | } | 267 | } |
199 | 268 | ||
200 | static int i915_emit_irq(struct drm_device * dev) | 269 | static int i915_emit_irq(struct drm_device * dev) |
@@ -330,48 +399,16 @@ int i915_irq_wait(struct drm_device *dev, void *data, | |||
330 | int i915_enable_vblank(struct drm_device *dev, int pipe) | 399 | int i915_enable_vblank(struct drm_device *dev, int pipe) |
331 | { | 400 | { |
332 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 401 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
333 | u32 pipestat_reg = 0; | ||
334 | u32 pipestat; | ||
335 | u32 interrupt = 0; | ||
336 | unsigned long irqflags; | 402 | unsigned long irqflags; |
337 | 403 | ||
338 | switch (pipe) { | ||
339 | case 0: | ||
340 | pipestat_reg = PIPEASTAT; | ||
341 | interrupt = I915_DISPLAY_PIPE_A_EVENT_INTERRUPT; | ||
342 | break; | ||
343 | case 1: | ||
344 | pipestat_reg = PIPEBSTAT; | ||
345 | interrupt = I915_DISPLAY_PIPE_B_EVENT_INTERRUPT; | ||
346 | break; | ||
347 | default: | ||
348 | DRM_ERROR("tried to enable vblank on non-existent pipe %d\n", | ||
349 | pipe); | ||
350 | return 0; | ||
351 | } | ||
352 | |||
353 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | 404 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); |
354 | /* Enabling vblank events in IMR comes before PIPESTAT write, or | ||
355 | * there's a race where the PIPESTAT vblank bit gets set to 1, so | ||
356 | * the OR of enabled PIPESTAT bits goes to 1, so the PIPExEVENT in | ||
357 | * ISR flashes to 1, but the IIR bit doesn't get set to 1 because | ||
358 | * IMR masks it. It doesn't ever get set after we clear the masking | ||
359 | * in IMR because the ISR bit is edge, not level-triggered, on the | ||
360 | * OR of PIPESTAT bits. | ||
361 | */ | ||
362 | i915_enable_irq(dev_priv, interrupt); | ||
363 | pipestat = I915_READ(pipestat_reg); | ||
364 | if (IS_I965G(dev)) | 405 | if (IS_I965G(dev)) |
365 | pipestat |= PIPE_START_VBLANK_INTERRUPT_ENABLE; | 406 | i915_enable_pipestat(dev_priv, pipe, |
407 | PIPE_START_VBLANK_INTERRUPT_ENABLE); | ||
366 | else | 408 | else |
367 | pipestat |= PIPE_VBLANK_INTERRUPT_ENABLE; | 409 | i915_enable_pipestat(dev_priv, pipe, |
368 | /* Clear any stale interrupt status */ | 410 | PIPE_VBLANK_INTERRUPT_ENABLE); |
369 | pipestat |= (PIPE_START_VBLANK_INTERRUPT_STATUS | | ||
370 | PIPE_VBLANK_INTERRUPT_STATUS); | ||
371 | I915_WRITE(pipestat_reg, pipestat); | ||
372 | (void) I915_READ(pipestat_reg); /* Posting read */ | ||
373 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | 411 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); |
374 | |||
375 | return 0; | 412 | return 0; |
376 | } | 413 | } |
377 | 414 | ||
@@ -381,37 +418,12 @@ int i915_enable_vblank(struct drm_device *dev, int pipe) | |||
381 | void i915_disable_vblank(struct drm_device *dev, int pipe) | 418 | void i915_disable_vblank(struct drm_device *dev, int pipe) |
382 | { | 419 | { |
383 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 420 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
384 | u32 pipestat_reg = 0; | ||
385 | u32 pipestat; | ||
386 | u32 interrupt = 0; | ||
387 | unsigned long irqflags; | 421 | unsigned long irqflags; |
388 | 422 | ||
389 | switch (pipe) { | ||
390 | case 0: | ||
391 | pipestat_reg = PIPEASTAT; | ||
392 | interrupt = I915_DISPLAY_PIPE_A_EVENT_INTERRUPT; | ||
393 | break; | ||
394 | case 1: | ||
395 | pipestat_reg = PIPEBSTAT; | ||
396 | interrupt = I915_DISPLAY_PIPE_B_EVENT_INTERRUPT; | ||
397 | break; | ||
398 | default: | ||
399 | DRM_ERROR("tried to disable vblank on non-existent pipe %d\n", | ||
400 | pipe); | ||
401 | return; | ||
402 | break; | ||
403 | } | ||
404 | |||
405 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | 423 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); |
406 | i915_disable_irq(dev_priv, interrupt); | 424 | i915_disable_pipestat(dev_priv, pipe, |
407 | pipestat = I915_READ(pipestat_reg); | 425 | PIPE_VBLANK_INTERRUPT_ENABLE | |
408 | pipestat &= ~(PIPE_START_VBLANK_INTERRUPT_ENABLE | | 426 | PIPE_START_VBLANK_INTERRUPT_ENABLE); |
409 | PIPE_VBLANK_INTERRUPT_ENABLE); | ||
410 | /* Clear any stale interrupt status */ | ||
411 | pipestat |= (PIPE_START_VBLANK_INTERRUPT_STATUS | | ||
412 | PIPE_VBLANK_INTERRUPT_STATUS); | ||
413 | I915_WRITE(pipestat_reg, pipestat); | ||
414 | (void) I915_READ(pipestat_reg); /* Posting read */ | ||
415 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | 427 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); |
416 | } | 428 | } |
417 | 429 | ||
@@ -476,32 +488,35 @@ void i915_driver_irq_preinstall(struct drm_device * dev) | |||
476 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 488 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
477 | 489 | ||
478 | I915_WRITE(HWSTAM, 0xeffe); | 490 | I915_WRITE(HWSTAM, 0xeffe); |
491 | I915_WRITE(PIPEASTAT, 0); | ||
492 | I915_WRITE(PIPEBSTAT, 0); | ||
479 | I915_WRITE(IMR, 0xffffffff); | 493 | I915_WRITE(IMR, 0xffffffff); |
480 | I915_WRITE(IER, 0x0); | 494 | I915_WRITE(IER, 0x0); |
495 | (void) I915_READ(IER); | ||
481 | } | 496 | } |
482 | 497 | ||
483 | int i915_driver_irq_postinstall(struct drm_device *dev) | 498 | int i915_driver_irq_postinstall(struct drm_device *dev) |
484 | { | 499 | { |
485 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 500 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
486 | int ret, num_pipes = 2; | ||
487 | |||
488 | /* Set initial unmasked IRQs to just the selected vblank pipes. */ | ||
489 | dev_priv->irq_mask_reg = ~0; | ||
490 | |||
491 | ret = drm_vblank_init(dev, num_pipes); | ||
492 | if (ret) | ||
493 | return ret; | ||
494 | 501 | ||
495 | dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; | 502 | dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; |
496 | dev_priv->irq_mask_reg &= ~I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT; | ||
497 | dev_priv->irq_mask_reg &= ~I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT; | ||
498 | 503 | ||
499 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ | 504 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ |
500 | 505 | ||
501 | dev_priv->irq_mask_reg &= I915_INTERRUPT_ENABLE_MASK; | 506 | /* Unmask the interrupts that we always want on. */ |
507 | dev_priv->irq_mask_reg = ~I915_INTERRUPT_ENABLE_FIX; | ||
508 | |||
509 | dev_priv->pipestat[0] = 0; | ||
510 | dev_priv->pipestat[1] = 0; | ||
511 | |||
512 | /* Disable pipe interrupt enables, clear pending pipe status */ | ||
513 | I915_WRITE(PIPEASTAT, I915_READ(PIPEASTAT) & 0x8000ffff); | ||
514 | I915_WRITE(PIPEBSTAT, I915_READ(PIPEBSTAT) & 0x8000ffff); | ||
515 | /* Clear pending interrupt status */ | ||
516 | I915_WRITE(IIR, I915_READ(IIR)); | ||
502 | 517 | ||
503 | I915_WRITE(IMR, dev_priv->irq_mask_reg); | ||
504 | I915_WRITE(IER, I915_INTERRUPT_ENABLE_MASK); | 518 | I915_WRITE(IER, I915_INTERRUPT_ENABLE_MASK); |
519 | I915_WRITE(IMR, dev_priv->irq_mask_reg); | ||
505 | (void) I915_READ(IER); | 520 | (void) I915_READ(IER); |
506 | 521 | ||
507 | opregion_enable_asle(dev); | 522 | opregion_enable_asle(dev); |
@@ -513,7 +528,6 @@ int i915_driver_irq_postinstall(struct drm_device *dev) | |||
513 | void i915_driver_irq_uninstall(struct drm_device * dev) | 528 | void i915_driver_irq_uninstall(struct drm_device * dev) |
514 | { | 529 | { |
515 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 530 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
516 | u32 temp; | ||
517 | 531 | ||
518 | if (!dev_priv) | 532 | if (!dev_priv) |
519 | return; | 533 | return; |
@@ -521,13 +535,12 @@ void i915_driver_irq_uninstall(struct drm_device * dev) | |||
521 | dev_priv->vblank_pipe = 0; | 535 | dev_priv->vblank_pipe = 0; |
522 | 536 | ||
523 | I915_WRITE(HWSTAM, 0xffffffff); | 537 | I915_WRITE(HWSTAM, 0xffffffff); |
538 | I915_WRITE(PIPEASTAT, 0); | ||
539 | I915_WRITE(PIPEBSTAT, 0); | ||
524 | I915_WRITE(IMR, 0xffffffff); | 540 | I915_WRITE(IMR, 0xffffffff); |
525 | I915_WRITE(IER, 0x0); | 541 | I915_WRITE(IER, 0x0); |
526 | 542 | ||
527 | temp = I915_READ(PIPEASTAT); | 543 | I915_WRITE(PIPEASTAT, I915_READ(PIPEASTAT) & 0x8000ffff); |
528 | I915_WRITE(PIPEASTAT, temp); | 544 | I915_WRITE(PIPEBSTAT, I915_READ(PIPEBSTAT) & 0x8000ffff); |
529 | temp = I915_READ(PIPEBSTAT); | 545 | I915_WRITE(IIR, I915_READ(IIR)); |
530 | I915_WRITE(PIPEBSTAT, temp); | ||
531 | temp = I915_READ(IIR); | ||
532 | I915_WRITE(IIR, temp); | ||
533 | } | 546 | } |
diff --git a/drivers/gpu/drm/i915/i915_opregion.c b/drivers/gpu/drm/i915/i915_opregion.c index 1787a0c7e3ab..13ae731a33db 100644 --- a/drivers/gpu/drm/i915/i915_opregion.c +++ b/drivers/gpu/drm/i915/i915_opregion.c | |||
@@ -235,17 +235,15 @@ void opregion_enable_asle(struct drm_device *dev) | |||
235 | struct opregion_asle *asle = dev_priv->opregion.asle; | 235 | struct opregion_asle *asle = dev_priv->opregion.asle; |
236 | 236 | ||
237 | if (asle) { | 237 | if (asle) { |
238 | u32 pipeb_stats = I915_READ(PIPEBSTAT); | ||
239 | if (IS_MOBILE(dev)) { | 238 | if (IS_MOBILE(dev)) { |
240 | /* Many devices trigger events with a write to the | 239 | unsigned long irqflags; |
241 | legacy backlight controller, so we need to ensure | 240 | |
242 | that it's able to generate interrupts */ | 241 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); |
243 | I915_WRITE(PIPEBSTAT, pipeb_stats |= | 242 | i915_enable_pipestat(dev_priv, 1, |
244 | I915_LEGACY_BLC_EVENT_ENABLE); | 243 | I915_LEGACY_BLC_EVENT_ENABLE); |
245 | i915_enable_irq(dev_priv, I915_ASLE_INTERRUPT | | 244 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, |
246 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT); | 245 | irqflags); |
247 | } else | 246 | } |
248 | i915_enable_irq(dev_priv, I915_ASLE_INTERRUPT); | ||
249 | 247 | ||
250 | asle->tche = ASLE_ALS_EN | ASLE_BLC_EN | ASLE_PFIT_EN | | 248 | asle->tche = ASLE_ALS_EN | ASLE_BLC_EN | ASLE_PFIT_EN | |
251 | ASLE_PFMB_EN; | 249 | ASLE_PFMB_EN; |
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 5ddc6e595c0c..5d84027ee8f3 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
@@ -244,6 +244,9 @@ int i915_save_state(struct drm_device *dev) | |||
244 | if (IS_I965G(dev) && IS_MOBILE(dev)) | 244 | if (IS_I965G(dev) && IS_MOBILE(dev)) |
245 | dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY); | 245 | dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY); |
246 | 246 | ||
247 | /* Hardware status page */ | ||
248 | dev_priv->saveHWS = I915_READ(HWS_PGA); | ||
249 | |||
247 | /* Display arbitration control */ | 250 | /* Display arbitration control */ |
248 | dev_priv->saveDSPARB = I915_READ(DSPARB); | 251 | dev_priv->saveDSPARB = I915_READ(DSPARB); |
249 | 252 | ||
@@ -373,6 +376,9 @@ int i915_restore_state(struct drm_device *dev) | |||
373 | if (IS_I965G(dev) && IS_MOBILE(dev)) | 376 | if (IS_I965G(dev) && IS_MOBILE(dev)) |
374 | I915_WRITE(MCHBAR_RENDER_STANDBY, dev_priv->saveRENDERSTANDBY); | 377 | I915_WRITE(MCHBAR_RENDER_STANDBY, dev_priv->saveRENDERSTANDBY); |
375 | 378 | ||
379 | /* Hardware status page */ | ||
380 | I915_WRITE(HWS_PGA, dev_priv->saveHWS); | ||
381 | |||
376 | /* Display arbitration */ | 382 | /* Display arbitration */ |
377 | I915_WRITE(DSPARB, dev_priv->saveDSPARB); | 383 | I915_WRITE(DSPARB, dev_priv->saveDSPARB); |
378 | 384 | ||
diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c index c1d12dbfa8d8..b49c5ff29585 100644 --- a/drivers/gpu/drm/mga/mga_dma.c +++ b/drivers/gpu/drm/mga/mga_dma.c | |||
@@ -396,6 +396,7 @@ int mga_freelist_put(struct drm_device * dev, struct drm_buf * buf) | |||
396 | int mga_driver_load(struct drm_device * dev, unsigned long flags) | 396 | int mga_driver_load(struct drm_device * dev, unsigned long flags) |
397 | { | 397 | { |
398 | drm_mga_private_t *dev_priv; | 398 | drm_mga_private_t *dev_priv; |
399 | int ret; | ||
399 | 400 | ||
400 | dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER); | 401 | dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER); |
401 | if (!dev_priv) | 402 | if (!dev_priv) |
@@ -415,6 +416,13 @@ int mga_driver_load(struct drm_device * dev, unsigned long flags) | |||
415 | dev->types[7] = _DRM_STAT_PRIMARY; | 416 | dev->types[7] = _DRM_STAT_PRIMARY; |
416 | dev->types[8] = _DRM_STAT_SECONDARY; | 417 | dev->types[8] = _DRM_STAT_SECONDARY; |
417 | 418 | ||
419 | ret = drm_vblank_init(dev, 1); | ||
420 | |||
421 | if (ret) { | ||
422 | (void) mga_driver_unload(dev); | ||
423 | return ret; | ||
424 | } | ||
425 | |||
418 | return 0; | 426 | return 0; |
419 | } | 427 | } |
420 | 428 | ||
diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c index bab42f41188b..daa6041a483a 100644 --- a/drivers/gpu/drm/mga/mga_irq.c +++ b/drivers/gpu/drm/mga/mga_irq.c | |||
@@ -152,11 +152,6 @@ void mga_driver_irq_preinstall(struct drm_device * dev) | |||
152 | int mga_driver_irq_postinstall(struct drm_device *dev) | 152 | int mga_driver_irq_postinstall(struct drm_device *dev) |
153 | { | 153 | { |
154 | drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; | 154 | drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; |
155 | int ret; | ||
156 | |||
157 | ret = drm_vblank_init(dev, 1); | ||
158 | if (ret) | ||
159 | return ret; | ||
160 | 155 | ||
161 | DRM_INIT_WAITQUEUE(&dev_priv->fence_queue); | 156 | DRM_INIT_WAITQUEUE(&dev_priv->fence_queue); |
162 | 157 | ||
diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c index 3265d53ba91f..601f4c0e5da5 100644 --- a/drivers/gpu/drm/r128/r128_drv.c +++ b/drivers/gpu/drm/r128/r128_drv.c | |||
@@ -45,6 +45,7 @@ static struct drm_driver driver = { | |||
45 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | | 45 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | |
46 | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, | 46 | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, |
47 | .dev_priv_size = sizeof(drm_r128_buf_priv_t), | 47 | .dev_priv_size = sizeof(drm_r128_buf_priv_t), |
48 | .load = r128_driver_load, | ||
48 | .preclose = r128_driver_preclose, | 49 | .preclose = r128_driver_preclose, |
49 | .lastclose = r128_driver_lastclose, | 50 | .lastclose = r128_driver_lastclose, |
50 | .get_vblank_counter = r128_get_vblank_counter, | 51 | .get_vblank_counter = r128_get_vblank_counter, |
@@ -84,6 +85,11 @@ static struct drm_driver driver = { | |||
84 | .patchlevel = DRIVER_PATCHLEVEL, | 85 | .patchlevel = DRIVER_PATCHLEVEL, |
85 | }; | 86 | }; |
86 | 87 | ||
88 | int r128_driver_load(struct drm_device * dev, unsigned long flags) | ||
89 | { | ||
90 | return drm_vblank_init(dev, 1); | ||
91 | } | ||
92 | |||
87 | static int __init r128_init(void) | 93 | static int __init r128_init(void) |
88 | { | 94 | { |
89 | driver.num_ioctls = r128_max_ioctl; | 95 | driver.num_ioctls = r128_max_ioctl; |
diff --git a/drivers/gpu/drm/r128/r128_drv.h b/drivers/gpu/drm/r128/r128_drv.h index 5898b274279d..797a26c42dab 100644 --- a/drivers/gpu/drm/r128/r128_drv.h +++ b/drivers/gpu/drm/r128/r128_drv.h | |||
@@ -159,6 +159,7 @@ extern void r128_driver_irq_preinstall(struct drm_device * dev); | |||
159 | extern int r128_driver_irq_postinstall(struct drm_device *dev); | 159 | extern int r128_driver_irq_postinstall(struct drm_device *dev); |
160 | extern void r128_driver_irq_uninstall(struct drm_device * dev); | 160 | extern void r128_driver_irq_uninstall(struct drm_device * dev); |
161 | extern void r128_driver_lastclose(struct drm_device * dev); | 161 | extern void r128_driver_lastclose(struct drm_device * dev); |
162 | extern int r128_driver_load(struct drm_device * dev, unsigned long flags); | ||
162 | extern void r128_driver_preclose(struct drm_device * dev, | 163 | extern void r128_driver_preclose(struct drm_device * dev, |
163 | struct drm_file *file_priv); | 164 | struct drm_file *file_priv); |
164 | 165 | ||
diff --git a/drivers/gpu/drm/r128/r128_irq.c b/drivers/gpu/drm/r128/r128_irq.c index d7349012a680..69810fb8ac49 100644 --- a/drivers/gpu/drm/r128/r128_irq.c +++ b/drivers/gpu/drm/r128/r128_irq.c | |||
@@ -102,7 +102,7 @@ void r128_driver_irq_preinstall(struct drm_device * dev) | |||
102 | 102 | ||
103 | int r128_driver_irq_postinstall(struct drm_device *dev) | 103 | int r128_driver_irq_postinstall(struct drm_device *dev) |
104 | { | 104 | { |
105 | return drm_vblank_init(dev, 1); | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | void r128_driver_irq_uninstall(struct drm_device * dev) | 108 | void r128_driver_irq_uninstall(struct drm_device * dev) |
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index abdc1ae38467..dcebb4bee7aa 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -1757,6 +1757,12 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags) | |||
1757 | if (ret != 0) | 1757 | if (ret != 0) |
1758 | return ret; | 1758 | return ret; |
1759 | 1759 | ||
1760 | ret = drm_vblank_init(dev, 2); | ||
1761 | if (ret) { | ||
1762 | radeon_driver_unload(dev); | ||
1763 | return ret; | ||
1764 | } | ||
1765 | |||
1760 | DRM_DEBUG("%s card detected\n", | 1766 | DRM_DEBUG("%s card detected\n", |
1761 | ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); | 1767 | ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); |
1762 | return ret; | 1768 | return ret; |
diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c index 5079f7054a2f..97c0599fdb1e 100644 --- a/drivers/gpu/drm/radeon/radeon_irq.c +++ b/drivers/gpu/drm/radeon/radeon_irq.c | |||
@@ -337,15 +337,10 @@ int radeon_driver_irq_postinstall(struct drm_device *dev) | |||
337 | { | 337 | { |
338 | drm_radeon_private_t *dev_priv = | 338 | drm_radeon_private_t *dev_priv = |
339 | (drm_radeon_private_t *) dev->dev_private; | 339 | (drm_radeon_private_t *) dev->dev_private; |
340 | int ret; | ||
341 | 340 | ||
342 | atomic_set(&dev_priv->swi_emitted, 0); | 341 | atomic_set(&dev_priv->swi_emitted, 0); |
343 | DRM_INIT_WAITQUEUE(&dev_priv->swi_queue); | 342 | DRM_INIT_WAITQUEUE(&dev_priv->swi_queue); |
344 | 343 | ||
345 | ret = drm_vblank_init(dev, 2); | ||
346 | if (ret) | ||
347 | return ret; | ||
348 | |||
349 | dev->max_vblank_count = 0x001fffff; | 344 | dev->max_vblank_count = 0x001fffff; |
350 | 345 | ||
351 | radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1); | 346 | radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1); |
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c index 665d319b927b..c248c1d37268 100644 --- a/drivers/gpu/drm/via/via_irq.c +++ b/drivers/gpu/drm/via/via_irq.c | |||
@@ -314,7 +314,6 @@ int via_driver_irq_postinstall(struct drm_device *dev) | |||
314 | if (!dev_priv) | 314 | if (!dev_priv) |
315 | return -EINVAL; | 315 | return -EINVAL; |
316 | 316 | ||
317 | drm_vblank_init(dev, 1); | ||
318 | status = VIA_READ(VIA_REG_INTERRUPT); | 317 | status = VIA_READ(VIA_REG_INTERRUPT); |
319 | VIA_WRITE(VIA_REG_INTERRUPT, status | VIA_IRQ_GLOBAL | 318 | VIA_WRITE(VIA_REG_INTERRUPT, status | VIA_IRQ_GLOBAL |
320 | | dev_priv->irq_enable_mask); | 319 | | dev_priv->irq_enable_mask); |
diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c index a967556be014..2c4f0b485792 100644 --- a/drivers/gpu/drm/via/via_map.c +++ b/drivers/gpu/drm/via/via_map.c | |||
@@ -107,8 +107,17 @@ int via_driver_load(struct drm_device *dev, unsigned long chipset) | |||
107 | ret = drm_sman_init(&dev_priv->sman, 2, 12, 8); | 107 | ret = drm_sman_init(&dev_priv->sman, 2, 12, 8); |
108 | if (ret) { | 108 | if (ret) { |
109 | drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); | 109 | drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); |
110 | return ret; | ||
110 | } | 111 | } |
111 | return ret; | 112 | |
113 | ret = drm_vblank_init(dev, 1); | ||
114 | if (ret) { | ||
115 | drm_sman_takedown(&dev_priv->sman); | ||
116 | drm_free(dev_priv, sizeof(drm_via_private_t), DRM_MEM_DRIVER); | ||
117 | return ret; | ||
118 | } | ||
119 | |||
120 | return 0; | ||
112 | } | 121 | } |
113 | 122 | ||
114 | int via_driver_unload(struct drm_device *dev) | 123 | int via_driver_unload(struct drm_device *dev) |
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 488e45cd43d7..f7dce8b9f64b 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -128,6 +128,9 @@ static const char* temperature_sensors_sets[][36] = { | |||
128 | /* Set 13: iMac 8,1 */ | 128 | /* Set 13: iMac 8,1 */ |
129 | { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P", | 129 | { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P", |
130 | "TL0P", "TO0P", "TW0P", "Tm0P", "Tp0P", NULL }, | 130 | "TL0P", "TO0P", "TW0P", "Tm0P", "Tp0P", NULL }, |
131 | /* Set 14: iMac 6,1 */ | ||
132 | { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P", | ||
133 | "TO0P", "Tp0P", NULL }, | ||
131 | }; | 134 | }; |
132 | 135 | ||
133 | /* List of keys used to read/write fan speeds */ | 136 | /* List of keys used to read/write fan speeds */ |
@@ -1296,6 +1299,8 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = { | |||
1296 | { .accelerometer = 1, .light = 1, .temperature_set = 12 }, | 1299 | { .accelerometer = 1, .light = 1, .temperature_set = 12 }, |
1297 | /* iMac 8: light sensor only, temperature set 13 */ | 1300 | /* iMac 8: light sensor only, temperature set 13 */ |
1298 | { .accelerometer = 0, .light = 0, .temperature_set = 13 }, | 1301 | { .accelerometer = 0, .light = 0, .temperature_set = 13 }, |
1302 | /* iMac 6: light sensor only, temperature set 14 */ | ||
1303 | { .accelerometer = 0, .light = 0, .temperature_set = 14 }, | ||
1299 | }; | 1304 | }; |
1300 | 1305 | ||
1301 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". | 1306 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". |
@@ -1349,10 +1354,18 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { | |||
1349 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), | 1354 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), |
1350 | DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, | 1355 | DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, |
1351 | &applesmc_dmi_data[4]}, | 1356 | &applesmc_dmi_data[4]}, |
1357 | { applesmc_dmi_match, "Apple MacPro", { | ||
1358 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | ||
1359 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, | ||
1360 | &applesmc_dmi_data[4]}, | ||
1352 | { applesmc_dmi_match, "Apple iMac 8", { | 1361 | { applesmc_dmi_match, "Apple iMac 8", { |
1353 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | 1362 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), |
1354 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") }, | 1363 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") }, |
1355 | &applesmc_dmi_data[13]}, | 1364 | &applesmc_dmi_data[13]}, |
1365 | { applesmc_dmi_match, "Apple iMac 6", { | ||
1366 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | ||
1367 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac6") }, | ||
1368 | &applesmc_dmi_data[14]}, | ||
1356 | { applesmc_dmi_match, "Apple iMac 5", { | 1369 | { applesmc_dmi_match, "Apple iMac 5", { |
1357 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | 1370 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), |
1358 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac5") }, | 1371 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac5") }, |
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 59ba2086d2f9..a257cd5cd134 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c | |||
@@ -189,8 +189,6 @@ static void i2c_parport_attach (struct parport *port) | |||
189 | if (adapter_parm[type].init.val) | 189 | if (adapter_parm[type].init.val) |
190 | line_set(port, 1, &adapter_parm[type].init); | 190 | line_set(port, 1, &adapter_parm[type].init); |
191 | 191 | ||
192 | parport_release(adapter->pdev); | ||
193 | |||
194 | if (i2c_bit_add_bus(&adapter->adapter) < 0) { | 192 | if (i2c_bit_add_bus(&adapter->adapter) < 0) { |
195 | printk(KERN_ERR "i2c-parport: Unable to register with I2C\n"); | 193 | printk(KERN_ERR "i2c-parport: Unable to register with I2C\n"); |
196 | goto ERROR1; | 194 | goto ERROR1; |
@@ -202,6 +200,7 @@ static void i2c_parport_attach (struct parport *port) | |||
202 | return; | 200 | return; |
203 | 201 | ||
204 | ERROR1: | 202 | ERROR1: |
203 | parport_release(adapter->pdev); | ||
205 | parport_unregister_device(adapter->pdev); | 204 | parport_unregister_device(adapter->pdev); |
206 | ERROR0: | 205 | ERROR0: |
207 | kfree(adapter); | 206 | kfree(adapter); |
@@ -221,6 +220,7 @@ static void i2c_parport_detach (struct parport *port) | |||
221 | if (adapter_parm[type].init.val) | 220 | if (adapter_parm[type].init.val) |
222 | line_set(port, 0, &adapter_parm[type].init); | 221 | line_set(port, 0, &adapter_parm[type].init); |
223 | 222 | ||
223 | parport_release(adapter->pdev); | ||
224 | parport_unregister_device(adapter->pdev); | 224 | parport_unregister_device(adapter->pdev); |
225 | if (prev) | 225 | if (prev) |
226 | prev->next = adapter->next; | 226 | prev->next = adapter->next; |
diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c index 28902ebd5539..e0d56ef2bcb0 100644 --- a/drivers/i2c/chips/isp1301_omap.c +++ b/drivers/i2c/chips/isp1301_omap.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/gpio.h> | ||
28 | #include <linux/usb/ch9.h> | 29 | #include <linux/usb/ch9.h> |
29 | #include <linux/usb/gadget.h> | 30 | #include <linux/usb/gadget.h> |
30 | #include <linux/usb.h> | 31 | #include <linux/usb.h> |
@@ -33,7 +34,10 @@ | |||
33 | #include <linux/workqueue.h> | 34 | #include <linux/workqueue.h> |
34 | 35 | ||
35 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
37 | #include <asm/mach-types.h> | ||
38 | |||
36 | #include <mach/usb.h> | 39 | #include <mach/usb.h> |
40 | #include <mach/mux.h> | ||
37 | 41 | ||
38 | 42 | ||
39 | #ifndef DEBUG | 43 | #ifndef DEBUG |
@@ -88,14 +92,9 @@ struct isp1301 { | |||
88 | 92 | ||
89 | /*-------------------------------------------------------------------------*/ | 93 | /*-------------------------------------------------------------------------*/ |
90 | 94 | ||
91 | #ifdef CONFIG_MACH_OMAP_H2 | ||
92 | |||
93 | /* board-specific PM hooks */ | 95 | /* board-specific PM hooks */ |
94 | 96 | ||
95 | #include <asm/gpio.h> | 97 | #if defined(CONFIG_MACH_OMAP_H2) || defined(CONFIG_MACH_OMAP_H3) |
96 | #include <mach/mux.h> | ||
97 | #include <asm/mach-types.h> | ||
98 | |||
99 | 98 | ||
100 | #if defined(CONFIG_TPS65010) || defined(CONFIG_TPS65010_MODULE) | 99 | #if defined(CONFIG_TPS65010) || defined(CONFIG_TPS65010_MODULE) |
101 | 100 | ||
@@ -135,6 +134,33 @@ static inline void notresponding(struct isp1301 *isp) | |||
135 | 134 | ||
136 | #endif | 135 | #endif |
137 | 136 | ||
137 | #if defined(CONFIG_MACH_OMAP_H4) | ||
138 | |||
139 | static void enable_vbus_draw(struct isp1301 *isp, unsigned mA) | ||
140 | { | ||
141 | /* H4 controls this by DIP switch S2.4; no soft control. | ||
142 | * ON means the charger is always enabled. Leave it OFF | ||
143 | * unless the OTG port is used only in B-peripheral mode. | ||
144 | */ | ||
145 | } | ||
146 | |||
147 | static void enable_vbus_source(struct isp1301 *isp) | ||
148 | { | ||
149 | /* this board won't supply more than 8mA vbus power. | ||
150 | * some boards can switch a 100ma "unit load" (or more). | ||
151 | */ | ||
152 | } | ||
153 | |||
154 | |||
155 | /* products will deliver OTG messages with LEDs, GUI, etc */ | ||
156 | static inline void notresponding(struct isp1301 *isp) | ||
157 | { | ||
158 | printk(KERN_NOTICE "OTG device not responding.\n"); | ||
159 | } | ||
160 | |||
161 | |||
162 | #endif | ||
163 | |||
138 | /*-------------------------------------------------------------------------*/ | 164 | /*-------------------------------------------------------------------------*/ |
139 | 165 | ||
140 | static struct i2c_driver isp1301_driver; | 166 | static struct i2c_driver isp1301_driver; |
@@ -334,8 +360,7 @@ static int gadget_suspend(struct isp1301 *isp) | |||
334 | * NOTE: guaranteeing certain response times might mean we shouldn't | 360 | * NOTE: guaranteeing certain response times might mean we shouldn't |
335 | * share keventd's work queue; a realtime task might be safest. | 361 | * share keventd's work queue; a realtime task might be safest. |
336 | */ | 362 | */ |
337 | void | 363 | static void isp1301_defer_work(struct isp1301 *isp, int work) |
338 | isp1301_defer_work(struct isp1301 *isp, int work) | ||
339 | { | 364 | { |
340 | int status; | 365 | int status; |
341 | 366 | ||
@@ -512,7 +537,6 @@ static void update_otg1(struct isp1301 *isp, u8 int_src) | |||
512 | otg_ctrl &= ~OTG_XCEIV_INPUTS; | 537 | otg_ctrl &= ~OTG_XCEIV_INPUTS; |
513 | otg_ctrl &= ~(OTG_ID|OTG_ASESSVLD|OTG_VBUSVLD); | 538 | otg_ctrl &= ~(OTG_ID|OTG_ASESSVLD|OTG_VBUSVLD); |
514 | 539 | ||
515 | |||
516 | if (int_src & INTR_SESS_VLD) | 540 | if (int_src & INTR_SESS_VLD) |
517 | otg_ctrl |= OTG_ASESSVLD; | 541 | otg_ctrl |= OTG_ASESSVLD; |
518 | else if (isp->otg.state == OTG_STATE_A_WAIT_VFALL) { | 542 | else if (isp->otg.state == OTG_STATE_A_WAIT_VFALL) { |
@@ -886,11 +910,11 @@ static int otg_probe(struct platform_device *dev) | |||
886 | 910 | ||
887 | static int otg_remove(struct platform_device *dev) | 911 | static int otg_remove(struct platform_device *dev) |
888 | { | 912 | { |
889 | otg_dev = 0; | 913 | otg_dev = NULL; |
890 | return 0; | 914 | return 0; |
891 | } | 915 | } |
892 | 916 | ||
893 | struct platform_driver omap_otg_driver = { | 917 | static struct platform_driver omap_otg_driver = { |
894 | .probe = otg_probe, | 918 | .probe = otg_probe, |
895 | .remove = otg_remove, | 919 | .remove = otg_remove, |
896 | .driver = { | 920 | .driver = { |
@@ -1212,6 +1236,8 @@ static void isp1301_release(struct device *dev) | |||
1212 | 1236 | ||
1213 | isp = dev_get_drvdata(dev); | 1237 | isp = dev_get_drvdata(dev); |
1214 | 1238 | ||
1239 | /* FIXME -- not with a "new style" driver, it doesn't!! */ | ||
1240 | |||
1215 | /* ugly -- i2c hijacks our memory hook to wait_for_completion() */ | 1241 | /* ugly -- i2c hijacks our memory hook to wait_for_completion() */ |
1216 | if (isp->i2c_release) | 1242 | if (isp->i2c_release) |
1217 | isp->i2c_release(dev); | 1243 | isp->i2c_release(dev); |
@@ -1233,7 +1259,7 @@ static int __exit isp1301_remove(struct i2c_client *i2c) | |||
1233 | otg_unbind(isp); | 1259 | otg_unbind(isp); |
1234 | #endif | 1260 | #endif |
1235 | if (machine_is_omap_h2()) | 1261 | if (machine_is_omap_h2()) |
1236 | omap_free_gpio(2); | 1262 | gpio_free(2); |
1237 | 1263 | ||
1238 | isp->timer.data = 0; | 1264 | isp->timer.data = 0; |
1239 | set_bit(WORK_STOP, &isp->todo); | 1265 | set_bit(WORK_STOP, &isp->todo); |
@@ -1241,7 +1267,7 @@ static int __exit isp1301_remove(struct i2c_client *i2c) | |||
1241 | flush_scheduled_work(); | 1267 | flush_scheduled_work(); |
1242 | 1268 | ||
1243 | put_device(&i2c->dev); | 1269 | put_device(&i2c->dev); |
1244 | the_transceiver = 0; | 1270 | the_transceiver = NULL; |
1245 | 1271 | ||
1246 | return 0; | 1272 | return 0; |
1247 | } | 1273 | } |
@@ -1295,7 +1321,7 @@ isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host) | |||
1295 | if (!host) { | 1321 | if (!host) { |
1296 | omap_writew(0, OTG_IRQ_EN); | 1322 | omap_writew(0, OTG_IRQ_EN); |
1297 | power_down(isp); | 1323 | power_down(isp); |
1298 | isp->otg.host = 0; | 1324 | isp->otg.host = NULL; |
1299 | return 0; | 1325 | return 0; |
1300 | } | 1326 | } |
1301 | 1327 | ||
@@ -1344,7 +1370,9 @@ static int | |||
1344 | isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget) | 1370 | isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget) |
1345 | { | 1371 | { |
1346 | struct isp1301 *isp = container_of(otg, struct isp1301, otg); | 1372 | struct isp1301 *isp = container_of(otg, struct isp1301, otg); |
1373 | #ifndef CONFIG_USB_OTG | ||
1347 | u32 l; | 1374 | u32 l; |
1375 | #endif | ||
1348 | 1376 | ||
1349 | if (!otg || isp != the_transceiver) | 1377 | if (!otg || isp != the_transceiver) |
1350 | return -ENODEV; | 1378 | return -ENODEV; |
@@ -1354,7 +1382,7 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget) | |||
1354 | if (!isp->otg.default_a) | 1382 | if (!isp->otg.default_a) |
1355 | enable_vbus_draw(isp, 0); | 1383 | enable_vbus_draw(isp, 0); |
1356 | usb_gadget_vbus_disconnect(isp->otg.gadget); | 1384 | usb_gadget_vbus_disconnect(isp->otg.gadget); |
1357 | isp->otg.gadget = 0; | 1385 | isp->otg.gadget = NULL; |
1358 | power_down(isp); | 1386 | power_down(isp); |
1359 | return 0; | 1387 | return 0; |
1360 | } | 1388 | } |
@@ -1379,7 +1407,7 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget) | |||
1379 | power_up(isp); | 1407 | power_up(isp); |
1380 | isp->otg.state = OTG_STATE_B_IDLE; | 1408 | isp->otg.state = OTG_STATE_B_IDLE; |
1381 | 1409 | ||
1382 | if (machine_is_omap_h2()) | 1410 | if (machine_is_omap_h2() || machine_is_omap_h3()) |
1383 | isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0); | 1411 | isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0); |
1384 | 1412 | ||
1385 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, | 1413 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, |
@@ -1499,7 +1527,8 @@ isp1301_start_hnp(struct otg_transceiver *dev) | |||
1499 | 1527 | ||
1500 | /*-------------------------------------------------------------------------*/ | 1528 | /*-------------------------------------------------------------------------*/ |
1501 | 1529 | ||
1502 | static int __init isp1301_probe(struct i2c_client *i2c) | 1530 | static int __init |
1531 | isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id) | ||
1503 | { | 1532 | { |
1504 | int status; | 1533 | int status; |
1505 | struct isp1301 *isp; | 1534 | struct isp1301 *isp; |
@@ -1647,7 +1676,7 @@ module_init(isp_init); | |||
1647 | static void __exit isp_exit(void) | 1676 | static void __exit isp_exit(void) |
1648 | { | 1677 | { |
1649 | if (the_transceiver) | 1678 | if (the_transceiver) |
1650 | otg_set_transceiver(0); | 1679 | otg_set_transceiver(NULL); |
1651 | i2c_del_driver(&isp1301_driver); | 1680 | i2c_del_driver(&isp1301_driver); |
1652 | } | 1681 | } |
1653 | module_exit(isp_exit); | 1682 | module_exit(isp_exit); |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 5a485c22660a..c6a63f46bc15 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -631,7 +631,7 @@ int i2c_del_adapter(struct i2c_adapter *adap) | |||
631 | 631 | ||
632 | /* detach any active clients. This must be done first, because | 632 | /* detach any active clients. This must be done first, because |
633 | * it can fail; in which case we give up. */ | 633 | * it can fail; in which case we give up. */ |
634 | list_for_each_entry_safe(client, _n, &adap->clients, list) { | 634 | list_for_each_entry_safe_reverse(client, _n, &adap->clients, list) { |
635 | struct i2c_driver *driver; | 635 | struct i2c_driver *driver; |
636 | 636 | ||
637 | driver = client->driver; | 637 | driver = client->driver; |
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c index 2d848010499d..81f70caeb40f 100644 --- a/drivers/ide/icside.c +++ b/drivers/ide/icside.c | |||
@@ -419,7 +419,7 @@ static void icside_setup_ports(hw_regs_t *hw, void __iomem *base, | |||
419 | hw->chipset = ide_acorn; | 419 | hw->chipset = ide_acorn; |
420 | } | 420 | } |
421 | 421 | ||
422 | static int __init | 422 | static int __devinit |
423 | icside_register_v5(struct icside_state *state, struct expansion_card *ec) | 423 | icside_register_v5(struct icside_state *state, struct expansion_card *ec) |
424 | { | 424 | { |
425 | void __iomem *base; | 425 | void __iomem *base; |
@@ -473,7 +473,7 @@ static const struct ide_port_info icside_v6_port_info __initdata = { | |||
473 | .swdma_mask = ATA_SWDMA2, | 473 | .swdma_mask = ATA_SWDMA2, |
474 | }; | 474 | }; |
475 | 475 | ||
476 | static int __init | 476 | static int __devinit |
477 | icside_register_v6(struct icside_state *state, struct expansion_card *ec) | 477 | icside_register_v6(struct icside_state *state, struct expansion_card *ec) |
478 | { | 478 | { |
479 | void __iomem *ioc_base, *easi_base; | 479 | void __iomem *ioc_base, *easi_base; |
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index 6790e975a98c..bc4e40f3ede7 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c | |||
@@ -397,8 +397,9 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) | |||
397 | { | 397 | { |
398 | struct ml_device *ml = dev->ff->private; | 398 | struct ml_device *ml = dev->ff->private; |
399 | struct ml_effect_state *state = &ml->states[effect_id]; | 399 | struct ml_effect_state *state = &ml->states[effect_id]; |
400 | unsigned long flags; | ||
400 | 401 | ||
401 | spin_lock_bh(&ml->timer_lock); | 402 | spin_lock_irqsave(&ml->timer_lock, flags); |
402 | 403 | ||
403 | if (value > 0) { | 404 | if (value > 0) { |
404 | debug("initiated play"); | 405 | debug("initiated play"); |
@@ -424,7 +425,7 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) | |||
424 | ml_play_effects(ml); | 425 | ml_play_effects(ml); |
425 | } | 426 | } |
426 | 427 | ||
427 | spin_unlock_bh(&ml->timer_lock); | 428 | spin_unlock_irqrestore(&ml->timer_lock, flags); |
428 | 429 | ||
429 | return 0; | 430 | return 0; |
430 | } | 431 | } |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 22016ca15351..379b7ff354ec 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -824,7 +824,7 @@ static void atkbd_disconnect(struct serio *serio) | |||
824 | atkbd_disable(atkbd); | 824 | atkbd_disable(atkbd); |
825 | 825 | ||
826 | /* make sure we don't have a command in flight */ | 826 | /* make sure we don't have a command in flight */ |
827 | flush_scheduled_work(); | 827 | cancel_delayed_work_sync(&atkbd->event_work); |
828 | 828 | ||
829 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); | 829 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); |
830 | input_unregister_device(atkbd->dev); | 830 | input_unregister_device(atkbd->dev); |
@@ -868,6 +868,22 @@ static void atkbd_hp_keymap_fixup(struct atkbd *atkbd) | |||
868 | } | 868 | } |
869 | 869 | ||
870 | /* | 870 | /* |
871 | * Inventec system with broken key release on volume keys | ||
872 | */ | ||
873 | static void atkbd_inventec_keymap_fixup(struct atkbd *atkbd) | ||
874 | { | ||
875 | const unsigned int forced_release_keys[] = { | ||
876 | 0xae, 0xb0, | ||
877 | }; | ||
878 | int i; | ||
879 | |||
880 | if (atkbd->set == 2) | ||
881 | for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++) | ||
882 | __set_bit(forced_release_keys[i], | ||
883 | atkbd->force_release_mask); | ||
884 | } | ||
885 | |||
886 | /* | ||
871 | * atkbd_set_keycode_table() initializes keyboard's keycode table | 887 | * atkbd_set_keycode_table() initializes keyboard's keycode table |
872 | * according to the selected scancode set | 888 | * according to the selected scancode set |
873 | */ | 889 | */ |
@@ -1468,6 +1484,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1468 | .callback = atkbd_setup_fixup, | 1484 | .callback = atkbd_setup_fixup, |
1469 | .driver_data = atkbd_hp_keymap_fixup, | 1485 | .driver_data = atkbd_hp_keymap_fixup, |
1470 | }, | 1486 | }, |
1487 | { | ||
1488 | .ident = "Inventec Symphony", | ||
1489 | .matches = { | ||
1490 | DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"), | ||
1491 | DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"), | ||
1492 | }, | ||
1493 | .callback = atkbd_setup_fixup, | ||
1494 | .driver_data = atkbd_inventec_keymap_fixup, | ||
1495 | }, | ||
1471 | { } | 1496 | { } |
1472 | }; | 1497 | }; |
1473 | 1498 | ||
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index bce160f4349b..86457feccfc4 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | static char *phone = "kip1000"; | 43 | static char *phone = "kip1000"; |
44 | module_param(phone, charp, S_IRUSR); | 44 | module_param(phone, charp, S_IRUSR); |
45 | MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01}"); | 45 | MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01, atcom}"); |
46 | 46 | ||
47 | enum { | 47 | enum { |
48 | /* HID Registers */ | 48 | /* HID Registers */ |
@@ -258,6 +258,37 @@ static unsigned short keymap_usbph01(int scancode) | |||
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | /* | ||
262 | * Keymap for ATCom AU-100 | ||
263 | * http://www.atcom.cn/En_products_AU100.html | ||
264 | * http://www.packetizer.com/products/au100/ | ||
265 | * http://www.voip-info.org/wiki/view/AU-100 | ||
266 | * | ||
267 | * Contributed by daniel@gimpelevich.san-francisco.ca.us | ||
268 | */ | ||
269 | static unsigned short keymap_atcom(int scancode) | ||
270 | { | ||
271 | switch (scancode) { /* phone key: */ | ||
272 | case 0x82: return KEY_NUMERIC_0; /* 0 */ | ||
273 | case 0x11: return KEY_NUMERIC_1; /* 1 */ | ||
274 | case 0x12: return KEY_NUMERIC_2; /* 2 */ | ||
275 | case 0x14: return KEY_NUMERIC_3; /* 3 */ | ||
276 | case 0x21: return KEY_NUMERIC_4; /* 4 */ | ||
277 | case 0x22: return KEY_NUMERIC_5; /* 5 */ | ||
278 | case 0x24: return KEY_NUMERIC_6; /* 6 */ | ||
279 | case 0x41: return KEY_NUMERIC_7; /* 7 */ | ||
280 | case 0x42: return KEY_NUMERIC_8; /* 8 */ | ||
281 | case 0x44: return KEY_NUMERIC_9; /* 9 */ | ||
282 | case 0x84: return KEY_NUMERIC_POUND; /* # */ | ||
283 | case 0x81: return KEY_NUMERIC_STAR; /* * */ | ||
284 | case 0x18: return KEY_ENTER; /* pickup */ | ||
285 | case 0x28: return KEY_ESC; /* hangup */ | ||
286 | case 0x48: return KEY_LEFT; /* left arrow */ | ||
287 | case 0x88: return KEY_RIGHT; /* right arrow */ | ||
288 | default: return special_keymap(scancode); | ||
289 | } | ||
290 | } | ||
291 | |||
261 | static unsigned short (*keymap)(int) = keymap_kip1000; | 292 | static unsigned short (*keymap)(int) = keymap_kip1000; |
262 | 293 | ||
263 | /* | 294 | /* |
@@ -840,6 +871,10 @@ static int __init cm109_select_keymap(void) | |||
840 | keymap = keymap_usbph01; | 871 | keymap = keymap_usbph01; |
841 | printk(KERN_INFO KBUILD_MODNAME ": " | 872 | printk(KERN_INFO KBUILD_MODNAME ": " |
842 | "Keymap for Allied-Telesis Corega USBPH01 phone loaded\n"); | 873 | "Keymap for Allied-Telesis Corega USBPH01 phone loaded\n"); |
874 | } else if (!strcasecmp(phone, "atcom")) { | ||
875 | keymap = keymap_atcom; | ||
876 | printk(KERN_INFO KBUILD_MODNAME ": " | ||
877 | "Keymap for ATCom AU-100 phone loaded\n"); | ||
843 | } else { | 878 | } else { |
844 | printk(KERN_ERR KBUILD_MODNAME ": " | 879 | printk(KERN_ERR KBUILD_MODNAME ": " |
845 | "Unsupported phone: %s\n", phone); | 880 | "Unsupported phone: %s\n", phone); |
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index e82d34201e97..88f04bf2ad6c 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c | |||
@@ -125,7 +125,7 @@ static void hgpk_spewing_hack(struct psmouse *psmouse, | |||
125 | */ | 125 | */ |
126 | static int hgpk_validate_byte(unsigned char *packet) | 126 | static int hgpk_validate_byte(unsigned char *packet) |
127 | { | 127 | { |
128 | return (packet[0] & 0x0C) == 0x08; | 128 | return (packet[0] & 0x0C) != 0x08; |
129 | } | 129 | } |
130 | 130 | ||
131 | static void hgpk_process_packet(struct psmouse *psmouse) | 131 | static void hgpk_process_packet(struct psmouse *psmouse) |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index eec375cd10e6..29e686388a2c 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -337,6 +337,20 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { | |||
337 | DMI_MATCH(DMI_PRODUCT_NAME, "2656"), | 337 | DMI_MATCH(DMI_PRODUCT_NAME, "2656"), |
338 | }, | 338 | }, |
339 | }, | 339 | }, |
340 | { | ||
341 | .ident = "Dell XPS M1530", | ||
342 | .matches = { | ||
343 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
344 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"), | ||
345 | }, | ||
346 | }, | ||
347 | { | ||
348 | .ident = "Compal HEL80I", | ||
349 | .matches = { | ||
350 | DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"), | ||
351 | DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"), | ||
352 | }, | ||
353 | }, | ||
340 | { } | 354 | { } |
341 | }; | 355 | }; |
342 | 356 | ||
diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h index ca62ec639f8f..677680e9f54f 100644 --- a/drivers/input/tablet/wacom.h +++ b/drivers/input/tablet/wacom.h | |||
@@ -66,6 +66,7 @@ | |||
66 | * - Support Intuos3 4x6 | 66 | * - Support Intuos3 4x6 |
67 | * v1.47 (pc) - Added support for Bamboo | 67 | * v1.47 (pc) - Added support for Bamboo |
68 | * v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX | 68 | * v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX |
69 | * v1.49 (pc) - Added support for USB Tablet PC (0x90, 0x93, and 0x9A) | ||
69 | */ | 70 | */ |
70 | 71 | ||
71 | /* | 72 | /* |
@@ -86,7 +87,7 @@ | |||
86 | /* | 87 | /* |
87 | * Version Information | 88 | * Version Information |
88 | */ | 89 | */ |
89 | #define DRIVER_VERSION "v1.48" | 90 | #define DRIVER_VERSION "v1.49" |
90 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" | 91 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" |
91 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" | 92 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" |
92 | #define DRIVER_LICENSE "GPL" | 93 | #define DRIVER_LICENSE "GPL" |
@@ -103,15 +104,15 @@ struct wacom { | |||
103 | struct usb_device *usbdev; | 104 | struct usb_device *usbdev; |
104 | struct usb_interface *intf; | 105 | struct usb_interface *intf; |
105 | struct urb *irq; | 106 | struct urb *irq; |
106 | struct wacom_wac * wacom_wac; | 107 | struct wacom_wac *wacom_wac; |
107 | struct mutex lock; | 108 | struct mutex lock; |
108 | unsigned int open:1; | 109 | unsigned int open:1; |
109 | char phys[32]; | 110 | char phys[32]; |
110 | }; | 111 | }; |
111 | 112 | ||
112 | struct wacom_combo { | 113 | struct wacom_combo { |
113 | struct wacom * wacom; | 114 | struct wacom *wacom; |
114 | struct urb * urb; | 115 | struct urb *urb; |
115 | }; | 116 | }; |
116 | 117 | ||
117 | extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); | 118 | extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); |
@@ -132,7 +133,7 @@ extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wa | |||
132 | extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac); | 133 | extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac); |
133 | extern __u16 wacom_le16_to_cpu(unsigned char *data); | 134 | extern __u16 wacom_le16_to_cpu(unsigned char *data); |
134 | extern __u16 wacom_be16_to_cpu(unsigned char *data); | 135 | extern __u16 wacom_be16_to_cpu(unsigned char *data); |
135 | extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id); | 136 | extern struct wacom_features *get_wacom_feature(const struct usb_device_id *id); |
136 | extern const struct usb_device_id * get_device_table(void); | 137 | extern const struct usb_device_id *get_device_table(void); |
137 | 138 | ||
138 | #endif | 139 | #endif |
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 09e227aa0d49..484496daa0f3 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -14,8 +14,41 @@ | |||
14 | #include "wacom.h" | 14 | #include "wacom.h" |
15 | #include "wacom_wac.h" | 15 | #include "wacom_wac.h" |
16 | 16 | ||
17 | /* defines to get HID report descriptor */ | ||
18 | #define HID_DEVICET_HID (USB_TYPE_CLASS | 0x01) | ||
19 | #define HID_DEVICET_REPORT (USB_TYPE_CLASS | 0x02) | ||
20 | #define HID_USAGE_UNDEFINED 0x00 | ||
21 | #define HID_USAGE_PAGE 0x05 | ||
22 | #define HID_USAGE_PAGE_DIGITIZER 0x0d | ||
23 | #define HID_USAGE_PAGE_DESKTOP 0x01 | ||
24 | #define HID_USAGE 0x09 | ||
25 | #define HID_USAGE_X 0x30 | ||
26 | #define HID_USAGE_Y 0x31 | ||
27 | #define HID_USAGE_X_TILT 0x3d | ||
28 | #define HID_USAGE_Y_TILT 0x3e | ||
29 | #define HID_USAGE_FINGER 0x22 | ||
30 | #define HID_USAGE_STYLUS 0x20 | ||
31 | #define HID_COLLECTION 0xc0 | ||
32 | |||
33 | enum { | ||
34 | WCM_UNDEFINED = 0, | ||
35 | WCM_DESKTOP, | ||
36 | WCM_DIGITIZER, | ||
37 | }; | ||
38 | |||
39 | struct hid_descriptor { | ||
40 | struct usb_descriptor_header header; | ||
41 | __le16 bcdHID; | ||
42 | u8 bCountryCode; | ||
43 | u8 bNumDescriptors; | ||
44 | u8 bDescriptorType; | ||
45 | __le16 wDescriptorLength; | ||
46 | } __attribute__ ((packed)); | ||
47 | |||
48 | /* defines to get/set USB message */ | ||
17 | #define USB_REQ_GET_REPORT 0x01 | 49 | #define USB_REQ_GET_REPORT 0x01 |
18 | #define USB_REQ_SET_REPORT 0x09 | 50 | #define USB_REQ_SET_REPORT 0x09 |
51 | #define WAC_HID_FEATURE_REPORT 0x03 | ||
19 | 52 | ||
20 | static int usb_get_report(struct usb_interface *intf, unsigned char type, | 53 | static int usb_get_report(struct usb_interface *intf, unsigned char type, |
21 | unsigned char id, void *buf, int size) | 54 | unsigned char id, void *buf, int size) |
@@ -80,25 +113,21 @@ static void wacom_sys_irq(struct urb *urb) | |||
80 | void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) | 113 | void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) |
81 | { | 114 | { |
82 | input_report_key(get_input_dev((struct wacom_combo *)wcombo), key_type, key_data); | 115 | input_report_key(get_input_dev((struct wacom_combo *)wcombo), key_type, key_data); |
83 | return; | ||
84 | } | 116 | } |
85 | 117 | ||
86 | void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data) | 118 | void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data) |
87 | { | 119 | { |
88 | input_report_abs(get_input_dev((struct wacom_combo *)wcombo), abs_type, abs_data); | 120 | input_report_abs(get_input_dev((struct wacom_combo *)wcombo), abs_type, abs_data); |
89 | return; | ||
90 | } | 121 | } |
91 | 122 | ||
92 | void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data) | 123 | void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data) |
93 | { | 124 | { |
94 | input_report_rel(get_input_dev((struct wacom_combo *)wcombo), rel_type, rel_data); | 125 | input_report_rel(get_input_dev((struct wacom_combo *)wcombo), rel_type, rel_data); |
95 | return; | ||
96 | } | 126 | } |
97 | 127 | ||
98 | void wacom_input_event(void *wcombo, unsigned int type, unsigned int code, int value) | 128 | void wacom_input_event(void *wcombo, unsigned int type, unsigned int code, int value) |
99 | { | 129 | { |
100 | input_event(get_input_dev((struct wacom_combo *)wcombo), type, code, value); | 130 | input_event(get_input_dev((struct wacom_combo *)wcombo), type, code, value); |
101 | return; | ||
102 | } | 131 | } |
103 | 132 | ||
104 | __u16 wacom_be16_to_cpu(unsigned char *data) | 133 | __u16 wacom_be16_to_cpu(unsigned char *data) |
@@ -118,7 +147,6 @@ __u16 wacom_le16_to_cpu(unsigned char *data) | |||
118 | void wacom_input_sync(void *wcombo) | 147 | void wacom_input_sync(void *wcombo) |
119 | { | 148 | { |
120 | input_sync(get_input_dev((struct wacom_combo *)wcombo)); | 149 | input_sync(get_input_dev((struct wacom_combo *)wcombo)); |
121 | return; | ||
122 | } | 150 | } |
123 | 151 | ||
124 | static int wacom_open(struct input_dev *dev) | 152 | static int wacom_open(struct input_dev *dev) |
@@ -160,7 +188,7 @@ static void wacom_close(struct input_dev *dev) | |||
160 | 188 | ||
161 | void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 189 | void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
162 | { | 190 | { |
163 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_1) | | 191 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_1) | |
164 | BIT_MASK(BTN_5); | 192 | BIT_MASK(BTN_5); |
165 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); | 193 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
166 | } | 194 | } |
@@ -170,7 +198,7 @@ void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
170 | input_dev->evbit[0] |= BIT_MASK(EV_MSC); | 198 | input_dev->evbit[0] |= BIT_MASK(EV_MSC); |
171 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); | 199 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); |
172 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); | 200 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); |
173 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | | 201 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | |
174 | BIT_MASK(BTN_4); | 202 | BIT_MASK(BTN_4); |
175 | } | 203 | } |
176 | 204 | ||
@@ -178,7 +206,7 @@ void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
178 | { | 206 | { |
179 | input_dev->evbit[0] |= BIT_MASK(EV_REL); | 207 | input_dev->evbit[0] |= BIT_MASK(EV_REL); |
180 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); | 208 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); |
181 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | | 209 | input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) | |
182 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); | 210 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); |
183 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | | 211 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | |
184 | BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2); | 212 | BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2); |
@@ -188,7 +216,7 @@ void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
188 | void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 216 | void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
189 | { | 217 | { |
190 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); | 218 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); |
191 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | | 219 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | |
192 | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); | 220 | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); |
193 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); | 221 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
194 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | 222 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
@@ -196,14 +224,14 @@ void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
196 | 224 | ||
197 | void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 225 | void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
198 | { | 226 | { |
199 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_4) | | 227 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_4) | |
200 | BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7); | 228 | BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7); |
201 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); | 229 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
202 | } | 230 | } |
203 | 231 | ||
204 | void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 232 | void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
205 | { | 233 | { |
206 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9); | 234 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9); |
207 | } | 235 | } |
208 | 236 | ||
209 | void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 237 | void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
@@ -211,7 +239,7 @@ void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
211 | input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); | 239 | input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); |
212 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); | 240 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); |
213 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); | 241 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); |
214 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | | 242 | input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) | |
215 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) | | 243 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) | |
216 | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); | 244 | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); |
217 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | | 245 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | |
@@ -228,8 +256,7 @@ void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
228 | 256 | ||
229 | void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 257 | void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
230 | { | 258 | { |
231 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2) | | 259 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2); |
232 | BIT_MASK(BTN_TOOL_RUBBER); | ||
233 | } | 260 | } |
234 | 261 | ||
235 | void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 262 | void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
@@ -237,15 +264,129 @@ void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
237 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER); | 264 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER); |
238 | } | 265 | } |
239 | 266 | ||
267 | static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, | ||
268 | struct wacom_wac *wacom_wac) | ||
269 | { | ||
270 | struct usb_device *dev = interface_to_usbdev(intf); | ||
271 | struct wacom_features *features = wacom_wac->features; | ||
272 | char limit = 0, result = 0; | ||
273 | int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; | ||
274 | unsigned char *report; | ||
275 | |||
276 | report = kzalloc(hid_desc->wDescriptorLength, GFP_KERNEL); | ||
277 | if (!report) | ||
278 | return -ENOMEM; | ||
279 | |||
280 | /* retrive report descriptors */ | ||
281 | do { | ||
282 | result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), | ||
283 | USB_REQ_GET_DESCRIPTOR, | ||
284 | USB_RECIP_INTERFACE | USB_DIR_IN, | ||
285 | HID_DEVICET_REPORT << 8, | ||
286 | intf->altsetting[0].desc.bInterfaceNumber, /* interface */ | ||
287 | report, | ||
288 | hid_desc->wDescriptorLength, | ||
289 | 5000); /* 5 secs */ | ||
290 | } while (result < 0 && limit++ < 5); | ||
291 | |||
292 | if (result < 0) | ||
293 | goto out; | ||
294 | |||
295 | for (i = 0; i < hid_desc->wDescriptorLength; i++) { | ||
296 | |||
297 | switch (report[i]) { | ||
298 | case HID_USAGE_PAGE: | ||
299 | switch (report[i + 1]) { | ||
300 | case HID_USAGE_PAGE_DIGITIZER: | ||
301 | usage = WCM_DIGITIZER; | ||
302 | i++; | ||
303 | break; | ||
304 | |||
305 | case HID_USAGE_PAGE_DESKTOP: | ||
306 | usage = WCM_DESKTOP; | ||
307 | i++; | ||
308 | break; | ||
309 | } | ||
310 | break; | ||
311 | |||
312 | case HID_USAGE: | ||
313 | switch (report[i + 1]) { | ||
314 | case HID_USAGE_X: | ||
315 | if (usage == WCM_DESKTOP) { | ||
316 | if (finger) { | ||
317 | features->touch_x_max = | ||
318 | features->touch_y_max = | ||
319 | wacom_le16_to_cpu(&report[i + 3]); | ||
320 | features->x_max = | ||
321 | wacom_le16_to_cpu(&report[i + 6]); | ||
322 | i += 7; | ||
323 | } else if (pen) { | ||
324 | features->x_max = | ||
325 | wacom_le16_to_cpu(&report[i + 3]); | ||
326 | i += 4; | ||
327 | } | ||
328 | } else if (usage == WCM_DIGITIZER) { | ||
329 | /* max pressure isn't reported | ||
330 | features->pressure_max = (unsigned short) | ||
331 | (report[i+4] << 8 | report[i + 3]); | ||
332 | */ | ||
333 | features->pressure_max = 255; | ||
334 | i += 4; | ||
335 | } | ||
336 | break; | ||
337 | |||
338 | case HID_USAGE_Y: | ||
339 | if (usage == WCM_DESKTOP) | ||
340 | features->y_max = | ||
341 | wacom_le16_to_cpu(&report[i + 3]); | ||
342 | i += 4; | ||
343 | break; | ||
344 | |||
345 | case HID_USAGE_FINGER: | ||
346 | finger = 1; | ||
347 | i++; | ||
348 | break; | ||
349 | |||
350 | case HID_USAGE_STYLUS: | ||
351 | pen = 1; | ||
352 | i++; | ||
353 | break; | ||
354 | |||
355 | case HID_USAGE_UNDEFINED: | ||
356 | if (usage == WCM_DESKTOP && finger) /* capacity */ | ||
357 | features->pressure_max = | ||
358 | wacom_le16_to_cpu(&report[i + 3]); | ||
359 | i += 4; | ||
360 | break; | ||
361 | } | ||
362 | break; | ||
363 | |||
364 | case HID_COLLECTION: | ||
365 | /* reset UsagePage ans Finger */ | ||
366 | finger = usage = 0; | ||
367 | break; | ||
368 | } | ||
369 | } | ||
370 | |||
371 | result = 0; | ||
372 | |||
373 | out: | ||
374 | kfree(report); | ||
375 | return result; | ||
376 | } | ||
377 | |||
240 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) | 378 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) |
241 | { | 379 | { |
242 | struct usb_device *dev = interface_to_usbdev(intf); | 380 | struct usb_device *dev = interface_to_usbdev(intf); |
381 | struct usb_host_interface *interface = intf->cur_altsetting; | ||
243 | struct usb_endpoint_descriptor *endpoint; | 382 | struct usb_endpoint_descriptor *endpoint; |
244 | struct wacom *wacom; | 383 | struct wacom *wacom; |
245 | struct wacom_wac *wacom_wac; | 384 | struct wacom_wac *wacom_wac; |
385 | struct wacom_features *features; | ||
246 | struct input_dev *input_dev; | 386 | struct input_dev *input_dev; |
247 | int error = -ENOMEM; | 387 | int error = -ENOMEM; |
248 | char rep_data[2], limit = 0; | 388 | char rep_data[2], limit = 0; |
389 | struct hid_descriptor *hid_desc; | ||
249 | 390 | ||
250 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); | 391 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); |
251 | wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL); | 392 | wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL); |
@@ -268,8 +409,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
268 | usb_make_path(dev, wacom->phys, sizeof(wacom->phys)); | 409 | usb_make_path(dev, wacom->phys, sizeof(wacom->phys)); |
269 | strlcat(wacom->phys, "/input0", sizeof(wacom->phys)); | 410 | strlcat(wacom->phys, "/input0", sizeof(wacom->phys)); |
270 | 411 | ||
271 | wacom_wac->features = get_wacom_feature(id); | 412 | wacom_wac->features = features = get_wacom_feature(id); |
272 | BUG_ON(wacom_wac->features->pktlen > 10); | 413 | BUG_ON(features->pktlen > 10); |
273 | 414 | ||
274 | input_dev->name = wacom_wac->features->name; | 415 | input_dev->name = wacom_wac->features->name; |
275 | wacom->wacom_wac = wacom_wac; | 416 | wacom->wacom_wac = wacom_wac; |
@@ -282,18 +423,37 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
282 | input_dev->open = wacom_open; | 423 | input_dev->open = wacom_open; |
283 | input_dev->close = wacom_close; | 424 | input_dev->close = wacom_close; |
284 | 425 | ||
426 | endpoint = &intf->cur_altsetting->endpoint[0].desc; | ||
427 | |||
428 | /* TabletPC need to retrieve the physical and logical maximum from report descriptor */ | ||
429 | if (wacom_wac->features->type == TABLETPC) { | ||
430 | if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { | ||
431 | if (usb_get_extra_descriptor(&interface->endpoint[0], | ||
432 | HID_DEVICET_REPORT, &hid_desc)) { | ||
433 | printk("wacom: can not retrive extra class descriptor\n"); | ||
434 | goto fail2; | ||
435 | } | ||
436 | } | ||
437 | error = wacom_parse_hid(intf, hid_desc, wacom_wac); | ||
438 | if (error) | ||
439 | goto fail2; | ||
440 | } | ||
441 | |||
285 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 442 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
286 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | | 443 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | |
287 | BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS); | 444 | BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS); |
288 | input_set_abs_params(input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0); | 445 | input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0); |
289 | input_set_abs_params(input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0); | 446 | input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0); |
290 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0); | 447 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0); |
448 | if (features->type == TABLETPC) { | ||
449 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_DOUBLETAP); | ||
450 | input_set_abs_params(input_dev, ABS_RX, 0, features->touch_x_max, 4, 0); | ||
451 | input_set_abs_params(input_dev, ABS_RY, 0, features->touch_y_max, 4, 0); | ||
452 | } | ||
291 | input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC); | 453 | input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC); |
292 | 454 | ||
293 | wacom_init_input_dev(input_dev, wacom_wac); | 455 | wacom_init_input_dev(input_dev, wacom_wac); |
294 | 456 | ||
295 | endpoint = &intf->cur_altsetting->endpoint[0].desc; | ||
296 | |||
297 | usb_fill_int_urb(wacom->irq, dev, | 457 | usb_fill_int_urb(wacom->irq, dev, |
298 | usb_rcvintpipe(dev, endpoint->bEndpointAddress), | 458 | usb_rcvintpipe(dev, endpoint->bEndpointAddress), |
299 | wacom_wac->data, wacom_wac->features->pktlen, | 459 | wacom_wac->data, wacom_wac->features->pktlen, |
@@ -305,13 +465,22 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
305 | if (error) | 465 | if (error) |
306 | goto fail3; | 466 | goto fail3; |
307 | 467 | ||
308 | /* Ask the tablet to report tablet data. Repeat until it succeeds */ | 468 | /* |
309 | do { | 469 | * Ask the tablet to report tablet data if it is not a Tablet PC. |
310 | rep_data[0] = 2; | 470 | * Repeat until it succeeds |
311 | rep_data[1] = 2; | 471 | */ |
312 | usb_set_report(intf, 3, 2, rep_data, 2); | 472 | if (wacom_wac->features->type != TABLETPC) { |
313 | usb_get_report(intf, 3, 2, rep_data, 2); | 473 | do { |
314 | } while (rep_data[1] != 2 && limit++ < 5); | 474 | rep_data[0] = 2; |
475 | rep_data[1] = 2; | ||
476 | error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, | ||
477 | 2, rep_data, 2); | ||
478 | if (error >= 0) | ||
479 | error = usb_get_report(intf, | ||
480 | WAC_HID_FEATURE_REPORT, 2, | ||
481 | rep_data, 2); | ||
482 | } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); | ||
483 | } | ||
315 | 484 | ||
316 | usb_set_intfdata(intf, wacom); | 485 | usb_set_intfdata(intf, wacom); |
317 | return 0; | 486 | return 0; |
@@ -333,7 +502,8 @@ static void wacom_disconnect(struct usb_interface *intf) | |||
333 | usb_kill_urb(wacom->irq); | 502 | usb_kill_urb(wacom->irq); |
334 | input_unregister_device(wacom->dev); | 503 | input_unregister_device(wacom->dev); |
335 | usb_free_urb(wacom->irq); | 504 | usb_free_urb(wacom->irq); |
336 | usb_buffer_free(interface_to_usbdev(intf), 10, wacom->wacom_wac->data, wacom->data_dma); | 505 | usb_buffer_free(interface_to_usbdev(intf), 10, |
506 | wacom->wacom_wac->data, wacom->data_dma); | ||
337 | kfree(wacom->wacom_wac); | 507 | kfree(wacom->wacom_wac); |
338 | kfree(wacom); | 508 | kfree(wacom); |
339 | } | 509 | } |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index bf3d9a8b2c1b..8dc8d1e59bea 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -535,31 +535,147 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo) | |||
535 | return 1; | 535 | return 1; |
536 | } | 536 | } |
537 | 537 | ||
538 | int wacom_tpc_irq(struct wacom_wac *wacom, void *wcombo) | ||
539 | { | ||
540 | char *data = wacom->data; | ||
541 | int prox = 0, pressure; | ||
542 | static int stylusInProx, touchInProx = 1, touchOut; | ||
543 | struct urb *urb = ((struct wacom_combo *)wcombo)->urb; | ||
544 | |||
545 | dbg("wacom_tpc_irq: received report #%d", data[0]); | ||
546 | |||
547 | if (urb->actual_length == 5 || data[0] == 6) { /* Touch data */ | ||
548 | if (urb->actual_length == 5) { /* with touch */ | ||
549 | prox = data[0] & 0x03; | ||
550 | } else { /* with capacity */ | ||
551 | prox = data[1] & 0x03; | ||
552 | } | ||
553 | |||
554 | if (!stylusInProx) { /* stylus not in prox */ | ||
555 | if (prox) { | ||
556 | if (touchInProx) { | ||
557 | wacom->tool[1] = BTN_TOOL_DOUBLETAP; | ||
558 | wacom->id[0] = TOUCH_DEVICE_ID; | ||
559 | if (urb->actual_length != 5) { | ||
560 | wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); | ||
561 | wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); | ||
562 | wacom_report_abs(wcombo, ABS_PRESSURE, wacom_le16_to_cpu(&data[6])); | ||
563 | wacom_report_key(wcombo, BTN_TOUCH, wacom_le16_to_cpu(&data[6])); | ||
564 | } else { | ||
565 | wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[1])); | ||
566 | wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[3])); | ||
567 | wacom_report_key(wcombo, BTN_TOUCH, 1); | ||
568 | } | ||
569 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); | ||
570 | wacom_report_key(wcombo, wacom->tool[1], prox & 0x01); | ||
571 | touchOut = 1; | ||
572 | return 1; | ||
573 | } | ||
574 | } else { | ||
575 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); | ||
576 | wacom_report_key(wcombo, wacom->tool[1], prox & 0x01); | ||
577 | wacom_report_key(wcombo, BTN_TOUCH, 0); | ||
578 | touchOut = 0; | ||
579 | touchInProx = 1; | ||
580 | return 1; | ||
581 | } | ||
582 | } else if (touchOut || !prox) { /* force touch out-prox */ | ||
583 | wacom_report_abs(wcombo, ABS_MISC, TOUCH_DEVICE_ID); | ||
584 | wacom_report_key(wcombo, BTN_TOUCH, 0); | ||
585 | touchOut = 0; | ||
586 | touchInProx = 1; | ||
587 | return 1; | ||
588 | } | ||
589 | } else if (data[0] == 2) { /* Penabled */ | ||
590 | prox = data[1] & 0x20; | ||
591 | |||
592 | touchInProx = 0; | ||
593 | |||
594 | wacom->id[0] = ERASER_DEVICE_ID; | ||
595 | |||
596 | /* | ||
597 | * if going from out of proximity into proximity select between the eraser | ||
598 | * and the pen based on the state of the stylus2 button, choose eraser if | ||
599 | * pressed else choose pen. if not a proximity change from out to in, send | ||
600 | * an out of proximity for previous tool then a in for new tool. | ||
601 | */ | ||
602 | if (prox) { /* in prox */ | ||
603 | if (!wacom->tool[0]) { | ||
604 | /* Going into proximity select tool */ | ||
605 | wacom->tool[1] = (data[1] & 0x08) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; | ||
606 | if (wacom->tool[1] == BTN_TOOL_PEN) | ||
607 | wacom->id[0] = STYLUS_DEVICE_ID; | ||
608 | } else if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[1] & 0x08)) { | ||
609 | /* | ||
610 | * was entered with stylus2 pressed | ||
611 | * report out proximity for previous tool | ||
612 | */ | ||
613 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); | ||
614 | wacom_report_key(wcombo, wacom->tool[1], 0); | ||
615 | wacom_input_sync(wcombo); | ||
616 | |||
617 | /* set new tool */ | ||
618 | wacom->tool[1] = BTN_TOOL_PEN; | ||
619 | wacom->id[0] = STYLUS_DEVICE_ID; | ||
620 | return 0; | ||
621 | } | ||
622 | if (wacom->tool[1] != BTN_TOOL_RUBBER) { | ||
623 | /* Unknown tool selected default to pen tool */ | ||
624 | wacom->tool[1] = BTN_TOOL_PEN; | ||
625 | wacom->id[0] = STYLUS_DEVICE_ID; | ||
626 | } | ||
627 | wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); | ||
628 | wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10); | ||
629 | wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); | ||
630 | wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); | ||
631 | pressure = ((data[7] & 0x01) << 8) | data[6]; | ||
632 | if (pressure < 0) | ||
633 | pressure = wacom->features->pressure_max + pressure + 1; | ||
634 | wacom_report_abs(wcombo, ABS_PRESSURE, pressure); | ||
635 | wacom_report_key(wcombo, BTN_TOUCH, pressure); | ||
636 | } else { | ||
637 | wacom_report_abs(wcombo, ABS_PRESSURE, 0); | ||
638 | wacom_report_key(wcombo, BTN_STYLUS, 0); | ||
639 | wacom_report_key(wcombo, BTN_STYLUS2, 0); | ||
640 | wacom_report_key(wcombo, BTN_TOUCH, 0); | ||
641 | } | ||
642 | wacom_report_key(wcombo, wacom->tool[1], prox); | ||
643 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); | ||
644 | stylusInProx = prox; | ||
645 | wacom->tool[0] = prox; | ||
646 | return 1; | ||
647 | } | ||
648 | return 0; | ||
649 | } | ||
650 | |||
538 | int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo) | 651 | int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo) |
539 | { | 652 | { |
540 | switch (wacom_wac->features->type) { | 653 | switch (wacom_wac->features->type) { |
541 | case PENPARTNER: | 654 | case PENPARTNER: |
542 | return (wacom_penpartner_irq(wacom_wac, wcombo)); | 655 | return wacom_penpartner_irq(wacom_wac, wcombo); |
543 | break; | 656 | |
544 | case PL: | 657 | case PL: |
545 | return (wacom_pl_irq(wacom_wac, wcombo)); | 658 | return wacom_pl_irq(wacom_wac, wcombo); |
546 | break; | 659 | |
547 | case WACOM_G4: | 660 | case WACOM_G4: |
548 | case GRAPHIRE: | 661 | case GRAPHIRE: |
549 | case WACOM_MO: | 662 | case WACOM_MO: |
550 | return (wacom_graphire_irq(wacom_wac, wcombo)); | 663 | return wacom_graphire_irq(wacom_wac, wcombo); |
551 | break; | 664 | |
552 | case PTU: | 665 | case PTU: |
553 | return (wacom_ptu_irq(wacom_wac, wcombo)); | 666 | return wacom_ptu_irq(wacom_wac, wcombo); |
554 | break; | 667 | |
555 | case INTUOS: | 668 | case INTUOS: |
556 | case INTUOS3S: | 669 | case INTUOS3S: |
557 | case INTUOS3: | 670 | case INTUOS3: |
558 | case INTUOS3L: | 671 | case INTUOS3L: |
559 | case CINTIQ: | 672 | case CINTIQ: |
560 | case WACOM_BEE: | 673 | case WACOM_BEE: |
561 | return (wacom_intuos_irq(wacom_wac, wcombo)); | 674 | return wacom_intuos_irq(wacom_wac, wcombo); |
562 | break; | 675 | |
676 | case TABLETPC: | ||
677 | return wacom_tpc_irq(wacom_wac, wcombo); | ||
678 | |||
563 | default: | 679 | default: |
564 | return 0; | 680 | return 0; |
565 | } | 681 | } |
@@ -586,13 +702,15 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w | |||
586 | /* fall through */ | 702 | /* fall through */ |
587 | case INTUOS3S: | 703 | case INTUOS3S: |
588 | input_dev_i3s(input_dev, wacom_wac); | 704 | input_dev_i3s(input_dev, wacom_wac); |
705 | /* fall through */ | ||
589 | case INTUOS: | 706 | case INTUOS: |
590 | input_dev_i(input_dev, wacom_wac); | 707 | input_dev_i(input_dev, wacom_wac); |
591 | break; | 708 | break; |
592 | case PL: | 709 | case PL: |
593 | case PTU: | 710 | case PTU: |
711 | case TABLETPC: | ||
594 | input_dev_pl(input_dev, wacom_wac); | 712 | input_dev_pl(input_dev, wacom_wac); |
595 | break; | 713 | /* fall through */ |
596 | case PENPARTNER: | 714 | case PENPARTNER: |
597 | input_dev_pt(input_dev, wacom_wac); | 715 | input_dev_pt(input_dev, wacom_wac); |
598 | break; | 716 | break; |
@@ -611,6 +729,7 @@ static struct wacom_features wacom_features[] = { | |||
611 | { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 }, | 729 | { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 }, |
612 | { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO }, | 730 | { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO }, |
613 | { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO }, | 731 | { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO }, |
732 | { "Wacom Bamboo1 Medium",8, 16704, 12064, 511, 63, GRAPHIRE }, | ||
614 | { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE }, | 733 | { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE }, |
615 | { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE }, | 734 | { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE }, |
616 | { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE }, | 735 | { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE }, |
@@ -650,6 +769,10 @@ static struct wacom_features wacom_features[] = { | |||
650 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ }, | 769 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ }, |
651 | { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE }, | 770 | { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE }, |
652 | { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE }, | 771 | { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE }, |
772 | { "Wacom DTU1931", 8, 37832, 30305, 511, 0, PL }, | ||
773 | { "Wacom ISDv4 90", 8, 26202, 16325, 255, 0, TABLETPC }, | ||
774 | { "Wacom ISDv4 93", 8, 26202, 16325, 255, 0, TABLETPC }, | ||
775 | { "Wacom ISDv4 9A", 8, 26202, 16325, 255, 0, TABLETPC }, | ||
653 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, | 776 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, |
654 | { } | 777 | { } |
655 | }; | 778 | }; |
@@ -665,6 +788,7 @@ static struct usb_device_id wacom_ids[] = { | |||
665 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) }, | 788 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) }, |
666 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) }, | 789 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) }, |
667 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) }, | 790 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) }, |
791 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x19) }, | ||
668 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, | 792 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, |
669 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) }, | 793 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) }, |
670 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, | 794 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, |
@@ -704,18 +828,26 @@ static struct usb_device_id wacom_ids[] = { | |||
704 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, | 828 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, |
705 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) }, | 829 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) }, |
706 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) }, | 830 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) }, |
831 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC7) }, | ||
832 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x90) }, | ||
833 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x93) }, | ||
834 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x9A) }, | ||
707 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, | 835 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, |
708 | { } | 836 | { } |
709 | }; | 837 | }; |
710 | 838 | ||
711 | const struct usb_device_id * get_device_table(void) { | 839 | const struct usb_device_id *get_device_table(void) |
712 | const struct usb_device_id * id_table = wacom_ids; | 840 | { |
841 | const struct usb_device_id *id_table = wacom_ids; | ||
842 | |||
713 | return id_table; | 843 | return id_table; |
714 | } | 844 | } |
715 | 845 | ||
716 | struct wacom_features * get_wacom_feature(const struct usb_device_id * id) { | 846 | struct wacom_features * get_wacom_feature(const struct usb_device_id *id) |
847 | { | ||
717 | int index = id - wacom_ids; | 848 | int index = id - wacom_ids; |
718 | struct wacom_features *wf = &wacom_features[index]; | 849 | struct wacom_features *wf = &wacom_features[index]; |
850 | |||
719 | return wf; | 851 | return wf; |
720 | } | 852 | } |
721 | 853 | ||
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 3342bc05847d..f9c8b69673b7 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define WACOM_WAC_H | 10 | #define WACOM_WAC_H |
11 | 11 | ||
12 | #define STYLUS_DEVICE_ID 0x02 | 12 | #define STYLUS_DEVICE_ID 0x02 |
13 | #define TOUCH_DEVICE_ID 0x03 | ||
13 | #define CURSOR_DEVICE_ID 0x06 | 14 | #define CURSOR_DEVICE_ID 0x06 |
14 | #define ERASER_DEVICE_ID 0x0A | 15 | #define ERASER_DEVICE_ID 0x0A |
15 | #define PAD_DEVICE_ID 0x0F | 16 | #define PAD_DEVICE_ID 0x0F |
@@ -27,6 +28,7 @@ enum { | |||
27 | CINTIQ, | 28 | CINTIQ, |
28 | WACOM_BEE, | 29 | WACOM_BEE, |
29 | WACOM_MO, | 30 | WACOM_MO, |
31 | TABLETPC, | ||
30 | MAX_TYPE | 32 | MAX_TYPE |
31 | }; | 33 | }; |
32 | 34 | ||
@@ -38,6 +40,8 @@ struct wacom_features { | |||
38 | int pressure_max; | 40 | int pressure_max; |
39 | int distance_max; | 41 | int distance_max; |
40 | int type; | 42 | int type; |
43 | int touch_x_max; | ||
44 | int touch_y_max; | ||
41 | }; | 45 | }; |
42 | 46 | ||
43 | struct wacom_wac { | 47 | struct wacom_wac { |
diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index d20689cdbd5d..8f38c5e55ce6 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c | |||
@@ -262,7 +262,7 @@ static int elo_setup_10(struct elo *elo) | |||
262 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); | 262 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); |
263 | 263 | ||
264 | printk(KERN_INFO "elo: %sTouch touchscreen, fw: %02x.%02x, " | 264 | printk(KERN_INFO "elo: %sTouch touchscreen, fw: %02x.%02x, " |
265 | "features: %x02x, controller: 0x%02x\n", | 265 | "features: 0x%02x, controller: 0x%02x\n", |
266 | elo_types[(packet[1] -'0') & 0x03], | 266 | elo_types[(packet[1] -'0') & 0x03], |
267 | packet[5], packet[4], packet[3], packet[7]); | 267 | packet[5], packet[4], packet[3], packet[7]); |
268 | 268 | ||
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c index 3ab6362f043c..928d2ed8865f 100644 --- a/drivers/input/xen-kbdfront.c +++ b/drivers/input/xen-kbdfront.c | |||
@@ -323,7 +323,7 @@ static struct xenbus_device_id xenkbd_ids[] = { | |||
323 | { "" } | 323 | { "" } |
324 | }; | 324 | }; |
325 | 325 | ||
326 | static struct xenbus_driver xenkbd = { | 326 | static struct xenbus_driver xenkbd_driver = { |
327 | .name = "vkbd", | 327 | .name = "vkbd", |
328 | .owner = THIS_MODULE, | 328 | .owner = THIS_MODULE, |
329 | .ids = xenkbd_ids, | 329 | .ids = xenkbd_ids, |
@@ -342,12 +342,12 @@ static int __init xenkbd_init(void) | |||
342 | if (xen_initial_domain()) | 342 | if (xen_initial_domain()) |
343 | return -ENODEV; | 343 | return -ENODEV; |
344 | 344 | ||
345 | return xenbus_register_frontend(&xenkbd); | 345 | return xenbus_register_frontend(&xenkbd_driver); |
346 | } | 346 | } |
347 | 347 | ||
348 | static void __exit xenkbd_cleanup(void) | 348 | static void __exit xenkbd_cleanup(void) |
349 | { | 349 | { |
350 | xenbus_unregister_driver(&xenkbd); | 350 | xenbus_unregister_driver(&xenkbd_driver); |
351 | } | 351 | } |
352 | 352 | ||
353 | module_init(xenkbd_init); | 353 | module_init(xenkbd_init); |
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 84d75a3f5d17..ded9d0baf607 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c | |||
@@ -1213,7 +1213,7 @@ static void HiSax_shiftcards(int idx) | |||
1213 | memcpy(&cards[i], &cards[i + 1], sizeof(cards[i])); | 1213 | memcpy(&cards[i], &cards[i + 1], sizeof(cards[i])); |
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | static int HiSax_inithardware(int *busy_flag) | 1216 | static int __init HiSax_inithardware(int *busy_flag) |
1217 | { | 1217 | { |
1218 | int foundcards = 0; | 1218 | int foundcards = 0; |
1219 | int i = 0; | 1219 | int i = 0; |
@@ -1542,7 +1542,9 @@ static void __exit HiSax_exit(void) | |||
1542 | printk(KERN_INFO "HiSax module removed\n"); | 1542 | printk(KERN_INFO "HiSax module removed\n"); |
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card) | 1545 | #ifdef CONFIG_HOTPLUG |
1546 | |||
1547 | int __devinit hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card) | ||
1546 | { | 1548 | { |
1547 | u_char ids[16]; | 1549 | u_char ids[16]; |
1548 | int ret = -1; | 1550 | int ret = -1; |
@@ -1563,6 +1565,8 @@ error: | |||
1563 | } | 1565 | } |
1564 | 1566 | ||
1565 | EXPORT_SYMBOL(hisax_init_pcmcia); | 1567 | EXPORT_SYMBOL(hisax_init_pcmcia); |
1568 | #endif | ||
1569 | |||
1566 | EXPORT_SYMBOL(HiSax_closecard); | 1570 | EXPORT_SYMBOL(HiSax_closecard); |
1567 | 1571 | ||
1568 | #include "hisax_if.h" | 1572 | #include "hisax_if.h" |
@@ -1580,6 +1584,11 @@ static void hisax_bc_close(struct BCState *bcs); | |||
1580 | static void hisax_bh(struct work_struct *work); | 1584 | static void hisax_bh(struct work_struct *work); |
1581 | static void EChannel_proc_rcv(struct hisax_d_if *d_if); | 1585 | static void EChannel_proc_rcv(struct hisax_d_if *d_if); |
1582 | 1586 | ||
1587 | static int hisax_setup_card_dynamic(struct IsdnCard *card) | ||
1588 | { | ||
1589 | return 2; | ||
1590 | } | ||
1591 | |||
1583 | int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], | 1592 | int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], |
1584 | char *name, int protocol) | 1593 | char *name, int protocol) |
1585 | { | 1594 | { |
@@ -1599,7 +1608,8 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], | |||
1599 | cards[i].protocol = protocol; | 1608 | cards[i].protocol = protocol; |
1600 | sprintf(id, "%s%d", name, i); | 1609 | sprintf(id, "%s%d", name, i); |
1601 | nrcards++; | 1610 | nrcards++; |
1602 | retval = checkcard(i, id, NULL, hisax_d_if->owner, hisax_cs_setup_card); | 1611 | retval = checkcard(i, id, NULL, hisax_d_if->owner, |
1612 | hisax_setup_card_dynamic); | ||
1603 | if (retval == 0) { // yuck | 1613 | if (retval == 0) { // yuck |
1604 | cards[i].typ = 0; | 1614 | cards[i].typ = 0; |
1605 | nrcards--; | 1615 | nrcards--; |
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 2c21d4f25cc8..a98ab72adf95 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c | |||
@@ -288,7 +288,7 @@ static void __devexit rackmeter_stop_cpu_sniffer(struct rackmeter *rm) | |||
288 | cancel_rearming_delayed_work(&rm->cpu[1].sniffer); | 288 | cancel_rearming_delayed_work(&rm->cpu[1].sniffer); |
289 | } | 289 | } |
290 | 290 | ||
291 | static int rackmeter_setup(struct rackmeter *rm) | 291 | static int __devinit rackmeter_setup(struct rackmeter *rm) |
292 | { | 292 | { |
293 | pr_debug("rackmeter: setting up i2s..\n"); | 293 | pr_debug("rackmeter: setting up i2s..\n"); |
294 | rackmeter_setup_i2s(rm); | 294 | rackmeter_setup_i2s(rm); |
@@ -582,12 +582,12 @@ static struct of_device_id rackmeter_match[] = { | |||
582 | { } | 582 | { } |
583 | }; | 583 | }; |
584 | 584 | ||
585 | static struct macio_driver rackmeter_drv = { | 585 | static struct macio_driver rackmeter_driver = { |
586 | .name = "rackmeter", | 586 | .name = "rackmeter", |
587 | .owner = THIS_MODULE, | 587 | .owner = THIS_MODULE, |
588 | .match_table = rackmeter_match, | 588 | .match_table = rackmeter_match, |
589 | .probe = rackmeter_probe, | 589 | .probe = rackmeter_probe, |
590 | .remove = rackmeter_remove, | 590 | .remove = __devexit_p(rackmeter_remove), |
591 | .shutdown = rackmeter_shutdown, | 591 | .shutdown = rackmeter_shutdown, |
592 | }; | 592 | }; |
593 | 593 | ||
@@ -596,14 +596,14 @@ static int __init rackmeter_init(void) | |||
596 | { | 596 | { |
597 | pr_debug("rackmeter_init()\n"); | 597 | pr_debug("rackmeter_init()\n"); |
598 | 598 | ||
599 | return macio_register_driver(&rackmeter_drv); | 599 | return macio_register_driver(&rackmeter_driver); |
600 | } | 600 | } |
601 | 601 | ||
602 | static void __exit rackmeter_exit(void) | 602 | static void __exit rackmeter_exit(void) |
603 | { | 603 | { |
604 | pr_debug("rackmeter_exit()\n"); | 604 | pr_debug("rackmeter_exit()\n"); |
605 | 605 | ||
606 | macio_unregister_driver(&rackmeter_drv); | 606 | macio_unregister_driver(&rackmeter_driver); |
607 | } | 607 | } |
608 | 608 | ||
609 | module_init(rackmeter_init); | 609 | module_init(rackmeter_init); |
diff --git a/drivers/misc/sgi-gru/Makefile b/drivers/misc/sgi-gru/Makefile index d03597a521b0..9e9170b3599a 100644 --- a/drivers/misc/sgi-gru/Makefile +++ b/drivers/misc/sgi-gru/Makefile | |||
@@ -1,3 +1,7 @@ | |||
1 | ifdef CONFIG_SGI_GRU_DEBUG | ||
2 | EXTRA_CFLAGS += -DDEBUG | ||
3 | endif | ||
4 | |||
1 | obj-$(CONFIG_SGI_GRU) := gru.o | 5 | obj-$(CONFIG_SGI_GRU) := gru.o |
2 | gru-y := grufile.o grumain.o grufault.o grutlbpurge.o gruprocfs.o grukservices.o | 6 | gru-y := grufile.o grumain.o grufault.o grutlbpurge.o gruprocfs.o grukservices.o |
3 | 7 | ||
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 7bcb81002dcf..571b211608d1 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -1038,8 +1038,8 @@ static int sony_nc_add(struct acpi_device *device) | |||
1038 | goto outinput; | 1038 | goto outinput; |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | if (!acpi_video_backlight_support()) { | 1041 | if (acpi_video_backlight_support()) { |
1042 | printk(KERN_INFO DRV_PFX "Sony: Brightness ignored, must be " | 1042 | printk(KERN_INFO DRV_PFX "brightness ignored, must be " |
1043 | "controlled by ACPI video driver\n"); | 1043 | "controlled by ACPI video driver\n"); |
1044 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", | 1044 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", |
1045 | &handle))) { | 1045 | &handle))) { |
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 7a4a26b0edd2..899766e16fa8 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -5318,6 +5318,7 @@ static enum fan_control_commands fan_control_commands; | |||
5318 | 5318 | ||
5319 | static u8 fan_control_initial_status; | 5319 | static u8 fan_control_initial_status; |
5320 | static u8 fan_control_desired_level; | 5320 | static u8 fan_control_desired_level; |
5321 | static u8 fan_control_resume_level; | ||
5321 | static int fan_watchdog_maxinterval; | 5322 | static int fan_watchdog_maxinterval; |
5322 | 5323 | ||
5323 | static struct mutex fan_mutex; | 5324 | static struct mutex fan_mutex; |
@@ -5440,8 +5441,8 @@ static int fan_set_level(int level) | |||
5440 | 5441 | ||
5441 | case TPACPI_FAN_WR_ACPI_FANS: | 5442 | case TPACPI_FAN_WR_ACPI_FANS: |
5442 | case TPACPI_FAN_WR_TPEC: | 5443 | case TPACPI_FAN_WR_TPEC: |
5443 | if ((level != TP_EC_FAN_AUTO) && | 5444 | if (!(level & TP_EC_FAN_AUTO) && |
5444 | (level != TP_EC_FAN_FULLSPEED) && | 5445 | !(level & TP_EC_FAN_FULLSPEED) && |
5445 | ((level < 0) || (level > 7))) | 5446 | ((level < 0) || (level > 7))) |
5446 | return -EINVAL; | 5447 | return -EINVAL; |
5447 | 5448 | ||
@@ -6005,38 +6006,67 @@ static void fan_exit(void) | |||
6005 | 6006 | ||
6006 | static void fan_suspend(pm_message_t state) | 6007 | static void fan_suspend(pm_message_t state) |
6007 | { | 6008 | { |
6009 | int rc; | ||
6010 | |||
6008 | if (!fan_control_allowed) | 6011 | if (!fan_control_allowed) |
6009 | return; | 6012 | return; |
6010 | 6013 | ||
6011 | /* Store fan status in cache */ | 6014 | /* Store fan status in cache */ |
6012 | fan_get_status_safe(NULL); | 6015 | fan_control_resume_level = 0; |
6016 | rc = fan_get_status_safe(&fan_control_resume_level); | ||
6017 | if (rc < 0) | ||
6018 | printk(TPACPI_NOTICE | ||
6019 | "failed to read fan level for later " | ||
6020 | "restore during resume: %d\n", rc); | ||
6021 | |||
6022 | /* if it is undefined, don't attempt to restore it. | ||
6023 | * KEEP THIS LAST */ | ||
6013 | if (tp_features.fan_ctrl_status_undef) | 6024 | if (tp_features.fan_ctrl_status_undef) |
6014 | fan_control_desired_level = TP_EC_FAN_AUTO; | 6025 | fan_control_resume_level = 0; |
6015 | } | 6026 | } |
6016 | 6027 | ||
6017 | static void fan_resume(void) | 6028 | static void fan_resume(void) |
6018 | { | 6029 | { |
6019 | u8 saved_fan_level; | ||
6020 | u8 current_level = 7; | 6030 | u8 current_level = 7; |
6021 | bool do_set = false; | 6031 | bool do_set = false; |
6032 | int rc; | ||
6022 | 6033 | ||
6023 | /* DSDT *always* updates status on resume */ | 6034 | /* DSDT *always* updates status on resume */ |
6024 | tp_features.fan_ctrl_status_undef = 0; | 6035 | tp_features.fan_ctrl_status_undef = 0; |
6025 | 6036 | ||
6026 | saved_fan_level = fan_control_desired_level; | ||
6027 | if (!fan_control_allowed || | 6037 | if (!fan_control_allowed || |
6038 | !fan_control_resume_level || | ||
6028 | (fan_get_status_safe(¤t_level) < 0)) | 6039 | (fan_get_status_safe(¤t_level) < 0)) |
6029 | return; | 6040 | return; |
6030 | 6041 | ||
6031 | switch (fan_control_access_mode) { | 6042 | switch (fan_control_access_mode) { |
6032 | case TPACPI_FAN_WR_ACPI_SFAN: | 6043 | case TPACPI_FAN_WR_ACPI_SFAN: |
6033 | do_set = (saved_fan_level > current_level); | 6044 | /* never decrease fan level */ |
6045 | do_set = (fan_control_resume_level > current_level); | ||
6034 | break; | 6046 | break; |
6035 | case TPACPI_FAN_WR_ACPI_FANS: | 6047 | case TPACPI_FAN_WR_ACPI_FANS: |
6036 | case TPACPI_FAN_WR_TPEC: | 6048 | case TPACPI_FAN_WR_TPEC: |
6037 | do_set = ((saved_fan_level & TP_EC_FAN_FULLSPEED) || | 6049 | /* never decrease fan level, scale is: |
6038 | (saved_fan_level == 7 && | 6050 | * TP_EC_FAN_FULLSPEED > 7 >= TP_EC_FAN_AUTO |
6039 | !(current_level & TP_EC_FAN_FULLSPEED))); | 6051 | * |
6052 | * We expect the firmware to set either 7 or AUTO, but we | ||
6053 | * handle FULLSPEED out of paranoia. | ||
6054 | * | ||
6055 | * So, we can safely only restore FULLSPEED or 7, anything | ||
6056 | * else could slow the fan. Restoring AUTO is useless, at | ||
6057 | * best that's exactly what the DSDT already set (it is the | ||
6058 | * slower it uses). | ||
6059 | * | ||
6060 | * Always keep in mind that the DSDT *will* have set the | ||
6061 | * fans to what the vendor supposes is the best level. We | ||
6062 | * muck with it only to speed the fan up. | ||
6063 | */ | ||
6064 | if (fan_control_resume_level != 7 && | ||
6065 | !(fan_control_resume_level & TP_EC_FAN_FULLSPEED)) | ||
6066 | return; | ||
6067 | else | ||
6068 | do_set = !(current_level & TP_EC_FAN_FULLSPEED) && | ||
6069 | (current_level != fan_control_resume_level); | ||
6040 | break; | 6070 | break; |
6041 | default: | 6071 | default: |
6042 | return; | 6072 | return; |
@@ -6044,8 +6074,11 @@ static void fan_resume(void) | |||
6044 | if (do_set) { | 6074 | if (do_set) { |
6045 | printk(TPACPI_NOTICE | 6075 | printk(TPACPI_NOTICE |
6046 | "restoring fan level to 0x%02x\n", | 6076 | "restoring fan level to 0x%02x\n", |
6047 | saved_fan_level); | 6077 | fan_control_resume_level); |
6048 | fan_set_level_safe(saved_fan_level); | 6078 | rc = fan_set_level_safe(fan_control_resume_level); |
6079 | if (rc < 0) | ||
6080 | printk(TPACPI_NOTICE | ||
6081 | "failed to restore fan level: %d\n", rc); | ||
6049 | } | 6082 | } |
6050 | } | 6083 | } |
6051 | 6084 | ||
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index e04bcf1dff87..d8966bae0e0b 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c | |||
@@ -1022,7 +1022,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to, | |||
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | /* | 1024 | /* |
1025 | * OK, now the LEB is locked and we can safely start moving iy. Since | 1025 | * OK, now the LEB is locked and we can safely start moving it. Since |
1026 | * this function utilizes thie @ubi->peb1_buf buffer which is shared | 1026 | * this function utilizes thie @ubi->peb1_buf buffer which is shared |
1027 | * with some other functions, so lock the buffer by taking the | 1027 | * with some other functions, so lock the buffer by taking the |
1028 | * @ubi->buf_mutex. | 1028 | * @ubi->buf_mutex. |
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 4f2daa5bbecf..41d47e1cf15c 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -320,7 +320,7 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb, | |||
320 | } | 320 | } |
321 | 321 | ||
322 | err = ubi_io_read_data(ubi, buf, pnum, 0, len); | 322 | err = ubi_io_read_data(ubi, buf, pnum, 0, len); |
323 | if (err && err != UBI_IO_BITFLIPS) | 323 | if (err && err != UBI_IO_BITFLIPS && err != -EBADMSG) |
324 | goto out_free_buf; | 324 | goto out_free_buf; |
325 | 325 | ||
326 | data_crc = be32_to_cpu(vid_hdr->data_crc); | 326 | data_crc = be32_to_cpu(vid_hdr->data_crc); |
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 05d70937b543..dcb6dac1dc54 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
@@ -1396,7 +1396,8 @@ int ubi_thread(void *u) | |||
1396 | ubi_msg("%s: %d consecutive failures", | 1396 | ubi_msg("%s: %d consecutive failures", |
1397 | ubi->bgt_name, WL_MAX_FAILURES); | 1397 | ubi->bgt_name, WL_MAX_FAILURES); |
1398 | ubi_ro_mode(ubi); | 1398 | ubi_ro_mode(ubi); |
1399 | break; | 1399 | ubi->thread_enabled = 0; |
1400 | continue; | ||
1400 | } | 1401 | } |
1401 | } else | 1402 | } else |
1402 | failures = 0; | 1403 | failures = 0; |
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index f5bdc92c1a65..8571e8c0bc67 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
@@ -1690,9 +1690,11 @@ static int atl2_resume(struct pci_dev *pdev) | |||
1690 | 1690 | ||
1691 | ATL2_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); | 1691 | ATL2_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); |
1692 | 1692 | ||
1693 | err = atl2_request_irq(adapter); | 1693 | if (netif_running(netdev)) { |
1694 | if (netif_running(netdev) && err) | 1694 | err = atl2_request_irq(adapter); |
1695 | return err; | 1695 | if (err) |
1696 | return err; | ||
1697 | } | ||
1696 | 1698 | ||
1697 | atl2_reset_hw(&adapter->hw); | 1699 | atl2_reset_hw(&adapter->hw); |
1698 | 1700 | ||
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 7373dafbb3f7..059369885be1 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c | |||
@@ -1112,7 +1112,7 @@ static void ipg_nic_rx_free_skb(struct net_device *dev) | |||
1112 | struct ipg_rx *rxfd = sp->rxd + entry; | 1112 | struct ipg_rx *rxfd = sp->rxd + entry; |
1113 | 1113 | ||
1114 | pci_unmap_single(sp->pdev, | 1114 | pci_unmap_single(sp->pdev, |
1115 | le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1115 | le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
1116 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1116 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1117 | dev_kfree_skb_irq(sp->rx_buff[entry]); | 1117 | dev_kfree_skb_irq(sp->rx_buff[entry]); |
1118 | sp->rx_buff[entry] = NULL; | 1118 | sp->rx_buff[entry] = NULL; |
@@ -1179,7 +1179,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev) | |||
1179 | */ | 1179 | */ |
1180 | if (sp->rx_buff[entry]) { | 1180 | if (sp->rx_buff[entry]) { |
1181 | pci_unmap_single(sp->pdev, | 1181 | pci_unmap_single(sp->pdev, |
1182 | le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1182 | le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
1183 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1183 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1184 | 1184 | ||
1185 | dev_kfree_skb_irq(sp->rx_buff[entry]); | 1185 | dev_kfree_skb_irq(sp->rx_buff[entry]); |
@@ -1246,7 +1246,7 @@ static void ipg_nic_rx_with_start(struct net_device *dev, | |||
1246 | if (jumbo->found_start) | 1246 | if (jumbo->found_start) |
1247 | dev_kfree_skb_irq(jumbo->skb); | 1247 | dev_kfree_skb_irq(jumbo->skb); |
1248 | 1248 | ||
1249 | pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1249 | pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
1250 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1250 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1251 | 1251 | ||
1252 | skb_put(skb, sp->rxfrag_size); | 1252 | skb_put(skb, sp->rxfrag_size); |
@@ -1349,7 +1349,7 @@ static int ipg_nic_rx_jumbo(struct net_device *dev) | |||
1349 | unsigned int entry = curr % IPG_RFDLIST_LENGTH; | 1349 | unsigned int entry = curr % IPG_RFDLIST_LENGTH; |
1350 | struct ipg_rx *rxfd = sp->rxd + entry; | 1350 | struct ipg_rx *rxfd = sp->rxd + entry; |
1351 | 1351 | ||
1352 | if (!(rxfd->rfs & le64_to_cpu(IPG_RFS_RFDDONE))) | 1352 | if (!(rxfd->rfs & cpu_to_le64(IPG_RFS_RFDDONE))) |
1353 | break; | 1353 | break; |
1354 | 1354 | ||
1355 | switch (ipg_nic_rx_check_frame_type(dev)) { | 1355 | switch (ipg_nic_rx_check_frame_type(dev)) { |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7548fb7360d9..8ed823ae639e 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1287,7 +1287,34 @@ static void ixgbe_set_itr(struct ixgbe_adapter *adapter) | |||
1287 | return; | 1287 | return; |
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter); | 1290 | /** |
1291 | * ixgbe_irq_disable - Mask off interrupt generation on the NIC | ||
1292 | * @adapter: board private structure | ||
1293 | **/ | ||
1294 | static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter) | ||
1295 | { | ||
1296 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); | ||
1297 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
1298 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | ||
1299 | int i; | ||
1300 | for (i = 0; i < adapter->num_msix_vectors; i++) | ||
1301 | synchronize_irq(adapter->msix_entries[i].vector); | ||
1302 | } else { | ||
1303 | synchronize_irq(adapter->pdev->irq); | ||
1304 | } | ||
1305 | } | ||
1306 | |||
1307 | /** | ||
1308 | * ixgbe_irq_enable - Enable default interrupt generation settings | ||
1309 | * @adapter: board private structure | ||
1310 | **/ | ||
1311 | static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) | ||
1312 | { | ||
1313 | u32 mask; | ||
1314 | mask = IXGBE_EIMS_ENABLE_MASK; | ||
1315 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); | ||
1316 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
1317 | } | ||
1291 | 1318 | ||
1292 | /** | 1319 | /** |
1293 | * ixgbe_intr - legacy mode Interrupt Handler | 1320 | * ixgbe_intr - legacy mode Interrupt Handler |
@@ -1394,35 +1421,6 @@ static void ixgbe_free_irq(struct ixgbe_adapter *adapter) | |||
1394 | } | 1421 | } |
1395 | 1422 | ||
1396 | /** | 1423 | /** |
1397 | * ixgbe_irq_disable - Mask off interrupt generation on the NIC | ||
1398 | * @adapter: board private structure | ||
1399 | **/ | ||
1400 | static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter) | ||
1401 | { | ||
1402 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); | ||
1403 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
1404 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | ||
1405 | int i; | ||
1406 | for (i = 0; i < adapter->num_msix_vectors; i++) | ||
1407 | synchronize_irq(adapter->msix_entries[i].vector); | ||
1408 | } else { | ||
1409 | synchronize_irq(adapter->pdev->irq); | ||
1410 | } | ||
1411 | } | ||
1412 | |||
1413 | /** | ||
1414 | * ixgbe_irq_enable - Enable default interrupt generation settings | ||
1415 | * @adapter: board private structure | ||
1416 | **/ | ||
1417 | static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) | ||
1418 | { | ||
1419 | u32 mask; | ||
1420 | mask = IXGBE_EIMS_ENABLE_MASK; | ||
1421 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); | ||
1422 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
1423 | } | ||
1424 | |||
1425 | /** | ||
1426 | * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts | 1424 | * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts |
1427 | * | 1425 | * |
1428 | **/ | 1426 | **/ |
@@ -2332,7 +2330,7 @@ static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, | |||
2332 | * Once we know the feature-set enabled for the device, we'll cache | 2330 | * Once we know the feature-set enabled for the device, we'll cache |
2333 | * the register offset the descriptor ring is assigned to. | 2331 | * the register offset the descriptor ring is assigned to. |
2334 | **/ | 2332 | **/ |
2335 | static void __devinit ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) | 2333 | static void ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) |
2336 | { | 2334 | { |
2337 | int feature_mask = 0, rss_i; | 2335 | int feature_mask = 0, rss_i; |
2338 | int i, txr_idx, rxr_idx; | 2336 | int i, txr_idx, rxr_idx; |
@@ -2369,7 +2367,7 @@ static void __devinit ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) | |||
2369 | * number of queues at compile-time. The polling_netdev array is | 2367 | * number of queues at compile-time. The polling_netdev array is |
2370 | * intended for Multiqueue, but should work fine with a single queue. | 2368 | * intended for Multiqueue, but should work fine with a single queue. |
2371 | **/ | 2369 | **/ |
2372 | static int __devinit ixgbe_alloc_queues(struct ixgbe_adapter *adapter) | 2370 | static int ixgbe_alloc_queues(struct ixgbe_adapter *adapter) |
2373 | { | 2371 | { |
2374 | int i; | 2372 | int i; |
2375 | 2373 | ||
@@ -2410,8 +2408,7 @@ err_tx_ring_allocation: | |||
2410 | * Attempt to configure the interrupts using the best available | 2408 | * Attempt to configure the interrupts using the best available |
2411 | * capabilities of the hardware and the kernel. | 2409 | * capabilities of the hardware and the kernel. |
2412 | **/ | 2410 | **/ |
2413 | static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter | 2411 | static int ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter) |
2414 | *adapter) | ||
2415 | { | 2412 | { |
2416 | int err = 0; | 2413 | int err = 0; |
2417 | int vector, v_budget; | 2414 | int vector, v_budget; |
@@ -2503,7 +2500,7 @@ static void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter) | |||
2503 | * - Hardware queue count (num_*_queues) | 2500 | * - Hardware queue count (num_*_queues) |
2504 | * - defined by miscellaneous hardware support/features (RSS, etc.) | 2501 | * - defined by miscellaneous hardware support/features (RSS, etc.) |
2505 | **/ | 2502 | **/ |
2506 | static int __devinit ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter) | 2503 | static int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter) |
2507 | { | 2504 | { |
2508 | int err; | 2505 | int err; |
2509 | 2506 | ||
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 81c6cdc3851f..665e70d620fc 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
@@ -912,23 +912,23 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx) | |||
912 | skb_put(skb, framesize); | 912 | skb_put(skb, framesize); |
913 | skb->protocol = eth_type_trans(skb, jme->dev); | 913 | skb->protocol = eth_type_trans(skb, jme->dev); |
914 | 914 | ||
915 | if (jme_rxsum_ok(jme, rxdesc->descwb.flags)) | 915 | if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags))) |
916 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 916 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
917 | else | 917 | else |
918 | skb->ip_summed = CHECKSUM_NONE; | 918 | skb->ip_summed = CHECKSUM_NONE; |
919 | 919 | ||
920 | if (rxdesc->descwb.flags & RXWBFLAG_TAGON) { | 920 | if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) { |
921 | if (jme->vlgrp) { | 921 | if (jme->vlgrp) { |
922 | jme->jme_vlan_rx(skb, jme->vlgrp, | 922 | jme->jme_vlan_rx(skb, jme->vlgrp, |
923 | le32_to_cpu(rxdesc->descwb.vlan)); | 923 | le16_to_cpu(rxdesc->descwb.vlan)); |
924 | NET_STAT(jme).rx_bytes += 4; | 924 | NET_STAT(jme).rx_bytes += 4; |
925 | } | 925 | } |
926 | } else { | 926 | } else { |
927 | jme->jme_rx(skb); | 927 | jme->jme_rx(skb); |
928 | } | 928 | } |
929 | 929 | ||
930 | if ((le16_to_cpu(rxdesc->descwb.flags) & RXWBFLAG_DEST) == | 930 | if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_DEST)) == |
931 | RXWBFLAG_DEST_MUL) | 931 | cpu_to_le16(RXWBFLAG_DEST_MUL)) |
932 | ++(NET_STAT(jme).multicast); | 932 | ++(NET_STAT(jme).multicast); |
933 | 933 | ||
934 | jme->dev->last_rx = jiffies; | 934 | jme->dev->last_rx = jiffies; |
@@ -961,7 +961,7 @@ jme_process_receive(struct jme_adapter *jme, int limit) | |||
961 | rxdesc = rxring->desc; | 961 | rxdesc = rxring->desc; |
962 | rxdesc += i; | 962 | rxdesc += i; |
963 | 963 | ||
964 | if ((rxdesc->descwb.flags & RXWBFLAG_OWN) || | 964 | if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || |
965 | !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) | 965 | !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) |
966 | goto out; | 966 | goto out; |
967 | 967 | ||
@@ -1763,10 +1763,9 @@ jme_expand_header(struct jme_adapter *jme, struct sk_buff *skb) | |||
1763 | } | 1763 | } |
1764 | 1764 | ||
1765 | static int | 1765 | static int |
1766 | jme_tx_tso(struct sk_buff *skb, | 1766 | jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags) |
1767 | u16 *mss, u8 *flags) | ||
1768 | { | 1767 | { |
1769 | *mss = skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT; | 1768 | *mss = cpu_to_le16(skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT); |
1770 | if (*mss) { | 1769 | if (*mss) { |
1771 | *flags |= TXFLAG_LSEN; | 1770 | *flags |= TXFLAG_LSEN; |
1772 | 1771 | ||
@@ -1826,11 +1825,11 @@ jme_tx_csum(struct jme_adapter *jme, struct sk_buff *skb, u8 *flags) | |||
1826 | } | 1825 | } |
1827 | 1826 | ||
1828 | static inline void | 1827 | static inline void |
1829 | jme_tx_vlan(struct sk_buff *skb, u16 *vlan, u8 *flags) | 1828 | jme_tx_vlan(struct sk_buff *skb, __le16 *vlan, u8 *flags) |
1830 | { | 1829 | { |
1831 | if (vlan_tx_tag_present(skb)) { | 1830 | if (vlan_tx_tag_present(skb)) { |
1832 | *flags |= TXFLAG_TAGON; | 1831 | *flags |= TXFLAG_TAGON; |
1833 | *vlan = vlan_tx_tag_get(skb); | 1832 | *vlan = cpu_to_le16(vlan_tx_tag_get(skb)); |
1834 | } | 1833 | } |
1835 | } | 1834 | } |
1836 | 1835 | ||
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index b9dcdbd369f8..e513f76f2a9f 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -899,7 +899,8 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) | |||
899 | if (skb != NULL) { | 899 | if (skb != NULL) { |
900 | if (skb_queue_len(&mp->rx_recycle) < | 900 | if (skb_queue_len(&mp->rx_recycle) < |
901 | mp->default_rx_ring_size && | 901 | mp->default_rx_ring_size && |
902 | skb_recycle_check(skb, mp->skb_size)) | 902 | skb_recycle_check(skb, mp->skb_size + |
903 | dma_get_cache_alignment() - 1)) | ||
903 | __skb_queue_head(&mp->rx_recycle, skb); | 904 | __skb_queue_head(&mp->rx_recycle, skb); |
904 | else | 905 | else |
905 | dev_kfree_skb(skb); | 906 | dev_kfree_skb(skb); |
@@ -2435,8 +2436,8 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev) | |||
2435 | struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; | 2436 | struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; |
2436 | 2437 | ||
2437 | if (pd == NULL || pd->shared_smi == NULL) { | 2438 | if (pd == NULL || pd->shared_smi == NULL) { |
2438 | mdiobus_free(msp->smi_bus); | ||
2439 | mdiobus_unregister(msp->smi_bus); | 2439 | mdiobus_unregister(msp->smi_bus); |
2440 | mdiobus_free(msp->smi_bus); | ||
2440 | } | 2441 | } |
2441 | if (msp->err_interrupt != NO_IRQ) | 2442 | if (msp->err_interrupt != NO_IRQ) |
2442 | free_irq(msp->err_interrupt, msp); | 2443 | free_irq(msp->err_interrupt, msp); |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index cf3cca4642f2..f51944b28cfa 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -349,7 +349,7 @@ static int ibmtr_suspend(struct pcmcia_device *link) | |||
349 | return 0; | 349 | return 0; |
350 | } | 350 | } |
351 | 351 | ||
352 | static int ibmtr_resume(struct pcmcia_device *link) | 352 | static int __devinit ibmtr_resume(struct pcmcia_device *link) |
353 | { | 353 | { |
354 | ibmtr_dev_t *info = link->priv; | 354 | ibmtr_dev_t *info = link->priv; |
355 | struct net_device *dev = info->dev; | 355 | struct net_device *dev = info->dev; |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 8fb1faca883a..55bc24b234e3 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -564,20 +564,32 @@ EXPORT_SYMBOL(genphy_restart_aneg); | |||
564 | */ | 564 | */ |
565 | int genphy_config_aneg(struct phy_device *phydev) | 565 | int genphy_config_aneg(struct phy_device *phydev) |
566 | { | 566 | { |
567 | int result = 0; | 567 | int result; |
568 | 568 | ||
569 | if (AUTONEG_ENABLE == phydev->autoneg) { | 569 | if (AUTONEG_ENABLE != phydev->autoneg) |
570 | int result = genphy_config_advert(phydev); | 570 | return genphy_setup_forced(phydev); |
571 | |||
572 | result = genphy_config_advert(phydev); | ||
573 | |||
574 | if (result < 0) /* error */ | ||
575 | return result; | ||
571 | 576 | ||
572 | if (result < 0) /* error */ | 577 | if (result == 0) { |
573 | return result; | 578 | /* Advertisment hasn't changed, but maybe aneg was never on to |
579 | * begin with? Or maybe phy was isolated? */ | ||
580 | int ctl = phy_read(phydev, MII_BMCR); | ||
581 | |||
582 | if (ctl < 0) | ||
583 | return ctl; | ||
584 | |||
585 | if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE)) | ||
586 | result = 1; /* do restart aneg */ | ||
587 | } | ||
574 | 588 | ||
575 | /* Only restart aneg if we are advertising something different | 589 | /* Only restart aneg if we are advertising something different |
576 | * than we were before. */ | 590 | * than we were before. */ |
577 | if (result > 0) | 591 | if (result > 0) |
578 | result = genphy_restart_aneg(phydev); | 592 | result = genphy_restart_aneg(phydev); |
579 | } else | ||
580 | result = genphy_setup_forced(phydev); | ||
581 | 593 | ||
582 | return result; | 594 | return result; |
583 | } | 595 | } |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index a24bb68887ab..59f242a67714 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -927,7 +927,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
927 | struct sh_eth_private *mdp = netdev_priv(ndev); | 927 | struct sh_eth_private *mdp = netdev_priv(ndev); |
928 | struct sh_eth_txdesc *txdesc; | 928 | struct sh_eth_txdesc *txdesc; |
929 | u32 entry; | 929 | u32 entry; |
930 | int flags; | 930 | unsigned long flags; |
931 | 931 | ||
932 | spin_lock_irqsave(&mdp->lock, flags); | 932 | spin_lock_irqsave(&mdp->lock, flags); |
933 | if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) { | 933 | if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) { |
@@ -1141,7 +1141,7 @@ static int sh_mdio_init(struct net_device *ndev, int id) | |||
1141 | /* Hook up MII support for ethtool */ | 1141 | /* Hook up MII support for ethtool */ |
1142 | mdp->mii_bus->name = "sh_mii"; | 1142 | mdp->mii_bus->name = "sh_mii"; |
1143 | mdp->mii_bus->parent = &ndev->dev; | 1143 | mdp->mii_bus->parent = &ndev->dev; |
1144 | mdp->mii_bus->id[0] = id; | 1144 | snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%x", id); |
1145 | 1145 | ||
1146 | /* PHY IRQ */ | 1146 | /* PHY IRQ */ |
1147 | mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); | 1147 | mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); |
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 1f26ab0e7986..9a16a79b67d0 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -1735,7 +1735,7 @@ static const struct ethtool_ops smc911x_ethtool_ops = { | |||
1735 | * This routine has a simple purpose -- make the SMC chip generate an | 1735 | * This routine has a simple purpose -- make the SMC chip generate an |
1736 | * interrupt, so an auto-detect routine can detect it, and find the IRQ, | 1736 | * interrupt, so an auto-detect routine can detect it, and find the IRQ, |
1737 | */ | 1737 | */ |
1738 | static int __init smc911x_findirq(struct net_device *dev) | 1738 | static int __devinit smc911x_findirq(struct net_device *dev) |
1739 | { | 1739 | { |
1740 | struct smc911x_local *lp = netdev_priv(dev); | 1740 | struct smc911x_local *lp = netdev_priv(dev); |
1741 | int timeout = 20; | 1741 | int timeout = 20; |
@@ -1799,7 +1799,7 @@ static int __init smc911x_findirq(struct net_device *dev) | |||
1799 | * o actually GRAB the irq. | 1799 | * o actually GRAB the irq. |
1800 | * o GRAB the region | 1800 | * o GRAB the region |
1801 | */ | 1801 | */ |
1802 | static int __init smc911x_probe(struct net_device *dev) | 1802 | static int __devinit smc911x_probe(struct net_device *dev) |
1803 | { | 1803 | { |
1804 | struct smc911x_local *lp = netdev_priv(dev); | 1804 | struct smc911x_local *lp = netdev_priv(dev); |
1805 | int i, retval; | 1805 | int i, retval; |
@@ -1813,7 +1813,7 @@ static int __init smc911x_probe(struct net_device *dev) | |||
1813 | val = SMC_GET_BYTE_TEST(lp); | 1813 | val = SMC_GET_BYTE_TEST(lp); |
1814 | DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val); | 1814 | DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val); |
1815 | if (val != 0x87654321) { | 1815 | if (val != 0x87654321) { |
1816 | printk(KERN_ERR "Invalid chip endian 0x08%x\n",val); | 1816 | printk(KERN_ERR "Invalid chip endian 0x%08x\n",val); |
1817 | retval = -ENODEV; | 1817 | retval = -ENODEV; |
1818 | goto err_out; | 1818 | goto err_out; |
1819 | } | 1819 | } |
@@ -2048,7 +2048,7 @@ err_out: | |||
2048 | * 0 --> there is a device | 2048 | * 0 --> there is a device |
2049 | * anything else, error | 2049 | * anything else, error |
2050 | */ | 2050 | */ |
2051 | static int smc911x_drv_probe(struct platform_device *pdev) | 2051 | static int __devinit smc911x_drv_probe(struct platform_device *pdev) |
2052 | { | 2052 | { |
2053 | #ifdef SMC_DYNAMIC_BUS_CONFIG | 2053 | #ifdef SMC_DYNAMIC_BUS_CONFIG |
2054 | struct smc911x_platdata *pd = pdev->dev.platform_data; | 2054 | struct smc911x_platdata *pd = pdev->dev.platform_data; |
@@ -2124,7 +2124,7 @@ out: | |||
2124 | return ret; | 2124 | return ret; |
2125 | } | 2125 | } |
2126 | 2126 | ||
2127 | static int smc911x_drv_remove(struct platform_device *pdev) | 2127 | static int __devexit smc911x_drv_remove(struct platform_device *pdev) |
2128 | { | 2128 | { |
2129 | struct net_device *ndev = platform_get_drvdata(pdev); | 2129 | struct net_device *ndev = platform_get_drvdata(pdev); |
2130 | struct smc911x_local *lp = netdev_priv(ndev); | 2130 | struct smc911x_local *lp = netdev_priv(ndev); |
@@ -2195,7 +2195,7 @@ static int smc911x_drv_resume(struct platform_device *dev) | |||
2195 | 2195 | ||
2196 | static struct platform_driver smc911x_driver = { | 2196 | static struct platform_driver smc911x_driver = { |
2197 | .probe = smc911x_drv_probe, | 2197 | .probe = smc911x_drv_probe, |
2198 | .remove = smc911x_drv_remove, | 2198 | .remove = __devexit_p(smc911x_drv_remove), |
2199 | .suspend = smc911x_drv_suspend, | 2199 | .suspend = smc911x_drv_suspend, |
2200 | .resume = smc911x_drv_resume, | 2200 | .resume = smc911x_drv_resume, |
2201 | .driver = { | 2201 | .driver = { |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index fc80f250da31..35c56abf4113 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -1696,7 +1696,7 @@ static const struct ethtool_ops smc_ethtool_ops = { | |||
1696 | * I just deleted auto_irq.c, since it was never built... | 1696 | * I just deleted auto_irq.c, since it was never built... |
1697 | * --jgarzik | 1697 | * --jgarzik |
1698 | */ | 1698 | */ |
1699 | static int __init smc_findirq(struct smc_local *lp) | 1699 | static int __devinit smc_findirq(struct smc_local *lp) |
1700 | { | 1700 | { |
1701 | void __iomem *ioaddr = lp->base; | 1701 | void __iomem *ioaddr = lp->base; |
1702 | int timeout = 20; | 1702 | int timeout = 20; |
@@ -1770,7 +1770,7 @@ static int __init smc_findirq(struct smc_local *lp) | |||
1770 | * o actually GRAB the irq. | 1770 | * o actually GRAB the irq. |
1771 | * o GRAB the region | 1771 | * o GRAB the region |
1772 | */ | 1772 | */ |
1773 | static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr, | 1773 | static int __devinit smc_probe(struct net_device *dev, void __iomem *ioaddr, |
1774 | unsigned long irq_flags) | 1774 | unsigned long irq_flags) |
1775 | { | 1775 | { |
1776 | struct smc_local *lp = netdev_priv(dev); | 1776 | struct smc_local *lp = netdev_priv(dev); |
@@ -2126,7 +2126,7 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device * | |||
2126 | * 0 --> there is a device | 2126 | * 0 --> there is a device |
2127 | * anything else, error | 2127 | * anything else, error |
2128 | */ | 2128 | */ |
2129 | static int smc_drv_probe(struct platform_device *pdev) | 2129 | static int __devinit smc_drv_probe(struct platform_device *pdev) |
2130 | { | 2130 | { |
2131 | struct smc91x_platdata *pd = pdev->dev.platform_data; | 2131 | struct smc91x_platdata *pd = pdev->dev.platform_data; |
2132 | struct smc_local *lp; | 2132 | struct smc_local *lp; |
@@ -2240,7 +2240,7 @@ static int smc_drv_probe(struct platform_device *pdev) | |||
2240 | return ret; | 2240 | return ret; |
2241 | } | 2241 | } |
2242 | 2242 | ||
2243 | static int smc_drv_remove(struct platform_device *pdev) | 2243 | static int __devexit smc_drv_remove(struct platform_device *pdev) |
2244 | { | 2244 | { |
2245 | struct net_device *ndev = platform_get_drvdata(pdev); | 2245 | struct net_device *ndev = platform_get_drvdata(pdev); |
2246 | struct smc_local *lp = netdev_priv(ndev); | 2246 | struct smc_local *lp = netdev_priv(ndev); |
@@ -2305,7 +2305,7 @@ static int smc_drv_resume(struct platform_device *dev) | |||
2305 | 2305 | ||
2306 | static struct platform_driver smc_driver = { | 2306 | static struct platform_driver smc_driver = { |
2307 | .probe = smc_drv_probe, | 2307 | .probe = smc_drv_probe, |
2308 | .remove = smc_drv_remove, | 2308 | .remove = __devexit_p(smc_drv_remove), |
2309 | .suspend = smc_drv_suspend, | 2309 | .suspend = smc_drv_suspend, |
2310 | .resume = smc_drv_resume, | 2310 | .resume = smc_drv_resume, |
2311 | .driver = { | 2311 | .driver = { |
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index e12cdb4543b4..de57490103fc 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -1102,12 +1102,14 @@ static int ax88178_link_reset(struct usbnet *dev) | |||
1102 | mode = AX88178_MEDIUM_DEFAULT; | 1102 | mode = AX88178_MEDIUM_DEFAULT; |
1103 | 1103 | ||
1104 | if (ecmd.speed == SPEED_1000) | 1104 | if (ecmd.speed == SPEED_1000) |
1105 | mode |= AX_MEDIUM_GM | AX_MEDIUM_ENCK; | 1105 | mode |= AX_MEDIUM_GM; |
1106 | else if (ecmd.speed == SPEED_100) | 1106 | else if (ecmd.speed == SPEED_100) |
1107 | mode |= AX_MEDIUM_PS; | 1107 | mode |= AX_MEDIUM_PS; |
1108 | else | 1108 | else |
1109 | mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM); | 1109 | mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM); |
1110 | 1110 | ||
1111 | mode |= AX_MEDIUM_ENCK; | ||
1112 | |||
1111 | if (ecmd.duplex == DUPLEX_FULL) | 1113 | if (ecmd.duplex == DUPLEX_FULL) |
1112 | mode |= AX_MEDIUM_FD; | 1114 | mode |= AX_MEDIUM_FD; |
1113 | else | 1115 | else |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 8d690a0eb1a9..444c5cc05f03 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1384,7 +1384,7 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
1384 | 1384 | ||
1385 | rxq->queue[i] = NULL; | 1385 | rxq->queue[i] = NULL; |
1386 | 1386 | ||
1387 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr, | 1387 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->aligned_dma_addr, |
1388 | priv->hw_params.rx_buf_size, | 1388 | priv->hw_params.rx_buf_size, |
1389 | PCI_DMA_FROMDEVICE); | 1389 | PCI_DMA_FROMDEVICE); |
1390 | pkt = (struct iwl_rx_packet *)rxb->skb->data; | 1390 | pkt = (struct iwl_rx_packet *)rxb->skb->data; |
@@ -1436,8 +1436,8 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
1436 | rxb->skb = NULL; | 1436 | rxb->skb = NULL; |
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | pci_unmap_single(priv->pci_dev, rxb->dma_addr, | 1439 | pci_unmap_single(priv->pci_dev, rxb->real_dma_addr, |
1440 | priv->hw_params.rx_buf_size, | 1440 | priv->hw_params.rx_buf_size + 256, |
1441 | PCI_DMA_FROMDEVICE); | 1441 | PCI_DMA_FROMDEVICE); |
1442 | spin_lock_irqsave(&rxq->lock, flags); | 1442 | spin_lock_irqsave(&rxq->lock, flags); |
1443 | list_add_tail(&rxb->list, &priv->rxq.rx_used); | 1443 | list_add_tail(&rxb->list, &priv->rxq.rx_used); |
@@ -2341,7 +2341,6 @@ static void iwl_bg_alive_start(struct work_struct *data) | |||
2341 | mutex_lock(&priv->mutex); | 2341 | mutex_lock(&priv->mutex); |
2342 | iwl_alive_start(priv); | 2342 | iwl_alive_start(priv); |
2343 | mutex_unlock(&priv->mutex); | 2343 | mutex_unlock(&priv->mutex); |
2344 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
2345 | } | 2344 | } |
2346 | 2345 | ||
2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) | 2346 | static void iwl4965_bg_rf_kill(struct work_struct *work) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index c018121085e9..9966d4e384ce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -89,7 +89,8 @@ extern struct iwl_cfg iwl5100_abg_cfg; | |||
89 | #define DEFAULT_LONG_RETRY_LIMIT 4U | 89 | #define DEFAULT_LONG_RETRY_LIMIT 4U |
90 | 90 | ||
91 | struct iwl_rx_mem_buffer { | 91 | struct iwl_rx_mem_buffer { |
92 | dma_addr_t dma_addr; | 92 | dma_addr_t real_dma_addr; |
93 | dma_addr_t aligned_dma_addr; | ||
93 | struct sk_buff *skb; | 94 | struct sk_buff *skb; |
94 | struct list_head list; | 95 | struct list_head list; |
95 | }; | 96 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 7cde9d76ff5d..0509c16dbe75 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -204,7 +204,7 @@ int iwl_rx_queue_restock(struct iwl_priv *priv) | |||
204 | list_del(element); | 204 | list_del(element); |
205 | 205 | ||
206 | /* Point to Rx buffer via next RBD in circular buffer */ | 206 | /* Point to Rx buffer via next RBD in circular buffer */ |
207 | rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->dma_addr); | 207 | rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->aligned_dma_addr); |
208 | rxq->queue[rxq->write] = rxb; | 208 | rxq->queue[rxq->write] = rxb; |
209 | rxq->write = (rxq->write + 1) & RX_QUEUE_MASK; | 209 | rxq->write = (rxq->write + 1) & RX_QUEUE_MASK; |
210 | rxq->free_count--; | 210 | rxq->free_count--; |
@@ -251,7 +251,7 @@ void iwl_rx_allocate(struct iwl_priv *priv) | |||
251 | rxb = list_entry(element, struct iwl_rx_mem_buffer, list); | 251 | rxb = list_entry(element, struct iwl_rx_mem_buffer, list); |
252 | 252 | ||
253 | /* Alloc a new receive buffer */ | 253 | /* Alloc a new receive buffer */ |
254 | rxb->skb = alloc_skb(priv->hw_params.rx_buf_size, | 254 | rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256, |
255 | __GFP_NOWARN | GFP_ATOMIC); | 255 | __GFP_NOWARN | GFP_ATOMIC); |
256 | if (!rxb->skb) { | 256 | if (!rxb->skb) { |
257 | if (net_ratelimit()) | 257 | if (net_ratelimit()) |
@@ -266,9 +266,17 @@ void iwl_rx_allocate(struct iwl_priv *priv) | |||
266 | list_del(element); | 266 | list_del(element); |
267 | 267 | ||
268 | /* Get physical address of RB/SKB */ | 268 | /* Get physical address of RB/SKB */ |
269 | rxb->dma_addr = | 269 | rxb->real_dma_addr = pci_map_single( |
270 | pci_map_single(priv->pci_dev, rxb->skb->data, | 270 | priv->pci_dev, |
271 | priv->hw_params.rx_buf_size, PCI_DMA_FROMDEVICE); | 271 | rxb->skb->data, |
272 | priv->hw_params.rx_buf_size + 256, | ||
273 | PCI_DMA_FROMDEVICE); | ||
274 | /* dma address must be no more than 36 bits */ | ||
275 | BUG_ON(rxb->real_dma_addr & ~DMA_BIT_MASK(36)); | ||
276 | /* and also 256 byte aligned! */ | ||
277 | rxb->aligned_dma_addr = ALIGN(rxb->real_dma_addr, 256); | ||
278 | skb_reserve(rxb->skb, rxb->aligned_dma_addr - rxb->real_dma_addr); | ||
279 | |||
272 | list_add_tail(&rxb->list, &rxq->rx_free); | 280 | list_add_tail(&rxb->list, &rxq->rx_free); |
273 | rxq->free_count++; | 281 | rxq->free_count++; |
274 | } | 282 | } |
@@ -300,8 +308,8 @@ void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
300 | for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { | 308 | for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { |
301 | if (rxq->pool[i].skb != NULL) { | 309 | if (rxq->pool[i].skb != NULL) { |
302 | pci_unmap_single(priv->pci_dev, | 310 | pci_unmap_single(priv->pci_dev, |
303 | rxq->pool[i].dma_addr, | 311 | rxq->pool[i].real_dma_addr, |
304 | priv->hw_params.rx_buf_size, | 312 | priv->hw_params.rx_buf_size + 256, |
305 | PCI_DMA_FROMDEVICE); | 313 | PCI_DMA_FROMDEVICE); |
306 | dev_kfree_skb(rxq->pool[i].skb); | 314 | dev_kfree_skb(rxq->pool[i].skb); |
307 | } | 315 | } |
@@ -354,8 +362,8 @@ void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
354 | * to an SKB, so we need to unmap and free potential storage */ | 362 | * to an SKB, so we need to unmap and free potential storage */ |
355 | if (rxq->pool[i].skb != NULL) { | 363 | if (rxq->pool[i].skb != NULL) { |
356 | pci_unmap_single(priv->pci_dev, | 364 | pci_unmap_single(priv->pci_dev, |
357 | rxq->pool[i].dma_addr, | 365 | rxq->pool[i].real_dma_addr, |
358 | priv->hw_params.rx_buf_size, | 366 | priv->hw_params.rx_buf_size + 256, |
359 | PCI_DMA_FROMDEVICE); | 367 | PCI_DMA_FROMDEVICE); |
360 | priv->alloc_rxb_skb--; | 368 | priv->alloc_rxb_skb--; |
361 | dev_kfree_skb(rxq->pool[i].skb); | 369 | dev_kfree_skb(rxq->pool[i].skb); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 285b53e7e261..45a6b0c35695 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6012,7 +6012,6 @@ static void iwl3945_bg_alive_start(struct work_struct *data) | |||
6012 | mutex_lock(&priv->mutex); | 6012 | mutex_lock(&priv->mutex); |
6013 | iwl3945_alive_start(priv); | 6013 | iwl3945_alive_start(priv); |
6014 | mutex_unlock(&priv->mutex); | 6014 | mutex_unlock(&priv->mutex); |
6015 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
6016 | } | 6015 | } |
6017 | 6016 | ||
6018 | static void iwl3945_bg_rf_kill(struct work_struct *work) | 6017 | static void iwl3945_bg_rf_kill(struct work_struct *work) |
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c index 1cc03a8dd67a..59634c33b1f9 100644 --- a/drivers/net/wireless/libertas_tf/if_usb.c +++ b/drivers/net/wireless/libertas_tf/if_usb.c | |||
@@ -331,7 +331,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp, | |||
331 | /* Fill the receive configuration URB and initialise the Rx call back */ | 331 | /* Fill the receive configuration URB and initialise the Rx call back */ |
332 | usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, | 332 | usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, |
333 | usb_rcvbulkpipe(cardp->udev, cardp->ep_in), | 333 | usb_rcvbulkpipe(cardp->udev, cardp->ep_in), |
334 | (void *) (skb->tail), | 334 | skb_tail_pointer(skb), |
335 | MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, cardp); | 335 | MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, cardp); |
336 | 336 | ||
337 | cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; | 337 | cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index c6948d8f53f6..6d017adc914a 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1785,7 +1785,7 @@ static int __devexit xennet_remove(struct xenbus_device *dev) | |||
1785 | return 0; | 1785 | return 0; |
1786 | } | 1786 | } |
1787 | 1787 | ||
1788 | static struct xenbus_driver netfront = { | 1788 | static struct xenbus_driver netfront_driver = { |
1789 | .name = "vif", | 1789 | .name = "vif", |
1790 | .owner = THIS_MODULE, | 1790 | .owner = THIS_MODULE, |
1791 | .ids = netfront_ids, | 1791 | .ids = netfront_ids, |
@@ -1805,7 +1805,7 @@ static int __init netif_init(void) | |||
1805 | 1805 | ||
1806 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); | 1806 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); |
1807 | 1807 | ||
1808 | return xenbus_register_frontend(&netfront); | 1808 | return xenbus_register_frontend(&netfront_driver); |
1809 | } | 1809 | } |
1810 | module_init(netif_init); | 1810 | module_init(netif_init); |
1811 | 1811 | ||
@@ -1815,7 +1815,7 @@ static void __exit netif_exit(void) | |||
1815 | if (xen_initial_domain()) | 1815 | if (xen_initial_domain()) |
1816 | return; | 1816 | return; |
1817 | 1817 | ||
1818 | xenbus_unregister_driver(&netfront); | 1818 | xenbus_unregister_driver(&netfront_driver); |
1819 | } | 1819 | } |
1820 | module_exit(netif_exit); | 1820 | module_exit(netif_exit); |
1821 | 1821 | ||
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig index 209b4a464bcf..855f389eea40 100644 --- a/drivers/parport/Kconfig +++ b/drivers/parport/Kconfig | |||
@@ -36,7 +36,7 @@ if PARPORT | |||
36 | config PARPORT_PC | 36 | config PARPORT_PC |
37 | tristate "PC-style hardware" | 37 | tristate "PC-style hardware" |
38 | depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && \ | 38 | depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && \ |
39 | (!M68K || ISA) && !MN10300 && !AVR32 | 39 | (!M68K || ISA) && !MN10300 && !AVR32 && !BLACKFIN |
40 | ---help--- | 40 | ---help--- |
41 | You should say Y here if you have a PC-style parallel port. All | 41 | You should say Y here if you have a PC-style parallel port. All |
42 | IBM PC compatible computers and some Alphas have PC-style | 42 | IBM PC compatible computers and some Alphas have PC-style |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index a2692724b68f..5c8baa43ac9c 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -1655,12 +1655,14 @@ int __init init_dmars(void) | |||
1655 | iommu->flush.flush_context = __iommu_flush_context; | 1655 | iommu->flush.flush_context = __iommu_flush_context; |
1656 | iommu->flush.flush_iotlb = __iommu_flush_iotlb; | 1656 | iommu->flush.flush_iotlb = __iommu_flush_iotlb; |
1657 | printk(KERN_INFO "IOMMU 0x%Lx: using Register based " | 1657 | printk(KERN_INFO "IOMMU 0x%Lx: using Register based " |
1658 | "invalidation\n", drhd->reg_base_addr); | 1658 | "invalidation\n", |
1659 | (unsigned long long)drhd->reg_base_addr); | ||
1659 | } else { | 1660 | } else { |
1660 | iommu->flush.flush_context = qi_flush_context; | 1661 | iommu->flush.flush_context = qi_flush_context; |
1661 | iommu->flush.flush_iotlb = qi_flush_iotlb; | 1662 | iommu->flush.flush_iotlb = qi_flush_iotlb; |
1662 | printk(KERN_INFO "IOMMU 0x%Lx: using Queued " | 1663 | printk(KERN_INFO "IOMMU 0x%Lx: using Queued " |
1663 | "invalidation\n", drhd->reg_base_addr); | 1664 | "invalidation\n", |
1665 | (unsigned long long)drhd->reg_base_addr); | ||
1664 | } | 1666 | } |
1665 | } | 1667 | } |
1666 | 1668 | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 21f2ac639cab..061d1ee0046a 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1832,7 +1832,7 @@ int pci_reset_function(struct pci_dev *dev) | |||
1832 | if (!(cap & PCI_EXP_DEVCAP_FLR)) | 1832 | if (!(cap & PCI_EXP_DEVCAP_FLR)) |
1833 | return -ENOTTY; | 1833 | return -ENOTTY; |
1834 | 1834 | ||
1835 | if (!dev->msi_enabled && !dev->msix_enabled) | 1835 | if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0) |
1836 | disable_irq(dev->irq); | 1836 | disable_irq(dev->irq); |
1837 | pci_save_state(dev); | 1837 | pci_save_state(dev); |
1838 | 1838 | ||
@@ -1841,7 +1841,7 @@ int pci_reset_function(struct pci_dev *dev) | |||
1841 | r = pci_execute_reset_function(dev); | 1841 | r = pci_execute_reset_function(dev); |
1842 | 1842 | ||
1843 | pci_restore_state(dev); | 1843 | pci_restore_state(dev); |
1844 | if (!dev->msi_enabled && !dev->msix_enabled) | 1844 | if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0) |
1845 | enable_irq(dev->irq); | 1845 | enable_irq(dev->irq); |
1846 | 1846 | ||
1847 | return r; | 1847 | return r; |
@@ -2042,7 +2042,7 @@ static int __devinit pci_init(void) | |||
2042 | return 0; | 2042 | return 0; |
2043 | } | 2043 | } |
2044 | 2044 | ||
2045 | static int __devinit pci_setup(char *str) | 2045 | static int __init pci_setup(char *str) |
2046 | { | 2046 | { |
2047 | while (str) { | 2047 | while (str) { |
2048 | char *k = strchr(str, ','); | 2048 | char *k = strchr(str, ','); |
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c index a926c896475e..643a6b98462b 100644 --- a/drivers/rapidio/rio-scan.c +++ b/drivers/rapidio/rio-scan.c | |||
@@ -879,7 +879,7 @@ static void rio_update_route_tables(struct rio_mport *port) | |||
879 | * link, then start recursive peer enumeration. Returns %0 if | 879 | * link, then start recursive peer enumeration. Returns %0 if |
880 | * enumeration succeeds or %-EBUSY if enumeration fails. | 880 | * enumeration succeeds or %-EBUSY if enumeration fails. |
881 | */ | 881 | */ |
882 | int rio_enum_mport(struct rio_mport *mport) | 882 | int __devinit rio_enum_mport(struct rio_mport *mport) |
883 | { | 883 | { |
884 | struct rio_net *net = NULL; | 884 | struct rio_net *net = NULL; |
885 | int rc = 0; | 885 | int rc = 0; |
@@ -972,7 +972,7 @@ static void rio_enum_timeout(unsigned long data) | |||
972 | * peer discovery. Returns %0 if discovery succeeds or %-EBUSY | 972 | * peer discovery. Returns %0 if discovery succeeds or %-EBUSY |
973 | * on failure. | 973 | * on failure. |
974 | */ | 974 | */ |
975 | int rio_disc_mport(struct rio_mport *mport) | 975 | int __devinit rio_disc_mport(struct rio_mport *mport) |
976 | { | 976 | { |
977 | struct rio_net *net = NULL; | 977 | struct rio_net *net = NULL; |
978 | int enum_timeout_flag = 0; | 978 | int enum_timeout_flag = 0; |
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index 680661abbc4b..6395c780008b 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c | |||
@@ -467,7 +467,7 @@ static int __devinit rio_init(void) | |||
467 | 467 | ||
468 | device_initcall(rio_init); | 468 | device_initcall(rio_init); |
469 | 469 | ||
470 | int rio_init_mports(void) | 470 | int __devinit rio_init_mports(void) |
471 | { | 471 | { |
472 | int rc = 0; | 472 | int rc = 0; |
473 | struct rio_mport *port; | 473 | struct rio_mport *port; |
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index f08e169ba1b5..054f5dd58931 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c | |||
@@ -361,7 +361,7 @@ fail: | |||
361 | extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); | 361 | extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); |
362 | extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); | 362 | extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); |
363 | 363 | ||
364 | static int __devinit bbc_i2c_probe(struct of_device *op, | 364 | static int __init bbc_i2c_probe(struct of_device *op, |
365 | const struct of_device_id *match) | 365 | const struct of_device_id *match) |
366 | { | 366 | { |
367 | struct bbc_i2c_bus *bp; | 367 | struct bbc_i2c_bus *bp; |
@@ -386,7 +386,7 @@ static int __devinit bbc_i2c_probe(struct of_device *op, | |||
386 | return err; | 386 | return err; |
387 | } | 387 | } |
388 | 388 | ||
389 | static int __devexit bbc_i2c_remove(struct of_device *op) | 389 | static int __exit bbc_i2c_remove(struct of_device *op) |
390 | { | 390 | { |
391 | struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev); | 391 | struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev); |
392 | 392 | ||
@@ -417,7 +417,7 @@ static struct of_platform_driver bbc_i2c_driver = { | |||
417 | .name = "bbc_i2c", | 417 | .name = "bbc_i2c", |
418 | .match_table = bbc_i2c_match, | 418 | .match_table = bbc_i2c_match, |
419 | .probe = bbc_i2c_probe, | 419 | .probe = bbc_i2c_probe, |
420 | .remove = __devexit_p(bbc_i2c_remove), | 420 | .remove = __exit_p(bbc_i2c_remove), |
421 | }; | 421 | }; |
422 | 422 | ||
423 | static int __init bbc_i2c_init(void) | 423 | static int __init bbc_i2c_init(void) |
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 218777bfc143..399fe559e4de 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -13872,8 +13872,10 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost, | |||
13872 | advansys_wide_free_mem(boardp); | 13872 | advansys_wide_free_mem(boardp); |
13873 | free_irq(boardp->irq, shost); | 13873 | free_irq(boardp->irq, shost); |
13874 | err_free_dma: | 13874 | err_free_dma: |
13875 | #ifdef CONFIG_ISA | ||
13875 | if (shost->dma_channel != NO_ISA_DMA) | 13876 | if (shost->dma_channel != NO_ISA_DMA) |
13876 | free_dma(shost->dma_channel); | 13877 | free_dma(shost->dma_channel); |
13878 | #endif | ||
13877 | err_free_proc: | 13879 | err_free_proc: |
13878 | kfree(boardp->prtbuf); | 13880 | kfree(boardp->prtbuf); |
13879 | err_unmap: | 13881 | err_unmap: |
@@ -13894,10 +13896,12 @@ static int advansys_release(struct Scsi_Host *shost) | |||
13894 | ASC_DBG(1, "begin\n"); | 13896 | ASC_DBG(1, "begin\n"); |
13895 | scsi_remove_host(shost); | 13897 | scsi_remove_host(shost); |
13896 | free_irq(board->irq, shost); | 13898 | free_irq(board->irq, shost); |
13899 | #ifdef CONFIG_ISA | ||
13897 | if (shost->dma_channel != NO_ISA_DMA) { | 13900 | if (shost->dma_channel != NO_ISA_DMA) { |
13898 | ASC_DBG(1, "free_dma()\n"); | 13901 | ASC_DBG(1, "free_dma()\n"); |
13899 | free_dma(shost->dma_channel); | 13902 | free_dma(shost->dma_channel); |
13900 | } | 13903 | } |
13904 | #endif | ||
13901 | if (ASC_NARROW_BOARD(board)) { | 13905 | if (ASC_NARROW_BOARD(board)) { |
13902 | dma_unmap_single(board->dev, | 13906 | dma_unmap_single(board->dev, |
13903 | board->dvc_var.asc_dvc_var.overrun_dma, | 13907 | board->dvc_var.asc_dvc_var.overrun_dma, |
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index c387c15a2128..fb247fdfa2bd 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -588,7 +588,7 @@ static struct pci_driver gdth_pci_driver = { | |||
588 | .remove = gdth_pci_remove_one, | 588 | .remove = gdth_pci_remove_one, |
589 | }; | 589 | }; |
590 | 590 | ||
591 | static void gdth_pci_remove_one(struct pci_dev *pdev) | 591 | static void __devexit gdth_pci_remove_one(struct pci_dev *pdev) |
592 | { | 592 | { |
593 | gdth_ha_str *ha = pci_get_drvdata(pdev); | 593 | gdth_ha_str *ha = pci_get_drvdata(pdev); |
594 | 594 | ||
@@ -600,7 +600,7 @@ static void gdth_pci_remove_one(struct pci_dev *pdev) | |||
600 | pci_disable_device(pdev); | 600 | pci_disable_device(pdev); |
601 | } | 601 | } |
602 | 602 | ||
603 | static int gdth_pci_init_one(struct pci_dev *pdev, | 603 | static int __devinit gdth_pci_init_one(struct pci_dev *pdev, |
604 | const struct pci_device_id *ent) | 604 | const struct pci_device_id *ent) |
605 | { | 605 | { |
606 | ushort vendor = pdev->vendor; | 606 | ushort vendor = pdev->vendor; |
@@ -853,7 +853,7 @@ static int __init gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha) | |||
853 | #endif /* CONFIG_ISA */ | 853 | #endif /* CONFIG_ISA */ |
854 | 854 | ||
855 | #ifdef CONFIG_PCI | 855 | #ifdef CONFIG_PCI |
856 | static int gdth_init_pci(struct pci_dev *pdev, gdth_pci_str *pcistr, | 856 | static int __devinit gdth_init_pci(struct pci_dev *pdev, gdth_pci_str *pcistr, |
857 | gdth_ha_str *ha) | 857 | gdth_ha_str *ha) |
858 | { | 858 | { |
859 | register gdt6_dpram_str __iomem *dp6_ptr; | 859 | register gdt6_dpram_str __iomem *dp6_ptr; |
@@ -1237,7 +1237,7 @@ static int gdth_init_pci(struct pci_dev *pdev, gdth_pci_str *pcistr, | |||
1237 | 1237 | ||
1238 | /* controller protocol functions */ | 1238 | /* controller protocol functions */ |
1239 | 1239 | ||
1240 | static void __init gdth_enable_int(gdth_ha_str *ha) | 1240 | static void __devinit gdth_enable_int(gdth_ha_str *ha) |
1241 | { | 1241 | { |
1242 | ulong flags; | 1242 | ulong flags; |
1243 | gdt2_dpram_str __iomem *dp2_ptr; | 1243 | gdt2_dpram_str __iomem *dp2_ptr; |
@@ -1553,7 +1553,7 @@ static int gdth_internal_cmd(gdth_ha_str *ha, unchar service, ushort opcode, | |||
1553 | 1553 | ||
1554 | /* search for devices */ | 1554 | /* search for devices */ |
1555 | 1555 | ||
1556 | static int __init gdth_search_drives(gdth_ha_str *ha) | 1556 | static int __devinit gdth_search_drives(gdth_ha_str *ha) |
1557 | { | 1557 | { |
1558 | ushort cdev_cnt, i; | 1558 | ushort cdev_cnt, i; |
1559 | int ok; | 1559 | int ok; |
@@ -4935,7 +4935,7 @@ static int __init gdth_eisa_probe_one(ushort eisa_slot) | |||
4935 | #endif /* CONFIG_EISA */ | 4935 | #endif /* CONFIG_EISA */ |
4936 | 4936 | ||
4937 | #ifdef CONFIG_PCI | 4937 | #ifdef CONFIG_PCI |
4938 | static int gdth_pci_probe_one(gdth_pci_str *pcistr, | 4938 | static int __devinit gdth_pci_probe_one(gdth_pci_str *pcistr, |
4939 | gdth_ha_str **ha_out) | 4939 | gdth_ha_str **ha_out) |
4940 | { | 4940 | { |
4941 | struct Scsi_Host *shp; | 4941 | struct Scsi_Host *shp; |
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index dae87b1a4c6e..cf12f2d84be2 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c | |||
@@ -352,21 +352,21 @@ static int map_dma_buffers(struct driver_data *drv_data) | |||
352 | } else | 352 | } else |
353 | drv_data->tx_map_len = drv_data->len; | 353 | drv_data->tx_map_len = drv_data->len; |
354 | 354 | ||
355 | /* Stream map the rx buffer */ | 355 | /* Stream map the tx buffer. Always do DMA_TO_DEVICE first |
356 | drv_data->rx_dma = dma_map_single(dev, drv_data->rx, | 356 | * so we flush the cache *before* invalidating it, in case |
357 | drv_data->rx_map_len, | 357 | * the tx and rx buffers overlap. |
358 | DMA_FROM_DEVICE); | 358 | */ |
359 | if (dma_mapping_error(dev, drv_data->rx_dma)) | ||
360 | return 0; | ||
361 | |||
362 | /* Stream map the tx buffer */ | ||
363 | drv_data->tx_dma = dma_map_single(dev, drv_data->tx, | 359 | drv_data->tx_dma = dma_map_single(dev, drv_data->tx, |
364 | drv_data->tx_map_len, | 360 | drv_data->tx_map_len, DMA_TO_DEVICE); |
365 | DMA_TO_DEVICE); | 361 | if (dma_mapping_error(dev, drv_data->tx_dma)) |
362 | return 0; | ||
366 | 363 | ||
367 | if (dma_mapping_error(dev, drv_data->tx_dma)) { | 364 | /* Stream map the rx buffer */ |
368 | dma_unmap_single(dev, drv_data->rx_dma, | 365 | drv_data->rx_dma = dma_map_single(dev, drv_data->rx, |
369 | drv_data->rx_map_len, DMA_FROM_DEVICE); | 366 | drv_data->rx_map_len, DMA_FROM_DEVICE); |
367 | if (dma_mapping_error(dev, drv_data->rx_dma)) { | ||
368 | dma_unmap_single(dev, drv_data->tx_dma, | ||
369 | drv_data->tx_map_len, DMA_TO_DEVICE); | ||
370 | return 0; | 370 | return 0; |
371 | } | 371 | } |
372 | 372 | ||
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index 61ba147e384d..0b4db0ce78d6 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c | |||
@@ -506,20 +506,6 @@ static int map_dma_buffers(struct driver_data *drv_data) | |||
506 | if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx)) | 506 | if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx)) |
507 | return -1; | 507 | return -1; |
508 | 508 | ||
509 | /* NULL rx means write-only transfer and no map needed | ||
510 | since rx DMA will not be used */ | ||
511 | if (drv_data->rx) { | ||
512 | buf = drv_data->rx; | ||
513 | drv_data->rx_dma = dma_map_single( | ||
514 | dev, | ||
515 | buf, | ||
516 | drv_data->len, | ||
517 | DMA_FROM_DEVICE); | ||
518 | if (dma_mapping_error(dev, drv_data->rx_dma)) | ||
519 | return -1; | ||
520 | drv_data->rx_dma_needs_unmap = 1; | ||
521 | } | ||
522 | |||
523 | if (drv_data->tx == NULL) { | 509 | if (drv_data->tx == NULL) { |
524 | /* Read only message --> use drv_data->dummy_dma_buf for dummy | 510 | /* Read only message --> use drv_data->dummy_dma_buf for dummy |
525 | writes to achive reads */ | 511 | writes to achive reads */ |
@@ -533,18 +519,31 @@ static int map_dma_buffers(struct driver_data *drv_data) | |||
533 | buf, | 519 | buf, |
534 | drv_data->tx_map_len, | 520 | drv_data->tx_map_len, |
535 | DMA_TO_DEVICE); | 521 | DMA_TO_DEVICE); |
536 | if (dma_mapping_error(dev, drv_data->tx_dma)) { | 522 | if (dma_mapping_error(dev, drv_data->tx_dma)) |
537 | if (drv_data->rx_dma) { | ||
538 | dma_unmap_single(dev, | ||
539 | drv_data->rx_dma, | ||
540 | drv_data->len, | ||
541 | DMA_FROM_DEVICE); | ||
542 | drv_data->rx_dma_needs_unmap = 0; | ||
543 | } | ||
544 | return -1; | 523 | return -1; |
545 | } | ||
546 | drv_data->tx_dma_needs_unmap = 1; | 524 | drv_data->tx_dma_needs_unmap = 1; |
547 | 525 | ||
526 | /* NULL rx means write-only transfer and no map needed | ||
527 | * since rx DMA will not be used */ | ||
528 | if (drv_data->rx) { | ||
529 | buf = drv_data->rx; | ||
530 | drv_data->rx_dma = dma_map_single(dev, | ||
531 | buf, | ||
532 | drv_data->len, | ||
533 | DMA_FROM_DEVICE); | ||
534 | if (dma_mapping_error(dev, drv_data->rx_dma)) { | ||
535 | if (drv_data->tx_dma) { | ||
536 | dma_unmap_single(dev, | ||
537 | drv_data->tx_dma, | ||
538 | drv_data->tx_map_len, | ||
539 | DMA_TO_DEVICE); | ||
540 | drv_data->tx_dma_needs_unmap = 0; | ||
541 | } | ||
542 | return -1; | ||
543 | } | ||
544 | drv_data->rx_dma_needs_unmap = 1; | ||
545 | } | ||
546 | |||
548 | return 0; | 547 | return 0; |
549 | } | 548 | } |
550 | 549 | ||
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 659b3d9671c4..428b5993575a 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
@@ -172,7 +172,6 @@ static struct usb_interface_descriptor rndis_data_intf __initdata = { | |||
172 | .bDescriptorType = USB_DT_INTERFACE, | 172 | .bDescriptorType = USB_DT_INTERFACE, |
173 | 173 | ||
174 | /* .bInterfaceNumber = DYNAMIC */ | 174 | /* .bInterfaceNumber = DYNAMIC */ |
175 | .bAlternateSetting = 1, | ||
176 | .bNumEndpoints = 2, | 175 | .bNumEndpoints = 2, |
177 | .bInterfaceClass = USB_CLASS_CDC_DATA, | 176 | .bInterfaceClass = USB_CLASS_CDC_DATA, |
178 | .bInterfaceSubClass = 0, | 177 | .bInterfaceSubClass = 0, |
@@ -303,7 +302,7 @@ static void rndis_response_available(void *_rndis) | |||
303 | __le32 *data = req->buf; | 302 | __le32 *data = req->buf; |
304 | int status; | 303 | int status; |
305 | 304 | ||
306 | if (atomic_inc_return(&rndis->notify_count)) | 305 | if (atomic_inc_return(&rndis->notify_count) != 1) |
307 | return; | 306 | return; |
308 | 307 | ||
309 | /* Send RNDIS RESPONSE_AVAILABLE notification; a | 308 | /* Send RNDIS RESPONSE_AVAILABLE notification; a |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index da6e93c201d2..2dbc0db0b46c 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -141,7 +141,11 @@ static int is_vbus_present(void) | |||
141 | 141 | ||
142 | if (mach->gpio_vbus) { | 142 | if (mach->gpio_vbus) { |
143 | int value = gpio_get_value(mach->gpio_vbus); | 143 | int value = gpio_get_value(mach->gpio_vbus); |
144 | return mach->gpio_vbus_inverted ? !value : value; | 144 | |
145 | if (mach->gpio_vbus_inverted) | ||
146 | return !value; | ||
147 | else | ||
148 | return !!value; | ||
145 | } | 149 | } |
146 | if (mach->udc_is_connected) | 150 | if (mach->udc_is_connected) |
147 | return mach->udc_is_connected(); | 151 | return mach->udc_is_connected(); |
@@ -982,7 +986,7 @@ static int pxa25x_udc_vbus_session(struct usb_gadget *_gadget, int is_active) | |||
982 | struct pxa25x_udc *udc; | 986 | struct pxa25x_udc *udc; |
983 | 987 | ||
984 | udc = container_of(_gadget, struct pxa25x_udc, gadget); | 988 | udc = container_of(_gadget, struct pxa25x_udc, gadget); |
985 | udc->vbus = (is_active != 0); | 989 | udc->vbus = is_active; |
986 | DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); | 990 | DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); |
987 | pullup(udc); | 991 | pullup(udc); |
988 | return 0; | 992 | return 0; |
@@ -1399,12 +1403,8 @@ lubbock_vbus_irq(int irq, void *_dev) | |||
1399 | static irqreturn_t udc_vbus_irq(int irq, void *_dev) | 1403 | static irqreturn_t udc_vbus_irq(int irq, void *_dev) |
1400 | { | 1404 | { |
1401 | struct pxa25x_udc *dev = _dev; | 1405 | struct pxa25x_udc *dev = _dev; |
1402 | int vbus = gpio_get_value(dev->mach->gpio_vbus); | ||
1403 | 1406 | ||
1404 | if (dev->mach->gpio_vbus_inverted) | 1407 | pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present()); |
1405 | vbus = !vbus; | ||
1406 | |||
1407 | pxa25x_udc_vbus_session(&dev->gadget, vbus); | ||
1408 | return IRQ_HANDLED; | 1408 | return IRQ_HANDLED; |
1409 | } | 1409 | } |
1410 | 1410 | ||
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index c46a58f9181d..9d0ea573aef6 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -66,6 +66,8 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
66 | { | 66 | { |
67 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 67 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
68 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | 68 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); |
69 | struct pci_dev *p_smbus; | ||
70 | u8 rev; | ||
69 | u32 temp; | 71 | u32 temp; |
70 | int retval; | 72 | int retval; |
71 | 73 | ||
@@ -166,6 +168,25 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
166 | pci_write_config_byte(pdev, 0x4b, tmp | 0x20); | 168 | pci_write_config_byte(pdev, 0x4b, tmp | 0x20); |
167 | } | 169 | } |
168 | break; | 170 | break; |
171 | case PCI_VENDOR_ID_ATI: | ||
172 | /* SB700 old version has a bug in EHCI controller, | ||
173 | * which causes usb devices lose response in some cases. | ||
174 | */ | ||
175 | if (pdev->device == 0x4396) { | ||
176 | p_smbus = pci_get_device(PCI_VENDOR_ID_ATI, | ||
177 | PCI_DEVICE_ID_ATI_SBX00_SMBUS, | ||
178 | NULL); | ||
179 | if (!p_smbus) | ||
180 | break; | ||
181 | rev = p_smbus->revision; | ||
182 | if ((rev == 0x3a) || (rev == 0x3b)) { | ||
183 | u8 tmp; | ||
184 | pci_read_config_byte(pdev, 0x53, &tmp); | ||
185 | pci_write_config_byte(pdev, 0x53, tmp | (1<<3)); | ||
186 | } | ||
187 | pci_dev_put(p_smbus); | ||
188 | } | ||
189 | break; | ||
169 | } | 190 | } |
170 | 191 | ||
171 | ehci_reset(ehci); | 192 | ehci_reset(ehci); |
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index c9de3f027aab..e06810aef2df 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
@@ -687,7 +687,10 @@ static ssize_t mon_bin_read(struct file *file, char __user *buf, | |||
687 | } | 687 | } |
688 | 688 | ||
689 | if (rp->b_read >= sizeof(struct mon_bin_hdr)) { | 689 | if (rp->b_read >= sizeof(struct mon_bin_hdr)) { |
690 | step_len = min(nbytes, (size_t)ep->len_cap); | 690 | step_len = ep->len_cap; |
691 | step_len -= rp->b_read - sizeof(struct mon_bin_hdr); | ||
692 | if (step_len > nbytes) | ||
693 | step_len = nbytes; | ||
691 | offset = rp->b_out + PKT_SIZE; | 694 | offset = rp->b_out + PKT_SIZE; |
692 | offset += rp->b_read - sizeof(struct mon_bin_hdr); | 695 | offset += rp->b_read - sizeof(struct mon_bin_hdr); |
693 | if (offset >= rp->b_size) | 696 | if (offset >= rp->b_size) |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index e45e70bcc5e2..cc64462d4c4e 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -1757,7 +1757,7 @@ static int musb_schedule( | |||
1757 | } | 1757 | } |
1758 | } | 1758 | } |
1759 | /* use bulk reserved ep1 if no other ep is free */ | 1759 | /* use bulk reserved ep1 if no other ep is free */ |
1760 | if (best_end > 0 && qh->type == USB_ENDPOINT_XFER_BULK) { | 1760 | if (best_end < 0 && qh->type == USB_ENDPOINT_XFER_BULK) { |
1761 | hw_ep = musb->bulk_ep; | 1761 | hw_ep = musb->bulk_ep; |
1762 | if (is_in) | 1762 | if (is_in) |
1763 | head = &musb->in_bulk; | 1763 | head = &musb->in_bulk; |
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index 9035d7256b03..cfaf1f085535 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c | |||
@@ -56,6 +56,7 @@ static void cp2101_shutdown(struct usb_serial *); | |||
56 | static int debug; | 56 | static int debug; |
57 | 57 | ||
58 | static struct usb_device_id id_table [] = { | 58 | static struct usb_device_id id_table [] = { |
59 | { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ | ||
59 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ | 60 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ |
60 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ | 61 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ |
61 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ | 62 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index d4e5fc86e43c..6da9a7a962a8 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -167,6 +167,13 @@ UNUSUAL_DEV( 0x0421, 0x005d, 0x0001, 0x0600, | |||
167 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 167 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
168 | US_FL_FIX_CAPACITY ), | 168 | US_FL_FIX_CAPACITY ), |
169 | 169 | ||
170 | /* Patch for Nokia 5310 capacity */ | ||
171 | UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591, | ||
172 | "Nokia", | ||
173 | "5310", | ||
174 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
175 | US_FL_FIX_CAPACITY ), | ||
176 | |||
170 | /* Reported by Mario Rettig <mariorettig@web.de> */ | 177 | /* Reported by Mario Rettig <mariorettig@web.de> */ |
171 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, | 178 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, |
172 | "Nokia", | 179 | "Nokia", |
@@ -233,14 +240,14 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, | |||
233 | US_FL_MAX_SECTORS_64 ), | 240 | US_FL_MAX_SECTORS_64 ), |
234 | 241 | ||
235 | /* Reported by Cedric Godin <cedric@belbone.be> */ | 242 | /* Reported by Cedric Godin <cedric@belbone.be> */ |
236 | UNUSUAL_DEV( 0x0421, 0x04b9, 0x0551, 0x0551, | 243 | UNUSUAL_DEV( 0x0421, 0x04b9, 0x0500, 0x0551, |
237 | "Nokia", | 244 | "Nokia", |
238 | "5300", | 245 | "5300", |
239 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 246 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
240 | US_FL_FIX_CAPACITY ), | 247 | US_FL_FIX_CAPACITY ), |
241 | 248 | ||
242 | /* Reported by Richard Nauber <RichardNauber@web.de> */ | 249 | /* Reported by Richard Nauber <RichardNauber@web.de> */ |
243 | UNUSUAL_DEV( 0x0421, 0x04fa, 0x0601, 0x0601, | 250 | UNUSUAL_DEV( 0x0421, 0x04fa, 0x0550, 0x0660, |
244 | "Nokia", | 251 | "Nokia", |
245 | "6300", | 252 | "6300", |
246 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 253 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index f8d0a57a07cb..9a577a800db5 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -132,7 +132,7 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) | |||
132 | 132 | ||
133 | bl = backlight_device_register("backlight", &sinfo->pdev->dev, | 133 | bl = backlight_device_register("backlight", &sinfo->pdev->dev, |
134 | sinfo, &atmel_lcdc_bl_ops); | 134 | sinfo, &atmel_lcdc_bl_ops); |
135 | if (IS_ERR(sinfo->backlight)) { | 135 | if (IS_ERR(bl)) { |
136 | dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n", | 136 | dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n", |
137 | PTR_ERR(bl)); | 137 | PTR_ERR(bl)); |
138 | return; | 138 | return; |
diff --git a/drivers/video/backlight/da903x.c b/drivers/video/backlight/da903x.c index 242c38250166..93bb4340cc64 100644 --- a/drivers/video/backlight/da903x.c +++ b/drivers/video/backlight/da903x.c | |||
@@ -119,6 +119,7 @@ static int da903x_backlight_probe(struct platform_device *pdev) | |||
119 | default: | 119 | default: |
120 | dev_err(&pdev->dev, "invalid backlight device ID(%d)\n", | 120 | dev_err(&pdev->dev, "invalid backlight device ID(%d)\n", |
121 | pdev->id); | 121 | pdev->id); |
122 | kfree(data); | ||
122 | return -EINVAL; | 123 | return -EINVAL; |
123 | } | 124 | } |
124 | 125 | ||
@@ -130,6 +131,7 @@ static int da903x_backlight_probe(struct platform_device *pdev) | |||
130 | data, &da903x_backlight_ops); | 131 | data, &da903x_backlight_ops); |
131 | if (IS_ERR(bl)) { | 132 | if (IS_ERR(bl)) { |
132 | dev_err(&pdev->dev, "failed to register backlight\n"); | 133 | dev_err(&pdev->dev, "failed to register backlight\n"); |
134 | kfree(data); | ||
133 | return PTR_ERR(bl); | 135 | return PTR_ERR(bl); |
134 | } | 136 | } |
135 | 137 | ||
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 8e1731d3b228..680e57b616cd 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
@@ -42,10 +42,13 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
42 | 42 | ||
43 | mutex_lock(&ld->ops_lock); | 43 | mutex_lock(&ld->ops_lock); |
44 | if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { | 44 | if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { |
45 | if (event == FB_EVENT_BLANK) | 45 | if (event == FB_EVENT_BLANK) { |
46 | ld->ops->set_power(ld, *(int *)evdata->data); | 46 | if (ld->ops->set_power) |
47 | else | 47 | ld->ops->set_power(ld, *(int *)evdata->data); |
48 | ld->ops->set_mode(ld, evdata->data); | 48 | } else { |
49 | if (ld->ops->set_mode) | ||
50 | ld->ops->set_mode(ld, evdata->data); | ||
51 | } | ||
49 | } | 52 | } |
50 | mutex_unlock(&ld->ops_lock); | 53 | mutex_unlock(&ld->ops_lock); |
51 | return 0; | 54 | return 0; |
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 8a8760230bc7..a2aa6ddffbe2 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
@@ -2462,8 +2462,7 @@ static int __init cirrusfb_init(void) | |||
2462 | 2462 | ||
2463 | #ifndef MODULE | 2463 | #ifndef MODULE |
2464 | static int __init cirrusfb_setup(char *options) { | 2464 | static int __init cirrusfb_setup(char *options) { |
2465 | char *this_opt, s[32]; | 2465 | char *this_opt; |
2466 | int i; | ||
2467 | 2466 | ||
2468 | DPRINTK("ENTER\n"); | 2467 | DPRINTK("ENTER\n"); |
2469 | 2468 | ||
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 1d5ae39cb271..3c65b0d67617 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -230,7 +230,7 @@ static void fb_set_logo_directpalette(struct fb_info *info, | |||
230 | greenshift = info->var.green.offset; | 230 | greenshift = info->var.green.offset; |
231 | blueshift = info->var.blue.offset; | 231 | blueshift = info->var.blue.offset; |
232 | 232 | ||
233 | for (i = 32; i < logo->clutsize; i++) | 233 | for (i = 32; i < 32 + logo->clutsize; i++) |
234 | palette[i] = i << redshift | i << greenshift | i << blueshift; | 234 | palette[i] = i << redshift | i << greenshift | i << blueshift; |
235 | } | 235 | } |
236 | 236 | ||
diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile index 99da8b6d2c36..ed13889c1162 100644 --- a/drivers/video/omap/Makefile +++ b/drivers/video/omap/Makefile | |||
@@ -23,7 +23,6 @@ objs-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o | |||
23 | objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o | 23 | objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o |
24 | objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o | 24 | objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o |
25 | objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o | 25 | objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o |
26 | objs-y$(CONFIG_MACH_SX1) += lcd_sx1.o | ||
27 | 26 | ||
28 | omapfb-objs := $(objs-yy) | 27 | omapfb-objs := $(objs-yy) |
29 | 28 | ||
diff --git a/drivers/video/omap/lcd_sx1.c b/drivers/video/omap/lcd_sx1.c deleted file mode 100644 index e55de201b8ff..000000000000 --- a/drivers/video/omap/lcd_sx1.c +++ /dev/null | |||
@@ -1,327 +0,0 @@ | |||
1 | /* | ||
2 | * LCD panel support for the Siemens SX1 mobile phone | ||
3 | * | ||
4 | * Current version : Vovan888@gmail.com, great help from FCA00000 | ||
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 as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/module.h> | ||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/io.h> | ||
25 | |||
26 | #include <mach/gpio.h> | ||
27 | #include <mach/omapfb.h> | ||
28 | #include <mach/mcbsp.h> | ||
29 | #include <mach/mux.h> | ||
30 | |||
31 | /* | ||
32 | * OMAP310 GPIO registers | ||
33 | */ | ||
34 | #define GPIO_DATA_INPUT 0xfffce000 | ||
35 | #define GPIO_DATA_OUTPUT 0xfffce004 | ||
36 | #define GPIO_DIR_CONTROL 0xfffce008 | ||
37 | #define GPIO_INT_CONTROL 0xfffce00c | ||
38 | #define GPIO_INT_MASK 0xfffce010 | ||
39 | #define GPIO_INT_STATUS 0xfffce014 | ||
40 | #define GPIO_PIN_CONTROL 0xfffce018 | ||
41 | |||
42 | |||
43 | #define A_LCD_SSC_RD 3 | ||
44 | #define A_LCD_SSC_SD 7 | ||
45 | #define _A_LCD_RESET 9 | ||
46 | #define _A_LCD_SSC_CS 12 | ||
47 | #define _A_LCD_SSC_A0 13 | ||
48 | |||
49 | #define DSP_REG 0xE1017024 | ||
50 | |||
51 | const unsigned char INIT_1[12] = { | ||
52 | 0x1C, 0x02, 0x88, 0x00, 0x1E, 0xE0, 0x00, 0xDC, 0x00, 0x02, 0x00 | ||
53 | }; | ||
54 | |||
55 | const unsigned char INIT_2[127] = { | ||
56 | 0x15, 0x00, 0x29, 0x00, 0x3E, 0x00, 0x51, 0x00, | ||
57 | 0x65, 0x00, 0x7A, 0x00, 0x8D, 0x00, 0xA1, 0x00, | ||
58 | 0xB6, 0x00, 0xC7, 0x00, 0xD8, 0x00, 0xEB, 0x00, | ||
59 | 0xFB, 0x00, 0x0B, 0x01, 0x1B, 0x01, 0x27, 0x01, | ||
60 | 0x34, 0x01, 0x41, 0x01, 0x4C, 0x01, 0x55, 0x01, | ||
61 | 0x5F, 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, 0x01, | ||
62 | 0x7E, 0x01, 0x86, 0x01, 0x8C, 0x01, 0x94, 0x01, | ||
63 | 0x9B, 0x01, 0xA1, 0x01, 0xA4, 0x01, 0xA9, 0x01, | ||
64 | 0xAD, 0x01, 0xB2, 0x01, 0xB7, 0x01, 0xBC, 0x01, | ||
65 | 0xC0, 0x01, 0xC4, 0x01, 0xC8, 0x01, 0xCB, 0x01, | ||
66 | 0xCF, 0x01, 0xD2, 0x01, 0xD5, 0x01, 0xD8, 0x01, | ||
67 | 0xDB, 0x01, 0xE0, 0x01, 0xE3, 0x01, 0xE6, 0x01, | ||
68 | 0xE8, 0x01, 0xEB, 0x01, 0xEE, 0x01, 0xF1, 0x01, | ||
69 | 0xF3, 0x01, 0xF8, 0x01, 0xF9, 0x01, 0xFC, 0x01, | ||
70 | 0x00, 0x02, 0x03, 0x02, 0x07, 0x02, 0x09, 0x02, | ||
71 | 0x0E, 0x02, 0x13, 0x02, 0x1C, 0x02, 0x00 | ||
72 | }; | ||
73 | |||
74 | const unsigned char INIT_3[15] = { | ||
75 | 0x14, 0x26, 0x33, 0x3D, 0x45, 0x4D, 0x53, 0x59, | ||
76 | 0x5E, 0x63, 0x67, 0x6D, 0x71, 0x78, 0xFF | ||
77 | }; | ||
78 | |||
79 | static void epson_sendbyte(int flag, unsigned char byte) | ||
80 | { | ||
81 | int i, shifter = 0x80; | ||
82 | |||
83 | if (!flag) | ||
84 | gpio_set_value(_A_LCD_SSC_A0, 0); | ||
85 | mdelay(2); | ||
86 | gpio_set_value(A_LCD_SSC_RD, 1); | ||
87 | |||
88 | gpio_set_value(A_LCD_SSC_SD, flag); | ||
89 | |||
90 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2200); | ||
91 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2202); | ||
92 | for (i = 0; i < 8; i++) { | ||
93 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2200); | ||
94 | gpio_set_value(A_LCD_SSC_SD, shifter & byte); | ||
95 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2202); | ||
96 | shifter >>= 1; | ||
97 | } | ||
98 | gpio_set_value(_A_LCD_SSC_A0, 1); | ||
99 | } | ||
100 | |||
101 | static void init_system(void) | ||
102 | { | ||
103 | omap_mcbsp_request(OMAP_MCBSP3); | ||
104 | omap_mcbsp_stop(OMAP_MCBSP3); | ||
105 | } | ||
106 | |||
107 | static void setup_GPIO(void) | ||
108 | { | ||
109 | /* new wave */ | ||
110 | gpio_request(A_LCD_SSC_RD, "lcd_ssc_rd"); | ||
111 | gpio_request(A_LCD_SSC_SD, "lcd_ssc_sd"); | ||
112 | gpio_request(_A_LCD_RESET, "lcd_reset"); | ||
113 | gpio_request(_A_LCD_SSC_CS, "lcd_ssc_cs"); | ||
114 | gpio_request(_A_LCD_SSC_A0, "lcd_ssc_a0"); | ||
115 | |||
116 | /* set GPIOs to output, with initial data */ | ||
117 | gpio_direction_output(A_LCD_SSC_RD, 1); | ||
118 | gpio_direction_output(A_LCD_SSC_SD, 0); | ||
119 | gpio_direction_output(_A_LCD_RESET, 0); | ||
120 | gpio_direction_output(_A_LCD_SSC_CS, 1); | ||
121 | gpio_direction_output(_A_LCD_SSC_A0, 1); | ||
122 | } | ||
123 | |||
124 | static void display_init(void) | ||
125 | { | ||
126 | int i; | ||
127 | |||
128 | omap_cfg_reg(MCBSP3_CLKX); | ||
129 | |||
130 | mdelay(2); | ||
131 | setup_GPIO(); | ||
132 | mdelay(2); | ||
133 | |||
134 | /* reset LCD */ | ||
135 | gpio_set_value(A_LCD_SSC_SD, 1); | ||
136 | epson_sendbyte(0, 0x25); | ||
137 | |||
138 | gpio_set_value(_A_LCD_RESET, 0); | ||
139 | mdelay(10); | ||
140 | gpio_set_value(_A_LCD_RESET, 1); | ||
141 | |||
142 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
143 | mdelay(2); | ||
144 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
145 | |||
146 | /* init LCD, phase 1 */ | ||
147 | epson_sendbyte(0, 0xCA); | ||
148 | for (i = 0; i < 10; i++) | ||
149 | epson_sendbyte(1, INIT_1[i]); | ||
150 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
151 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
152 | |||
153 | /* init LCD phase 2 */ | ||
154 | epson_sendbyte(0, 0xCB); | ||
155 | for (i = 0; i < 125; i++) | ||
156 | epson_sendbyte(1, INIT_2[i]); | ||
157 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
158 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
159 | |||
160 | /* init LCD phase 2a */ | ||
161 | epson_sendbyte(0, 0xCC); | ||
162 | for (i = 0; i < 14; i++) | ||
163 | epson_sendbyte(1, INIT_3[i]); | ||
164 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
165 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
166 | |||
167 | /* init LCD phase 3 */ | ||
168 | epson_sendbyte(0, 0xBC); | ||
169 | epson_sendbyte(1, 0x08); | ||
170 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
171 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
172 | |||
173 | /* init LCD phase 4 */ | ||
174 | epson_sendbyte(0, 0x07); | ||
175 | epson_sendbyte(1, 0x05); | ||
176 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
177 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
178 | |||
179 | /* init LCD phase 5 */ | ||
180 | epson_sendbyte(0, 0x94); | ||
181 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
182 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
183 | |||
184 | /* init LCD phase 6 */ | ||
185 | epson_sendbyte(0, 0xC6); | ||
186 | epson_sendbyte(1, 0x80); | ||
187 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
188 | mdelay(100); /* used to be 1000 */ | ||
189 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
190 | |||
191 | /* init LCD phase 7 */ | ||
192 | epson_sendbyte(0, 0x16); | ||
193 | epson_sendbyte(1, 0x02); | ||
194 | epson_sendbyte(1, 0x00); | ||
195 | epson_sendbyte(1, 0xB1); | ||
196 | epson_sendbyte(1, 0x00); | ||
197 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
198 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
199 | |||
200 | /* init LCD phase 8 */ | ||
201 | epson_sendbyte(0, 0x76); | ||
202 | epson_sendbyte(1, 0x00); | ||
203 | epson_sendbyte(1, 0x00); | ||
204 | epson_sendbyte(1, 0xDB); | ||
205 | epson_sendbyte(1, 0x00); | ||
206 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
207 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
208 | |||
209 | /* init LCD phase 9 */ | ||
210 | epson_sendbyte(0, 0xAF); | ||
211 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
212 | } | ||
213 | |||
214 | static int sx1_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) | ||
215 | { | ||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | static void sx1_panel_cleanup(struct lcd_panel *panel) | ||
220 | { | ||
221 | } | ||
222 | |||
223 | static void sx1_panel_disable(struct lcd_panel *panel) | ||
224 | { | ||
225 | printk(KERN_INFO "SX1: LCD panel disable\n"); | ||
226 | sx1_setmmipower(0); | ||
227 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
228 | |||
229 | epson_sendbyte(0, 0x25); | ||
230 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
231 | |||
232 | epson_sendbyte(0, 0xAE); | ||
233 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
234 | mdelay(100); | ||
235 | gpio_set_value(_A_LCD_SSC_CS, 0); | ||
236 | |||
237 | epson_sendbyte(0, 0x95); | ||
238 | gpio_set_value(_A_LCD_SSC_CS, 1); | ||
239 | } | ||
240 | |||
241 | static int sx1_panel_enable(struct lcd_panel *panel) | ||
242 | { | ||
243 | printk(KERN_INFO "lcd_sx1: LCD panel enable\n"); | ||
244 | init_system(); | ||
245 | display_init(); | ||
246 | |||
247 | sx1_setmmipower(1); | ||
248 | sx1_setbacklight(0x18); | ||
249 | sx1_setkeylight (0x06); | ||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | |||
254 | static unsigned long sx1_panel_get_caps(struct lcd_panel *panel) | ||
255 | { | ||
256 | return 0; | ||
257 | } | ||
258 | |||
259 | struct lcd_panel sx1_panel = { | ||
260 | .name = "sx1", | ||
261 | .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | | ||
262 | OMAP_LCDC_INV_HSYNC | OMAP_LCDC_INV_PIX_CLOCK | | ||
263 | OMAP_LCDC_INV_OUTPUT_EN, | ||
264 | |||
265 | .x_res = 176, | ||
266 | .y_res = 220, | ||
267 | .data_lines = 16, | ||
268 | .bpp = 16, | ||
269 | .hsw = 5, | ||
270 | .hfp = 5, | ||
271 | .hbp = 5, | ||
272 | .vsw = 2, | ||
273 | .vfp = 1, | ||
274 | .vbp = 1, | ||
275 | .pixel_clock = 1500, | ||
276 | |||
277 | .init = sx1_panel_init, | ||
278 | .cleanup = sx1_panel_cleanup, | ||
279 | .enable = sx1_panel_enable, | ||
280 | .disable = sx1_panel_disable, | ||
281 | .get_caps = sx1_panel_get_caps, | ||
282 | }; | ||
283 | |||
284 | static int sx1_panel_probe(struct platform_device *pdev) | ||
285 | { | ||
286 | omapfb_register_panel(&sx1_panel); | ||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | static int sx1_panel_remove(struct platform_device *pdev) | ||
291 | { | ||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | static int sx1_panel_suspend(struct platform_device *pdev, pm_message_t mesg) | ||
296 | { | ||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static int sx1_panel_resume(struct platform_device *pdev) | ||
301 | { | ||
302 | return 0; | ||
303 | } | ||
304 | |||
305 | struct platform_driver sx1_panel_driver = { | ||
306 | .probe = sx1_panel_probe, | ||
307 | .remove = sx1_panel_remove, | ||
308 | .suspend = sx1_panel_suspend, | ||
309 | .resume = sx1_panel_resume, | ||
310 | .driver = { | ||
311 | .name = "lcd_sx1", | ||
312 | .owner = THIS_MODULE, | ||
313 | }, | ||
314 | }; | ||
315 | |||
316 | static int sx1_panel_drv_init(void) | ||
317 | { | ||
318 | return platform_driver_register(&sx1_panel_driver); | ||
319 | } | ||
320 | |||
321 | static void sx1_panel_drv_cleanup(void) | ||
322 | { | ||
323 | platform_driver_unregister(&sx1_panel_driver); | ||
324 | } | ||
325 | |||
326 | module_init(sx1_panel_drv_init); | ||
327 | module_exit(sx1_panel_drv_cleanup); | ||
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 97204497d9f7..cc59c52e1103 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -804,6 +804,9 @@ static int pxafb_smart_thread(void *arg) | |||
804 | 804 | ||
805 | static int pxafb_smart_init(struct pxafb_info *fbi) | 805 | static int pxafb_smart_init(struct pxafb_info *fbi) |
806 | { | 806 | { |
807 | if (!(fbi->lccr0 | LCCR0_LCDT)) | ||
808 | return 0; | ||
809 | |||
807 | fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi, | 810 | fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi, |
808 | "lcd_refresh"); | 811 | "lcd_refresh"); |
809 | if (IS_ERR(fbi->smart_thread)) { | 812 | if (IS_ERR(fbi->smart_thread)) { |
@@ -1372,7 +1375,7 @@ static void pxafb_decode_mach_info(struct pxafb_info *fbi, | |||
1372 | fbi->cmap_inverse = inf->cmap_inverse; | 1375 | fbi->cmap_inverse = inf->cmap_inverse; |
1373 | fbi->cmap_static = inf->cmap_static; | 1376 | fbi->cmap_static = inf->cmap_static; |
1374 | 1377 | ||
1375 | switch (lcd_conn & 0xf) { | 1378 | switch (lcd_conn & LCD_TYPE_MASK) { |
1376 | case LCD_TYPE_MONO_STN: | 1379 | case LCD_TYPE_MONO_STN: |
1377 | fbi->lccr0 = LCCR0_CMS; | 1380 | fbi->lccr0 = LCCR0_CMS; |
1378 | break; | 1381 | break; |
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c index 2a380011e9ba..7baf2dd12d50 100644 --- a/drivers/video/tmiofb.c +++ b/drivers/video/tmiofb.c | |||
@@ -222,6 +222,9 @@ static irqreturn_t tmiofb_irq(int irq, void *__info) | |||
222 | unsigned int bbisc = tmio_ioread16(par->lcr + LCR_BBISC); | 222 | unsigned int bbisc = tmio_ioread16(par->lcr + LCR_BBISC); |
223 | 223 | ||
224 | 224 | ||
225 | tmio_iowrite16(bbisc, par->lcr + LCR_BBISC); | ||
226 | |||
227 | #ifdef CONFIG_FB_TMIO_ACCELL | ||
225 | /* | 228 | /* |
226 | * We were in polling mode and now we got correct irq. | 229 | * We were in polling mode and now we got correct irq. |
227 | * Switch back to IRQ-based sync of command FIFO | 230 | * Switch back to IRQ-based sync of command FIFO |
@@ -231,9 +234,6 @@ static irqreturn_t tmiofb_irq(int irq, void *__info) | |||
231 | par->use_polling = false; | 234 | par->use_polling = false; |
232 | } | 235 | } |
233 | 236 | ||
234 | tmio_iowrite16(bbisc, par->lcr + LCR_BBISC); | ||
235 | |||
236 | #ifdef CONFIG_FB_TMIO_ACCELL | ||
237 | if (bbisc & 1) | 237 | if (bbisc & 1) |
238 | wake_up(&par->wait_acc); | 238 | wake_up(&par->wait_acc); |
239 | #endif | 239 | #endif |
@@ -938,7 +938,9 @@ static void tmiofb_dump_regs(struct platform_device *dev) | |||
938 | static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) | 938 | static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) |
939 | { | 939 | { |
940 | struct fb_info *info = platform_get_drvdata(dev); | 940 | struct fb_info *info = platform_get_drvdata(dev); |
941 | #ifdef CONFIG_FB_TMIO_ACCELL | ||
941 | struct tmiofb_par *par = info->par; | 942 | struct tmiofb_par *par = info->par; |
943 | #endif | ||
942 | struct mfd_cell *cell = dev->dev.platform_data; | 944 | struct mfd_cell *cell = dev->dev.platform_data; |
943 | int retval = 0; | 945 | int retval = 0; |
944 | 946 | ||
@@ -950,12 +952,14 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) | |||
950 | info->fbops->fb_sync(info); | 952 | info->fbops->fb_sync(info); |
951 | 953 | ||
952 | 954 | ||
955 | #ifdef CONFIG_FB_TMIO_ACCELL | ||
953 | /* | 956 | /* |
954 | * The fb should be usable even if interrupts are disabled (and they are | 957 | * The fb should be usable even if interrupts are disabled (and they are |
955 | * during suspend/resume). Switch temporary to forced polling. | 958 | * during suspend/resume). Switch temporary to forced polling. |
956 | */ | 959 | */ |
957 | printk(KERN_INFO "tmiofb: switching to polling\n"); | 960 | printk(KERN_INFO "tmiofb: switching to polling\n"); |
958 | par->use_polling = true; | 961 | par->use_polling = true; |
962 | #endif | ||
959 | tmiofb_hw_stop(dev); | 963 | tmiofb_hw_stop(dev); |
960 | 964 | ||
961 | if (cell->suspend) | 965 | if (cell->suspend) |
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 0132eae06f55..73ac754ad801 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -2036,30 +2036,30 @@ static int viafb_vt1636_proc_write(struct file *file, | |||
2036 | return count; | 2036 | return count; |
2037 | } | 2037 | } |
2038 | 2038 | ||
2039 | static void viafb_init_proc(struct proc_dir_entry *viafb_entry) | 2039 | static void viafb_init_proc(struct proc_dir_entry **viafb_entry) |
2040 | { | 2040 | { |
2041 | struct proc_dir_entry *entry; | 2041 | struct proc_dir_entry *entry; |
2042 | viafb_entry = proc_mkdir("viafb", NULL); | 2042 | *viafb_entry = proc_mkdir("viafb", NULL); |
2043 | if (viafb_entry) { | 2043 | if (viafb_entry) { |
2044 | entry = create_proc_entry("dvp0", 0, viafb_entry); | 2044 | entry = create_proc_entry("dvp0", 0, *viafb_entry); |
2045 | if (entry) { | 2045 | if (entry) { |
2046 | entry->owner = THIS_MODULE; | 2046 | entry->owner = THIS_MODULE; |
2047 | entry->read_proc = viafb_dvp0_proc_read; | 2047 | entry->read_proc = viafb_dvp0_proc_read; |
2048 | entry->write_proc = viafb_dvp0_proc_write; | 2048 | entry->write_proc = viafb_dvp0_proc_write; |
2049 | } | 2049 | } |
2050 | entry = create_proc_entry("dvp1", 0, viafb_entry); | 2050 | entry = create_proc_entry("dvp1", 0, *viafb_entry); |
2051 | if (entry) { | 2051 | if (entry) { |
2052 | entry->owner = THIS_MODULE; | 2052 | entry->owner = THIS_MODULE; |
2053 | entry->read_proc = viafb_dvp1_proc_read; | 2053 | entry->read_proc = viafb_dvp1_proc_read; |
2054 | entry->write_proc = viafb_dvp1_proc_write; | 2054 | entry->write_proc = viafb_dvp1_proc_write; |
2055 | } | 2055 | } |
2056 | entry = create_proc_entry("dfph", 0, viafb_entry); | 2056 | entry = create_proc_entry("dfph", 0, *viafb_entry); |
2057 | if (entry) { | 2057 | if (entry) { |
2058 | entry->owner = THIS_MODULE; | 2058 | entry->owner = THIS_MODULE; |
2059 | entry->read_proc = viafb_dfph_proc_read; | 2059 | entry->read_proc = viafb_dfph_proc_read; |
2060 | entry->write_proc = viafb_dfph_proc_write; | 2060 | entry->write_proc = viafb_dfph_proc_write; |
2061 | } | 2061 | } |
2062 | entry = create_proc_entry("dfpl", 0, viafb_entry); | 2062 | entry = create_proc_entry("dfpl", 0, *viafb_entry); |
2063 | if (entry) { | 2063 | if (entry) { |
2064 | entry->owner = THIS_MODULE; | 2064 | entry->owner = THIS_MODULE; |
2065 | entry->read_proc = viafb_dfpl_proc_read; | 2065 | entry->read_proc = viafb_dfpl_proc_read; |
@@ -2068,7 +2068,7 @@ static void viafb_init_proc(struct proc_dir_entry *viafb_entry) | |||
2068 | if (VT1636_LVDS == viaparinfo->chip_info->lvds_chip_info. | 2068 | if (VT1636_LVDS == viaparinfo->chip_info->lvds_chip_info. |
2069 | lvds_chip_name || VT1636_LVDS == | 2069 | lvds_chip_name || VT1636_LVDS == |
2070 | viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) { | 2070 | viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) { |
2071 | entry = create_proc_entry("vt1636", 0, viafb_entry); | 2071 | entry = create_proc_entry("vt1636", 0, *viafb_entry); |
2072 | if (entry) { | 2072 | if (entry) { |
2073 | entry->owner = THIS_MODULE; | 2073 | entry->owner = THIS_MODULE; |
2074 | entry->read_proc = viafb_vt1636_proc_read; | 2074 | entry->read_proc = viafb_vt1636_proc_read; |
@@ -2087,6 +2087,7 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry) | |||
2087 | remove_proc_entry("dfpl", viafb_entry); | 2087 | remove_proc_entry("dfpl", viafb_entry); |
2088 | remove_proc_entry("vt1636", viafb_entry); | 2088 | remove_proc_entry("vt1636", viafb_entry); |
2089 | remove_proc_entry("vt1625", viafb_entry); | 2089 | remove_proc_entry("vt1625", viafb_entry); |
2090 | remove_proc_entry("viafb", NULL); | ||
2090 | } | 2091 | } |
2091 | 2092 | ||
2092 | static int __devinit via_pci_probe(void) | 2093 | static int __devinit via_pci_probe(void) |
@@ -2348,7 +2349,7 @@ static int __devinit via_pci_probe(void) | |||
2348 | viafbinfo->node, viafbinfo->fix.id, default_var.xres, | 2349 | viafbinfo->node, viafbinfo->fix.id, default_var.xres, |
2349 | default_var.yres, default_var.bits_per_pixel); | 2350 | default_var.yres, default_var.bits_per_pixel); |
2350 | 2351 | ||
2351 | viafb_init_proc(viaparinfo->proc_entry); | 2352 | viafb_init_proc(&viaparinfo->proc_entry); |
2352 | viafb_init_dac(IGA2); | 2353 | viafb_init_dac(IGA2); |
2353 | return 0; | 2354 | return 0; |
2354 | } | 2355 | } |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index a463b3dd837b..2493f05e9f61 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -668,7 +668,7 @@ static struct xenbus_device_id xenfb_ids[] = { | |||
668 | { "" } | 668 | { "" } |
669 | }; | 669 | }; |
670 | 670 | ||
671 | static struct xenbus_driver xenfb = { | 671 | static struct xenbus_driver xenfb_driver = { |
672 | .name = "vfb", | 672 | .name = "vfb", |
673 | .owner = THIS_MODULE, | 673 | .owner = THIS_MODULE, |
674 | .ids = xenfb_ids, | 674 | .ids = xenfb_ids, |
@@ -687,12 +687,12 @@ static int __init xenfb_init(void) | |||
687 | if (xen_initial_domain()) | 687 | if (xen_initial_domain()) |
688 | return -ENODEV; | 688 | return -ENODEV; |
689 | 689 | ||
690 | return xenbus_register_frontend(&xenfb); | 690 | return xenbus_register_frontend(&xenfb_driver); |
691 | } | 691 | } |
692 | 692 | ||
693 | static void __exit xenfb_cleanup(void) | 693 | static void __exit xenfb_cleanup(void) |
694 | { | 694 | { |
695 | xenbus_unregister_driver(&xenfb); | 695 | xenbus_unregister_driver(&xenfb_driver); |
696 | } | 696 | } |
697 | 697 | ||
698 | module_init(xenfb_init); | 698 | module_init(xenfb_init); |
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig index a14d5b6e4c7c..90616822cd20 100644 --- a/drivers/w1/masters/Kconfig +++ b/drivers/w1/masters/Kconfig | |||
@@ -36,7 +36,7 @@ config W1_MASTER_DS2482 | |||
36 | 36 | ||
37 | config W1_MASTER_DS1WM | 37 | config W1_MASTER_DS1WM |
38 | tristate "Maxim DS1WM 1-wire busmaster" | 38 | tristate "Maxim DS1WM 1-wire busmaster" |
39 | depends on W1 && ARM | 39 | depends on W1 && ARM && HAVE_CLK |
40 | help | 40 | help |
41 | Say Y here to enable the DS1WM 1-wire driver, such as that | 41 | Say Y here to enable the DS1WM 1-wire driver, such as that |
42 | in HP iPAQ devices like h5xxx, h2200, and ASIC3-based like | 42 | in HP iPAQ devices like h5xxx, h2200, and ASIC3-based like |
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c index 1295625c4825..c973889110c8 100644 --- a/drivers/w1/masters/omap_hdq.c +++ b/drivers/w1/masters/omap_hdq.c | |||
@@ -86,8 +86,8 @@ static struct platform_driver omap_hdq_driver = { | |||
86 | static u8 omap_w1_read_byte(void *_hdq); | 86 | static u8 omap_w1_read_byte(void *_hdq); |
87 | static void omap_w1_write_byte(void *_hdq, u8 byte); | 87 | static void omap_w1_write_byte(void *_hdq, u8 byte); |
88 | static u8 omap_w1_reset_bus(void *_hdq); | 88 | static u8 omap_w1_reset_bus(void *_hdq); |
89 | static void omap_w1_search_bus(void *_hdq, u8 search_type, | 89 | static void omap_w1_search_bus(void *_hdq, struct w1_master *master_dev, |
90 | w1_slave_found_callback slave_found); | 90 | u8 search_type, w1_slave_found_callback slave_found); |
91 | 91 | ||
92 | 92 | ||
93 | static struct w1_bus_master omap_w1_master = { | 93 | static struct w1_bus_master omap_w1_master = { |
@@ -231,8 +231,8 @@ static u8 omap_w1_reset_bus(void *_hdq) | |||
231 | } | 231 | } |
232 | 232 | ||
233 | /* W1 search callback function */ | 233 | /* W1 search callback function */ |
234 | static void omap_w1_search_bus(void *_hdq, u8 search_type, | 234 | static void omap_w1_search_bus(void *_hdq, struct w1_master *master_dev, |
235 | w1_slave_found_callback slave_found) | 235 | u8 search_type, w1_slave_found_callback slave_found) |
236 | { | 236 | { |
237 | u64 module_id, rn_le, cs, id; | 237 | u64 module_id, rn_le, cs, id; |
238 | 238 | ||
@@ -249,7 +249,7 @@ static void omap_w1_search_bus(void *_hdq, u8 search_type, | |||
249 | cs = w1_calc_crc8((u8 *)&rn_le, 7); | 249 | cs = w1_calc_crc8((u8 *)&rn_le, 7); |
250 | id = (cs << 56) | module_id; | 250 | id = (cs << 56) | module_id; |
251 | 251 | ||
252 | slave_found(_hdq, id); | 252 | slave_found(master_dev, id); |
253 | } | 253 | } |
254 | 254 | ||
255 | static int _omap_hdq_reset(struct hdq_data *hdq_data) | 255 | static int _omap_hdq_reset(struct hdq_data *hdq_data) |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index a0fb5eac407c..526c191e84ea 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -122,14 +122,7 @@ static struct timer_list balloon_timer; | |||
122 | static void scrub_page(struct page *page) | 122 | static void scrub_page(struct page *page) |
123 | { | 123 | { |
124 | #ifdef CONFIG_XEN_SCRUB_PAGES | 124 | #ifdef CONFIG_XEN_SCRUB_PAGES |
125 | if (PageHighMem(page)) { | 125 | clear_highpage(page); |
126 | void *v = kmap(page); | ||
127 | clear_page(v); | ||
128 | kunmap(v); | ||
129 | } else { | ||
130 | void *v = page_address(page); | ||
131 | clear_page(v); | ||
132 | } | ||
133 | #endif | 126 | #endif |
134 | } | 127 | } |
135 | 128 | ||