diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2008-02-08 17:53:07 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-02-14 06:11:01 -0500 |
commit | ea24608f02dbdfd83c77749445df58616a18a770 (patch) | |
tree | 1c0f32cdb38c97e5b8c3a5c3d52d37d1944c85a8 /drivers/ps3/ps3-sys-manager.c | |
parent | 50dad90264096363a35e75d1b8a1c9efc2ee4114 (diff) |
[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>
Diffstat (limited to 'drivers/ps3/ps3-sys-manager.c')
-rw-r--r-- | drivers/ps3/ps3-sys-manager.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/ps3/ps3-sys-manager.c b/drivers/ps3/ps3-sys-manager.c index 0502e9e7d0b4..d4f6f960dd18 100644 --- a/drivers/ps3/ps3-sys-manager.c +++ b/drivers/ps3/ps3-sys-manager.c | |||
@@ -138,9 +138,11 @@ enum ps3_sys_manager_attr { | |||
138 | 138 | ||
139 | /** | 139 | /** |
140 | * 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. |
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 | * @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec. | 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 | * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec. | 146 | * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec. |
145 | * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id. | 147 | * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id. |
146 | * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id. | 148 | * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id. |
@@ -158,6 +160,17 @@ enum ps3_sys_manager_event { | |||
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 | * 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. |
162 | */ | 175 | */ |
163 | 176 | ||
@@ -416,8 +429,10 @@ static int ps3_sys_manager_handle_event(struct ps3_system_bus_device *dev) | |||
416 | 429 | ||
417 | switch (event.type) { | 430 | switch (event.type) { |
418 | case PS3_SM_EVENT_POWER_PRESSED: | 431 | case PS3_SM_EVENT_POWER_PRESSED: |
419 | dev_dbg(&dev->core, "%s:%d: POWER_PRESSED\n", | 432 | dev_dbg(&dev->core, "%s:%d: POWER_PRESSED (%s)\n", |
420 | __func__, __LINE__); | 433 | __func__, __LINE__, |
434 | (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft" | ||
435 | : "hard")); | ||
421 | ps3_sm_force_power_off = 1; | 436 | ps3_sm_force_power_off = 1; |
422 | /* | 437 | /* |
423 | * A memory barrier is use here to sync memory since | 438 | * A memory barrier is use here to sync memory since |
@@ -432,8 +447,10 @@ static int ps3_sys_manager_handle_event(struct ps3_system_bus_device *dev) | |||
432 | __func__, __LINE__, event.value); | 447 | __func__, __LINE__, event.value); |
433 | break; | 448 | break; |
434 | case PS3_SM_EVENT_RESET_PRESSED: | 449 | case PS3_SM_EVENT_RESET_PRESSED: |
435 | dev_dbg(&dev->core, "%s:%d: RESET_PRESSED\n", | 450 | dev_dbg(&dev->core, "%s:%d: RESET_PRESSED (%s)\n", |
436 | __func__, __LINE__); | 451 | __func__, __LINE__, |
452 | (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft" | ||
453 | : "hard")); | ||
437 | ps3_sm_force_power_off = 0; | 454 | ps3_sm_force_power_off = 0; |
438 | /* | 455 | /* |
439 | * A memory barrier is use here to sync memory since | 456 | * A memory barrier is use here to sync memory since |