Skip to contentSkip to conversation

Introduce a led trigger for CPU activity and consolidate LED driver in ARM

PATCH Superseded Bryan Wu 3 participants 23 messages Aug 10, 2011 – Aug 17, 2011

Subsystems (10)

v3 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

v3 cover Introduce a led trigger for CPU activity and consolidate LED driver in ARM

Based on Linus Walleij's ARM LED consolidation work, this patchset introduce a new generic led trigger for CPU not only for ARM but also for others.

For enabling CPU idle event, CPU arch code should call ledtrig_cpu() stub to trigger idle start or idle end event.

These patches convert old style LED driver in arch/arm to gpio_led or new led driver interface. Against 3.1.0-rc1 and build successfully for all the machines.

Test ledtrig-cpu driver on OMAP4 Panda board.

--
root at omap4430-panda:~# uname -a
Linux omap4430-panda 3.1.0-rc1-07641-gb154376 #1 SMP Wed Aug 10 18:26:24 CST 2011 armv7l unknown root at omap4430-panda:~# dmesg | grep trig

[    1.891265] LED trigger cpu0 indicate activity on CPU 0
[    1.896728] LED trigger cpu1 indicate activity on CPU 1

root at omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status1/trigger none nand-disk mmc0 mmc1 timer [heartbeat] cpu0 cpu1
root at omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status2/trigger none nand-disk [mmc0] mmc1 timer heartbeat cpu0 cpu1
root at omap4430-panda:~# echo cpu0 > /sys/class/leds/pandaboard\:\:status1/trigger root at omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status1/trigger none nand-disk mmc0 mmc1 timer heartbeat [cpu0] cpu1
root at omap4430-panda:~# echo cpu1 > /sys/class/leds/pandaboard\:\:status2/trigger root at omap4430-panda:~# cat /sys/class/leds/pandaboard\:\:status2/trigger none nand-disk mmc0 mmc1 timer heartbeat cpu0 [cpu1]

Then try some heavy task like dd and use taskset to assign the task to a specific CPU, LED will turn on or off as expect
--

v2 --> v3:
* almost rewrote the whole ledtrig-cpu driver, which is more simple
* every CPU will have a per-CPU trigger
* cpu trigger can be assigned to any leds
* fix a lockdep issue in led-trigger common code
* other fix according to review

v1 --> v2:
* remove select operations in Kconfig of every machines
* add back supporting of led in core module of mach-integrator
* solidate name scheme in ledtrig-cpu.c
* add comments of CPU_LED_* cpu led events
* fold patches of RealView and Versatile together
* add machine_is_ check during assabet led driver init
* add some Acked-by in patch logs
* remove code for simpad machine in machine-sa11000, since Jochen Friedrich introduced gpiolib and gpio-led driver for simpad
* on Assabet and Netwinder machine, LED operations is reversed like:
setting bit means turn off leds
clearing bit means turn on leds
* add a new function to read CM_CTRL register for led driver

This patchset is based on patches from Jochen Friedrich for simpad:
* http://lists.infradead.org/pipermail/linux-arm-kernel/2011-July/057566.html
* http://lists.infradead.org/pipermail/linux-arm-kernel/2011-July/057564.html
* http://lists.infradead.org/pipermail/linux-arm-kernel/2011-July/057567.html
* http://lists.infradead.org/pipermail/linux-arm-kernel/2011-July/057565.html
* http://lists.infradead.org/pipermail/linux-arm-kernel/2011-July/057568.html

*** BLURB HERE ***

Bryan Wu (17):
led-triggers: use atomic kzalloc during led trigger registering
led-triggers: create a trigger for CPU activity
arm: at91: convert old leds drivers to gpio_led and led_trigger
drivers
mach-ks8695: remove leds driver, since nobody use it
mach-shark: retire custom LED code
mach-orion5x: convert custom LED code to gpio_led and LED CPU trigger
mach-integrator: move CM_CTRL to header file for accessing by other
functions
mach-integrator: retire custom LED code
mach-clps711x: retire custom LED code of P720T machine
mach-ebsa110: retire custom LED code
mach-footbridge: retire custom LED code
mach-pxa: retire custom LED code
plat-samsung: remove including old leds event API header file
mach-pnx4008: remove including old leds event API header file
mach-omap1: retire custom LED code
mach-sa1100: retire custom LED code
ARM: use new LEDS CPU trigger stub to replace old one

Linus Walleij (1):
mach-realview and mach-versatile: retire custom LED code

 arch/arm/Kconfig                               |   53 -----
 arch/arm/include/asm/leds.h                    |   50 ----
 arch/arm/kernel/Makefile                       |    1 -
 arch/arm/kernel/leds.c                         |  119 ----------
 arch/arm/kernel/process.c                      |    6 +-
 arch/arm/kernel/time.c                         |   17 --
 arch/arm/mach-at91/board-cap9adk.c             |   21 ++-
 arch/arm/mach-at91/board-csb337.c              |    3 -
 arch/arm/mach-at91/board-ecbat91.c             |   18 ++-
 arch/arm/mach-at91/board-eco920.c              |   23 ++-
 arch/arm/mach-at91/board-kafa.c                |   17 ++-
 arch/arm/mach-at91/board-kb9202.c              |   23 ++-
 arch/arm/mach-at91/board-rm9200dk.c            |    3 -
 arch/arm/mach-at91/board-rm9200ek.c            |    3 -
 arch/arm/mach-at91/board-sam9-l9260.c          |   23 ++-
 arch/arm/mach-at91/board-sam9261ek.c           |    3 -
 arch/arm/mach-at91/board-yl-9200.c             |    3 -
 arch/arm/mach-at91/include/mach/board.h        |    1 -
 arch/arm/mach-at91/leds.c                      |  105 ---------
 arch/arm/mach-clps711x/Makefile                |    2 -
 arch/arm/mach-clps711x/include/mach/time.h     |    2 -
 arch/arm/mach-clps711x/p720t-leds.c            |   67 ------
 arch/arm/mach-clps711x/p720t.c                 |   60 +++++
 arch/arm/mach-clps711x/time.c                  |    1 -
 arch/arm/mach-ebsa110/Makefile                 |    4 +-
 arch/arm/mach-ebsa110/leds.c                   |   80 ++++---
 arch/arm/mach-footbridge/Makefile              |    4 -
 arch/arm/mach-footbridge/ebsa285-leds.c        |  139 -----------
 arch/arm/mach-footbridge/ebsa285.c             |   79 +++++++
 arch/arm/mach-footbridge/include/mach/system.h |    1 -
 arch/arm/mach-footbridge/netwinder-hw.c        |  110 ++++++++--
 arch/arm/mach-footbridge/netwinder-leds.c      |  139 -----------
 arch/arm/mach-integrator/Makefile              |    3 +-
 arch/arm/mach-integrator/core.c                |    3 -
 arch/arm/mach-integrator/include/mach/cm.h     |    2 +
 arch/arm/mach-integrator/leds.c                |  159 ++++++++-----
 arch/arm/mach-ks8695/Makefile                  |    3 -
 arch/arm/mach-ks8695/devices.c                 |   21 --
 arch/arm/mach-ks8695/include/mach/devices.h    |    5 -
 arch/arm/mach-ks8695/leds.c                    |   93 --------
 arch/arm/mach-omap1/Makefile                   |    8 -
 arch/arm/mach-omap1/board-h2.c                 |   34 +++-
 arch/arm/mach-omap1/board-h3.c                 |   34 +++-
 arch/arm/mach-omap1/board-osk.c                |   33 +++
 arch/arm/mach-omap1/leds-h2p2-debug.c          |  167 --------------
 arch/arm/mach-omap1/leds-innovator.c           |   99 --------
 arch/arm/mach-omap1/leds-osk.c                 |  115 ----------
 arch/arm/mach-omap1/leds.c                     |   69 ------
 arch/arm/mach-omap1/leds.h                     |    3 -
 arch/arm/mach-omap1/time.c                     |    1 -
 arch/arm/mach-omap1/timer32k.c                 |    1 -
 arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c   |    1 -
 arch/arm/mach-orion5x/rd88f5181l-ge-setup.c    |    1 -
 arch/arm/mach-orion5x/rd88f5182-setup.c        |   74 ++----
 arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c   |    1 -
 arch/arm/mach-pnx4008/time.c                   |    1 -
 arch/arm/mach-pxa/Makefile                     |    8 -
 arch/arm/mach-pxa/idp.c                        |   79 +++++++
 arch/arm/mach-pxa/leds-idp.c                   |  116 ----------
 arch/arm/mach-pxa/leds-lubbock.c               |  125 ----------
 arch/arm/mach-pxa/leds-mainstone.c             |  120 ----------
 arch/arm/mach-pxa/leds.c                       |   32 ---
 arch/arm/mach-pxa/leds.h                       |   13 -
 arch/arm/mach-pxa/lubbock.c                    |   93 ++++++++
 arch/arm/mach-pxa/mainstone.c                  |   92 ++++++++
 arch/arm/mach-realview/core.c                  |   39 ----
 arch/arm/mach-realview/core.h                  |    2 -
 arch/arm/mach-realview/realview_eb.c           |    4 -
 arch/arm/mach-realview/realview_pb1176.c       |    4 -
 arch/arm/mach-realview/realview_pb11mp.c       |    4 -
 arch/arm/mach-realview/realview_pba8.c         |    4 -
 arch/arm/mach-realview/realview_pbx.c          |    4 -
 arch/arm/mach-sa1100/Makefile                  |    9 -
 arch/arm/mach-sa1100/assabet.c                 |   83 +++++++
 arch/arm/mach-sa1100/badge4.c                  |   30 +++
 arch/arm/mach-sa1100/cerf.c                    |   42 ++++
 arch/arm/mach-sa1100/hackkit.c                 |   32 +++
 arch/arm/mach-sa1100/lart.c                    |   26 ++
 arch/arm/mach-sa1100/leds-assabet.c            |  114 ---------
 arch/arm/mach-sa1100/leds-badge4.c             |  111 ---------
 arch/arm/mach-sa1100/leds-cerf.c               |  110 ---------
 arch/arm/mach-sa1100/leds-hackkit.c            |  112 ---------
 arch/arm/mach-sa1100/leds-lart.c               |  101 --------
 arch/arm/mach-sa1100/leds.c                    |   50 ----
 arch/arm/mach-sa1100/leds.h                    |   13 -
 arch/arm/mach-shark/Makefile                   |    4 +-
 arch/arm/mach-shark/core.c                     |    1 -
 arch/arm/mach-shark/leds.c                     |  225 +++++++-----------
 arch/arm/mach-versatile/core.c                 |   42 ----
 arch/arm/plat-omap/Kconfig                     |    3 +-
 arch/arm/plat-omap/debug-leds.c                |  292 ++++++------------------
 arch/arm/plat-samsung/time.c                   |    1 -
 arch/arm/plat-versatile/Kconfig                |    2 +-
 arch/arm/plat-versatile/leds.c                 |   13 +-
 drivers/leds/Kconfig                           |   10 +
 drivers/leds/Makefile                          |    1 +
 drivers/leds/led-triggers.c                    |    2 +-
 drivers/leds/ledtrig-cpu.c                     |  120 ++++++++++
 include/linux/leds.h                           |   15 ++
 99 files changed, 1403 insertions(+), 3011 deletions(-)
 delete mode 100644 arch/arm/include/asm/leds.h
 delete mode 100644 arch/arm/kernel/leds.c
 delete mode 100644 arch/arm/mach-clps711x/p720t-leds.c
 delete mode 100644 arch/arm/mach-footbridge/ebsa285-leds.c
 delete mode 100644 arch/arm/mach-footbridge/netwinder-leds.c
 delete mode 100644 arch/arm/mach-ks8695/leds.c
 delete mode 100644 arch/arm/mach-omap1/leds-h2p2-debug.c
 delete mode 100644 arch/arm/mach-omap1/leds-innovator.c
 delete mode 100644 arch/arm/mach-omap1/leds-osk.c
 delete mode 100644 arch/arm/mach-omap1/leds.c
 delete mode 100644 arch/arm/mach-omap1/leds.h
 delete mode 100644 arch/arm/mach-pxa/leds-idp.c
 delete mode 100644 arch/arm/mach-pxa/leds-lubbock.c
 delete mode 100644 arch/arm/mach-pxa/leds-mainstone.c
 delete mode 100644 arch/arm/mach-pxa/leds.c
 delete mode 100644 arch/arm/mach-pxa/leds.h
 delete mode 100644 arch/arm/mach-sa1100/leds-assabet.c
 delete mode 100644 arch/arm/mach-sa1100/leds-badge4.c
 delete mode 100644 arch/arm/mach-sa1100/leds-cerf.c
 delete mode 100644 arch/arm/mach-sa1100/leds-hackkit.c
 delete mode 100644 arch/arm/mach-sa1100/leds-lart.c
 delete mode 100644 arch/arm/mach-sa1100/leds.c
 delete mode 100644 arch/arm/mach-sa1100/leds.h
 create mode 100644 drivers/leds/ledtrig-cpu.c
