diff options
Diffstat (limited to 'drivers')
64 files changed, 954 insertions, 848 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/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/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/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/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/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 36f2bb666bf7..8ed823ae639e 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -2330,7 +2330,7 @@ static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, | |||
| 2330 | * 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 |
| 2331 | * the register offset the descriptor ring is assigned to. | 2331 | * the register offset the descriptor ring is assigned to. |
| 2332 | **/ | 2332 | **/ |
| 2333 | static void __devinit ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) | 2333 | static void ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) |
| 2334 | { | 2334 | { |
| 2335 | int feature_mask = 0, rss_i; | 2335 | int feature_mask = 0, rss_i; |
| 2336 | int i, txr_idx, rxr_idx; | 2336 | int i, txr_idx, rxr_idx; |
| @@ -2367,7 +2367,7 @@ static void __devinit ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) | |||
| 2367 | * number of queues at compile-time. The polling_netdev array is | 2367 | * number of queues at compile-time. The polling_netdev array is |
| 2368 | * intended for Multiqueue, but should work fine with a single queue. | 2368 | * intended for Multiqueue, but should work fine with a single queue. |
| 2369 | **/ | 2369 | **/ |
| 2370 | static int __devinit ixgbe_alloc_queues(struct ixgbe_adapter *adapter) | 2370 | static int ixgbe_alloc_queues(struct ixgbe_adapter *adapter) |
| 2371 | { | 2371 | { |
| 2372 | int i; | 2372 | int i; |
| 2373 | 2373 | ||
| @@ -2408,8 +2408,7 @@ err_tx_ring_allocation: | |||
| 2408 | * Attempt to configure the interrupts using the best available | 2408 | * Attempt to configure the interrupts using the best available |
| 2409 | * capabilities of the hardware and the kernel. | 2409 | * capabilities of the hardware and the kernel. |
| 2410 | **/ | 2410 | **/ |
| 2411 | static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter | 2411 | static int ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter) |
| 2412 | *adapter) | ||
| 2413 | { | 2412 | { |
| 2414 | int err = 0; | 2413 | int err = 0; |
| 2415 | int vector, v_budget; | 2414 | int vector, v_budget; |
| @@ -2501,7 +2500,7 @@ static void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter) | |||
| 2501 | * - Hardware queue count (num_*_queues) | 2500 | * - Hardware queue count (num_*_queues) |
| 2502 | * - defined by miscellaneous hardware support/features (RSS, etc.) | 2501 | * - defined by miscellaneous hardware support/features (RSS, etc.) |
| 2503 | **/ | 2502 | **/ |
| 2504 | static int __devinit ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter) | 2503 | static int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter) |
| 2505 | { | 2504 | { |
| 2506 | int err; | 2505 | int err; |
| 2507 | 2506 | ||
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/smc911x.c b/drivers/net/smc911x.c index b185cd12269c..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; |
| @@ -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/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/pci/pci.c b/drivers/pci/pci.c index 28af496b441e..061d1ee0046a 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -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/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/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 |
