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>
18 #include <linux/delay.h>
24 module_param(gpio
, int, 0444);
25 MODULE_PARM_DESC(gpio
, " GPIO line");
27 static void rdc321x_led_set(struct led_classdev
*led_cdev
, enum led_brightness brightness
)
29 gpio_set_value(gpio
, brightness
? 1 : 0);
32 static struct led_classdev rdc321x_dmz_led
= {
33 .name
= "rdc321x:dmz",
34 .brightness_set
= rdc321x_led_set
,
37 static int rdc321x_leds_probe(struct platform_device
*pdev
)
39 return led_classdev_register(&pdev
->dev
, &rdc321x_dmz_led
);
42 static int rdc321x_leds_remove(struct platform_device
*pdev
)
44 led_classdev_unregister(&rdc321x_dmz_led
);
48 static struct platform_driver rdc321x_leds_driver
= {
49 .probe
= rdc321x_leds_probe
,
50 .remove
= rdc321x_leds_remove
,
52 .name
= "rdc321x-leds",
57 static int __init
rdc321x_leds_init(void)
61 ret
= platform_driver_register(&rdc321x_leds_driver
);
66 static void __exit
rdc321x_leds_exit(void)
68 platform_driver_unregister(&rdc321x_leds_driver
);
71 module_init(rdc321x_leds_init
);
72 module_exit(rdc321x_leds_exit
);
74 MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
75 MODULE_DESCRIPTION("RDC321x LED driver");
76 MODULE_LICENSE("GPL");