Signature · 1 line
1.7.5
author
#1 lore raw

PATCH v3 1/18 led-triggers: use atomic kzalloc during led trigger registering

kzalloc might cause sleep and will generate some warning detected by lockdep, when call led_trigger_register_simple on each cpu cores in SMP. This patch fix this.

[    1.999938] ------------[ cut here ]------------
[    2.004791] WARNING: at kernel/lockdep.c:2664 lockdep_trace_alloc+0xd8/0xf0()
[    2.012298] Modules linked in:
[    2.015563] [<c001b0cc>] (unwind_backtrace+0x0/0xf0) from [<c0052408>] (warn_slowpath_common+0x4c/0x64)
[    2.025451] [<c0052408>] (warn_slowpath_common+0x4c/0x64) from [<c005243c>] (warn_slowpath_null+0x1c/0x24)
[    2.035583] [<c005243c>] (warn_slowpath_null+0x1c/0x24) from [<c008be28>] (lockdep_trace_alloc+0xd8/0xf0)
[    2.045684] [<c008be28>] (lockdep_trace_alloc+0xd8/0xf0) from [<c00feeb4>] (kmem_cache_alloc_trace+0x2c/0x148)
[    2.056213] [<c00feeb4>] (kmem_cache_alloc_trace+0x2c/0x148) from [<c03770a0>] (led_trigger_register_simple+0x20/0x74)
[    2.067474] [<c03770a0>] (led_trigger_register_simple+0x20/0x74) from [<c0627a30>] (ledtrig_cpu_register+0x4c/0x8c)
[    2.078460] [<c0627a30>] (ledtrig_cpu_register+0x4c/0x8c) from [<c0094ca4>] (generic_smp_call_function_single_interrupt+0xcc/0x138)
[    2.090911] [<c0094ca4>] (generic_smp_call_function_single_interrupt+0xcc/0x138) from [<c0008408>] (do_IPI+0xb0/0x128)
[    2.102172] [<c0008408>] (do_IPI+0xb0/0x128) from [<c045921c>] (__irq_svc+0x3c/0x100)
[    2.110412] Exception stack(0xc07adf70 to 0xc07adfb8)
[    2.115722] df60:                                     c07c80f8 0000fb45 00000000 c07c80f8
[    2.124328] df80: c07ac000 c0837be4 c0464b64 c07c9d8c 00000000 411fc092 00000000 00000000
[    2.132934] dfa0: c0649760 c07adfb8 c07c5c58 c0014d50 20000013 ffffffff
[    2.139892] [<c045921c>] (__irq_svc+0x3c/0x100) from [<c0014d50>] (default_idle+0x30/0x38)
[    2.148590] [<c0014d50>] (default_idle+0x30/0x38) from [<c0014f74>] (cpu_idle+0xb4/0xf4)
[    2.157135] [<c0014f74>] (cpu_idle+0xb4/0xf4) from [<c0602778>] (start_kernel+0x2a8/0x2fc)
[    2.165832] [<c0602778>] (start_kernel+0x2a8/0x2fc) from [<80008040>] (0x80008040)
[    2.173797] ---[ end trace 97549d21d8dad3f5 ]---
---
 drivers/leds/led-triggers.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/leds/led-triggers.c +1 -1
index 4bebae7..9a9c78d 100644
@@ -256,7 +256,7 @@ void led_trigger_register_simple(const char *name, struct led_trigger **tp)
 	struct led_trigger *trigger;
 	int err;
 
-	trigger = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
+	trigger = kzalloc(sizeof(struct led_trigger), GFP_ATOMIC);
 
 	if (trigger) {
 		trigger->name = name;
Signature · 1 line
1.7.5
author
#2 lore raw

PATCH v3 2/18 led-triggers: create a trigger for CPU activity

In reply to Bryan Wu

Attempting to consolidate the ARM LED code, this removes the custom RealView LED trigger code to turn LEDs on and off in response to CPU activity and replace it with a standard trigger.

(bryan.wu at canonical.com:
It moves arch/arm/kernel/leds.c syscore stubs into this trigger. It also provides ledtrig_cpu trigger event stub in <linux/leds.h>. Although it was inspired by ARM work, it can be used in other arch.)

---
 drivers/leds/Kconfig       |   10 ++++
 drivers/leds/Makefile      |    1 +
 drivers/leds/ledtrig-cpu.c |  120 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/leds.h       |   15 ++++++
 4 files changed, 146 insertions(+), 0 deletions(-)
 create mode 100644 drivers/leds/ledtrig-cpu.c
drivers/leds/Kconfig +10 -0
index b591e72..a97c6a3 100644
@@ -430,6 +430,16 @@ config LEDS_TRIGGER_BACKLIGHT
 
 	  If unsure, say N.
 
+config LEDS_TRIGGER_CPU
+	bool "LED CPU Trigger"
+	depends on LEDS_TRIGGERS
+	help
+	  This allows LEDs to be controlled by active CPUs. This shows
+	  the active CPUs across an array of LEDs so you can see what
+	  CPUs are active on the system at any given moment.
+
+	  If unsure, say N.
+
 config LEDS_TRIGGER_GPIO
 	tristate "LED GPIO Trigger"
 	depends on LEDS_TRIGGERS
drivers/leds/Makefile +1 -0
index bbfd2e3..5e70d2e 100644
@@ -53,4 +53,5 @@ obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK)	+= ledtrig-ide-disk.o
 obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)	+= ledtrig-heartbeat.o
 obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT)	+= ledtrig-backlight.o
 obj-$(CONFIG_LEDS_TRIGGER_GPIO)		+= ledtrig-gpio.o
+obj-$(CONFIG_LEDS_TRIGGER_CPU)		+= ledtrig-cpu.o
 obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON)	+= ledtrig-default-on.o
drivers/leds/ledtrig-cpu.c new file +120 -0

120 lines not on this page · raw message

include/linux/leds.h +15 -0
index 5884def..b782abd 100644
@@ -210,4 +210,19 @@ struct gpio_led_platform_data {
 struct platform_device *gpio_led_register_device(
 		int id, const struct gpio_led_platform_data *pdata);
 
+#ifdef CONFIG_LEDS_TRIGGER_CPU
+enum cpu_led_event {
+	CPU_LED_IDLE_START,	/* CPU enters idle */
+	CPU_LED_IDLE_END,	/* CPU idle ends */
+	CPU_LED_START,		/* Machine starts, especially resume */
+	CPU_LED_STOP,		/* Machine stops, especially suspend */
+	CPU_LED_HALTED,		/* Machine shutdown */
+};
+
+/* Use this routine to handle LEDs */
+extern void ledtrig_cpu(enum cpu_led_event evt);
+#else
+#define ledtrig_cpu(evt) do {} while (0)
+#endif
+
 #endif		/* __LINUX_LEDS_H_INCLUDED */
Signature · 1 line
1.7.5
#3 lore raw

PATCH 2/18 led-triggers: create a trigger for CPU activity

Hi Bryan,

Quoted 9 lines · Bryan Wu

Attempting to consolidate the ARM LED code, this removes the custom RealView LED trigger code to turn LEDs on and off in response to CPU activity and replace it with a standard trigger.

(bryan.wu at canonical.com:
It moves arch/arm/kernel/leds.c syscore stubs into this trigger. It also provides ledtrig_cpu trigger event stub in <linux/leds.h>. Although it was inspired by ARM work, it can be used in other arch.)

Quoted 4 lines

---

This looks really nice and small now!

Jamie

#4 lore raw

PATCH 2/18 led-triggers: create a trigger for CPU activity

Quoted 17 lines · Jamie Iles

Hi Bryan,

Quoted 9 lines · Bryan Wu

Attempting to consolidate the ARM LED code, this removes the custom RealView LED trigger code to turn LEDs on and off in response to CPU activity and replace it with a standard trigger.

(bryan.wu at canonical.com:
It moves arch/arm/kernel/leds.c syscore stubs into this trigger. It also provides ledtrig_cpu trigger event stub in<linux/leds.h>. Although it was inspired by ARM work, it can be used in other arch.)

Quoted 4 lines

---

Quoted 5 lines

This looks really nice and small now!

Jamie

This works OK now on SIMpad devices :-)

Thanks,
Jochen

author
#5 lore raw

PATCH v3 3/18 arm: at91: convert old leds drivers to gpio_led and led_trigger drivers

