summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/dev-keypad.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2010-08-06 19:26:10 +0900
committerKukjin Kim <kgene.kim@samsung.com>2010-08-06 21:27:50 +0900
commit995c48adde09e04298036501df9dac87661fa66c (patch)
tree6c5bf7939dac0c6a5f233c6095ad2d68760606ca /arch/arm/plat-samsung/dev-keypad.c
parent929343ef840051b102b67ad1bc8748dbe7c7ce13 (diff)
downloadblackbird-obmc-linux-995c48adde09e04298036501df9dac87661fa66c.tar.gz
blackbird-obmc-linux-995c48adde09e04298036501df9dac87661fa66c.zip
ARM: SAMSUNG: Add keypad device support
This patch adds Samsung keypad device definition for Samsung SoCs. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung/dev-keypad.c')
-rw-r--r--arch/arm/plat-samsung/dev-keypad.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/dev-keypad.c b/arch/arm/plat-samsung/dev-keypad.c
new file mode 100644
index 000000000000..677c2d731b65
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-keypad.c
@@ -0,0 +1,50 @@
+/*
+ * linux/arch/arm/plat-samsung/dev-keypad.c
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ * Author: Joonyoung Shim <jy0922.shim@samsung.com>
+ *
+ * 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.
+ *
+ */
+
+#include <linux/platform_device.h>
+#include <mach/irqs.h>
+#include <mach/map.h>
+#include <plat/cpu.h>
+#include <plat/devs.h>
+#include <plat/keypad.h>
+
+static struct resource samsung_keypad_resources[] = {
+ [0] = {
+ .start = SAMSUNG_PA_KEYPAD,
+ .end = SAMSUNG_PA_KEYPAD + 0x20 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_KEYPAD,
+ .end = IRQ_KEYPAD,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device samsung_device_keypad = {
+ .name = "samsung-keypad",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(samsung_keypad_resources),
+ .resource = samsung_keypad_resources,
+};
+
+void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
+{
+ struct samsung_keypad_platdata *npd;
+
+ npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata),
+ &samsung_device_keypad);
+
+ if (!npd->cfg_gpio)
+ npd->cfg_gpio = samsung_keypad_cfg_gpio;
+}
OpenPOWER on IntegriCloud