diff options
Diffstat (limited to 'drivers/ps3/ps3-sys-manager.c')
-rw-r--r-- | drivers/ps3/ps3-sys-manager.c | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/drivers/ps3/ps3-sys-manager.c b/drivers/ps3/ps3-sys-manager.c index c3c3aba3ffce..d4f6f960dd18 100644 --- a/drivers/ps3/ps3-sys-manager.c +++ b/drivers/ps3/ps3-sys-manager.c | |||
@@ -28,10 +28,6 @@ | |||
28 | 28 | ||
29 | #include "vuart.h" | 29 | #include "vuart.h" |
30 | 30 | ||
31 | MODULE_AUTHOR("Sony Corporation"); | ||
32 | MODULE_LICENSE("GPL v2"); | ||
33 | MODULE_DESCRIPTION("PS3 System Manager"); | ||
34 | |||
35 | /** | 31 | /** |
36 | * ps3_sys_manager - PS3 system manager driver. | 32 | * ps3_sys_manager - PS3 system manager driver. |
37 | * | 33 | * |
@@ -142,9 +138,11 @@ enum ps3_sys_manager_attr { | |||
142 | 138 | ||
143 | /** | 139 | /** |
144 | * enum ps3_sys_manager_event - External event type, reported by system manager. | 140 | * enum ps3_sys_manager_event - External event type, reported by system manager. |
145 | * @PS3_SM_EVENT_POWER_PRESSED: payload.value not used. | 141 | * @PS3_SM_EVENT_POWER_PRESSED: payload.value = |
142 | * enum ps3_sys_manager_button_event. | ||
146 | * @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec. | 143 | * @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec. |
147 | * @PS3_SM_EVENT_RESET_PRESSED: payload.value not used. | 144 | * @PS3_SM_EVENT_RESET_PRESSED: payload.value = |
145 | * enum ps3_sys_manager_button_event. | ||
148 | * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec. | 146 | * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec. |
149 | * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id. | 147 | * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id. |
150 | * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id. | 148 | * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id. |
@@ -162,6 +160,17 @@ enum ps3_sys_manager_event { | |||
162 | }; | 160 | }; |
163 | 161 | ||
164 | /** | 162 | /** |
163 | * enum ps3_sys_manager_button_event - Button event payload values. | ||
164 | * @PS3_SM_BUTTON_EVENT_HARD: Hardware generated event. | ||
165 | * @PS3_SM_BUTTON_EVENT_SOFT: Software generated event. | ||
166 | */ | ||
167 | |||
168 | enum ps3_sys_manager_button_event { | ||
169 | PS3_SM_BUTTON_EVENT_HARD = 0, | ||
170 | PS3_SM_BUTTON_EVENT_SOFT = 1, | ||
171 | }; | ||
172 | |||
173 | /** | ||
165 | * enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed. | 174 | * enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed. |
166 | */ | 175 | */ |
167 | 176 | ||
@@ -181,7 +190,9 @@ enum ps3_sys_manager_next_op { | |||
181 | * @PS3_SM_WAKE_P_O_R: Power on reset. | 190 | * @PS3_SM_WAKE_P_O_R: Power on reset. |
182 | * | 191 | * |
183 | * Additional wakeup sources when specifying PS3_SM_NEXT_OP_SYS_SHUTDOWN. | 192 | * Additional wakeup sources when specifying PS3_SM_NEXT_OP_SYS_SHUTDOWN. |
184 | * System will always wake from the PS3_SM_WAKE_DEFAULT sources. | 193 | * The system will always wake from the PS3_SM_WAKE_DEFAULT sources. |
194 | * Sources listed here are the only ones available to guests in the | ||
195 | * other-os lpar. | ||
185 | */ | 196 | */ |
186 | 197 | ||
187 | enum ps3_sys_manager_wake_source { | 198 | enum ps3_sys_manager_wake_source { |
@@ -189,7 +200,7 @@ enum ps3_sys_manager_wake_source { | |||
189 | PS3_SM_WAKE_DEFAULT = 0, | 200 | PS3_SM_WAKE_DEFAULT = 0, |
190 | PS3_SM_WAKE_RTC = 0x00000040, | 201 | PS3_SM_WAKE_RTC = 0x00000040, |
191 | PS3_SM_WAKE_RTC_ERROR = 0x00000080, | 202 | PS3_SM_WAKE_RTC_ERROR = 0x00000080, |
192 | PS3_SM_WAKE_P_O_R = 0x10000000, | 203 | PS3_SM_WAKE_P_O_R = 0x80000000, |
193 | }; | 204 | }; |
194 | 205 | ||
195 | /** | 206 | /** |
@@ -418,8 +429,10 @@ static int ps3_sys_manager_handle_event(struct ps3_system_bus_device *dev) | |||
418 | 429 | ||
419 | switch (event.type) { | 430 | switch (event.type) { |
420 | case PS3_SM_EVENT_POWER_PRESSED: | 431 | case PS3_SM_EVENT_POWER_PRESSED: |
421 | dev_dbg(&dev->core, "%s:%d: POWER_PRESSED\n", | 432 | dev_dbg(&dev->core, "%s:%d: POWER_PRESSED (%s)\n", |
422 | __func__, __LINE__); | 433 | __func__, __LINE__, |
434 | (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft" | ||
435 | : "hard")); | ||
423 | ps3_sm_force_power_off = 1; | 436 | ps3_sm_force_power_off = 1; |
424 | /* | 437 | /* |
425 | * A memory barrier is use here to sync memory since | 438 | * A memory barrier is use here to sync memory since |
@@ -434,8 +447,10 @@ static int ps3_sys_manager_handle_event(struct ps3_system_bus_device *dev) | |||
434 | __func__, __LINE__, event.value); | 447 | __func__, __LINE__, event.value); |
435 | break; | 448 | break; |
436 | case PS3_SM_EVENT_RESET_PRESSED: | 449 | case PS3_SM_EVENT_RESET_PRESSED: |
437 | dev_dbg(&dev->core, "%s:%d: RESET_PRESSED\n", | 450 | dev_dbg(&dev->core, "%s:%d: RESET_PRESSED (%s)\n", |
438 | __func__, __LINE__); | 451 | __func__, __LINE__, |
452 | (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft" | ||
453 | : "hard")); | ||
439 | ps3_sm_force_power_off = 0; | 454 | ps3_sm_force_power_off = 0; |
440 | /* | 455 | /* |
441 | * A memory barrier is use here to sync memory since | 456 | * A memory barrier is use here to sync memory since |
@@ -622,7 +637,7 @@ static void ps3_sys_manager_final_restart(struct ps3_system_bus_device *dev) | |||
622 | ps3_vuart_cancel_async(dev); | 637 | ps3_vuart_cancel_async(dev); |
623 | 638 | ||
624 | ps3_sys_manager_send_attr(dev, 0); | 639 | ps3_sys_manager_send_attr(dev, 0); |
625 | ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_LPAR_REBOOT, | 640 | ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT, |
626 | PS3_SM_WAKE_DEFAULT); | 641 | PS3_SM_WAKE_DEFAULT); |
627 | ps3_sys_manager_send_request_shutdown(dev); | 642 | ps3_sys_manager_send_request_shutdown(dev); |
628 | 643 | ||
@@ -699,4 +714,7 @@ static int __init ps3_sys_manager_init(void) | |||
699 | module_init(ps3_sys_manager_init); | 714 | module_init(ps3_sys_manager_init); |
700 | /* Module remove not supported. */ | 715 | /* Module remove not supported. */ |
701 | 716 | ||
717 | MODULE_AUTHOR("Sony Corporation"); | ||
718 | MODULE_LICENSE("GPL v2"); | ||
719 | MODULE_DESCRIPTION("PS3 System Manager"); | ||
702 | MODULE_ALIAS(PS3_MODULE_ALIAS_SYSTEM_MANAGER); | 720 | MODULE_ALIAS(PS3_MODULE_ALIAS_SYSTEM_MANAGER); |