In reply to Bryan Wu

Build with at91 defconfigs successfully

---
 arch/arm/mach-at91/board-cap9adk.c      |   21 ++++++-
 arch/arm/mach-at91/board-csb337.c       |    3 -
 arch/arm/mach-at91/board-ecbat91.c      |   18 +++++-
 arch/arm/mach-at91/board-eco920.c       |   23 ++++++-
 arch/arm/mach-at91/board-kafa.c         |   17 ++++-
 arch/arm/mach-at91/board-kb9202.c       |   23 ++++++-
 arch/arm/mach-at91/board-rm9200dk.c     |    3 -
 arch/arm/mach-at91/board-rm9200ek.c     |    3 -
 arch/arm/mach-at91/board-sam9-l9260.c   |   23 ++++++-
 arch/arm/mach-at91/board-sam9261ek.c    |    3 -
 arch/arm/mach-at91/board-yl-9200.c      |    3 -
 arch/arm/mach-at91/include/mach/board.h |    1 -
 arch/arm/mach-at91/leds.c               |  105 -------------------------------
 13 files changed, 108 insertions(+), 138 deletions(-)
arch/arm/mach-at91/board-cap9adk.c +19 -2
index 679b0b7..0f95be9 100644
@@ -55,8 +55,6 @@ static void __init cap9adk_init_early(void)
 	/* Initialize processor: 12 MHz crystal */
 	at91_initialize(12000000);
 
-	/* Setup the LEDs: USER1 and USER2 LED for cpu/timer... */
-	at91_init_leds(AT91_PIN_PA10, AT91_PIN_PA11);
 	/* ... POWER LED always on */
 	at91_set_gpio_output(AT91_PIN_PC29, 1);
 
@@ -359,6 +357,23 @@ static struct ac97c_platform_data cap9adk_ac97_data = {
 //	.reset_pin	= ... not connected
 };
 
+/*
+ * LEDs
+ */
+static struct gpio_led cap9adk_leds[] = {
+	{	/* D1 */
+		.name			= "led1",
+		.gpio			= AT91_PIN_PA10,
+		.active_low		= 1,
+		.default_trigger	= "heartbeat",
+	},
+	{	/* D2 */
+		.name			= "led2",
+		.gpio			= AT91_PIN_PA11,
+		.active_low		= 1,
+		.default_trigger	= "timer",
+	}
+};
 
 static void __init cap9adk_board_init(void)
 {
@@ -386,6 +401,8 @@ static void __init cap9adk_board_init(void)
 	at91_add_device_lcdc(&cap9adk_lcdc_data);
 	/* AC97 */
 	at91_add_device_ac97(&cap9adk_ac97_data);
+	/* LEDs */
+	at91_gpio_leds(cap9adk_leds, ARRAY_SIZE(cap9adk_leds));
 }
 
 MACHINE_START(AT91CAP9ADK, "Atmel AT91CAP9A-DK")
arch/arm/mach-at91/board-csb337.c +0 -3
index 17654d5..0b2cdee 100644
@@ -48,9 +48,6 @@ static void __init csb337_init_early(void)
 	/* Initialize processor: 3.6864 MHz crystal */
 	at91_initialize(3686400);
 
-	/* Setup the LEDs */
-	at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
-
 	/* DBGU on ttyS0 */
 	at91_register_uart(0, 0, 0);
 
arch/arm/mach-at91/board-ecbat91.c +15 -3
index 7c0313c..15cbbe4 100644
@@ -51,9 +51,6 @@ static void __init ecb_at91init_early(void)
 	/* Initialize processor: 18.432 MHz crystal */
 	at91_initialize(18432000);
 
-	/* Setup the LEDs */
-	at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
@@ -144,6 +141,18 @@ static struct spi_board_info __initdata ecb_at91spi_devices[] = {
 	},
 };
 
+/*
+ * LEDs
+ */
+static struct gpio_led ecb_leds[] = {
+	{	/* D1 */
+		.name			= "led1",
+		.gpio			= AT91_PIN_PC7,
+		.active_low		= 1,
+		.default_trigger	= "heartbeat",
+	}
+};
+
 static void __init ecb_at91board_init(void)
 {
 	/* Serial */
@@ -163,6 +172,9 @@ static void __init ecb_at91board_init(void)
 
 	/* SPI */
 	at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
+
+	/* LEDs */
+	at91_gpio_leds(ecb_leds, ARRAY_SIZE(ecb_leds));
 }
 
 MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
arch/arm/mach-at91/board-eco920.c +20 -3
index 8252c72..efa8e55 100644
@@ -37,9 +37,6 @@ static void __init eco920_init_early(void)
 
 	at91_initialize(18432000);
 
-	/* Setup the LEDs */
-	at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
-
 	/* DBGU on ttyS0. (Rx & Tx only */
 	at91_register_uart(0, 0, 0);
 
@@ -95,6 +92,24 @@ static struct spi_board_info eco920_spi_devices[] = {
 	},
 };
 
+/*
+ * LEDs
+ */
+static struct gpio_led eco920_leds[] = {
+	{	/* D1 */
+		.name			= "led1",
+		.gpio			= AT91_PIN_PB0,
+		.active_low		= 1,
+		.default_trigger	= "heartbeat",
+	},
+	{	/* D2 */
+		.name			= "led2",
+		.gpio			= AT91_PIN_PB1,
+		.active_low		= 1,
+		.default_trigger	= "timer",
+	}
+};
+
 static void __init eco920_board_init(void)
 {
 	at91_add_device_serial();
@@ -125,6 +140,8 @@ static void __init eco920_board_init(void)
 	);
 
 	at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices));
+	/* LEDs */
+	at91_gpio_leds(eco920_leds, ARRAY_SIZE(eco920_leds));
 }
 
 MACHINE_START(ECO920, "eco920")
arch/arm/mach-at91/board-kafa.c +14 -3
index 4a17089..17a470b 100644
@@ -48,9 +48,6 @@ static void __init kafa_init_early(void)
 	/* Initialize processor: 18.432 MHz crystal */
 	at91_initialize(18432000);
 
-	/* Set up the LEDs */
-	at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
@@ -75,6 +72,18 @@ static struct at91_udc_data __initdata kafa_udc_data = {
 	.pullup_pin	= AT91_PIN_PB7,
 };
 
+/*
+ * LEDs
+ */
+static struct gpio_led kafa_leds[] = {
+	{	/* D1 */
+		.name			= "led1",
+		.gpio			= AT91_PIN_PB4,
+		.active_low		= 1,
+		.default_trigger	= "heartbeat",
+	},
+};
+
 static void __init kafa_board_init(void)
 {
 	/* Serial */
@@ -89,6 +98,8 @@ static void __init kafa_board_init(void)
 	at91_add_device_i2c(NULL, 0);
 	/* SPI */
 	at91_add_device_spi(NULL, 0);
+	/* LEDs */
+	at91_gpio_leds(kafa_leds, ARRAY_SIZE(kafa_leds));
 }
 
 MACHINE_START(KAFA, "Sperry-Sun KAFA")
arch/arm/mach-at91/board-kb9202.c +20 -3
index 9dc8d49..bee2a4e 100644
@@ -50,9 +50,6 @@ static void __init kb9202_init_early(void)
 	/* Initialize processor: 10 MHz crystal */
 	at91_initialize(10000000);
 
-	/* Set up the LEDs */
-	at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
@@ -112,6 +109,24 @@ static struct atmel_nand_data __initdata kb9202_nand_data = {
 	.partition_info	= nand_partitions,
 };
 
+/*
+ * LEDs
+ */
+static struct gpio_led kb9202_leds[] = {
+	{	/* D1 */
+		.name			= "led1",
+		.gpio			= AT91_PIN_PC19,
+		.active_low		= 1,
+		.default_trigger	= "heartbeat",
+	},
+	{	/* D2 */
+		.name			= "led2",
+		.gpio			= AT91_PIN_PC18,
+		.active_low		= 1,
+		.default_trigger	= "timer",
+	}
+};
+
 static void __init kb9202_board_init(void)
 {
 	/* Serial */
@@ -130,6 +145,8 @@ static void __init kb9202_board_init(void)
 	at91_add_device_spi(NULL, 0);
 	/* NAND */
 	at91_add_device_nand(&kb9202_nand_data);
+	/* LEDs */
+	at91_gpio_leds(kb9202_leds, ARRAY_SIZE(kb9202_leds));
 }
 
 MACHINE_START(KB9200, "KB920x")
arch/arm/mach-at91/board-rm9200dk.c +0 -3
index 6f08faa..8694b74 100644
@@ -50,9 +50,6 @@ static void __init dk_init_early(void)
 	/* Initialize processor: 18.432 MHz crystal */
 	at91_initialize(18432000);
 
-	/* Setup the LEDs */
-	at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
arch/arm/mach-at91/board-rm9200ek.c +0 -3
index 85bcccd..3a96ed3 100644
@@ -50,9 +50,6 @@ static void __init ek_init_early(void)
 	/* Initialize processor: 18.432 MHz crystal */
 	at91_initialize(18432000);
 
-	/* Setup the LEDs */
-	at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
arch/arm/mach-at91/board-sam9-l9260.c +20 -3
index 4d3a02f..8c3a15a 100644
@@ -49,9 +49,6 @@ static void __init ek_init_early(void)
 	/* Initialize processor: 18.432 MHz crystal */
 	at91_initialize(18432000);
 
-	/* Setup the LEDs */
-	at91_init_leds(AT91_PIN_PA9, AT91_PIN_PA6);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
@@ -184,6 +181,24 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
 //	.vcc_pin	= ... not connected
 };
 
+/*
+ * LEDs
+ */
+static struct gpio_led ek_leds[] = {
+	{	/* D1 */
+		.name			= "led1",
+		.gpio			= AT91_PIN_PA9,
+		.active_low		= 1,
+		.default_trigger	= "heartbeat",
+	},
+	{	/* D2 */
+		.name			= "led2",
+		.gpio			= AT91_PIN_PA6,
+		.active_low		= 1,
+		.default_trigger	= "timer",
+	}
+};
+
 static void __init ek_board_init(void)
 {
 	/* Serial */
@@ -202,6 +217,8 @@ static void __init ek_board_init(void)
 	at91_add_device_mmc(0, &ek_mmc_data);
 	/* I2C */
 	at91_add_device_i2c(NULL, 0);
+	/* LEDs */
+	at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
 }
 
 MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
arch/arm/mach-at91/board-sam9261ek.c +0 -3
index 5096a0e..4d7b6fa 100644
@@ -59,9 +59,6 @@ static void __init ek_init_early(void)
 	/* Initialize processor: 18.432 MHz crystal */
 	at91_initialize(18432000);
 
