Commit ea24608f02dbdfd83c77749445df58616a18a770
Committed by
Paul Mackerras
1 parent
50dad90264
Exists in
master
and in
20 other branches
[POWERPC] PS3: Update sys-manager button events
PS3 firmware 1.94 added the source of power and reset events to the payload of the system manager POWER_PRESSED and RESET_PRESSED events. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Showing 1 changed file with 23 additions and 6 deletions Side-by-side Diff
drivers/ps3/ps3-sys-manager.c
... | ... | @@ -138,9 +138,11 @@ |
138 | 138 | |
139 | 139 | /** |
140 | 140 | * enum ps3_sys_manager_event - External event type, reported by system manager. |
141 | - * @PS3_SM_EVENT_POWER_PRESSED: payload.value not used. | |
141 | + * @PS3_SM_EVENT_POWER_PRESSED: payload.value = | |
142 | + * enum ps3_sys_manager_button_event. | |
142 | 143 | * @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec. |
143 | - * @PS3_SM_EVENT_RESET_PRESSED: payload.value not used. | |
144 | + * @PS3_SM_EVENT_RESET_PRESSED: payload.value = | |
145 | + * enum ps3_sys_manager_button_event. | |
144 | 146 | * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec. |
145 | 147 | * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id. |
146 | 148 | * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id. |
... | ... | @@ -158,6 +160,17 @@ |
158 | 160 | }; |
159 | 161 | |
160 | 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 | +/** | |
161 | 174 | * enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed. |
162 | 175 | */ |
163 | 176 | |
... | ... | @@ -416,8 +429,10 @@ |
416 | 429 | |
417 | 430 | switch (event.type) { |
418 | 431 | case PS3_SM_EVENT_POWER_PRESSED: |
419 | - dev_dbg(&dev->core, "%s:%d: POWER_PRESSED\n", | |
420 | - __func__, __LINE__); | |
432 | + dev_dbg(&dev->core, "%s:%d: POWER_PRESSED (%s)\n", | |
433 | + __func__, __LINE__, | |
434 | + (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft" | |
435 | + : "hard")); | |
421 | 436 | ps3_sm_force_power_off = 1; |
422 | 437 | /* |
423 | 438 | * A memory barrier is use here to sync memory since |
... | ... | @@ -432,8 +447,10 @@ |
432 | 447 | __func__, __LINE__, event.value); |
433 | 448 | break; |
434 | 449 | case PS3_SM_EVENT_RESET_PRESSED: |
435 | - dev_dbg(&dev->core, "%s:%d: RESET_PRESSED\n", | |
436 | - __func__, __LINE__); | |
450 | + dev_dbg(&dev->core, "%s:%d: RESET_PRESSED (%s)\n", | |
451 | + __func__, __LINE__, | |
452 | + (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft" | |
453 | + : "hard")); | |
437 | 454 | ps3_sm_force_power_off = 0; |
438 | 455 | /* |
439 | 456 | * A memory barrier is use here to sync memory since |