Skip to content

Commit

Permalink
sh: heartbeat consolidation for banked LEDs.
Browse files Browse the repository at this point in the history
This consolidates the various board heartbeat LED implementations,
used for strobing the load average across a LED bank. Those boards
not implementing a full bank can hook in via the LED class.

We leave the compat hook in the machvec for now until those non-banked
boards are able to migrate to the drivers/leds.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Feb 13, 2007
1 parent c7666e7 commit 3b4d953
Show file tree
Hide file tree
Showing 32 changed files with 260 additions and 571 deletions.
3 changes: 2 additions & 1 deletion arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ config HEARTBEAT
bool "Heartbeat LED"
depends on SH_MPC1211 || SH_SH03 || \
SH_BIGSUR || SOLUTION_ENGINE || \
SH_RTS7751R2D || SH_SH4202_MICRODEV || SH_LANDISK
SH_RTS7751R2D || SH_SH4202_MICRODEV || SH_LANDISK || \
SH_R7780RP
help
Use the power-on LED on your machine as a load meter. The exact
behavior is platform-dependent, but normally the flash frequency is
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/mpc1211/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the Interface (CTP/PCI/MPC-SH02) specific parts of the kernel
#

obj-y := setup.o rtc.o led.o
obj-y := setup.o rtc.o

obj-$(CONFIG_PCI) += pci.o

63 changes: 0 additions & 63 deletions arch/sh/boards/mpc1211/led.c

This file was deleted.

31 changes: 27 additions & 4 deletions arch/sh/boards/mpc1211/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <asm/io.h>
#include <asm/machvec.h>
#include <asm/mpc1211/mpc1211.h>
Expand Down Expand Up @@ -281,6 +282,32 @@ static int put_smb_blk(unsigned char *p, int address, int command, int no)
return 0;
}

static struct resource heartbeat_resources[] = {
[0] = {
.start = 0xa2000000,
.end = 0xa2000000 + 8 - 1,
.flags = IORESOURCE_MEM,
},
};

static struct platform_device heartbeat_device = {
.name = "heartbeat",
.id = -1,
.num_resources = ARRAY_SIZE(heartbeat_resources),
.resource = heartbeat_resources,
};

static struct platform_device *mpc1211_devices[] __initdata = {
&heartbeat_device,
};

static int __init mpc1211_devices_setup(void)
{
return platform_add_devices(mpc1211_devices,
ARRAY_SIZE(mpc1211_devices));
}
__initcall(mpc1211_devices_setup);

/* arch/sh/boards/mpc1211/rtc.c */
void mpc1211_time_init(void);

Expand Down Expand Up @@ -317,9 +344,5 @@ struct sh_machine_vector mv_mpc1211 __initmv = {
.mv_nr_irqs = 48,
.mv_irq_demux = mpc1211_irq_demux,
.mv_init_irq = init_mpc1211_IRQ,

#ifdef CONFIG_HEARTBEAT
.mv_heartbeat = heartbeat_mpc1211,
#endif
};
ALIAS_MV(mpc1211)
1 change: 0 additions & 1 deletion arch/sh/boards/renesas/r7780rp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

obj-y := setup.o io.o irq.o

obj-$(CONFIG_HEARTBEAT) += led.o
obj-$(CONFIG_PUSH_SWITCH) += psw.o
43 changes: 0 additions & 43 deletions arch/sh/boards/renesas/r7780rp/led.c

This file was deleted.

25 changes: 21 additions & 4 deletions arch/sh/boards/renesas/r7780rp/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <asm/clock.h>
#include <asm/io.h>

extern void heartbeat_r7780rp(void);
extern void init_r7780rp_IRQ(void);

static struct resource m66596_usb_host_resources[] = {
Expand Down Expand Up @@ -72,9 +71,30 @@ static struct platform_device cf_ide_device = {
.resource = cf_ide_resources,
};

static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };

static struct resource heartbeat_resources[] = {
[0] = {
.start = PA_OBLED,
.end = PA_OBLED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
.flags = IORESOURCE_MEM,
},
};

static struct platform_device heartbeat_device = {
.name = "heartbeat",
.id = -1,
.dev = {
.platform_data = heartbeat_bit_pos,
},
.num_resources = ARRAY_SIZE(heartbeat_resources),
.resource = heartbeat_resources,
};

static struct platform_device *r7780rp_devices[] __initdata = {
&m66596_usb_host_device,
&cf_ide_device,
&heartbeat_device,
};

static int __init r7780rp_devices_setup(void)
Expand Down Expand Up @@ -185,8 +205,5 @@ struct sh_machine_vector mv_r7780rp __initmv = {

.mv_ioport_map = r7780rp_ioport_map,
.mv_init_irq = init_r7780rp_IRQ,
#ifdef CONFIG_HEARTBEAT
.mv_heartbeat = heartbeat_r7780rp,
#endif
};
ALIAS_MV(r7780rp)
1 change: 0 additions & 1 deletion arch/sh/boards/renesas/rts7751r2d/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
#

obj-y := setup.o io.o irq.o
obj-$(CONFIG_HEARTBEAT) += led.o
44 changes: 0 additions & 44 deletions arch/sh/boards/renesas/rts7751r2d/led.c

This file was deleted.

19 changes: 16 additions & 3 deletions arch/sh/boards/renesas/rts7751r2d/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,24 @@ static struct platform_device uart_device = {
},
};

static struct resource heartbeat_resources[] = {
[0] = {
.start = PA_OUTPORT,
.end = PA_OUTPORT + 8 - 1,
.flags = IORESOURCE_MEM,
},
};

static struct platform_device heartbeat_device = {
.name = "heartbeat",
.id = -1,
.num_resources = ARRAY_SIZE(heartbeat_resources),
.resource = heartbeat_resources,
};

static struct platform_device *rts7751r2d_devices[] __initdata = {
&uart_device,
&heartbeat_device,
};

static int __init rts7751r2d_devices_setup(void)
Expand Down Expand Up @@ -129,9 +145,6 @@ struct sh_machine_vector mv_rts7751r2d __initmv = {
.mv_outsl = rts7751r2d_outsl,

.mv_init_irq = init_rts7751r2d_IRQ,
#ifdef CONFIG_HEARTBEAT
.mv_heartbeat = heartbeat_rts7751r2d,
#endif
.mv_irq_demux = rts7751r2d_irq_demux,

#ifdef CONFIG_USB_SM501
Expand Down
2 changes: 0 additions & 2 deletions arch/sh/boards/se/7206/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
#

obj-y := setup.o io.o irq.o
obj-$(CONFIG_HEARTBEAT) += led.o

57 changes: 0 additions & 57 deletions arch/sh/boards/se/7206/led.c

This file was deleted.

Loading

0 comments on commit 3b4d953

Please sign in to comment.