-	/* Setup the LEDs */
-	at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
arch/arm/mach-at91/board-yl-9200.c +0 -3
index 95edcbd..9ac5c47 100644
@@ -58,9 +58,6 @@ static void __init yl9200_init_early(void)
 	/* Initialize processor: 18.432 MHz crystal */
 	at91_initialize(18432000);
 
-	/* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */
-	at91_init_leds(AT91_PIN_PB16, AT91_PIN_PB17);
-
 	/* DBGU on ttyS0. (Rx & Tx only) */
 	at91_register_uart(0, 0, 0);
 
arch/arm/mach-at91/include/mach/board.h +0 -1
index ed544a0..c2a7746 100644
@@ -200,7 +200,6 @@ struct at91_can_data {
 extern void __init at91_add_device_can(struct at91_can_data *data);
 
  /* LEDs */
-extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
 extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);
 extern void __init at91_pwm_leds(struct gpio_led *leds, int nr);
 
arch/arm/mach-at91/leds.c +0 -105

108 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#6 lore raw

PATCH v3 4/18 mach-realview and mach-versatile: retire custom LED code

In reply to Bryan Wu

From: Linus Walleij <[email protected]>

This replaces the custom LED trigger code in mach-realview with some overarching platform code for the plat-versatile family that will lock down LEDs 2 thru 5 for CPU activity indication. The day we have 8 core ARM systems the plat-versatile code will have to become more elaborate.

Tested on RealView PB11MPCore by invoking four different CPU hogs (yes > /dev/null&) and see the LEDs go on one at a time. They all go off as the hogs are killed. Tested on the PB1176 as well - just one activity led (led 2) goes on and off with CPU activity.

(bryan.wu at canonical.com: use ledtrig-cpu instead of ledtrig-arm-cpu)

---
 arch/arm/mach-realview/core.c            |   39 ---------------------------
 arch/arm/mach-realview/core.h            |    2 -
 arch/arm/mach-realview/realview_eb.c     |    4 ---
 arch/arm/mach-realview/realview_pb1176.c |    4 ---
 arch/arm/mach-realview/realview_pb11mp.c |    4 ---
 arch/arm/mach-realview/realview_pba8.c   |    4 ---
 arch/arm/mach-realview/realview_pbx.c    |    4 ---
 arch/arm/mach-versatile/core.c           |   42 ------------------------------
 arch/arm/plat-versatile/Kconfig          |    2 +-
 arch/arm/plat-versatile/leds.c           |   13 ++++++---
 10 files changed, 10 insertions(+), 108 deletions(-)
arch/arm/mach-realview/core.c +0 -39
index 5c23450..3a12b6b 100644
@@ -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)?
  */
arch/arm/mach-realview/core.h +0 -2
index 5c83d1e..47ee3bc 100644
@@ -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);
arch/arm/mach-realview/realview_eb.c +0 -4
index 7a4e3b1..8bdd783 100644
@@ -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;
 }
 
arch/arm/mach-realview/realview_pb1176.c +0 -4
index ad5671a..72bbe53 100644
@@ -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;
 }
 
arch/arm/mach-realview/realview_pb11mp.c +0 -4
index b43644b..e6eeffc 100644
@@ -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;
 }
 
arch/arm/mach-realview/realview_pba8.c +0 -4
index 763e8f3..f29c640 100644
@@ -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;
 }
 
arch/arm/mach-realview/realview_pbx.c +0 -4
index 363b0ab..61d30fa 100644
@@ -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;
 }
 
arch/arm/mach-versatile/core.c +0 -42

60 lines not on this page · raw message

arch/arm/plat-versatile/Kconfig +1 -1
index 52353be..bfcea07 100644
@@ -7,7 +7,7 @@ config PLAT_VERSATILE_FPGA_IRQ
 	bool
 
 config PLAT_VERSATILE_LEDS
-	def_bool y if LEDS_CLASS
+	def_bool y if NEW_LEDS
 	depends on ARCH_REALVIEW || ARCH_VERSATILE
 
 config PLAT_VERSATILE_SCHED_CLOCK
arch/arm/plat-versatile/leds.c +9 -4
index 3169fa5..50090c4 100644
@@ -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", "cpu0" },
+	{ "versatile:3", "cpu1" },
+	{ "versatile:4", "cpu2" },
+	{ "versatile:5", "cpu3" },
 	{ "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) {
Signature · 1 line
1.7.5
author
#7 lore raw

PATCH v3 5/18 mach-ks8695: remove leds driver, since nobody use it

In reply to Bryan Wu
---
 arch/arm/mach-ks8695/Makefile               |    3 -
 arch/arm/mach-ks8695/devices.c              |   21 ------
 arch/arm/mach-ks8695/include/mach/devices.h |    5 --
 arch/arm/mach-ks8695/leds.c                 |   93 ---------------------------
 4 files changed, 0 insertions(+), 122 deletions(-)
 delete mode 100644 arch/arm/mach-ks8695/leds.c
arch/arm/mach-ks8695/Makefile +0 -3
index 7e3e816..39c7d3c 100644
@@ -11,9 +11,6 @@ obj-				:=
 # PCI support is optional
 obj-$(CONFIG_PCI)		+= pci.o
 
-# LEDs
-obj-$(CONFIG_LEDS)		+= leds.o
-
 # Board-specific support
 obj-$(CONFIG_MACH_KS8695)	+= board-micrel.o
 obj-$(CONFIG_MACH_DSM320)	+= board-dsm320.o
arch/arm/mach-ks8695/devices.c +0 -21
index b89fb6d..5ebf45d 100644
@@ -181,27 +181,6 @@ static void __init ks8695_add_device_watchdog(void)
 }
 
 
-/* --------------------------------------------------------------------
- *  LEDs
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_LEDS)
-short ks8695_leds_cpu = -1;
-short ks8695_leds_timer = -1;
-
-void __init ks8695_init_leds(u8 cpu_led, u8 timer_led)
-{
-	/* Enable GPIO to access the LEDs */
-	gpio_direction_output(cpu_led, 1);
-	gpio_direction_output(timer_led, 1);
-
-	ks8695_leds_cpu	  = cpu_led;
-	ks8695_leds_timer = timer_led;
-}
-#else
-void __init ks8695_init_leds(u8 cpu_led, u8 timer_led) {}
-#endif
-
 /* -------------------------------------------------------------------- */
 
 /*
arch/arm/mach-ks8695/include/mach/devices.h +0 -5
index 85a3c9a..1e6594a 100644
@@ -18,11 +18,6 @@ extern void __init ks8695_add_device_wan(void);
 extern void __init ks8695_add_device_lan(void);
 extern void __init ks8695_add_device_hpna(void);
 
- /* LEDs */
-extern short ks8695_leds_cpu;
-extern short ks8695_leds_timer;
-extern void __init ks8695_init_leds(u8 cpu_led, u8 timer_led);
-
  /* PCI */
 #define KS8695_MODE_PCI		0
 #define KS8695_MODE_MINIPCI	1
arch/arm/mach-ks8695/leds.c deleted +0 -93

93 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#8 lore raw

PATCH v3 6/18 mach-shark: retire custom LED code

In reply to Bryan Wu

The CPU activity LED is now handled by the trigger in the leds subsystem, retire this old CONFIG_LEDS-based code.

---
 arch/arm/mach-shark/Makefile |    4 +-
 arch/arm/mach-shark/core.c   |    1 -
 arch/arm/mach-shark/leds.c   |  225 ++++++++++++++++--------------------------
 3 files changed, 87 insertions(+), 143 deletions(-)
arch/arm/mach-shark/Makefile +1 -3
index 45be9b0..2965718 100644
@@ -4,9 +4,7 @@
 
 # Object file lists.
 
-obj-y			:= core.o dma.o irq.o pci.o
+obj-y			:= core.o dma.o irq.o pci.o leds.o
 obj-m			:=
 obj-n			:=
 obj-			:=
-
-obj-$(CONFIG_LEDS)	+= leds.o
arch/arm/mach-shark/core.c +0 -1
index ac2873c..36b6b87 100644
@@ -13,7 +13,6 @@
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
-#include <asm/leds.h>
 #include <asm/param.h>
 
 #include <asm/mach/map.h>
arch/arm/mach-shark/leds.c +86 -139

252 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#9 lore raw

PATCH v3 7/18 mach-orion5x: convert custom LED code to gpio_led and LED CPU trigger

In reply to Bryan Wu
---
 arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c |    1 -
 arch/arm/mach-orion5x/rd88f5181l-ge-setup.c  |    1 -
 arch/arm/mach-orion5x/rd88f5182-setup.c      |   74 ++++++++------------------
 arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c |    1 -
 4 files changed, 23 insertions(+), 54 deletions(-)
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c +0 -1
index 291d22b..fb9c635 100644
@@ -19,7 +19,6 @@
 #include <net/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/gpio.h>
-#include <asm/leds.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/orion5x.h>
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c +0 -1
index 3f02362..f4d64e6 100644
@@ -20,7 +20,6 @@
 #include <net/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/gpio.h>
-#include <asm/leds.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/orion5x.h>
arch/arm/mach-orion5x/rd88f5182-setup.c +23 -51

105 lines not on this page · raw message

arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c +0 -1
index ad2eba9..0c5d1d2 100644
@@ -22,7 +22,6 @@
 #include <net/dsa.h>
 #include <asm/mach-types.h>
 #include <asm/gpio.h>
-#include <asm/leds.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/orion5x.h>
Signature · 1 line
1.7.5
author
#10 lore raw

PATCH v3 8/18 mach-integrator: move CM_CTRL to header file for accessing by other functions

In reply to Bryan Wu
---
 arch/arm/mach-integrator/core.c            |    2 --
 arch/arm/mach-integrator/include/mach/cm.h |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-integrator/core.c +0 -2
index 77315b9..3267cdd 100644
@@ -203,8 +203,6 @@ static struct amba_pl010_data integrator_uart_data = {
 	.set_mctrl = integrator_uart_set_mctrl,
 };
 
-#define CM_CTRL	IO_ADDRESS(INTEGRATOR_HDR_CTRL)
-
 static DEFINE_SPINLOCK(cm_lock);
 
 /**
arch/arm/mach-integrator/include/mach/cm.h +2 -0
index 445d57a..1a78692e 100644
@@ -3,6 +3,8 @@
  */
 void cm_control(u32, u32);
 
+#define CM_CTRL	IO_ADDRESS(INTEGRATOR_HDR_CTRL)
+
 #define CM_CTRL_LED			(1 << 0)
 #define CM_CTRL_nMBDET			(1 << 1)
 #define CM_CTRL_REMAP			(1 << 2)
Signature · 1 line
1.7.5
author
#11 lore raw

