diff options
author | Florian Fainelli <florian.fainelli@int-evry.fr> | 2007-02-12 18:16:27 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-15 16:37:29 -0500 |
commit | 2fea6f35c388c5add15d1492c7f4f3dac401717b (patch) | |
tree | 9ac4ddd197e978ff33ddecc4c2e2b8f6c09e84e8 | |
parent | bd4009af4883451f55f57155e364f03f700c9ce8 (diff) |
leds: Add support for Cobalt Server front LED
Add support for Cobalt Server front LED (MIPS)
Signed-off-by: Florian Fainell <florian.fainelli@int-evry.fr>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
-rw-r--r-- | drivers/leds/Kconfig | 6 | ||||
-rw-r--r-- | drivers/leds/Makefile | 1 | ||||
-rw-r--r-- | drivers/leds/leds-cobalt.c | 43 |
3 files changed, 50 insertions, 0 deletions
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 383d297f328a..80acd08f0e97 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -88,6 +88,12 @@ config LEDS_H1940 | |||
88 | help | 88 | help |
89 | This option enables support for the LEDs on the h1940. | 89 | This option enables support for the LEDs on the h1940. |
90 | 90 | ||
91 | config LEDS_COBALT | ||
92 | tristate "LED Support for Cobalt Server front LED" | ||
93 | depends on LEDS_CLASS && MIPS_COBALT | ||
94 | help | ||
95 | This option enables support for the front LED on Cobalt Server | ||
96 | |||
91 | comment "LED Triggers" | 97 | comment "LED Triggers" |
92 | 98 | ||
93 | config LEDS_TRIGGERS | 99 | config LEDS_TRIGGERS |
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 377fe709216d..aa2c18efa5b2 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -15,6 +15,7 @@ obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o | |||
15 | obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o | 15 | obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o |
16 | obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o | 16 | obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o |
17 | obj-$(CONFIG_LEDS_H1940) += leds-h1940.o | 17 | obj-$(CONFIG_LEDS_H1940) += leds-h1940.o |
18 | obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o | ||
18 | 19 | ||
19 | # LED Triggers | 20 | # LED Triggers |
20 | obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o | 21 | obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o |
diff --git a/drivers/leds/leds-cobalt.c b/drivers/leds/leds-cobalt.c new file mode 100644 index 000000000000..d16439ce5da7 --- /dev/null +++ b/drivers/leds/leds-cobalt.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright 2006 - Florian Fainelli <florian@openwrt.org> | ||
3 | * | ||
4 | * Control the Cobalt Qube/RaQ front LED | ||
5 | */ | ||
6 | |||
7 | #include <linux/module.h> | ||
8 | #include <linux/types.h> | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/device.h> | ||
11 | #include <linux/leds.h> | ||
12 | #include <asm/mach-cobalt/cobalt.h> | ||
13 | |||
14 | static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) | ||
15 | { | ||
16 | if (brightness) | ||
17 | COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT; | ||
18 | else | ||
19 | COBALT_LED_PORT = 0; | ||
20 | } | ||
21 | |||
22 | static struct led_classdev cobalt_led = { | ||
23 | .name = "cobalt-front-led", | ||
24 | .brightness_set = cobalt_led_set, | ||
25 | .default_trigger = "ide-disk", | ||
26 | }; | ||
27 | |||
28 | static int __init cobalt_led_init(void) | ||
29 | { | ||
30 | return led_classdev_register(NULL, &cobalt_led); | ||
31 | } | ||
32 | |||
33 | static void __exit cobalt_led_exit(void) | ||
34 | { | ||
35 | led_classdev_unregister(&cobalt_led); | ||
36 | } | ||
37 | |||
38 | module_init(cobalt_led_init); | ||
39 | module_exit(cobalt_led_exit); | ||
40 | |||
41 | MODULE_LICENSE("GPL"); | ||
42 | MODULE_DESCRIPTION("Front LED support for Cobalt Server"); | ||
43 | MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); | ||