aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authormerge <null@invalid>2008-12-03 11:20:14 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-12-03 11:20:14 +0000
commit1e664d4740009ac49c2a2f85ffc994c12ee040bd (patch)
treebb4f41fda406a637dacffdd74235250d05b689e9 /drivers/misc
parent6c19559f4c6d0697f9c9c7706970ce70bb3d64c6 (diff)
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-MERGE-via-master-1228302402-1228302766-1228303138
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-MERGE-via-master-1228302402-1228302766-1228303138 / 27d86638fe294ef1d1a8f527564ec37bb20e7ef2 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-MERGE-via-master-1228302402-1228302766 stable-tracking-hist top was MERGE-via-mokopatches-tracking-MERGE-via-master-1228302402-1228302766 / 66e84c4be853030f1cea816a124cf76a741ecc08 ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-MERGE-via-master-1228302402 mokopatches-tracking-hist top was MERGE-via-master-1228302402 / de9177f7bd127e9b6fa6213018c7c731b8ca0d0c ... parent commitmessage: From: merge <null@invalid> MERGE-via-master- master top was / 3838a80929f91d35c6d987e518bf9ea397f3e13c ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-wm8753-DBG.patch Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/Makefile1
-rw-r--r--drivers/misc/smdk6410-sleeptest.c65
2 files changed, 66 insertions, 0 deletions
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 94b8fea5fb8..77efd7a7aab 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_KGDB_TESTS) += kgdbts.o
obj-$(CONFIG_SGI_XP) += sgi-xp/
obj-$(CONFIG_SGI_GRU) += sgi-gru/
obj-$(CONFIG_HP_ILO) += hpilo.o
+obj-$(CONFIG_MACH_SMDK6410) += smdk6410-sleeptest.o
obj-$(CONFIG_LOW_MEMORY_KILLER) += lowmemorykiller.o
obj-$(CONFIG_MACH_NEO1973) += neo1973_version.o \
neo1973_pm_host.o \
diff --git a/drivers/misc/smdk6410-sleeptest.c b/drivers/misc/smdk6410-sleeptest.c
new file mode 100644
index 00000000000..3bf668024fb
--- /dev/null
+++ b/drivers/misc/smdk6410-sleeptest.c
@@ -0,0 +1,65 @@
+/* linux/drivers/misc/smdk6410-sleeptest.c
+ *
+ * Copyright 2008 Simtec Electronics
+ * Ben Dooks <ben@simtec.co.uk>
+ * http://armlinux.simtec.co.uk/
+ *
+ * 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.
+*/
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/gpio.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+
+#include <plat/gpio-cfg.h>
+
+static irqreturn_t sleep_action(int irq, void *pw)
+{
+ printk(KERN_INFO "%s: irq %d\n", __func__, irq);
+ return IRQ_HANDLED;
+}
+
+static void sleep_setup(unsigned int irq, unsigned int gpio)
+{
+ int ret;
+
+ WARN_ON(s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)) < 0);
+ WARN_ON(s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP) < 0);
+
+ ret = request_irq(irq, sleep_action, IRQF_TRIGGER_FALLING,
+ "sleep", NULL);
+ if (ret < 0)
+ printk(KERN_ERR "%s: request_irq() failed\n", __func__);
+
+ ret = set_irq_wake(irq, 1);
+ if (ret < 0)
+ printk(KERN_ERR "%s: set_irq_wake() failed\n", __func__);
+}
+
+static void sleep_led(unsigned int gpio)
+{
+ gpio_request(gpio, "sleep led");
+ gpio_direction_output(gpio, 0);
+}
+
+static __init int smdk6410_sleeptest_init(void)
+{
+ sleep_setup(IRQ_EINT(10), S3C64XX_GPN(10));
+ sleep_led(S3C64XX_GPN(15));
+ sleep_led(S3C64XX_GPN(14));
+ sleep_led(S3C64XX_GPN(13));
+ sleep_led(S3C64XX_GPN(12));
+
+ return 0;
+}
+
+module_init(smdk6410_sleeptest_init);
+
+MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
+MODULE_LICENSE("GPL");