PATCH v3 9/18 mach-integrator: retire custom LED code

In reply to Bryan Wu

Use the LED in core module for CPU activity and also enable 4 debugging LEDs in baseboard.

The CPU activity LED is now handled by the trigger in the leds subsystem, retire this old CONFIG_LEDS-based code.

---
 arch/arm/mach-integrator/Makefile |    3 +-
 arch/arm/mach-integrator/core.c   |    1 -
 arch/arm/mach-integrator/leds.c   |  159 ++++++++++++++++++++++---------------
 3 files changed, 96 insertions(+), 67 deletions(-)
arch/arm/mach-integrator/Makefile +1 -2
index ebeef96..5521d18 100644
@@ -4,11 +4,10 @@
 
 # Object file lists.
 
-obj-y					:= core.o lm.o
+obj-y					:= core.o lm.o leds.o
 obj-$(CONFIG_ARCH_INTEGRATOR_AP)	+= integrator_ap.o
 obj-$(CONFIG_ARCH_INTEGRATOR_CP)	+= integrator_cp.o
 
-obj-$(CONFIG_LEDS)			+= leds.o
 obj-$(CONFIG_PCI)			+= pci_v3.o pci.o
 obj-$(CONFIG_CPU_FREQ_INTEGRATOR)	+= cpu.o
 obj-$(CONFIG_INTEGRATOR_IMPD1)		+= impd1.o
arch/arm/mach-integrator/core.c +0 -1
index 3267cdd..f9c638d 100644
@@ -28,7 +28,6 @@
 #include <asm/irq.h>
 #include <mach/cm.h>
 #include <asm/system.h>
-#include <asm/leds.h>
 #include <asm/mach/time.h>
 #include <asm/pgtable.h>
 
arch/arm/mach-integrator/leds.c +95 -64

186 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#12 lore raw

PATCH v3 10/18 mach-clps711x: retire custom LED code of P720T machine

In reply to Bryan Wu

Add tigger based LED driver into board file of P720T. Remove old LED driver file.

---
 arch/arm/mach-clps711x/Makefile            |    2 -
 arch/arm/mach-clps711x/include/mach/time.h |    2 -
 arch/arm/mach-clps711x/p720t-leds.c        |   67 ----------------------------
 arch/arm/mach-clps711x/p720t.c             |   60 +++++++++++++++++++++++++
 arch/arm/mach-clps711x/time.c              |    1 -
 5 files changed, 60 insertions(+), 72 deletions(-)
 delete mode 100644 arch/arm/mach-clps711x/p720t-leds.c
arch/arm/mach-clps711x/Makefile +0 -2
index 4a19731..af9dcce 100644
@@ -16,5 +16,3 @@ obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o
 obj-$(CONFIG_ARCH_EDB7211)  += edb7211-arch.o edb7211-mm.o
 obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o
 obj-$(CONFIG_ARCH_P720T)    += p720t.o
-leds-$(CONFIG_ARCH_P720T)   += p720t-leds.o
-obj-$(CONFIG_LEDS)          += $(leds-y)
arch/arm/mach-clps711x/include/mach/time.h +0 -2
index 61fef91..bafc325 100644
@@ -17,7 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <asm/leds.h>
 #include <asm/hardware/clps7111.h>
 
 extern void clps711x_setup_timer(void);
@@ -29,7 +28,6 @@ static irqreturn_t
 p720t_timer_interrupt(int irq, void *dev_id)
 {
 	struct pt_regs *regs = get_irq_regs();
-	do_leds();
 	xtime_update(1);
 #ifndef CONFIG_SMP
 	update_process_times(user_mode(regs));
arch/arm/mach-clps711x/p720t-leds.c deleted +0 -67

67 lines not on this page · raw message

arch/arm/mach-clps711x/p720t.c +60 -0

75 lines not on this page · raw message

arch/arm/mach-clps711x/time.c +0 -1
index d581ef0..d79fe79 100644
@@ -25,7 +25,6 @@
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/hardware/clps7111.h>
 
 #include <asm/mach/time.h>
Signature · 1 line
1.7.5
author
#13 lore raw

PATCH v3 11/18 mach-ebsa110: retire custom LED code

In reply to Bryan Wu
---
 arch/arm/mach-ebsa110/Makefile |    4 +-
 arch/arm/mach-ebsa110/leds.c   |   80 ++++++++++++++++++++++++----------------
 2 files changed, 49 insertions(+), 35 deletions(-)
arch/arm/mach-ebsa110/Makefile +1 -3
index 6520ac8..935e4af 100644
@@ -4,9 +4,7 @@
 
 # Object file lists.
 
-obj-y			:= core.o io.o
+obj-y			:= core.o io.o leds.o
 obj-m			:=
 obj-n			:=
 obj-			:=
-
-obj-$(CONFIG_LEDS)	+= leds.o
arch/arm/mach-ebsa110/leds.c +48 -32

99 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#14 lore raw

PATCH v3 12/18 mach-footbridge: retire custom LED code

In reply to Bryan Wu
---
 arch/arm/mach-footbridge/Makefile              |    4 -
 arch/arm/mach-footbridge/ebsa285-leds.c        |  139 ------------------------
 arch/arm/mach-footbridge/ebsa285.c             |   79 ++++++++++++++
 arch/arm/mach-footbridge/include/mach/system.h |    1 -
 arch/arm/mach-footbridge/netwinder-hw.c        |  110 ++++++++++++++++---
 arch/arm/mach-footbridge/netwinder-leds.c      |  139 ------------------------
 6 files changed, 175 insertions(+), 297 deletions(-)
 delete mode 100644 arch/arm/mach-footbridge/ebsa285-leds.c
 delete mode 100644 arch/arm/mach-footbridge/netwinder-leds.c
arch/arm/mach-footbridge/Makefile +0 -4
index 3afb1b2..0b64dd4 100644
@@ -14,15 +14,11 @@ pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o
 pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o
 pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o
 
-leds-$(CONFIG_ARCH_EBSA285) += ebsa285-leds.o
-leds-$(CONFIG_ARCH_NETWINDER) += netwinder-leds.o
-
 obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o
 obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o
 obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o
 obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o
 
 obj-$(CONFIG_PCI)	+=$(pci-y)
-obj-$(CONFIG_LEDS)	+=$(leds-y)
 
 obj-$(CONFIG_ISA)	+= isa.o isa-rtc.o
arch/arm/mach-footbridge/ebsa285-leds.c deleted +0 -139

139 lines not on this page · raw message

arch/arm/mach-footbridge/ebsa285.c +79 -0

91 lines not on this page · raw message

arch/arm/mach-footbridge/include/mach/system.h +0 -1
index 0b29315..c026efa 100644
@@ -10,7 +10,6 @@
 #include <linux/io.h>
 #include <asm/hardware/dec21285.h>
 #include <mach/hardware.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 
 static inline void arch_idle(void)
arch/arm/mach-footbridge/netwinder-hw.c +96 -14

139 lines not on this page · raw message

arch/arm/mach-footbridge/netwinder-leds.c deleted +0 -139

139 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#15 lore raw

PATCH v3 13/18 mach-pxa: retire custom LED code

In reply to Bryan Wu
---
 arch/arm/mach-pxa/Makefile         |    8 --
 arch/arm/mach-pxa/idp.c            |   79 +++++++++++++++++++++++
 arch/arm/mach-pxa/leds-idp.c       |  116 ---------------------------------
 arch/arm/mach-pxa/leds-lubbock.c   |  125 ------------------------------------
 arch/arm/mach-pxa/leds-mainstone.c |  120 ----------------------------------
 arch/arm/mach-pxa/leds.c           |   32 ---------
 arch/arm/mach-pxa/leds.h           |   13 ----
 arch/arm/mach-pxa/lubbock.c        |   93 ++++++++++++++++++++++++++
 arch/arm/mach-pxa/mainstone.c      |   92 ++++++++++++++++++++++++++
 9 files changed, 264 insertions(+), 414 deletions(-)
 delete mode 100644 arch/arm/mach-pxa/leds-idp.c
 delete mode 100644 arch/arm/mach-pxa/leds-lubbock.c
 delete mode 100644 arch/arm/mach-pxa/leds-mainstone.c
 delete mode 100644 arch/arm/mach-pxa/leds.c
 delete mode 100644 arch/arm/mach-pxa/leds.h
arch/arm/mach-pxa/Makefile +0 -8
index cc39d17..2d42d23 100644
@@ -95,12 +95,4 @@ obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR)	+= raumfeld.o
 obj-$(CONFIG_MACH_RAUMFELD_SPEAKER)	+= raumfeld.o
 obj-$(CONFIG_MACH_ZIPIT2)	+= z2.o
 
-# Support for blinky lights
-led-y := leds.o
-led-$(CONFIG_ARCH_LUBBOCK)	+= leds-lubbock.o
-led-$(CONFIG_MACH_MAINSTONE)	+= leds-mainstone.o
-led-$(CONFIG_ARCH_PXA_IDP)	+= leds-idp.o
-
-obj-$(CONFIG_LEDS)		+= $(led-y)
-
 obj-$(CONFIG_TOSA_BT)		+= tosa-bt.o
arch/arm/mach-pxa/idp.c +79 -0

85 lines not on this page · raw message

arch/arm/mach-pxa/leds-idp.c deleted +0 -116

116 lines not on this page · raw message

arch/arm/mach-pxa/leds-lubbock.c deleted +0 -125

125 lines not on this page · raw message

arch/arm/mach-pxa/leds-mainstone.c deleted +0 -120

120 lines not on this page · raw message

arch/arm/mach-pxa/leds.c deleted +0 -32
deleted file mode 100644
index bbe4d5f..0000000
@@ -1,32 +0,0 @@
-/*
- * linux/arch/arm/mach-pxa/leds.c
- *
- * xscale LEDs dispatcher
- *
- * Copyright (C) 2001 Nicolas Pitre
- *
- * Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc.
- */
-#include <linux/compiler.h>
-#include <linux/init.h>
-
-#include <asm/leds.h>
-#include <asm/mach-types.h>
-
-#include "leds.h"
-
-static int __init
-pxa_leds_init(void)
-{
-	if (machine_is_lubbock())
-		leds_event = lubbock_leds_event;
-	if (machine_is_mainstone())
-		leds_event = mainstone_leds_event;
-	if (machine_is_pxa_idp())
-		leds_event = idp_leds_event;
-
-	leds_event(led_start);
-	return 0;
-}
-
-core_initcall(pxa_leds_init);
arch/arm/mach-pxa/leds.h deleted +0 -13
deleted file mode 100644
index 7f0dfe0..0000000
@@ -1,13 +0,0 @@
-/*
- * arch/arm/mach-pxa/leds.h
- *
- * Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc.
- *
- * blinky lights for various PXA-based systems:
- *
- */
-
-extern void idp_leds_event(led_event_t evt);
-extern void lubbock_leds_event(led_event_t evt);
-extern void mainstone_leds_event(led_event_t evt);
-extern void trizeps4_leds_event(led_event_t evt);
arch/arm/mach-pxa/lubbock.c +93 -0

