2 * linux/drivers/leds/leds-rb500.c
5 * Twente Institute for Wireless and Mobile Communications BV
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details (see file GPLv2).
17 * Author: Tjalling Hattink <tjalling.hattink@ti-wmc.nl>
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/platform_device.h>
23 #include <linux/leds.h>
24 #include <asm/rc32434/rb.h>
26 static void rb500led_amber_set(struct led_classdev
*led_cdev
, enum led_brightness value
)
29 changeLatchU5(LO_ULED
, 0);
31 changeLatchU5(0, LO_ULED
);
34 static struct led_classdev rb500_amber_led
= {
35 .name
= "rb500led:amber",
36 .default_trigger
= "ide-disk",
37 .brightness_set
= rb500led_amber_set
,
40 static int rb500led_probe(struct platform_device
*pdev
)
44 changeLatchU5(0, LO_ULED
);
46 ret
= led_classdev_register(&pdev
->dev
, &rb500_amber_led
);
51 static int rb500led_remove(struct platform_device
*pdev
)
53 led_classdev_unregister(&rb500_amber_led
);
58 static struct platform_driver rb500led_driver
= {
59 .probe
= rb500led_probe
,
60 .remove
= rb500led_remove
,
66 static int __init
rb500led_init(void)
68 return platform_driver_register(&rb500led_driver
);
71 static void __exit
rb500led_exit(void)
73 platform_driver_unregister(&rb500led_driver
);
76 module_init(rb500led_init
);
77 module_exit(rb500led_exit
);
79 MODULE_AUTHOR("tjalling.hattink@ti-wmc.nl");
80 MODULE_DESCRIPTION("Mikrotik RB500 LED driver");
81 MODULE_LICENSE("GPL");