summaryrefslogtreecommitdiff
path: root/arch/arm/mach-sa1100/hackkit.c
diff options
context:
space:
mode:
authorBryan Wu <bryan.wu@canonical.com>2012-03-14 02:22:03 +0800
committerBryan Wu <bryan.wu@canonical.com>2012-08-01 11:22:14 +0800
commit18775a7bea8fbbebe8818db7a64aaeb40b40a0c5 (patch)
tree6f47d6a4147a6505da85cf4126254bdccc458842 /arch/arm/mach-sa1100/hackkit.c
parentdafbeadf4a9e1b2765641b687e3343be76d2eacd (diff)
ARM: mach-sa1100: retire custom LED code
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'arch/arm/mach-sa1100/hackkit.c')
-rw-r--r--arch/arm/mach-sa1100/hackkit.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 7f86bd911826..fc106aab7c7e 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -21,6 +21,10 @@
#include <linux/serial_core.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/tty.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
#include <asm/mach-types.h>
#include <asm/setup.h>
@@ -183,9 +187,37 @@ static struct flash_platform_data hackkit_flash_data = {
static struct resource hackkit_flash_resource =
DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M);
+/* LEDs */
+struct gpio_led hackkit_gpio_leds[] = {
+ {
+ .name = "hackkit:red",
+ .default_trigger = "cpu0",
+ .gpio = 22,
+ },
+ {
+ .name = "hackkit:green",
+ .default_trigger = "heartbeat",
+ .gpio = 23,
+ },
+};
+
+static struct gpio_led_platform_data hackkit_gpio_led_info = {
+ .leds = hackkit_gpio_leds,
+ .num_leds = ARRAY_SIZE(hackkit_gpio_leds),
+};
+
+static struct platform_device hackkit_leds = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &hackkit_gpio_led_info,
+ }
+};
+
static void __init hackkit_init(void)
{
sa11x0_register_mtd(&hackkit_flash_data, &hackkit_flash_resource, 1);
+ platform_device_register(&hackkit_leds);
}
/**********************************************************************