111 lines not on this page · raw message

arch/arm/mach-pxa/mainstone.c +92 -0

104 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#16 lore raw

PATCH v3 14/18 plat-samsung: remove including old leds event API header file

In reply to Bryan Wu
---
 arch/arm/plat-samsung/time.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/time.c +0 -1
index e3bb806..a65ef40 100644
@@ -29,7 +29,6 @@
 #include <linux/platform_device.h>
 
 #include <asm/system.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 
 #include <asm/irq.h>
Signature · 1 line
1.7.5
author
#17 lore raw

PATCH v3 15/18 mach-pnx4008: remove including old leds event API header file

In reply to Bryan Wu
---
 arch/arm/mach-pnx4008/time.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-pnx4008/time.c +0 -1
index 0c8aad4..4385793 100644
@@ -26,7 +26,6 @@
 
 #include <asm/system.h>
 #include <mach/hardware.h>
-#include <asm/leds.h>
 #include <asm/mach/time.h>
 #include <asm/errno.h>
 
Signature · 1 line
1.7.5
author
#18 lore raw

PATCH v3 16/18 mach-omap1: retire custom LED code

In reply to Bryan Wu
---
 arch/arm/mach-omap1/Makefile          |    8 -
 arch/arm/mach-omap1/board-h2.c        |   34 ++++-
 arch/arm/mach-omap1/board-h3.c        |   34 ++++-
 arch/arm/mach-omap1/board-osk.c       |   33 ++++
 arch/arm/mach-omap1/leds-h2p2-debug.c |  167 -------------------
 arch/arm/mach-omap1/leds-innovator.c  |   99 -----------
 arch/arm/mach-omap1/leds-osk.c        |  115 -------------
 arch/arm/mach-omap1/leds.c            |   69 --------
 arch/arm/mach-omap1/leds.h            |    3 -
 arch/arm/mach-omap1/time.c            |    1 -
 arch/arm/mach-omap1/timer32k.c        |    1 -
 arch/arm/plat-omap/Kconfig            |    3 +-
 arch/arm/plat-omap/debug-leds.c       |  292 ++++++++-------------------------
 13 files changed, 166 insertions(+), 693 deletions(-)
 delete mode 100644 arch/arm/mach-omap1/leds-h2p2-debug.c
 delete mode 100644 arch/arm/mach-omap1/leds-innovator.c
 delete mode 100644 arch/arm/mach-omap1/leds-osk.c
 delete mode 100644 arch/arm/mach-omap1/leds.c
 delete mode 100644 arch/arm/mach-omap1/leds.h
arch/arm/mach-omap1/Makefile +0 -8
index 5b114d1..4d2a140 100644
@@ -54,14 +54,6 @@ obj-$(CONFIG_ARCH_OMAP850)		+= gpio7xx.o
 obj-$(CONFIG_ARCH_OMAP15XX)		+= gpio15xx.o
 obj-$(CONFIG_ARCH_OMAP16XX)		+= gpio16xx.o
 
-# LEDs support
-led-$(CONFIG_MACH_OMAP_H2)		+= leds-h2p2-debug.o
-led-$(CONFIG_MACH_OMAP_H3)		+= leds-h2p2-debug.o
-led-$(CONFIG_MACH_OMAP_INNOVATOR)	+= leds-innovator.o
-led-$(CONFIG_MACH_OMAP_PERSEUS2)	+= leds-h2p2-debug.o
-led-$(CONFIG_MACH_OMAP_OSK)		+= leds-osk.o
-obj-$(CONFIG_LEDS)			+= $(led-y)
-
 ifneq ($(CONFIG_FB_OMAP),)
 obj-y += lcd_dma.o
 endif
arch/arm/mach-omap1/board-h2.c +33 -1
index cb7fb1a..a9f32fc 100644
@@ -30,9 +30,10 @@
 #include <linux/input.h>
 #include <linux/i2c/tps65010.h>
 #include <linux/smc91x.h>
+#include <linux/leds.h>
+#include <linux/gpio.h>
 
 #include <mach/hardware.h>
-#include <asm/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -331,6 +332,32 @@ static struct platform_device h2_lcd_device = {
 	.id		= -1,
 };
 
+static struct gpio_led h2_gpio_led_pins[] = {
+	{
+		.name		= "h2:red",
+		.default_trigger = "heartbeat",
+		.gpio		= 3,
+	},
+	{
+		.name		= "h2:green",
+		.default_trigger = "cpu0",
+		.gpio		= OMAP_MPUIO(4),
+	},
+};
+
+static struct gpio_led_platform_data h2_gpio_led_data = {
+	.leds		= h2_gpio_led_pins,
+	.num_leds	= ARRAY_SIZE(h2_gpio_led_pins),
+};
+
+static struct platform_device h2_gpio_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data = &h2_gpio_led_data,
+	},
+};
+
 static struct platform_device *h2_devices[] __initdata = {
 	&h2_nor_device,
 	&h2_nand_device,
@@ -338,6 +365,7 @@ static struct platform_device *h2_devices[] __initdata = {
 	&h2_irda_device,
 	&h2_kp_device,
 	&h2_lcd_device,
+	&h2_gpio_leds,
 };
 
 static void __init h2_init_smc91x(void)
@@ -444,6 +472,10 @@ static void __init h2_init(void)
 	omap_cfg_reg(E19_1610_KBR4);
 	omap_cfg_reg(N19_1610_KBR5);
 
+	/* GPIO based LEDs */
+	omap_cfg_reg(P18_1610_GPIO3);
+	omap_cfg_reg(MPUIO4);
+
 	platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
 	omap_board_config = h2_config;
 	omap_board_config_size = ARRAY_SIZE(h2_config);
arch/arm/mach-omap1/board-h3.c +33 -1
index 31f3487..8845734 100644
@@ -30,11 +30,12 @@
 #include <linux/spi/spi.h>
 #include <linux/i2c/tps65010.h>
 #include <linux/smc91x.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
 
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <mach/hardware.h>
-#include <asm/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -344,6 +345,32 @@ static struct spi_board_info h3_spi_board_info[] __initdata = {
 	},
 };
 
+static struct gpio_led h3_gpio_led_pins[] = {
+	{
+		.name		= "h3:red",
+		.default_trigger = "heartbeat",
+		.gpio		= 3,
+	},
+	{
+		.name		= "h3:green",
+		.default_trigger = "cpu0",
+		.gpio		= OMAP_MPUIO(4),
+	},
+};
+
+static struct gpio_led_platform_data h3_gpio_led_data = {
+	.leds		= h3_gpio_led_pins,
+	.num_leds	= ARRAY_SIZE(h3_gpio_led_pins),
+};
+
+static struct platform_device h3_gpio_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data = &h3_gpio_led_data,
+	},
+};
+
 static struct platform_device *devices[] __initdata = {
 	&nor_device,
 	&nand_device,
@@ -351,6 +378,7 @@ static struct platform_device *devices[] __initdata = {
 	&intlat_device,
 	&h3_kp_device,
 	&h3_lcd_device,
+	&h3_gpio_leds,
 };
 
 static struct omap_usb_config h3_usb_config __initdata = {
@@ -424,6 +452,10 @@ static void __init h3_init(void)
 	omap_cfg_reg(E19_1610_KBR4);
 	omap_cfg_reg(N19_1610_KBR5);
 
+	/* GPIO based LEDs */
+	omap_cfg_reg(P18_1610_GPIO3);
+	omap_cfg_reg(MPUIO4);
+
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 	spi_register_board_info(h3_spi_board_info,
 				ARRAY_SIZE(h3_spi_board_info));
arch/arm/mach-omap1/board-osk.c +33 -0
index b08a213..4ebf135 100644
@@ -398,10 +398,37 @@ static struct platform_device osk5912_lcd_device = {
 	.id		= -1,
 };
 
+static struct gpio_led mistral_gpio_led_pins[] = {
+	{
+		.name		= "mistral:red",
+		.default_trigger = "heartbeat",
+		.gpio		= 3,
+	},
+	{
+		.name		= "mistral:green",
+		.default_trigger = "cpu0",
+		.gpio		= OMAP_MPUIO(4),
+	},
+};
+
+static struct gpio_led_platform_data mistral_gpio_led_data = {
+	.leds		= mistral_gpio_led_pins,
+	.num_leds	= ARRAY_SIZE(mistral_gpio_led_pins),
+};
+
+static struct platform_device mistral_gpio_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data = &mistral_gpio_led_data,
+	},
+};
+
 static struct platform_device *mistral_devices[] __initdata = {
 	&osk5912_kp_device,
 	&mistral_bl_device,
 	&osk5912_lcd_device,
+	&mistral_gpio_leds,
 };
 
 static int mistral_get_pendown_state(void)
@@ -526,6 +553,12 @@ static void __init osk_mistral_init(void)
 	if (gpio_request(2, "lcd_pwr") == 0)
 		gpio_direction_output(2, 1);
 
+	/*
+	 * GPIO based LEDs
+	 */
+	omap_cfg_reg(P18_1610_GPIO3);
+	omap_cfg_reg(MPUIO4);
+
 	i2c_register_board_info(1, mistral_i2c_board_info,
 			ARRAY_SIZE(mistral_i2c_board_info));
 
arch/arm/mach-omap1/leds-h2p2-debug.c deleted +0 -167

167 lines not on this page · raw message

arch/arm/mach-omap1/leds-innovator.c deleted +0 -99

99 lines not on this page · raw message

arch/arm/mach-omap1/leds-osk.c deleted +0 -115

115 lines not on this page · raw message

arch/arm/mach-omap1/leds.c deleted +0 -69

69 lines not on this page · raw message

arch/arm/mach-omap1/leds.h deleted +0 -3
deleted file mode 100644
index a1e9fed..0000000
@@ -1,3 +0,0 @@
-extern void innovator_leds_event(led_event_t evt);
-extern void h2p2_dbg_leds_event(led_event_t evt);
-extern void osk_leds_event(led_event_t evt);
arch/arm/mach-omap1/time.c +0 -1
index a183777..8abb067 100644
@@ -47,7 +47,6 @@
 
 #include <asm/system.h>
 #include <mach/hardware.h>
-#include <asm/leds.h>
 #include <asm/irq.h>
 #include <asm/sched_clock.h>
 
