Skip to content

Commit

Permalink
leds: Add support for Cobalt Server front LED
Browse files Browse the repository at this point in the history
Add support for Cobalt Server front LED (MIPS)

Signed-off-by: Florian Fainell <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
  • Loading branch information
Florian Fainelli authored and rpurdie committed Feb 15, 2007
1 parent bd4009a commit 2fea6f3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions drivers/leds/leds-cobalt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 2006 - Florian Fainelli <[email protected]>
*
* Control the Cobalt Qube/RaQ front LED
*/

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/leds.h>
#include <asm/mach-cobalt/cobalt.h>

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 <[email protected]>");

0 comments on commit 2fea6f3

Please sign in to comment.