diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
index ffbb5af..35c54af 100644
--- a/arch/arm/mach-s3c2410/devs.c
+++ b/arch/arm/mach-s3c2410/devs.c
@@ -38,6 +38,7 @@
 #include <asm/arch/udc.h>
 #include <asm/arch/ts.h>
 #include <asm/arch/lcd.h>
+#include <asm/arch/buttons.h>
 
 #include "devs.h"
 
@@ -171,6 +172,27 @@ void __init set_s3c2410ts_info(struct s3
 }
 EXPORT_SYMBOL(set_s3c2410ts_info);
 
+/* 'Keyboard' */
+struct platform_device s3c_device_buttons = {
+	.name             = "s3c2410-buttons",
+	.id               = -1,
+};
+
+EXPORT_SYMBOL(s3c_device_buttons);
+
+void __init s3c24xx_butt_set_platdata(struct s3c2410_butt_mach_info *pd)
+{
+	struct s3c2410_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 aafe6ad..817625b 100644
--- a/arch/arm/mach-s3c2410/devs.h
+++ b/arch/arm/mach-s3c2410/devs.h
@@ -40,6 +40,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 c6523fa..834935a 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -57,11 +57,13 @@
 #include <asm/arch/regs-lcd.h>
 #include <asm/arch/regs-timer.h>
 
+#include <asm/arch/irqs.h>
 #include <asm/arch/fb.h>
 #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>
 
@@ -246,6 +248,25 @@ static struct s3c2410_bl_mach_info h1940
 	.lcd_power		= h1940_lcd_power
 };
 
+static struct s3c2410_button h1940_butts[] = {
+	{  IRQ_EINT0,  S3C2410_GPF0,   S3C2410_GPF0_EINT0,    KEY_POWER,	      "Power", 0 },
+	{  IRQ_EINT6,  S3C2410_GPF6,   S3C2410_GPF6_EINT6,    KEY_ENTER, 	     "Select", 0 },
+	{  IRQ_EINT7,  S3C2410_GPF7,   S3C2410_GPF7_EINT7,   KEY_RECORD,	     "Record", 0 },
+	{  IRQ_EINT8,  S3C2410_GPG0,   S3C2410_GPG0_EINT8, KEY_CALENDAR,	   "Calendar", 0 },
+	{ IRQ_EINT10,  S3C2410_GPG2,  S3C2410_GPG2_EINT10,   KEY_COFFEE,	   "Contacts", 0 }, /* TODO: find a better key :P */
+	{ IRQ_EINT11,  S3C2410_GPG3,  S3C2410_GPG3_EINT11,     KEY_MAIL,	       "Mail", 0 },
+	{ IRQ_EINT14,  S3C2410_GPG6,  S3C2410_GPG6_EINT14,     KEY_LEFT,	 "Left_arrow", 0 },
+	{ IRQ_EINT15,  S3C2410_GPG7,  S3C2410_GPG7_EINT15, KEY_HOMEPAGE,	       "Home", 0 },
+	{ IRQ_EINT16,  S3C2410_GPG8,  S3C2410_GPG8_EINT16,    KEY_RIGHT,	"Right_arrow", 0 },
+	{ IRQ_EINT17,  S3C2410_GPG9,  S3C2410_GPG9_EINT17,       KEY_UP,	   "Up_arrow", 0 },
+	{ IRQ_EINT18, S3C2410_GPG10, S3C2410_GPG10_EINT18,     KEY_DOWN,	 "Down_arrow", 0 },
+};
+
+static struct s3c2410_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,
@@ -256,6 +277,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 = {
@@ -284,6 +306,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 571a686..b737782 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -193,4 +193,14 @@ config KEYBOARD_HIL
 	  This driver implements support for HIL-keyboards attached
 	  to your machine, so normally you should say Y here.
 
+config S3C2410_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 9ce0b87..798bd4f 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -17,4 +17,5 @@ obj-$(CONFIG_KEYBOARD_CORGI)		+= corgikb
 obj-$(CONFIG_KEYBOARD_SPITZ)		+= spitzkbd.o
 obj-$(CONFIG_KEYBOARD_HIL)		+= hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD)		+= hilkbd.o
+obj-$(CONFIG_S3C2410_BUTTONS)		+= s3c2410_buttons.o
 