arch/arm/mach-omap1/timer32k.c +0 -1
index 96604a5..85870a8 100644
@@ -48,7 +48,6 @@
 
 #include <asm/system.h>
 #include <mach/hardware.h>
-#include <asm/leds.h>
 #include <asm/irq.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
arch/arm/plat-omap/Kconfig +1 -2
index 6e6735f..b2fb233 100644
@@ -34,9 +34,8 @@ config OMAP_DEBUG_DEVICES
 	  For debug cards on TI reference boards.
 
 config OMAP_DEBUG_LEDS
-	bool
+	def_bool y if NEW_LEDS
 	depends on OMAP_DEBUG_DEVICES
-	default y if LEDS_CLASS
 
 config OMAP_SMARTREFLEX
 	bool "SmartReflex support"
arch/arm/plat-omap/debug-leds.c +66 -226

359 lines not on this page · raw message

Signature · 1 line
1.7.5
author
#19 lore raw

PATCH v3 17/18 mach-sa1100: retire custom LED code

In reply to Bryan Wu
---
 arch/arm/mach-sa1100/Makefile       |    9 ---
 arch/arm/mach-sa1100/assabet.c      |   83 +++++++++++++++++++++++++
 arch/arm/mach-sa1100/badge4.c       |   30 +++++++++
 arch/arm/mach-sa1100/cerf.c         |   42 +++++++++++++
 arch/arm/mach-sa1100/hackkit.c      |   32 ++++++++++
 arch/arm/mach-sa1100/lart.c         |   26 ++++++++
 arch/arm/mach-sa1100/leds-assabet.c |  114 -----------------------------------
 arch/arm/mach-sa1100/leds-badge4.c  |  111 ----------------------------------
 arch/arm/mach-sa1100/leds-cerf.c    |  110 ---------------------------------
 arch/arm/mach-sa1100/leds-hackkit.c |  112 ----------------------------------
 arch/arm/mach-sa1100/leds-lart.c    |  101 -------------------------------
 arch/arm/mach-sa1100/leds.c         |   50 ---------------
 arch/arm/mach-sa1100/leds.h         |   13 ----
 13 files changed, 213 insertions(+), 620 deletions(-)
 delete mode 100644 arch/arm/mach-sa1100/leds-assabet.c
 delete mode 100644 arch/arm/mach-sa1100/leds-badge4.c
 delete mode 100644 arch/arm/mach-sa1100/leds-cerf.c
 delete mode 100644 arch/arm/mach-sa1100/leds-hackkit.c
 delete mode 100644 arch/arm/mach-sa1100/leds-lart.c
 delete mode 100644 arch/arm/mach-sa1100/leds.c
 delete mode 100644 arch/arm/mach-sa1100/leds.h
arch/arm/mach-sa1100/Makefile +0 -9
index 0063178..5f5f491 100644
@@ -7,21 +7,17 @@ obj-y := clock.o generic.o gpio.o irq.o dma.o time.o #nmi-oopser.o
 obj-m :=
 obj-n :=
 obj-  :=
-led-y := leds.o
 
 obj-$(CONFIG_CPU_FREQ_SA1100)		+= cpu-sa1100.o
 obj-$(CONFIG_CPU_FREQ_SA1110)		+= cpu-sa1110.o
 
 # Specific board support
 obj-$(CONFIG_SA1100_ASSABET)		+= assabet.o
-led-$(CONFIG_SA1100_ASSABET)		+= leds-assabet.o
 obj-$(CONFIG_ASSABET_NEPONSET)		+= neponset.o
 
 obj-$(CONFIG_SA1100_BADGE4)		+= badge4.o
-led-$(CONFIG_SA1100_BADGE4)		+= leds-badge4.o
 
 obj-$(CONFIG_SA1100_CERF)		+= cerf.o
-led-$(CONFIG_SA1100_CERF)		+= leds-cerf.o
 
 obj-$(CONFIG_SA1100_COLLIE)		+= collie.o
 
@@ -29,13 +25,11 @@ obj-$(CONFIG_SA1100_H3100)		+= h3100.o h3xxx.o
 obj-$(CONFIG_SA1100_H3600)		+= h3600.o h3xxx.o
 
 obj-$(CONFIG_SA1100_HACKKIT)		+= hackkit.o
-led-$(CONFIG_SA1100_HACKKIT)		+= leds-hackkit.o
 
 obj-$(CONFIG_SA1100_JORNADA720)		+= jornada720.o
 obj-$(CONFIG_SA1100_JORNADA720_SSP)	+= jornada720_ssp.o
 
 obj-$(CONFIG_SA1100_LART)		+= lart.o
-led-$(CONFIG_SA1100_LART)		+= leds-lart.o
 
 obj-$(CONFIG_SA1100_NANOENGINE)		+= nanoengine.o
 obj-$(CONFIG_PCI_NANOENGINE)		+= pci-nanoengine.o
@@ -46,9 +40,6 @@ obj-$(CONFIG_SA1100_SHANNON)		+= shannon.o
 
 obj-$(CONFIG_SA1100_SIMPAD)		+= simpad.o
 
-# LEDs support
-obj-$(CONFIG_LEDS) += $(led-y)
-
 # Miscellaneous functions
 obj-$(CONFIG_PM)			+= pm.o sleep.o
 obj-$(CONFIG_SA1100_SSP)		+= ssp.o
arch/arm/mach-sa1100/assabet.c +83 -0

95 lines not on this page · raw message

arch/arm/mach-sa1100/badge4.c +30 -0
index b4311b0..2e370c6c 100644
@@ -22,6 +22,8 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/errno.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -69,8 +71,36 @@ static struct platform_device sa1111_device = {
 	.resource	= sa1111_resources,
 };
 
+/* LEDs */
+struct gpio_led badge4_gpio_leds[] = {
+	{
+		.name			= "badge4:red",
+		.default_trigger	= "heartbeat",
+		.gpio			= 7,
+	},
+	{
+		.name			= "badge4:green",
+		.default_trigger	= "cpu0",
+		.gpio			= 9,
+	},
+};
+
+static struct gpio_led_platform_data badge4_gpio_led_info = {
+	.leds		= badge4_gpio_leds,
+	.num_leds	= ARRAY_SIZE(badge4_gpio_leds),
+};
+
+static struct platform_device badge4_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &badge4_gpio_led_info,
+	}
+};
+
 static struct platform_device *devices[] __initdata = {
 	&sa1111_device,
+	&badge4_leds;
 };
 
 static int __init badge4_sa1111_init(void)
arch/arm/mach-sa1100/cerf.c +42 -0

56 lines not on this page · raw message

arch/arm/mach-sa1100/hackkit.c +32 -0
index db5e434..7c72323 100644
@@ -21,6 +21,10 @@
 #include <linux/serial_core.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/tty.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -185,9 +189,37 @@ static struct resource hackkit_flash_resource = {
 	.flags		= IORESOURCE_MEM,
 };
 
+/* LEDs */
+struct gpio_led hackkit_gpio_leds[] = {
+	{
+		.name			= "hackkit:red",
+		.default_trigger	= "cpu0",
+		.gpio			= 22,
+	},
+	{
+		.name			= "hackkit:green",
+		.default_trigger	= "heartbeat",
+		.gpio			= 23,
+	},
+};
+
+static struct gpio_led_platform_data hackkit_gpio_led_info = {
+	.leds		= hackkit_gpio_leds,
+	.num_leds	= ARRAY_SIZE(hackkit_gpio_leds),
+};
+
+static struct platform_device hackkit_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &hackkit_gpio_led_info,
+	}
+};
+
 static void __init hackkit_init(void)
 {
 	sa11x0_register_mtd(&hackkit_flash_data, &hackkit_flash_resource, 1);
+	platform_device_register(&hackkit_leds);
 }
 
 /**********************************************************************
arch/arm/mach-sa1100/lart.c +26 -0
index 7b9556b..69f21e7 100644
@@ -5,6 +5,9 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/tty.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
 
 #include <mach/hardware.h>
 #include <asm/setup.h>
@@ -45,6 +48,27 @@ static struct map_desc lart_io_desc[] __initdata = {
 	}
 };
 
+/* LEDs */
+struct gpio_led lart_gpio_leds[] = {
+	{
+		.name			= "lart:red",
+		.default_trigger	= "cpu0",
+		.gpio			= 23,
+	},
+};
+
+static struct gpio_led_platform_data lart_gpio_led_info = {
+	.leds		= lart_gpio_leds,
+	.num_leds	= ARRAY_SIZE(lart_gpio_leds),
+};
+
+static struct platform_device lart_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &lart_gpio_led_info,
+	}
+};
 static void __init lart_map_io(void)
 {
 	sa1100_map_io();
@@ -58,6 +82,8 @@ static void __init lart_map_io(void)
 	GPDR |= GPIO_UART_TXD;
 	GPDR &= ~GPIO_UART_RXD;
 	PPAR |= PPAR_UPR;
+
+	platform_device_register(&lart_leds);
 }
 
 MACHINE_START(LART, "LART")
arch/arm/mach-sa1100/leds-assabet.c deleted +0 -114

114 lines not on this page · raw message

arch/arm/mach-sa1100/leds-badge4.c deleted +0 -111

111 lines not on this page · raw message

arch/arm/mach-sa1100/leds-cerf.c deleted +0 -110

110 lines not on this page · raw message

arch/arm/mach-sa1100/leds-hackkit.c deleted +0 -112

112 lines not on this page · raw message

arch/arm/mach-sa1100/leds-lart.c deleted +0 -101

101 lines not on this page · raw message

arch/arm/mach-sa1100/leds.c deleted +0 -50

50 lines not on this page · raw message

arch/arm/mach-sa1100/leds.h deleted +0 -13
deleted file mode 100644
index 776b602..0000000
@@ -1,13 +0,0 @@
-extern void assabet_leds_event(led_event_t evt);
-extern void badge4_leds_event(led_event_t evt);
-extern void consus_leds_event(led_event_t evt);
-extern void brutus_leds_event(led_event_t evt);
-extern void cerf_leds_event(led_event_t evt);
-extern void flexanet_leds_event(led_event_t evt);
-extern void graphicsclient_leds_event(led_event_t evt);
-extern void hackkit_leds_event(led_event_t evt);
-extern void lart_leds_event(led_event_t evt);
-extern void pfs168_leds_event(led_event_t evt);
-extern void graphicsmaster_leds_event(led_event_t evt);
-extern void adsbitsy_leds_event(led_event_t evt);
-extern void system3_leds_event(led_event_t evt);
Signature · 1 line
1.7.5
#20 lore raw

PATCH 17/18 mach-sa1100: retire custom LED code

Hi Bryan,

