diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-10 19:08:35 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-10 19:08:35 -0500 |
| commit | 6a1c64cb401d14babf7df6307fe8ed5b9728df30 (patch) | |
| tree | 77eddb6bc1d5cafdbe7f35caae11ce4fb337b2a8 | |
| parent | 13de22c59fd1f5a452fea806a5f822883deec88b (diff) | |
| parent | 158204397034f088bfd505eeee281f7072da1c24 (diff) | |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/apm into pm-apm-next
Pull APM update for 3.14-rc1 from Jiri Kosina.
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/apm:
apm-emulation: add hibernation APM events to support suspend2disk
| -rw-r--r-- | drivers/char/apm-emulation.c | 11 | ||||
| -rw-r--r-- | include/uapi/linux/apm_bios.h | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c index 46118f845948..dd9dfa15e9d1 100644 --- a/drivers/char/apm-emulation.c +++ b/drivers/char/apm-emulation.c | |||
| @@ -531,6 +531,7 @@ static int apm_suspend_notifier(struct notifier_block *nb, | |||
| 531 | { | 531 | { |
| 532 | struct apm_user *as; | 532 | struct apm_user *as; |
| 533 | int err; | 533 | int err; |
| 534 | unsigned long apm_event; | ||
| 534 | 535 | ||
| 535 | /* short-cut emergency suspends */ | 536 | /* short-cut emergency suspends */ |
| 536 | if (atomic_read(&userspace_notification_inhibit)) | 537 | if (atomic_read(&userspace_notification_inhibit)) |
| @@ -538,6 +539,9 @@ static int apm_suspend_notifier(struct notifier_block *nb, | |||
| 538 | 539 | ||
| 539 | switch (event) { | 540 | switch (event) { |
| 540 | case PM_SUSPEND_PREPARE: | 541 | case PM_SUSPEND_PREPARE: |
| 542 | case PM_HIBERNATION_PREPARE: | ||
| 543 | apm_event = (event == PM_SUSPEND_PREPARE) ? | ||
| 544 | APM_USER_SUSPEND : APM_USER_HIBERNATION; | ||
| 541 | /* | 545 | /* |
| 542 | * Queue an event to all "writer" users that we want | 546 | * Queue an event to all "writer" users that we want |
| 543 | * to suspend and need their ack. | 547 | * to suspend and need their ack. |
| @@ -550,7 +554,7 @@ static int apm_suspend_notifier(struct notifier_block *nb, | |||
| 550 | as->writer && as->suser) { | 554 | as->writer && as->suser) { |
| 551 | as->suspend_state = SUSPEND_PENDING; | 555 | as->suspend_state = SUSPEND_PENDING; |
| 552 | atomic_inc(&suspend_acks_pending); | 556 | atomic_inc(&suspend_acks_pending); |
| 553 | queue_add_event(&as->queue, APM_USER_SUSPEND); | 557 | queue_add_event(&as->queue, apm_event); |
| 554 | } | 558 | } |
| 555 | } | 559 | } |
| 556 | 560 | ||
| @@ -601,11 +605,14 @@ static int apm_suspend_notifier(struct notifier_block *nb, | |||
| 601 | return notifier_from_errno(err); | 605 | return notifier_from_errno(err); |
| 602 | 606 | ||
| 603 | case PM_POST_SUSPEND: | 607 | case PM_POST_SUSPEND: |
| 608 | case PM_POST_HIBERNATION: | ||
| 609 | apm_event = (event == PM_POST_SUSPEND) ? | ||
| 610 | APM_NORMAL_RESUME : APM_HIBERNATION_RESUME; | ||
| 604 | /* | 611 | /* |
| 605 | * Anyone on the APM queues will think we're still suspended. | 612 | * Anyone on the APM queues will think we're still suspended. |
| 606 | * Send a message so everyone knows we're now awake again. | 613 | * Send a message so everyone knows we're now awake again. |
| 607 | */ | 614 | */ |
| 608 | queue_event(APM_NORMAL_RESUME); | 615 | queue_event(apm_event); |
| 609 | 616 | ||
| 610 | /* | 617 | /* |
| 611 | * Finally, wake up anyone who is sleeping on the suspend. | 618 | * Finally, wake up anyone who is sleeping on the suspend. |
diff --git a/include/uapi/linux/apm_bios.h b/include/uapi/linux/apm_bios.h index 724f409adae0..df79bca1b898 100644 --- a/include/uapi/linux/apm_bios.h +++ b/include/uapi/linux/apm_bios.h | |||
| @@ -67,6 +67,8 @@ struct apm_bios_info { | |||
| 67 | #define APM_USER_SUSPEND 0x000a | 67 | #define APM_USER_SUSPEND 0x000a |
| 68 | #define APM_STANDBY_RESUME 0x000b | 68 | #define APM_STANDBY_RESUME 0x000b |
| 69 | #define APM_CAPABILITY_CHANGE 0x000c | 69 | #define APM_CAPABILITY_CHANGE 0x000c |
| 70 | #define APM_USER_HIBERNATION 0x000d | ||
| 71 | #define APM_HIBERNATION_RESUME 0x000e | ||
| 70 | 72 | ||
| 71 | /* | 73 | /* |
| 72 | * Error codes | 74 | * Error codes |
