@@ -36,7 +36,6 @@
#include <asm/system.h>
#include <mach/hardware.h>
#include <asm/irq.h>
-#include <asm/leds.h>
#include <asm/mach-types.h>
#include <asm/hardware/arm_timer.h>
#include <asm/hardware/icst.h>
@@ -437,44 +436,6 @@ struct clcd_board clcd_plat_data = {
.remove = versatile_clcd_remove_dma,
};
-#ifdef CONFIG_LEDS
-#define VA_LEDS_BASE (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
-
-void realview_leds_event(led_event_t ledevt)
-{
- unsigned long flags;
- u32 val;
- u32 led = 1 << smp_processor_id();
-
- local_irq_save(flags);
- val = readl(VA_LEDS_BASE);
-
- switch (ledevt) {
- case led_idle_start:
- val = val & ~led;
- break;
-
- case led_idle_end:
- val = val | led;
- break;
-
- case led_timer:
- val = val ^ REALVIEW_SYS_LED7;
- break;
-
- case led_halted:
- val = 0;
- break;
-
- default:
- break;
- }
-
- writel(val, VA_LEDS_BASE);
- local_irq_restore(flags);
-}
-#endif /* CONFIG_LEDS */
-
/*
* Where is the timer (VA)?
*/
@@ -26,7 +26,6 @@
#include <linux/io.h>
#include <asm/setup.h>
-#include <asm/leds.h>
#define AMBA_DEVICE(name,busid,base,plat) \
static struct amba_device name##_device = { \
@@ -57,7 +56,6 @@ extern void __iomem *timer1_va_base;
extern void __iomem *timer2_va_base;
extern void __iomem *timer3_va_base;
-extern void realview_leds_event(led_event_t ledevt);
extern void realview_timer_init(unsigned int timer_irq);
extern int realview_flash_register(struct resource *res, u32 num);
extern int realview_eth_register(const char *name, struct resource *res);
@@ -30,7 +30,6 @@
#include <mach/hardware.h>
#include <asm/irq.h>
-#include <asm/leds.h>
#include <asm/mach-types.h>
#include <asm/pmu.h>
#include <asm/pgtable.h>
@@ -455,9 +454,6 @@ static void __init realview_eb_init(void)
amba_device_register(d, &iomem_resource);
}
-#ifdef CONFIG_LEDS
- leds_event = realview_leds_event;
-#endif
realview_reset = realview_eb_reset;
}
@@ -30,7 +30,6 @@
#include <mach/hardware.h>
#include <asm/irq.h>
-#include <asm/leds.h>
#include <asm/mach-types.h>
#include <asm/pmu.h>
#include <asm/pgtable.h>
@@ -350,9 +349,6 @@ static void __init realview_pb1176_init(void)
amba_device_register(d, &iomem_resource);
}
-#ifdef CONFIG_LEDS
- leds_event = realview_leds_event;
-#endif
realview_reset = realview_pb1176_reset;
}
@@ -30,7 +30,6 @@
#include <mach/hardware.h>
#include <asm/irq.h>
-#include <asm/leds.h>
#include <asm/mach-types.h>
#include <asm/pmu.h>
#include <asm/pgtable.h>
@@ -352,9 +351,6 @@ static void __init realview_pb11mp_init(void)
amba_device_register(d, &iomem_resource);
}
-#ifdef CONFIG_LEDS
- leds_event = realview_leds_event;
-#endif
realview_reset = realview_pb11mp_reset;
}
@@ -29,7 +29,6 @@
#include <linux/io.h>
#include <asm/irq.h>
-#include <asm/leds.h>
#include <asm/mach-types.h>
#include <asm/pmu.h>
#include <asm/pgtable.h>
@@ -302,9 +301,6 @@ static void __init realview_pba8_init(void)
amba_device_register(d, &iomem_resource);
}
-#ifdef CONFIG_LEDS
- leds_event = realview_leds_event;
-#endif
realview_reset = realview_pba8_reset;
}
@@ -28,7 +28,6 @@
#include <linux/io.h>
#include <asm/irq.h>
-#include <asm/leds.h>
#include <asm/mach-types.h>
#include <asm/pmu.h>
#include <asm/smp_twd.h>
@@ -385,9 +384,6 @@ static void __init realview_pbx_init(void)
amba_device_register(d, &iomem_resource);
}
-#ifdef CONFIG_LEDS
- leds_event = realview_leds_event;
-#endif
realview_reset = realview_pbx_reset;
}
@@ -7,8 +7,12 @@ config PLAT_VERSATILE_FPGA_IRQ
bool
config PLAT_VERSATILE_LEDS
- def_bool y if LEDS_CLASS
+ def_bool y
depends on ARCH_REALVIEW || ARCH_VERSATILE
+ select NEW_LEDS
+ select LEDS_CLASS
+ select LEDS_TRIGGERS
+ select LEDS_TRIGGER_CPU
config PLAT_VERSATILE_SCHED_CLOCK
def_bool y if !ARCH_INTEGRATOR_AP
@@ -37,10 +37,10 @@ static const struct {
} versatile_leds[] = {
{ "versatile:0", "heartbeat", },
{ "versatile:1", "mmc0", },
- { "versatile:2", },
- { "versatile:3", },
- { "versatile:4", },
- { "versatile:5", },
+ { "versatile:2", "cpu" },
+ { "versatile:3", "cpu" },
+ { "versatile:4", "cpu" },
+ { "versatile:5", "cpu" },
{ "versatile:6", },
{ "versatile:7", },
};
@@ -85,6 +85,11 @@ static int __init versatile_leds_init(void)
led->cdev.brightness_set = versatile_led_set;
led->cdev.brightness_get = versatile_led_get;
led->cdev.default_trigger = versatile_leds[i].trigger;
+ /* Some trigger data for CPU LEDs */
+ if (i >= 2 && i <= 5) {
+ /* This is the CPU number actually */
+ led->cdev.trigger_data = (void *) i - 2;
+ }
led->mask = BIT(i);
if (led_classdev_register(NULL, &led->cdev) < 0) {