Quoted 37 lines
arch/arm/mach-sa1100/badge4.c +22 -0
index b4311b0..2e370c6c 100644
@@ -22,6 +22,8 @@
  #include<linux/mtd/mtd.h>
  #include<linux/mtd/partitions.h>
  #include<linux/errno.h>
+#include<linux/gpio.h>
+#include<linux/leds.h>
 
  #include<mach/hardware.h>
  #include<asm/mach-types.h>
@@ -69,8 +71,36 @@ static struct platform_device sa1111_device = {
  	.resource	= sa1111_resources,
  };
 
+/* LEDs */
+struct gpio_led badge4_gpio_leds[] = {
+	{
+		.name			= "badge4:red",
+		.default_trigger	= "heartbeat",
+		.gpio			= 7,
+	},
+	{
+		.name			= "badge4:green",
+		.default_trigger	= "cpu0",
+		.gpio			= 9,
+	},
+};
+
+static struct gpio_led_platform_data badge4_gpio_led_info = {
+	.leds		= badge4_gpio_leds,
+	.num_leds	= ARRAY_SIZE(badge4_gpio_leds),
+};
+
+static struct platform_device badge4_leds = {

arch/arm/mach-sa1100/badge4.c static struct platform_device sa1111_device = { · line 103

Quoted 10 lines
arch/arm/mach-sa1100/badge4.c +8 -0
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	=&badge4_gpio_led_info,
+	}
+};
+
  static struct platform_device *devices[] __initdata = {
  	&sa1111_device,
+	&badge4_leds;

Typo. This should be &badge4_leds,

arch/arm/mach-sa1100/badge4.c static struct platform_device sa1111_device = { · line 106

Quoted 3 lines
arch/arm/mach-sa1100/badge4.c +0 -0
  };
 
  static int __init badge4_sa1111_init(void)

Thanks,
Jochen

author
#21 lore raw

PATCH v3 17/18 mach-sa1100: retire custom LED code

Quoted 43 lines · Jochen Friedrich

Hi Bryan,

Quoted 41 lines
arch/arm/mach-sa1100/badge4.c +0 -0
index b4311b0..2e370c6c 100644
@@ -22,6 +22,8 @@

?#include<linux/mtd/mtd.h>
?#include<linux/mtd/partitions.h>
?#include<linux/errno.h>

arch/arm/mach-sa1100/badge4.c +2 -0
+#include<linux/gpio.h>
+#include<linux/leds.h>

?#include<mach/hardware.h>
?#include<asm/mach-types.h>

arch/arm/mach-sa1100/badge4.c +24 -0
@@ -69,8 +71,36 @@ static struct platform_device sa1111_device = {
 ? ? ? ?.resource ? ? ? = sa1111_resources,
 ?};
 
+/* LEDs */
+struct gpio_led badge4_gpio_leds[] = {
+ ? ? ? {
+ ? ? ? ? ? ? ? .name ? ? ? ? ? ? ? ? ? = "badge4:red",
+ ? ? ? ? ? ? ? .default_trigger ? ? ? ?= "heartbeat",
+ ? ? ? ? ? ? ? .gpio ? ? ? ? ? ? ? ? ? = 7,
+ ? ? ? },
+ ? ? ? {
+ ? ? ? ? ? ? ? .name ? ? ? ? ? ? ? ? ? = "badge4:green",
+ ? ? ? ? ? ? ? .default_trigger ? ? ? ?= "cpu0",
+ ? ? ? ? ? ? ? .gpio ? ? ? ? ? ? ? ? ? = 9,
+ ? ? ? },
+};
+
+static struct gpio_led_platform_data badge4_gpio_led_info = {
+ ? ? ? .leds ? ? ? ? ? = badge4_gpio_leds,
+ ? ? ? .num_leds ? ? ? = ARRAY_SIZE(badge4_gpio_leds),
+};
+
+static struct platform_device badge4_leds = {
+ ? ? ? .name ? = "leds-gpio",
+ ? ? ? .id ? ? = -1,
+ ? ? ? .dev ? ?= {
+ ? ? ? ? ? ? ? .platform_data ?=&badge4_gpio_led_info,
Quoted 9 lines

arch/arm/mach-sa1100/badge4.c static struct platform_device sa1111_device = { · line 103

Quoted 6 lines
arch/arm/mach-sa1100/badge4.c +4 -0
+ ? ? ? }
+};
+
 ?static struct platform_device *devices[] __initdata = {
 ? ? ? ?&sa1111_device,
+ ? ? ? &badge4_leds;

Typo. This should be &badge4_leds,

Thanks a lot, I will fix it and update my patches. -Bryan

author
#22 lore raw

PATCH v3 18/18 ARM: use new LEDS CPU trigger stub to replace old one

In reply to Bryan Wu
Cc Linus Walleij <[email protected]>
---
 arch/arm/Kconfig            |   53 -------------------
 arch/arm/include/asm/leds.h |   50 ------------------
 arch/arm/kernel/Makefile    |    1 -
 arch/arm/kernel/leds.c      |  119 -------------------------------------------
 arch/arm/kernel/process.c   |    6 +-
 arch/arm/kernel/time.c      |   17 ------
 6 files changed, 3 insertions(+), 243 deletions(-)
 delete mode 100644 arch/arm/include/asm/leds.h
 delete mode 100644 arch/arm/kernel/leds.c
arch/arm/Kconfig +0 -53
index 2c71a8f..f9d9f4a 100644
@@ -1592,59 +1592,6 @@ config FORCE_MAX_ZONEORDER
 	  This config option is actually maximum order plus one. For example,
 	  a value of 11 means that the largest free memory block is 2^10 pages.
 
-config LEDS
-	bool "Timer and CPU usage LEDs"
-	depends on ARCH_CDB89712 || ARCH_EBSA110 || \
-		   ARCH_EBSA285 || ARCH_INTEGRATOR || \
-		   ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
-		   ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
-		   ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
-		   ARCH_AT91 || ARCH_DAVINCI || \
-		   ARCH_KS8695 || MACH_RD88F5182 || ARCH_REALVIEW
-	help
-	  If you say Y here, the LEDs on your machine will be used
-	  to provide useful information about your current system status.
-
-	  If you are compiling a kernel for a NetWinder or EBSA-285, you will
-	  be able to select which LEDs are active using the options below. If
-	  you are compiling a kernel for the EBSA-110 or the LART however, the
-	  red LED will simply flash regularly to indicate that the system is
-	  still functional. It is safe to say Y here if you have a CATS
-	  system, but the driver will do nothing.
-
-config LEDS_TIMER
-	bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
-			    OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
-			    || MACH_OMAP_PERSEUS2
-	depends on LEDS
-	depends on !GENERIC_CLOCKEVENTS
-	default y if ARCH_EBSA110
-	help
-	  If you say Y here, one of the system LEDs (the green one on the
-	  NetWinder, the amber one on the EBSA285, or the red one on the LART)
-	  will flash regularly to indicate that the system is still
-	  operational. This is mainly useful to kernel hackers who are
-	  debugging unstable kernels.
-
-	  The LART uses the same LED for both Timer LED and CPU usage LED
-	  functions. You may choose to use both, but the Timer LED function
-	  will overrule the CPU usage LED.
-
-config LEDS_CPU
-	bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \
-			!ARCH_OMAP) \
-			|| OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
-			|| MACH_OMAP_PERSEUS2
-	depends on LEDS
-	help
-	  If you say Y here, the red LED will be used to give a good real
-	  time indication of CPU usage, by lighting whenever the idle task
-	  is not currently executing.
-
-	  The LART uses the same LED for both Timer LED and CPU usage LED
-	  functions. You may choose to use both, but the Timer LED function
-	  will overrule the CPU usage LED.
-
 config ALIGNMENT_TRAP
 	bool
 	depends on CPU_CP15_MMU
arch/arm/include/asm/leds.h deleted +0 -50

50 lines not on this page · raw message

arch/arm/kernel/Makefile +0 -1
index f7887dc..5c6c1b7 100644
@@ -19,7 +19,6 @@ obj-y		:= elf.o entry-armv.o entry-common.o irq.o \
 
 obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o
 
-obj-$(CONFIG_LEDS)		+= leds.o
 obj-$(CONFIG_OC_ETM)		+= etm.o
 
 obj-$(CONFIG_ISA_DMA_API)	+= dma.o
arch/arm/kernel/leds.c deleted +0 -119

119 lines not on this page · raw message

arch/arm/kernel/process.c +3 -3
index 1a347f4..4b24f18 100644
@@ -31,9 +31,9 @@
 #include <linux/random.h>
 #include <linux/hw_breakpoint.h>
 #include <linux/cpuidle.h>
+#include <linux/leds.h>
 
 #include <asm/cacheflush.h>
-#include <asm/leds.h>
 #include <asm/processor.h>
 #include <asm/system.h>
 #include <asm/thread_notify.h>
@@ -184,7 +184,7 @@ void cpu_idle(void)
 	/* endless idle loop with no priority at all */
 	while (1) {
 		tick_nohz_stop_sched_tick(1);
-		leds_event(led_idle_start);
+		ledtrig_cpu(CPU_LED_IDLE_START);
 		while (!need_resched()) {
 #ifdef CONFIG_HOTPLUG_CPU
 			if (cpu_is_offline(smp_processor_id()))
@@ -209,7 +209,7 @@ void cpu_idle(void)
 				local_irq_enable();
 			}
 		}
-		leds_event(led_idle_end);
+		ledtrig_cpu(CPU_LED_IDLE_END);
 		tick_nohz_restart_sched_tick();
 		preempt_enable_no_resched();
 		schedule();
arch/arm/kernel/time.c +0 -17
index cb634c3..a2a0c88 100644
@@ -27,7 +27,6 @@
 
 #include <linux/mc146818rtc.h>
 
-#include <asm/leds.h>
 #include <asm/thread_info.h>
 #include <asm/sched_clock.h>
 #include <asm/stacktrace.h>
@@ -84,21 +83,6 @@ u32 arch_gettimeoffset(void)
 }
 #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */
 
-#ifdef CONFIG_LEDS_TIMER
-static inline void do_leds(void)
-{
-	static unsigned int count = HZ/2;
-
-	if (--count == 0) {
-		count = HZ/2;
-		leds_event(led_timer);
-	}
-}
-#else
-#define	do_leds()
-#endif
-
-
 #ifndef CONFIG_GENERIC_CLOCKEVENTS
 /*
  * Kernel system timer support.
@@ -106,7 +90,6 @@ static inline void do_leds(void)
 void timer_tick(void)
 {
 	profile_tick(CPU_PROFILING);
-	do_leds();
 	xtime_update(1);
 #ifndef CONFIG_SMP
 	update_process_times(user_mode(get_irq_regs()));
Signature · 1 line
1.7.5