diff options
author | Florian Fainelli <florian.fainelli@int-evry.fr> | 2007-02-12 23:16:27 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-15 21:37:29 +0000 |
commit | 2fea6f35c388c5add15d1492c7f4f3dac401717b (patch) | |
tree | 9ac4ddd197e978ff33ddecc4c2e2b8f6c09e84e8 /drivers/leds/leds-cobalt.c | |
parent | bd4009af4883451f55f57155e364f03f700c9ce8 (diff) | |
download | kernel_samsung_smdk4412-2fea6f35c388c5add15d1492c7f4f3dac401717b.zip kernel_samsung_smdk4412-2fea6f35c388c5add15d1492c7f4f3dac401717b.tar.gz kernel_samsung_smdk4412-2fea6f35c388c5add15d1492c7f4f3dac401717b.tar.bz2 |
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>
Diffstat (limited to 'drivers/leds/leds-cobalt.c')
-rw-r--r-- | drivers/leds/leds-cobalt.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/leds/leds-cobalt.c b/drivers/leds/leds-cobalt.c new file mode 100644 index 0000000..d16439c --- /dev/null +++ b/drivers/leds/leds-cobalt.c @@ -0,0 +1,43 @@ +/* + * Copyright 2006 - Florian Fainelli <florian@openwrt.org> + * + * 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 <florian@openwrt.org>"); |