2 * LED driver for RDC3211 boards
4 * Copyright 2007 Florian Fainelli <florian@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/module.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <linux/leds.h>
17 #include <linux/err.h>
21 static void rdc321x_led_set(struct led_classdev
*led_cdev
, enum led_brightness brightness
)
23 gpio_set_value(1, brightness
? 1 : 0);
26 /* The DMZ led is at GPIO line 1 */
27 static struct led_classdev rdc321x_dmz_led
= {
28 .name
= "rdc321x:dmz",
29 .brightness_set
= rdc321x_led_set
,
32 static int rdc321x_leds_probe(struct platform_device
*pdev
)
34 return led_classdev_register(&pdev
->dev
, &rdc321x_dmz_led
);
37 static int rdc321x_leds_remove(struct platform_device
*pdev
)
39 led_classdev_unregister(&rdc321x_dmz_led
);
43 static struct platform_driver rdc321x_leds_driver
= {
44 .probe
= rdc321x_leds_probe
,
45 .remove
= rdc321x_leds_remove
,
47 .name
= "rdc321x-leds",
52 static int __init
rdc321x_leds_init(void)
56 ret
= platform_driver_register(&rdc321x_leds_driver
);
61 static void __exit
rdc321x_leds_exit(void)
63 platform_driver_unregister(&rdc321x_leds_driver
);
66 module_init(rdc321x_leds_init
);
67 module_exit(rdc321x_leds_exit
);
69 MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
70 MODULE_DESCRIPTION("RDC321x LED driver");
71 MODULE_LICENSE("GPL");