---
 arch/arm/mach-s3c2410/mach-h1940.c     |   22 	11 +	11 -	0 !
 drivers/input/keyboard/s3c_buttons.c   |    8 	8 +	0 -	0 !
 include/asm-arm/arch-s3c2410/buttons.h |   13 	10 +	3 -	0 !
 3 files changed, 29 insertions(+), 14 deletions(-)

Index: linux-2.6/drivers/input/keyboard/s3c_buttons.c
===================================================================
--- linux-2.6.orig/drivers/input/keyboard/s3c_buttons.c	2006-12-05 21:58:04.000000000 +0100
+++ linux-2.6/drivers/input/keyboard/s3c_buttons.c	2006-12-05 22:01:33.000000000 +0100
@@ -145,6 +145,10 @@ static int __init s3c_but_probe(struct p
 			dev_err(&pdev->dev, "error requesting irq %d\n", bp->irq);
 			goto err_irq;
 		}
+
+		if (bp->wake)
+			enable_irq_wake(bp->irq);
+
 		init_timer(&bp->timer);
 		bp->timer.function = s3c_but_timer_callback;
 		bp->timer.data     = (unsigned long)bp;
@@ -159,6 +163,8 @@ static int __init s3c_but_probe(struct p
 
 err_irq:
 	for (--i,--bp ; i >= 0; i--, bp--) {
+		if (bp->wake)
+			disable_irq_wake(bp->irq);
 		disable_irq(bp->irq);
 		free_irq(bp->irq, bp);
 	}
@@ -177,6 +183,8 @@ static int s3c_but_remove(struct platfor
 	s3c_buttons = butt_info->buttons;
 
 	for (i = 0, bp = s3c_buttons; i < butt_info->size; i++, bp++) {
+		if (bp->wake)
+			disable_irq_wake(bp->irq);
 		disable_irq(bp->irq);
 		free_irq(bp->irq, bp);
 	}
Index: linux-2.6/include/asm-arm/arch-s3c2410/buttons.h
===================================================================
--- linux-2.6.orig/include/asm-arm/arch-s3c2410/buttons.h	2006-12-05 21:58:04.000000000 +0100
+++ linux-2.6/include/asm-arm/arch-s3c2410/buttons.h	2006-12-05 22:43:51.000000000 +0100
@@ -6,9 +6,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
- *
- *  Changelog:
- *	21-Nov-2005	RTP	Created file
  */
 
 #ifndef __ASM_ARM_BUTTONS_H
@@ -20,6 +17,7 @@ struct s3c_button {
 	int		pin;
 	int		keycode;
 	char		*name;
+	char		wake;
 	int		irq;
 	int		last_state;
 	struct timer_list timer;
@@ -30,5 +28,14 @@ struct s3c_butt_mach_info {
 	int			size;
 };
 
+#define DECLARE_BUTTON(p, k, n, w)	\
+	{				\
+		.pin     = p,		\
+		.keycode = k,		\
+		.name	 = n,		\
+		.wake	 = w,		\
+	}
+
+
 extern void __init s3c24xx_butt_set_platdata(struct s3c_butt_mach_info *);
 #endif
Index: linux-2.6/arch/arm/mach-s3c2410/mach-h1940.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-s3c2410/mach-h1940.c	2006-12-05 21:59:11.000000000 +0100
+++ linux-2.6/arch/arm/mach-s3c2410/mach-h1940.c	2006-12-05 22:43:41.000000000 +0100
@@ -303,17 +303,17 @@ static struct s3c2410_bl_mach_info h1940
 };
 
 static struct s3c_button h1940_butts[] = {
-	{  S3C2410_GPF0,    KEY_POWER,	      "Power" },
-	{  S3C2410_GPF6,    KEY_ENTER, 	     "Select" },
-	{  S3C2410_GPF7,   KEY_RECORD,	     "Record" },
-	{  S3C2410_GPG0, KEY_CALENDAR,	   "Calendar" },
-	{  S3C2410_GPG2,   KEY_COFFEE,	   "Contacts" }, /* TODO: find a better key :P */
-	{  S3C2410_GPG3,     KEY_MAIL,	       "Mail" },
-	{  S3C2410_GPG6,     KEY_LEFT,	 "Left_arrow" },
-	{  S3C2410_GPG7, KEY_HOMEPAGE,	       "Home" },
-	{  S3C2410_GPG8,    KEY_RIGHT,	"Right_arrow" },
-	{  S3C2410_GPG9,       KEY_UP,	   "Up_arrow" },
-	{ S3C2410_GPG10,     KEY_DOWN,	 "Down_arrow" },
+	DECLARE_BUTTON(  S3C2410_GPF0,    KEY_POWER,	      "Power", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPF6,    KEY_ENTER, 	     "Select", 1 ),
+	DECLARE_BUTTON(  S3C2410_GPF7,   KEY_RECORD,	     "Record", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPG0, KEY_CALENDAR,	   "Calendar", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPG2,   KEY_COFFEE,	   "Contacts", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPG3,     KEY_MAIL,	       "Mail", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPG6,     KEY_LEFT,	 "Left_arrow", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPG7, KEY_HOMEPAGE,	       "Home", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPG8,    KEY_RIGHT,	"Right_arrow", 0 ),
+	DECLARE_BUTTON(  S3C2410_GPG9,       KEY_UP,	   "Up_arrow", 0 ),
+	DECLARE_BUTTON( S3C2410_GPG10,     KEY_DOWN,	 "Down_arrow", 0 ),
 };
 
 static struct s3c_butt_mach_info h1940_butt_cfg __initdata = {
