diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
index c2a3163..fe94044 100644
--- a/arch/arm/mach-s3c2410/devs.c
+++ b/arch/arm/mach-s3c2410/devs.c
@@ -31,6 +31,7 @@ #include <asm/arch/regs-serial.h>
 #include <asm/arch/udc.h>
 #include <asm/arch/ts.h>
 #include <asm/arch/lcd.h>
+#include <asm/arch/buttons.h>
 
 #include "devs.h"
 #include "cpu.h"
@@ -240,6 +241,27 @@ void __init set_s3c2410ts_info(struct s3
 }
 EXPORT_SYMBOL(set_s3c2410ts_info);
 
+/* 'Keyboard' */
+struct platform_device s3c_device_buttons = {
+	.name             = "s3c-buttons",
+	.id               = -1,
+};
+
+EXPORT_SYMBOL(s3c_device_buttons);
+
+void __init s3c24xx_butt_set_platdata(struct s3c_butt_mach_info *pd)
+{
+	struct s3c_butt_mach_info *npd;
+
+	npd = kmalloc(sizeof(*npd), GFP_KERNEL);
+	if (npd) {
+		memcpy(npd, pd, sizeof(*npd));
+		s3c_device_buttons.dev.platform_data = npd;
+	} else {
+		printk(KERN_ERR "no memory for buttons platform data\n");
+	}
+}
+
 /* USB Device (Gadget)*/
 
 static struct resource s3c_usbgadget_resource[] = {
diff --git a/arch/arm/mach-s3c2410/devs.h b/arch/arm/mach-s3c2410/devs.h
index 57cea9a..6760aa4 100644
--- a/arch/arm/mach-s3c2410/devs.h
+++ b/arch/arm/mach-s3c2410/devs.h
@@ -43,6 +43,7 @@ extern struct platform_device s3c_device
 
 extern struct platform_device s3c_device_usbgadget;
 extern struct platform_device s3c_device_ts;
+extern struct platform_device s3c_device_buttons;
 
 /* s3c2440 specific devices */
 
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 79bdce1..ec10f48 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -37,6 +37,7 @@ #include <asm/arch/regs-lcd.h>
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/regs-timer.h>
 #include <asm/arch/regs-clock.h>
+#include <asm/arch/irqs.h>
 
 #include <asm/arch/h1940.h>
 #include <asm/arch/h1940-latch.h>
@@ -45,6 +46,7 @@ #include <asm/arch/udc.h>
 #include <asm/arch/ts.h>
 #include <asm/arch/lcd.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/buttons.h>
 
 #include <linux/serial_core.h>
 
@@ -274,6 +276,25 @@ static struct s3c2410_bl_mach_info h1940
 	.lcd_power		= h1940_lcd_power
 };
 
