aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/integrator.dtsi10
-rw-r--r--arch/arm/mach-integrator/Makefile2
-rw-r--r--arch/arm/mach-integrator/leds.c80
3 files changed, 11 insertions, 81 deletions
diff --git a/arch/arm/boot/dts/integrator.dtsi b/arch/arm/boot/dts/integrator.dtsi
index 5d27087d5248..28e38f8c6b0f 100644
--- a/arch/arm/boot/dts/integrator.dtsi
+++ b/arch/arm/boot/dts/integrator.dtsi
@@ -8,6 +8,16 @@
8 core-module@10000000 { 8 core-module@10000000 {
9 compatible = "arm,core-module-integrator", "syscon"; 9 compatible = "arm,core-module-integrator", "syscon";
10 reg = <0x10000000 0x200>; 10 reg = <0x10000000 0x200>;
11
12 /* Use core module LED to indicate CPU load */
13 led@0c.0 {
14 compatible = "register-bit-led";
15 offset = <0x0c>;
16 mask = <0x01>;
17 label = "integrator:core_module";
18 linux,default-trigger = "cpu0";
19 default-state = "on";
20 };
11 }; 21 };
12 22
13 ebi@12000000 { 23 ebi@12000000 {
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
index ec759ded7b60..1ebe45356b09 100644
--- a/arch/arm/mach-integrator/Makefile
+++ b/arch/arm/mach-integrator/Makefile
@@ -4,7 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := core.o lm.o leds.o 7obj-y := core.o lm.o
8obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o 8obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o
9obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o 9obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o
10 10
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
deleted file mode 100644
index 56f243744b98..000000000000
--- a/arch/arm/mach-integrator/leds.c
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * Driver for the 4 user LEDs found on the Integrator AP/CP baseboard
3 * Based on Versatile and RealView machine LED code
4 *
5 * License terms: GNU General Public License (GPL) version 2
6 * Author: Bryan Wu <bryan.wu@canonical.com>
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/io.h>
11#include <linux/slab.h>
12#include <linux/leds.h>
13
14#include "hardware.h"
15#include "cm.h"
16
17#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
18
19struct integrator_led {
20 struct led_classdev cdev;
21};
22
23/*
24 * The triggers lines up below will only be used if the
25 * LED triggers are compiled in.
26 */
27static const struct {
28 const char *name;
29 const char *trigger;
30} integrator_leds[] = {
31 { "integrator:core_module", "cpu0", },
32};
33
34static void cm_led_set(struct led_classdev *cdev,
35 enum led_brightness b)
36{
37 if (b != LED_OFF)
38 cm_control(CM_CTRL_LED, CM_CTRL_LED);
39 else
40 cm_control(CM_CTRL_LED, 0);
41}
42
43static enum led_brightness cm_led_get(struct led_classdev *cdev)
44{
45 u32 reg = cm_get();
46
47 return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF;
48}
49
50static int __init integrator_leds_init(void)
51{
52 int i;
53
54 for (i = 0; i < ARRAY_SIZE(integrator_leds); i++) {
55 struct integrator_led *led;
56
57 led = kzalloc(sizeof(*led), GFP_KERNEL);
58 if (!led)
59 break;
60
61 led->cdev.name = integrator_leds[i].name;
62 led->cdev.brightness_set = cm_led_set;
63 led->cdev.brightness_get = cm_led_get;
64 led->cdev.default_trigger = integrator_leds[i].trigger;
65
66 if (led_classdev_register(NULL, &led->cdev) < 0) {
67 kfree(led);
68 break;
69 }
70 }
71
72 return 0;
73}
74
75/*
76 * Since we may have triggers on any subsystem, defer registration
77 * until after subsystem_init.
78 */
79fs_initcall(integrator_leds_init);
80#endif