 +#include <linux/err.h>
 +#include <asm/io.h>
 +
++/* note the board is not wired for read access from the LED buffer */
 +#define LEDS_BASE 0xfa000000
 +#define LEDS_SIZE 0x2
 +

+MODULE_AUTHOR("Jeremy Laine <jeremy.laine@bolloretelecom.eu>");
+MODULE_DESCRIPTION("MPC8313E-RDB LED driver");
+MODULE_LICENSE("GPL");
diff -urN linux-2.6.24.orig/drivers/leds/Makefile linux-2.6.24/drivers/leds/Makefile
--- linux-2.6.24.orig/drivers/leds/Makefile	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24/drivers/leds/Makefile	2008-02-08 08:12:38.000000000 +0100
@@ -19,6 +19,7 @@
 obj-$(CONFIG_LEDS_COBALT_RAQ)		+= leds-cobalt-raq.o
 obj-$(CONFIG_LEDS_GPIO)			+= leds-gpio.o

+	iowrite8(led_state, led_io);
+}
+
+/* led0 is red, led1 is yellow, led2-7 are green */
+static struct mpc8313_led mpc8313_leds[] = {
+	{
+		.cdev = {
+			.name		= "mpc8313:led0",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 128,
+	},
+	{
+		.cdev = {
+			.name		= "mpc8313:led1",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 64,
+	},
+	{
+		.cdev = {
+			.name		= "mpc8313:led2",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 32,
+	},
+	{
+		.cdev = {
+			.name		= "mpc8313:led3",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 16,
+	},
+	{
+		.cdev = {
+			.name		= "mpc8313:led4",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 8,
+	},
+	{
+		.cdev = {
+			.name		= "mpc8313:led5",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 4,
+	},
+	{
+		.cdev = {
+			.name		= "mpc8313:led6",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 2,
+	},
+	{
+		.cdev = {
+			.name		= "mpc8313:led7",
+			.brightness_set	= mpc8313leds_set,
+		},
+		.bitmask	= 1,
+	},
+};
+