diff --git a/drivers/input/keyboard/s3c2410_buttons.c b/drivers/input/keyboard/s3c2410_buttons.c
new file mode 100644
index 0000000..93522e9
--- /dev/null
+++ b/drivers/input/keyboard/s3c2410_buttons.c
@@ -0,0 +1,215 @@
+/*
+ * 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.
+ * 
+ * ChangeLog
+ *
+ * 2005-07-24: Arnaud Patard <arnaud.patard@rtp-net.org>
+ * 	- Added key repeat
+ *
+ * 2005-07-23: Arnaud Patard <arnaud.patard@rtp-net.org>
+ * 	- Renamed all kbd occurences to something like buttons
+ * 	- Added debounce (specially usefull for iPAQ power button)
+ *
+ * 2005-06-21: Arnaud Patard <arnaud.patard@rtp-net.org>
+ *      - Initial version
+ *
+ */
+
+#include <linux/config.h>
+#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/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 S3C2410BUTVERSION	0x0001
+#define DRV_NAME		"s3c2410-buttons"
+
+#define REPEAT_DELAY		HZ/10
+
+#ifdef DEBUG
+#define dprintk(msg...) printk(KERN_DEBUG "s3c2410_buttons: " msg);
+#else
+#define dprintk(msg...)
+#endif
+
+MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
+MODULE_DESCRIPTION("s3c2410 buttons driver");
+MODULE_LICENSE("GPL");
+
+struct s3c2410_buttons_private {
+	struct input_dev	*dev;
+	spinlock_t		lock;
+	int 			count;
+	int			shift;	
+};
+
+static struct s3c2410_buttons_private priv;
+
+static irqreturn_t s3c2410but_keyevent(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct s3c2410_button *button = (struct s3c2410_button *)dev_id;
+	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;
+	
+	dprintk("%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 s3c2410but_timer_callback(unsigned long data)
+{
+		struct s3c2410_button *button = (struct s3c2410_button *) data;
+		int down;
+
+		down = !(s3c2410_gpio_getpin(button->pin));
+		
+		if (down) {
+			dprintk("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 s3c2410but_probe(struct device *dev)
+{
+	int i;
+	struct input_dev *input_dev;
+	struct s3c2410_button *s3c2410_buttons;
+	struct s3c2410_butt_mach_info *butt_info;
+
+
+	butt_info = dev->platform_data;
+	s3c2410_buttons = butt_info->buttons;
+
+	/* Initialise input stuff */
+	memset(&priv, 0, sizeof(struct s3c2410_buttons_private));
+
+	input_dev = input_allocate_device();
+	if (!input_dev) {
+		printk(KERN_ERR "Unable to allocate the input device !!\n");
+		return -ENOMEM;
+	}
+
+	priv.dev = input_dev;
+	priv.dev->evbit[0] = BIT(EV_KEY);
+
+	priv.dev->private = &priv;
+	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 = S3C2410BUTVERSION;
+
+
+	for (i = 0; i < butt_info->size; i++) {
+		set_bit(s3c2410_buttons[i].keycode, priv.dev->keybit);
+		s3c2410_gpio_cfgpin(s3c2410_buttons[i].pin,s3c2410_buttons[i].pin_setting);
+		request_irq (s3c2410_buttons[i].irq, s3c2410but_keyevent,\
+				SA_SAMPLE_RANDOM, s3c2410_buttons[i].name, &s3c2410_buttons[i]);
+		set_irq_type(s3c2410_buttons[i].irq, IRQT_BOTHEDGE);
+		
+		init_timer(&s3c2410_buttons[i].timer);
+		s3c2410_buttons[i].timer.function = s3c2410but_timer_callback;
+		s3c2410_buttons[i].timer.data     = (unsigned long)&s3c2410_buttons[i];
+	}
+	
+	printk(KERN_INFO "%s successfully loaded\n", DRV_NAME);
+
+	/* All went ok, so register to the input system */
+	input_register_device(priv.dev);
+
+	return 0;
+}
+
+static int s3c2410but_remove(struct device *dev)
+{
+	int i;
+	struct s3c2410_button *s3c2410_buttons;
+	struct s3c2410_butt_mach_info *butt_info;
+
+	butt_info = dev->platform_data;
+	s3c2410_buttons = butt_info->buttons;
+
+	for (i = 0; i < butt_info->size; i++) {
+		disable_irq(s3c2410_buttons[i].irq);
+		free_irq(s3c2410_buttons[i].irq,priv.dev);
+	}
+
+	input_unregister_device(priv.dev);
+
+	return 0;
+}
+
+
+static struct device_driver s3c2410but_driver = {
+       .name           = DRV_NAME,
+       .bus            = &platform_bus_type,
+       .probe          = s3c2410but_probe,
+       .remove         = s3c2410but_remove,
+};
+
+
+int __init s3c2410but_init(void)
+{
+	return driver_register(&s3c2410but_driver);
+}
+
+void __exit s3c2410but_exit(void)
+{
+	driver_unregister(&s3c2410but_driver);
+}
+
+module_init(s3c2410but_init);
+module_exit(s3c2410but_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..f62ffc4
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/buttons.h
@@ -0,0 +1,35 @@
+/* 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.
+ *
+ *
+ *  Changelog:
+ *	21-Nov-2005	RTP	Created file
+ */
+
+#ifndef __ASM_ARM_BUTTONS_H
+#define __ASM_ARM_BUTTONS_H
+
+#include <linux/input.h>
+
+struct s3c2410_button {
+	int irq;
+	int pin;
+	int pin_setting;
+	int keycode;
+	char *name;
+	int last_state;
+	struct timer_list timer;
+};
+
+struct s3c2410_butt_mach_info {
+	struct s3c2410_button *buttons;
+	int size;
+};
+
+extern void __init s3c24xx_butt_set_platdata(struct s3c2410_butt_mach_info *);
+#endif
