aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/rb532-2.6/files
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-07-17 10:25:18 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-07-17 10:25:18 +0000
commiteb097e30686e7318eb11eea5d4555f174ce40f15 (patch)
tree1c277b5e7d0b8083bec90f7e9d2498fae9fd44c9 /target/linux/rb532-2.6/files
parente5520b8853462f148e3b339d172b1764cb4b1ff1 (diff)
downloadupstream-eb097e30686e7318eb11eea5d4555f174ce40f15.tar.gz
upstream-eb097e30686e7318eb11eea5d4555f174ce40f15.tar.bz2
upstream-eb097e30686e7318eb11eea5d4555f174ce40f15.zip
Upgrade rb500 to .22.1, add the LED driver from #986
SVN-Revision: 8015
Diffstat (limited to 'target/linux/rb532-2.6/files')
-rw-r--r--target/linux/rb532-2.6/files/arch/mips/rb500/devices.c8
-rw-r--r--target/linux/rb532-2.6/files/drivers/leds/leds-rb500.c81
2 files changed, 88 insertions, 1 deletions
diff --git a/target/linux/rb532-2.6/files/arch/mips/rb500/devices.c b/target/linux/rb532-2.6/files/arch/mips/rb500/devices.c
index 079eb09602..61250f9da1 100644
--- a/target/linux/rb532-2.6/files/arch/mips/rb500/devices.c
+++ b/target/linux/rb532-2.6/files/arch/mips/rb500/devices.c
@@ -139,11 +139,17 @@ static struct platform_device nand_slot0 = {
.num_resources = ARRAY_SIZE(nand_slot0_res),
};
+static struct platform_device rb500led = {
+ .name = "rb500-led",
+ .id = 0,
+};
+
static struct platform_device *rb500_devs[] = {
&korina_dev0,
&nand_slot0,
- &cf_slot0
+ &cf_slot0,
+ &rb500led
};
static void __init parse_mac_addr(char* macstr)
diff --git a/target/linux/rb532-2.6/files/drivers/leds/leds-rb500.c b/target/linux/rb532-2.6/files/drivers/leds/leds-rb500.c
new file mode 100644
index 0000000000..3ab530a758
--- /dev/null
+++ b/target/linux/rb532-2.6/files/drivers/leds/leds-rb500.c
@@ -0,0 +1,81 @@
+/*
+ * linux/drivers/leds/leds-rb500.c
+ *
+ * Copyright (C) 2006
+ * Twente Institute for Wireless and Mobile Communications BV
+ *
+ * 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 (see file GPLv2).
+ *
+ * Author: Tjalling Hattink <tjalling.hattink@ti-wmc.nl>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <asm/rc32434/rb.h>
+
+static void rb500led_amber_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value)
+ changeLatchU5(LO_ULED, 0);
+ else
+ changeLatchU5(0, LO_ULED);
+}
+
+static struct led_classdev rb500_amber_led = {
+ .name = "rb500led:amber",
+ .default_trigger = "ide-disk",
+ .brightness_set = rb500led_amber_set,
+};
+
+static int rb500led_probe(struct platform_device *pdev)
+{
+ int ret;
+
+ changeLatchU5(0, LO_ULED);
+
+ ret = led_classdev_register(&pdev->dev, &rb500_amber_led);
+
+ return ret;
+}
+
+static int rb500led_remove(struct platform_device *pdev)
+{
+ led_classdev_unregister(&rb500_amber_led);
+
+ return 0;
+}
+
+static struct platform_driver rb500led_driver = {
+ .probe = rb500led_probe,
+ .remove = rb500led_remove,
+ .driver = {
+ .name = "rb500-led",
+ },
+};
+
+static int __init rb500led_init(void)
+{
+ return platform_driver_register(&rb500led_driver);
+}
+
+static void __exit rb500led_exit(void)
+{
+ platform_driver_unregister(&rb500led_driver);
+}
+
+module_init(rb500led_init);
+module_exit(rb500led_exit);
+
+MODULE_AUTHOR("tjalling.hattink@ti-wmc.nl");
+MODULE_DESCRIPTION("Mikrotik RB500 LED driver");
+MODULE_LICENSE("GPL");