Permalink
Browse files

fix show wakeup irq error

  • Loading branch information...
1 parent 1255998 commit 22e84dc269fae65ff98878b2ea3d4bc837b0789c @lvchaqiu committed Oct 16, 2012
@@ -12,7 +12,10 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
-
+
+#ifndef _MX_DEBU_H_
+#define _MX_DEBU_H_
+
typedef enum {
MX_USB_WAKE = 1<<0,
MX_LOWBAT_WAKE = 1<<1,
@@ -43,4 +46,4 @@ typedef enum {
OTHER_INT,
} mx_int_type;
-extern unsigned long mx_get_wakeup_type(void);
+#endif /* _MX_DEBU_H_ */
@@ -14,14 +14,20 @@
* GNU General Public License for more details.
*/
-static unsigned long mx_wakeup_type;
-
-unsigned long mx_get_wakeup_type(void) {return mx_wakeup_type;}
+static unsigned long mx_get_wakeup_type(void) {
+ return readl(S5P_INFORM3);
+}
-static unsigned long mx_set_wakeup_type(unsigned long mask)
+static void mx_set_wakeup_type(unsigned long mask)
{
- return mask ? (mx_wakeup_type |= mask) :
- (mx_wakeup_type = mask);
+ static unsigned long tmp = 0;
+
+ if (mask)
+ tmp |= mask;
+ else
+ tmp = 0;
+
+ writel(tmp, S5P_INFORM3);
}
static inline void m030_set_wakeup_type(mx_int_type group, int pending)
@@ -150,41 +156,41 @@ static void mx_show_wakeup_name(void)
len = sprintf(wakeup_str, "%s", "MX Wakeup By:");
- if(mx_wakeup_type & MX_USB_WAKE)
+ if(mx_get_wakeup_type() & MX_USB_WAKE)
len += sprintf(wakeup_str+len, " USB_WAKE");
- if(mx_wakeup_type & MX_LOWBAT_WAKE)
+ if(mx_get_wakeup_type() & MX_LOWBAT_WAKE)
len += sprintf(wakeup_str+len, " LOWBAT_WAKE");
- if(mx_wakeup_type & MX_CHARG_WAKE)
+ if(mx_get_wakeup_type() & MX_CHARG_WAKE)
len += sprintf(wakeup_str+len, " CHARG_WAKE");
- if(mx_wakeup_type & MX_WIFI_WAKE)
+ if(mx_get_wakeup_type() & MX_WIFI_WAKE)
len += sprintf(wakeup_str+len, " WIFI_WAKE");
- if(mx_wakeup_type & MX_BLUETOOTH_WAKE)
+ if(mx_get_wakeup_type() & MX_BLUETOOTH_WAKE)
len += sprintf(wakeup_str+len, " BLUETOOTH_WAKE");
- if(mx_wakeup_type & MX_MODEM_RST_WAKE)
+ if(mx_get_wakeup_type() & MX_MODEM_RST_WAKE)
len += sprintf(wakeup_str+len, " MODEM_RST_WAKE");
- if(mx_wakeup_type & MX_MODEM_WAKE)
+ if(mx_get_wakeup_type() & MX_MODEM_WAKE)
len += sprintf(wakeup_str+len, " MODEM_WAKE");
- if(mx_wakeup_type & MX_KEY_POWER_WAKE)
+ if(mx_get_wakeup_type() & MX_KEY_POWER_WAKE)
len += sprintf(wakeup_str+len, " KEY_POWER_WAKE");
- if(mx_wakeup_type & MX_KEY_HOME_WAKE)
+ if(mx_get_wakeup_type() & MX_KEY_HOME_WAKE)
len += sprintf(wakeup_str+len, " KEY_HOME_WAKE");
- if(mx_wakeup_type & MX_USB_HOST_WAKE)
+ if(mx_get_wakeup_type() & MX_USB_HOST_WAKE)
len += sprintf(wakeup_str+len, " MX_USB_HOST_WAKE");
- if(mx_wakeup_type & MX_ALARM_WAKE)
+ if(mx_get_wakeup_type() & MX_ALARM_WAKE)
len += sprintf(wakeup_str+len, " ALARM_WAKE");
- if(mx_wakeup_type & MX_TICK_WAKE)
+ if(mx_get_wakeup_type() & MX_TICK_WAKE)
len += sprintf(wakeup_str+len, " TICK_WAKE");
- if(mx_wakeup_type & MX_I2S_WAKE)
+ if(mx_get_wakeup_type() & MX_I2S_WAKE)
len += sprintf(wakeup_str+len, " I2S_WAKE");
- if(mx_wakeup_type & MX_SYSTIMER_WAKE)
+ if(mx_get_wakeup_type() & MX_SYSTIMER_WAKE)
len += sprintf(wakeup_str+len, " SYSTIMER_WAKE");
- if(mx_wakeup_type & MX_MINUS_KEY_WAKE)
+ if(mx_get_wakeup_type() & MX_MINUS_KEY_WAKE)
len += sprintf(wakeup_str+len, " VOLUMEDOWN_KEY_WAKE");
- if(mx_wakeup_type & MX_PLUS_KEY_WAKE)
+ if(mx_get_wakeup_type() & MX_PLUS_KEY_WAKE)
len += sprintf(wakeup_str+len, " VOLUMEUP_KEY_WAKE");
- if(mx_wakeup_type & MX_JACK_WAKE)
+ if(mx_get_wakeup_type() & MX_JACK_WAKE)
len += sprintf(wakeup_str+len, " JACK_WAKE");
- if(!mx_wakeup_type)
+ if(!mx_get_wakeup_type())
len += sprintf(wakeup_str+len, " UNKNOW_WAKE");
pr_info("%s\n", wakeup_str);
@@ -12,6 +12,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <mach/regs-pmu.h>
+
#include <mach/mx_debug.h>
#define DEV_NAME "wakeup_assist"
@@ -71,10 +72,9 @@ static int __devexit wakeup_assist_remove(struct platform_device *pdev)
#ifdef CONFIG_MX_SERIAL_TYPE
static inline int wakeup_assist_done(struct input_dev *input_dev)
{
- unsigned long mx_wake_typed = mx_get_wakeup_type();
+ unsigned long mx_wake_typed = readl(S5P_INFORM3);
unsigned long allow_wake_type = MX_USB_WAKE |
MX_LOWBAT_WAKE |
- MX_IR_WAKE |
MX_KEY_HOME_WAKE |
MX_KEY_POWER_WAKE ;
@@ -94,6 +94,10 @@ static inline int wakeup_assist_done(struct input_dev *input_dev)
input_report_key(input_dev, wakeup_assist_keycode[3], 0);
input_sync(input_dev);
}
+
+ /* To clean inform3 at here*/
+ writel(0, S5P_INFORM3);
+
return 0;
}
#else

0 comments on commit 22e84dc

Please sign in to comment.