Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ea24608f02dbdfd83c77749445df58616a18a770
Commit:     ea24608f02dbdfd83c77749445df58616a18a770
Parent:     50dad90264096363a35e75d1b8a1c9efc2ee4114
Author:     Geoff Levand <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 9 09:53:07 2008 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Feb 14 22:11:01 2008 +1100

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 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 0502e9e..d4f6f96 100644
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -138,9 +138,11 @@ enum ps3_sys_manager_attr {
 
 /**
  * enum ps3_sys_manager_event - External event type, reported by system 
manager.
- * @PS3_SM_EVENT_POWER_PRESSED: payload.value not used.
+ * @PS3_SM_EVENT_POWER_PRESSED: payload.value =
+ *  enum ps3_sys_manager_button_event.
  * @PS3_SM_EVENT_POWER_RELEASED: payload.value = time pressed in millisec.
- * @PS3_SM_EVENT_RESET_PRESSED: payload.value not used.
+ * @PS3_SM_EVENT_RESET_PRESSED: payload.value =
+ *  enum ps3_sys_manager_button_event.
  * @PS3_SM_EVENT_RESET_RELEASED: payload.value = time pressed in millisec.
  * @PS3_SM_EVENT_THERMAL_ALERT: payload.value = thermal zone id.
  * @PS3_SM_EVENT_THERMAL_CLEARED: payload.value = thermal zone id.
@@ -158,6 +160,17 @@ enum ps3_sys_manager_event {
 };
 
 /**
+ * enum ps3_sys_manager_button_event - Button event payload values.
+ * @PS3_SM_BUTTON_EVENT_HARD: Hardware generated event.
+ * @PS3_SM_BUTTON_EVENT_SOFT: Software generated event.
+ */
+
+enum ps3_sys_manager_button_event {
+       PS3_SM_BUTTON_EVENT_HARD = 0,
+       PS3_SM_BUTTON_EVENT_SOFT = 1,
+};
+
+/**
  * enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed.
  */
 
@@ -416,8 +429,10 @@ static int ps3_sys_manager_handle_event(struct 
ps3_system_bus_device *dev)
 
        switch (event.type) {
        case PS3_SM_EVENT_POWER_PRESSED:
-               dev_dbg(&dev->core, "%s:%d: POWER_PRESSED\n",
-                       __func__, __LINE__);
+               dev_dbg(&dev->core, "%s:%d: POWER_PRESSED (%s)\n",
+                       __func__, __LINE__,
+                       (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft"
+                       : "hard"));
                ps3_sm_force_power_off = 1;
                /*
                 * 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)
                        __func__, __LINE__, event.value);
                break;
        case PS3_SM_EVENT_RESET_PRESSED:
-               dev_dbg(&dev->core, "%s:%d: RESET_PRESSED\n",
-                       __func__, __LINE__);
+               dev_dbg(&dev->core, "%s:%d: RESET_PRESSED (%s)\n",
+                       __func__, __LINE__,
+                       (event.value == PS3_SM_BUTTON_EVENT_SOFT ? "soft"
+                       : "hard"));
                ps3_sm_force_power_off = 0;
                /*
                 * A memory barrier is use here to sync memory since
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to