forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
leds: Add support for Cobalt Server front LED
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
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]>"); |