6 #include <linux/kernel.h>
7 #include <linux/module.h>
12 #include <linux/slab.h>
17 #define DRIVER_NAME "leds-sunfire"
18 #define PFX DRIVER_NAME ": "
28 #define to_sunfire_led(d) container_of(d, struct sunfire_led, led_cdev)
30 static void __clockboard_set(
struct led_classdev *led_cdev,
51 upa_writeb(reg, p->
reg);
93 upa_writel(reg, p->
reg);
102 static void fhc_middle_set(
struct led_classdev *led_cdev,
108 static void fhc_right_set(
struct led_classdev *led_cdev,
121 #define NUM_LEDS_PER_BOARD 3
157 for (i--; i >= 0; i--)
179 static struct led_type clockboard_led_types[NUM_LEDS_PER_BOARD] = {
181 .name =
"clockboard-left",
182 .handler = clockboard_left_set,
185 .name =
"clockboard-middle",
186 .handler = clockboard_middle_set,
189 .name =
"clockboard-right",
190 .handler = clockboard_right_set,
191 .default_trigger=
"heartbeat",
197 return sunfire_led_generic_probe(pdev, clockboard_led_types);
200 static struct led_type fhc_led_types[NUM_LEDS_PER_BOARD] = {
203 .handler = fhc_left_set,
206 .name =
"fhc-middle",
207 .handler = fhc_middle_set,
211 .handler = fhc_right_set,
212 .default_trigger=
"heartbeat",
218 return sunfire_led_generic_probe(pdev, fhc_led_types);
225 .probe = sunfire_clockboard_led_probe,
228 .name =
"sunfire-clockboard-leds",
234 .probe = sunfire_fhc_led_probe,
237 .name =
"sunfire-fhc-leds",
242 static int __init sunfire_leds_init(
void)
260 static void __exit sunfire_leds_exit(
void)