2 * linux/arch/arm/mach-footbridge/ebsa285.c
4 * EBSA285 machine fixup
6 #include <linux/init.h>
7 #include <linux/spinlock.h>
8 #include <linux/slab.h>
9 #include <linux/leds.h>
11 #include <asm/hardware/dec21285.h>
12 #include <asm/mach-types.h>
14 #include <asm/mach/arch.h>
19 #if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
21 struct led_classdev cdev
;
26 * The triggers lines up below will only be used if the
27 * LED triggers are compiled in.
33 { "ebsa285:amber", "heartbeat", },
34 { "ebsa285:green", "cpu0", },
38 static void ebsa285_led_set(struct led_classdev
*cdev
,
39 enum led_brightness b
)
41 struct ebsa285_led
*led
= container_of(cdev
,
42 struct ebsa285_led
, cdev
);
45 *XBUS_LEDS
|= led
->mask
;
47 *XBUS_LEDS
&= ~led
->mask
;
50 static enum led_brightness
ebsa285_led_get(struct led_classdev
*cdev
)
52 struct ebsa285_led
*led
= container_of(cdev
,
53 struct ebsa285_led
, cdev
);
55 return (*XBUS_LEDS
& led
->mask
) ? LED_FULL
: LED_OFF
;
58 static int __init
ebsa285_leds_init(void)
62 if (machine_is_ebsa285())
66 *XBUS_LEDS
|= XBUS_LED_AMBER
| XBUS_LED_GREEN
| XBUS_LED_RED
;
68 for (i
= 0; i
< ARRAY_SIZE(ebsa285_leds
); i
++) {
69 struct ebsa285_led
*led
;
71 led
= kzalloc(sizeof(*led
), GFP_KERNEL
);
75 led
->cdev
.name
= ebsa285_leds
[i
].name
;
76 led
->cdev
.brightness_set
= ebsa285_led_set
;
77 led
->cdev
.brightness_get
= ebsa285_led_get
;
78 led
->cdev
.default_trigger
= ebsa285_leds
[i
].trigger
;
81 if (led_classdev_register(NULL
, &led
->cdev
) < 0) {
91 * Since we may have triggers on any subsystem, defer registration
92 * until after subsystem_init.
94 fs_initcall(ebsa285_leds_init
);
97 MACHINE_START(EBSA285
, "EBSA285")
98 /* Maintainer: Russell King */
100 .video_start
= 0x000a0000,
101 .video_end
= 0x000bffff,
102 .map_io
= footbridge_map_io
,
103 .init_irq
= footbridge_init_irq
,
104 .init_time
= footbridge_timer_init
,
105 .restart
= footbridge_restart
,