From: Florian Fainelli Date: Mon, 12 Feb 2007 23:16:27 +0000 (+0000) Subject: leds: Add support for Cobalt Server front LED X-Git-Tag: v2.6.21-rc2~41^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fea6f35c388c5add15d1492c7f4f3dac401717b;p=linux-2.6 leds: Add support for Cobalt Server front LED Add support for Cobalt Server front LED (MIPS) Signed-off-by: Florian Fainell Signed-off-by: Richard Purdie --- diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 383d297f32..80acd08f0e 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -88,6 +88,12 @@ config LEDS_H1940 help This option enables support for the LEDs on the h1940. +config LEDS_COBALT + tristate "LED Support for Cobalt Server front LED" + depends on LEDS_CLASS && MIPS_COBALT + help + This option enables support for the front LED on Cobalt Server + comment "LED Triggers" config LEDS_TRIGGERS diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 377fe70921..aa2c18efa5 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile @@ -15,6 +15,7 @@ obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o obj-$(CONFIG_LEDS_H1940) += leds-h1940.o +obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o # LED Triggers 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 0000000000..d16439ce5d --- /dev/null +++ b/drivers/leds/leds-cobalt.c @@ -0,0 +1,43 @@ +/* + * Copyright 2006 - Florian Fainelli + * + * Control the Cobalt Qube/RaQ front LED + */ + +#include +#include +#include +#include +#include +#include + +static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) +{ + if (brightness) + COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT; + else + COBALT_LED_PORT = 0; +} + +static struct led_classdev cobalt_led = { + .name = "cobalt-front-led", + .brightness_set = cobalt_led_set, + .default_trigger = "ide-disk", +}; + +static int __init cobalt_led_init(void) +{ + return led_classdev_register(NULL, &cobalt_led); +} + +static void __exit cobalt_led_exit(void) +{ + led_classdev_unregister(&cobalt_led); +} + +module_init(cobalt_led_init); +module_exit(cobalt_led_exit); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Front LED support for Cobalt Server"); +MODULE_AUTHOR("Florian Fainelli ");