diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
index c2a3163..8637374 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             = "s3c2410-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 dce8a24..23328bf 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -38,12 +38,15 @@ #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-latch.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>
 
@@ -254,6 +257,25 @@ static struct s3c2410_bl_mach_info h1940
 	.lcd_power		= h1940_lcd_power
 };
 
+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" },
+};
+
+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,
@@ -264,6 +286,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 = {
@@ -292,6 +315,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 81a333f..d524409 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -203,4 +203,13 @@ config KEYBOARD_OMAP
 	  To compile this driver as a module, choose M here: the
 	  module will be called omap-keypad.
 
+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 4c79e7b..a5b7212 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -17,4 +17,5 @@ obj-$(CONFIG_KEYBOARD_SPITZ)		+= spitzkb
 obj-$(CONFIG_KEYBOARD_HIL)		+= hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD)		+= hilkbd.o
 obj-$(CONFIG_KEYBOARD_OMAP)             += omap-keypad.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..7746c57
--- /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/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	"s3c2410-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;
+
+	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);
+		request_irq (bp->irq, s3c_but_keyevent,
+			     SA_SAMPLE_RANDOM | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
+			     bp->name, bp);
+		
+		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;
+}
+
+static int s3c_but_remove(struct platform_device *pdev)
+{
+	int i;
+	struct s3c_button *s3c_buttons;
+	struct s3c_butt_mach_info *butt_info;
+
+	butt_info = pdev->dev.platform_data;
+	s3c_buttons = butt_info->buttons;
+
+	for (i = 0; i < butt_info->size; i++) {
+		disable_irq(s3c_buttons[i].irq);
+		free_irq(s3c_buttons[i].irq,priv.dev);
+	}
+
+	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..4db03c1
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/buttons.h
@@ -0,0 +1,34 @@
+/* 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 s3c_button {
+	int		pin;
+	int		keycode;
+	char		*name;
+	int		irq;
+	int		last_state;
+	struct timer_list timer;
+};
+
+struct s3c_butt_mach_info {
+	struct s3c_button	*buttons;
+	int			size;
+};
+
+extern void __init s3c24xx_butt_set_platdata(struct s3c_butt_mach_info *);
+#endif
