diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
| commit | 24a77daf3d80bddcece044e6dc3675e427eef3f3 (patch) | |
| tree | 2c5e0b0bea394d6fe62c5d5857c252e83e48ac48 /drivers/macintosh/adb.c | |
| parent | e389f9aec689209724105ae80a6c91fd2e747bc9 (diff) | |
| parent | f900e9777fc9b65140cb9570438597bc8fae56ab (diff) | |
Merge branch 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (255 commits)
[POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
[POWERPC] remove kernel module option for booke wdt
[POWERPC] Avoid putting cpu node twice
[POWERPC] Spinlock initializer cleanup
[POWERPC] ppc4xx_sgdma needs dma-mapping.h
[POWERPC] arch/powerpc/sysdev/timer.c build fix
[POWERPC] get_property cleanups
[POWERPC] Remove the unused HTDMSOUND driver
[POWERPC] cell: cbe_cpufreq cleanup and crash fix
[POWERPC] Declare enable_kernel_spe in a header
[POWERPC] Add dt_xlate_addr() to bootwrapper
[POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE
[POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
[POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
[POWERPC] Add uartlite boot console driver for the zImage wrapper
[POWERPC] Stop using ppc_sys for Xilinx Virtex boards
[POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
[POWERPC] Merge common virtex header files
[POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
[POWERPC] Clean up cpufreq Kconfig dependencies
...
Diffstat (limited to 'drivers/macintosh/adb.c')
| -rw-r--r-- | drivers/macintosh/adb.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index f729eebf771f..adfea3c7c62a 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
| @@ -90,7 +90,7 @@ static int autopoll_devs; | |||
| 90 | int __adb_probe_sync; | 90 | int __adb_probe_sync; |
| 91 | 91 | ||
| 92 | #ifdef CONFIG_PM | 92 | #ifdef CONFIG_PM |
| 93 | static int adb_notify_sleep(struct pmu_sleep_notifier *self, int when); | 93 | static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when); |
| 94 | static struct pmu_sleep_notifier adb_sleep_notifier = { | 94 | static struct pmu_sleep_notifier adb_sleep_notifier = { |
| 95 | adb_notify_sleep, | 95 | adb_notify_sleep, |
| 96 | SLEEP_LEVEL_ADB, | 96 | SLEEP_LEVEL_ADB, |
| @@ -340,11 +340,9 @@ __initcall(adb_init); | |||
| 340 | /* | 340 | /* |
| 341 | * notify clients before sleep and reset bus afterwards | 341 | * notify clients before sleep and reset bus afterwards |
| 342 | */ | 342 | */ |
| 343 | int | 343 | void |
| 344 | adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | 344 | adb_notify_sleep(struct pmu_sleep_notifier *self, int when) |
| 345 | { | 345 | { |
| 346 | int ret; | ||
| 347 | |||
| 348 | switch (when) { | 346 | switch (when) { |
| 349 | case PBOOK_SLEEP_REQUEST: | 347 | case PBOOK_SLEEP_REQUEST: |
| 350 | adb_got_sleep = 1; | 348 | adb_got_sleep = 1; |
| @@ -353,22 +351,8 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | |||
| 353 | /* Stop autopoll */ | 351 | /* Stop autopoll */ |
| 354 | if (adb_controller->autopoll) | 352 | if (adb_controller->autopoll) |
| 355 | adb_controller->autopoll(0); | 353 | adb_controller->autopoll(0); |
| 356 | ret = blocking_notifier_call_chain(&adb_client_list, | 354 | blocking_notifier_call_chain(&adb_client_list, |
| 357 | ADB_MSG_POWERDOWN, NULL); | 355 | ADB_MSG_POWERDOWN, NULL); |
| 358 | if (ret & NOTIFY_STOP_MASK) { | ||
| 359 | up(&adb_probe_mutex); | ||
| 360 | return PBOOK_SLEEP_REFUSE; | ||
| 361 | } | ||
| 362 | break; | ||
| 363 | case PBOOK_SLEEP_REJECT: | ||
| 364 | if (adb_got_sleep) { | ||
| 365 | adb_got_sleep = 0; | ||
| 366 | up(&adb_probe_mutex); | ||
| 367 | adb_reset_bus(); | ||
| 368 | } | ||
| 369 | break; | ||
| 370 | |||
| 371 | case PBOOK_SLEEP_NOW: | ||
| 372 | break; | 356 | break; |
| 373 | case PBOOK_WAKE: | 357 | case PBOOK_WAKE: |
| 374 | adb_got_sleep = 0; | 358 | adb_got_sleep = 0; |
| @@ -376,14 +360,13 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | |||
| 376 | adb_reset_bus(); | 360 | adb_reset_bus(); |
| 377 | break; | 361 | break; |
| 378 | } | 362 | } |
| 379 | return PBOOK_SLEEP_OK; | ||
| 380 | } | 363 | } |
| 381 | #endif /* CONFIG_PM */ | 364 | #endif /* CONFIG_PM */ |
| 382 | 365 | ||
| 383 | static int | 366 | static int |
| 384 | do_adb_reset_bus(void) | 367 | do_adb_reset_bus(void) |
| 385 | { | 368 | { |
| 386 | int ret, nret; | 369 | int ret; |
| 387 | 370 | ||
| 388 | if (adb_controller == NULL) | 371 | if (adb_controller == NULL) |
| 389 | return -ENXIO; | 372 | return -ENXIO; |
| @@ -391,13 +374,8 @@ do_adb_reset_bus(void) | |||
| 391 | if (adb_controller->autopoll) | 374 | if (adb_controller->autopoll) |
| 392 | adb_controller->autopoll(0); | 375 | adb_controller->autopoll(0); |
| 393 | 376 | ||
| 394 | nret = blocking_notifier_call_chain(&adb_client_list, | 377 | blocking_notifier_call_chain(&adb_client_list, |
| 395 | ADB_MSG_PRE_RESET, NULL); | 378 | ADB_MSG_PRE_RESET, NULL); |
| 396 | if (nret & NOTIFY_STOP_MASK) { | ||
| 397 | if (adb_controller->autopoll) | ||
| 398 | adb_controller->autopoll(autopoll_devs); | ||
| 399 | return -EBUSY; | ||
| 400 | } | ||
| 401 | 379 | ||
| 402 | if (sleepy_trackpad) { | 380 | if (sleepy_trackpad) { |
| 403 | /* Let the trackpad settle down */ | 381 | /* Let the trackpad settle down */ |
| @@ -427,10 +405,8 @@ do_adb_reset_bus(void) | |||
| 427 | } | 405 | } |
| 428 | up(&adb_handler_sem); | 406 | up(&adb_handler_sem); |
| 429 | 407 | ||
| 430 | nret = blocking_notifier_call_chain(&adb_client_list, | 408 | blocking_notifier_call_chain(&adb_client_list, |
| 431 | ADB_MSG_POST_RESET, NULL); | 409 | ADB_MSG_POST_RESET, NULL); |
| 432 | if (nret & NOTIFY_STOP_MASK) | ||
| 433 | return -EBUSY; | ||
| 434 | 410 | ||
| 435 | return ret; | 411 | return ret; |
| 436 | } | 412 | } |