+static struct s3c_button h1940_butts[] = {
+	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 = {
+	.buttons  = h1940_butts,
+	.size = ARRAY_SIZE(h1940_butts),
+};
+
 static struct platform_device *h1940_devices[] __initdata = {
 	&s3c_device_usb,
 	&s3c_device_lcd,
@@ -284,6 +305,7 @@ static struct platform_device *h1940_dev
 	&s3c_device_sdi,
 	&s3c_device_usbgadget,
 	&s3c_device_ts,
+	&s3c_device_buttons,
 };
 
 static struct s3c24xx_board h1940_board __initdata = {
@@ -317,6 +339,7 @@ static void __init h1940_init(void)
 	set_s3c2410ts_info(&h1940_ts_cfg);
 	set_s3c2410bl_info(&h1940_blcfg);
  	s3c24xx_udc_set_platdata(&h1940_udc_cfg);
+	s3c24xx_butt_set_platdata(&h1940_butt_cfg);
 
 	s3c_device_sdi.dev.platform_data = &h1940_mmc_cfg;
 
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 049f2f5..2a98293 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -214,4 +214,13 @@ config KEYBOARD_AAED2000
 	  To compile this driver as a module, choose M here: the
 	  module will be called aaed2000_kbd.
 
+config S3C_BUTTONS
+	tristate "s3c2410 buttons"
+	depends on ARCH_S3C2410
+	default y	
+	help
+
+	  To compile this driver as a module, choose M here: the 
+	  module will be called s3c2410_buttons.ko.
+
 endif
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 5687979..90cd801 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -18,4 +18,5 @@ obj-$(CONFIG_KEYBOARD_HIL)		+= hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD)		+= hilkbd.o
 obj-$(CONFIG_KEYBOARD_OMAP)             += omap-keypad.o
 obj-$(CONFIG_KEYBOARD_AAED2000)         += aaed2000_kbd.o
+obj-$(CONFIG_S3C_BUTTONS)		+= s3c_buttons.o
 
diff --git a/drivers/input/keyboard/s3c_buttons.c b/drivers/input/keyboard/s3c_buttons.c
new file mode 100644
index 0000000..85a361f
--- /dev/null
+++ b/drivers/input/keyboard/s3c_buttons.c
@@ -0,0 +1,219 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
+ * Samsung S3C2410 keyboard support
+ *
+ * Based on various pxa ipaq drivers.
+ * 
+ */
+
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/input.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+
+#include <asm/arch/regs-gpio.h>
+#include <asm/arch/buttons.h>
+
+/* For id.version */
+#define DRV_VERSION	0x0001
+#define DRV_NAME	"s3c-buttons"
+
+#define REPEAT_DELAY	HZ/10
+
+MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
+MODULE_DESCRIPTION("s3c24xx buttons driver");
+MODULE_LICENSE("GPL");
+
+struct s3c_buttons_private {
+	struct device		*parent;
+	struct input_dev	*dev;
+	spinlock_t		lock;
+	int 			count;
+	int			shift;	
+};
+
+static struct s3c_buttons_private priv;
+
+static irqreturn_t s3c_but_keyevent(int irq, void *dev)
+{
+	struct s3c_button *button = (struct s3c_button *)dev;
+	int down;
+
+	if (!button)
+		return IRQ_HANDLED;
+
+	down = !(s3c2410_gpio_getpin(button->pin));
+
+	/* the power button of the ipaq are tricky. They send 'released'
+	 * events even when the button are already released. The work-around
+	 * is to proceed only if the state changed.
+	 */
+	if (button->last_state == down)
+		return IRQ_HANDLED;
+
+	button->last_state = down;
+	
+	dev_dbg(priv.parent, "%s button %s\n", button->name,
+		down ? "pressed" : "released");
+
+	input_report_key(priv.dev, button->keycode, down);
+	input_sync(priv.dev);
+
+	if (down)
+		mod_timer(&button->timer, jiffies + REPEAT_DELAY);
+
+	return IRQ_HANDLED;
+}
+
+static void s3c_but_timer_callback(unsigned long data)
+{
+		struct s3c_button *button = (struct s3c_button *) data;
+		int down;
+
+		down = !(s3c2410_gpio_getpin(button->pin));
+		
+		if (down) {
+			dev_dbg(priv.parent, "Timer: %s button %s\n",
+				button->name, down ? "pressed" : "released");
+			input_report_key(priv.dev, button->keycode, down);
+			input_sync(priv.dev);
+			mod_timer(&button->timer, jiffies + REPEAT_DELAY);
+		}
+}
+
+static int __init s3c_but_probe(struct platform_device *pdev)
+{
+	struct input_dev *input_dev;
+	struct s3c_button *s3c_buttons;
+	struct s3c_button *bp;
+	struct s3c_butt_mach_info *butt_info;
+	int i, err;
+
+	butt_info = pdev->dev.platform_data;
+	s3c_buttons = butt_info->buttons;
+
+	/* Initialise input stuff */
+	memset(&priv, 0, sizeof(struct s3c_buttons_private));
+
+	input_dev = input_allocate_device();
+	if (!input_dev) {
+		printk(KERN_ERR "Unable to allocate the input device !!\n");
+		return -ENOMEM;
+	}
+
+	priv.parent	     = &pdev->dev;
+	priv.dev	     = input_dev;
+	priv.dev->evbit[0]   = BIT(EV_KEY);
+
+	priv.dev->private    = &priv;
+	priv.dev->cdev.dev   = &pdev->dev;
+	priv.dev->name       = DRV_NAME;
+	priv.dev->id.bustype = BUS_HOST;
+	priv.dev->id.vendor  = 0xDEAD;
+	priv.dev->id.product = 0xBEEF;
+	priv.dev->id.version = DRV_VERSION;
+
+	for (i = 0, bp = s3c_buttons; i < butt_info->size; i++, bp++) {
+		set_bit(bp->keycode, priv.dev->keybit);
+		bp->irq = s3c2410_gpio_getirq(bp->pin);
+		s3c2410_gpio_cfgpin(bp->pin, S3C2410_GPIO_SFN2);
+		err = request_irq (bp->irq, s3c_but_keyevent,
+			     IRQF_SAMPLE_RANDOM | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+			     bp->name, bp);
+		if (err) {
+			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;
+	}
+	
+	dev_info(&pdev->dev, "successfully loaded\n");
+
+	/* All went ok, so register to the input system */
+	input_register_device(priv.dev);
+
+	return 0;
+
+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);
+	}
+	input_free_device(input_dev);	
+	return err;
+}
+
+static int s3c_but_remove(struct platform_device *pdev)
+{
+	int i;
+	struct s3c_button *s3c_buttons;
+	struct s3c_button *bp;
+	struct s3c_butt_mach_info *butt_info;
+
+	butt_info = pdev->dev.platform_data;
+	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);
+	}
+
+	input_unregister_device(priv.dev);
+
+	return 0;
+}
+
+
+static struct platform_driver s3c_but_driver = {
+	.driver		= {
+		.name	= DRV_NAME,
+		.owner	= THIS_MODULE,
+	},
+	.probe		= s3c_but_probe,
+	.remove		= s3c_but_remove,
+};
+
+
+static int __init s3c_but_init(void)
+{
+	return platform_driver_register(&s3c_but_driver);
+}
+
+static void __exit s3c_but_exit(void)
+{
+	platform_driver_unregister(&s3c_but_driver);
+}
+
+module_init(s3c_but_init);
+module_exit(s3c_but_exit);
diff --git a/include/asm-arm/arch-s3c2410/buttons.h b/include/asm-arm/arch-s3c2410/buttons.h
new file mode 100644
index 0000000..d47a2ec
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/buttons.h
@@ -0,0 +1,41 @@
+/* linux/include/asm/arch-s3c2410/buttons.h
+ *
+ * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef __ASM_ARM_BUTTONS_H
+#define __ASM_ARM_BUTTONS_H
+
+#include <linux/input.h>
+
+struct s3c_button {
+	int		pin;
+	int		keycode;
+	char		*name;
+	char		wake;
+	int		irq;
+	int		last_state;
+	struct timer_list timer;
+};
+
+struct s3c_butt_mach_info {
+	struct s3c_button	*buttons;
+	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
