Index: linux-2.6.13/arch/arm/mach-pxa/tosa.c
===================================================================
--- linux-2.6.13.orig/arch/arm/mach-pxa/tosa.c	2005-09-16 12:25:04.000000000 +0100
+++ linux-2.6.13/arch/arm/mach-pxa/tosa.c	2005-09-16 12:27:00.000000000 +0100
@@ -43,6 +43,7 @@
 
 #include "generic.h"
 
+static struct platform_device tosanssp_device;
 
 /*
  * SCOOP Device
@@ -160,7 +161,7 @@
 	.name		= "tc6393",
 	.id		= -1,
 	.dev		= {
-		.parent 	= &tosascoop_jc_device.dev,
+		.parent 	= &tosanssp_device.dev,
 	},
 	.num_resources	= ARRAY_SIZE(tc6393_resources),
 	.resource	= tc6393_resources,
@@ -189,13 +190,17 @@
 	.name		= "tosa-lcd",
 	.id		= -1,
 	.dev		= {
-		.parent 	= &tosanssp_device.dev,
+		.parent 	= &tc6393_device.dev,
 	},
 };
 
 static struct platform_device tosanssp_device = {
 	.name		= "tosa-nssp",
 	.id		= -1,
+	.dev		= {
+		.parent 	= &tosascoop_jc_device.dev,
+	},
+
 };
 
 /*
Index: linux-2.6.13/drivers/video/backlight/Kconfig
===================================================================
--- linux-2.6.13.orig/drivers/video/backlight/Kconfig	2005-09-16 12:24:59.000000000 +0100
+++ linux-2.6.13/drivers/video/backlight/Kconfig	2005-09-16 12:27:00.000000000 +0100
@@ -57,3 +57,10 @@
 	help
 	  If you have an iPAQ hx2750, say y to enable the backlight driver.
 
+config BACKLIGHT_TOSA
+	tristate "Sharp Tosa  Backlight Driver (SL-6000x Series)"
+	depends on BACKLIGHT_DEVICE && MACH_TOSA
+	default y
+	help
+	  If you have a Sharp Zaurus SL-6000x, say y to enable the
+	  backlight driver.
Index: linux-2.6.13/drivers/video/backlight/Makefile
===================================================================
--- linux-2.6.13.orig/drivers/video/backlight/Makefile	2005-09-16 12:24:59.000000000 +0100
+++ linux-2.6.13/drivers/video/backlight/Makefile	2005-09-16 12:28:36.000000000 +0100
@@ -1,5 +1,6 @@
 # Backlight & LCD drivers
 
+obj-$(CONFIG_BACKLIGHT_TOSA)	+= tosa_bl.o
 obj-$(CONFIG_LCD_CLASS_DEVICE)     += lcd.o
 obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
 obj-$(CONFIG_BACKLIGHT_CORGI)	+= corgi_bl.o
Index: linux-2.6.13/drivers/video/backlight/tosa_bl.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.13/drivers/video/backlight/tosa_bl.c	2005-09-16 12:27:00.000000000 +0100
@@ -0,0 +1,211 @@
+/*
+ *  Backlight Driver for Sharp Toas
+ *
+ *  Copyright (c) 2005 Dirk Opfer
+ *
+ *  Based on Sharp's 2.4 Backlight Driver
+ *  Based on corgi_bl.c
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/spinlock.h>
+#include <linux/fb.h>
+#include <linux/backlight.h>
+#include <asm/arch/pxa-regs.h> 
+
+#include <asm/arch-pxa/tosa.h>
+
+//extern void tosapwr_kick_battery(void);
+
+#define TOSA_MAX_INTENSITY 		255
+#define TOSA_DEFAULT_INTENSITY		68
+#define TOSA_LIMIT_MASK			0x0b
+
+static int tosabl_powermode = FB_BLANK_UNBLANK;
+static int current_intensity = 0;
+static int tosabl_limit = 0;
+static spinlock_t bl_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * Backlight control functions. 
+ */
+extern int tosa_set_backlight(int intensity);
+#if 0
+void bl_enable(int sw);
+int set_bl_bright(unsigned char dat);
+void SetBacklightVR(int value);
+
+
+#define SetBacklightDuty(a)	set_bl_bright(a);
+#endif
+static void tosabl_send_intensity(int intensity)
+{
+	unsigned long flags;
+	void (*tosa_kick_batt)(void);
+
+	if (tosabl_powermode != FB_BLANK_UNBLANK) {
+		intensity = 0;
+	} else {
+		if (tosabl_limit)
+			intensity &= TOSA_LIMIT_MASK;
+	}
+
+	tosa_set_backlight(intensity);
+
+#if 0	
+	tosa_kick_batt = symbol_get(tosapwr_kick_battery);
+	if (tosa_kick_batt) {
+		tosa_kick_batt();
+		symbol_put(tosapwr_kick_battery);
+	}
+#endif	
+	
+}
+
+static void tosabl_blank(int blank)
+{
+	switch(blank) {
+
+	case FB_BLANK_NORMAL:
+	case FB_BLANK_VSYNC_SUSPEND:
+	case FB_BLANK_HSYNC_SUSPEND:
+	case FB_BLANK_POWERDOWN:
+		if (tosabl_powermode == FB_BLANK_UNBLANK) {
+			tosabl_send_intensity(0);
+			tosabl_powermode = blank;
+		}
+		break;
+	case FB_BLANK_UNBLANK:
+		if (tosabl_powermode != FB_BLANK_UNBLANK) {
+			tosabl_powermode = blank;
+			tosabl_send_intensity(current_intensity);
+		}
+		break;
+	}
+}
+
+#ifdef CONFIG_PM
+static int tosabl_suspend(struct device *dev, u32 state, u32 level)
+{
+	if (level == SUSPEND_POWER_DOWN)
+		tosabl_blank(FB_BLANK_POWERDOWN);
+	return 0;
+}
+
+static int tosabl_resume(struct device *dev, u32 level)
+{
+	if (level == RESUME_POWER_ON)
+		tosabl_blank(FB_BLANK_UNBLANK);
+	return 0;
+}
+#else
+#define tosabl_suspend	NULL
+#define tosabl_resume	NULL
+#endif
+
+
+static int tosabl_set_power(struct backlight_device *bd, int state)
+{
+	tosabl_blank(state);
+	return 0;
+}
+
+static int tosabl_get_power(struct backlight_device *bd)
+{
+	return tosabl_powermode;
+}
+
+static int tosabl_set_intensity(struct backlight_device *bd, int intensity)
+{
+	if (intensity > TOSA_MAX_INTENSITY)
+		intensity = TOSA_MAX_INTENSITY;
+	tosabl_send_intensity(intensity);
+	current_intensity=intensity;
+	return 0;
+}
+
+static int tosabl_get_intensity(struct backlight_device *bd)
+{
+	return current_intensity;
+}
+
+/*
+ * Called when the battery is low to limit the backlight intensity.
+ * If limit==0 clear any limit, otherwise limit the intensity
+ */
+void tosabl_limit_intensity(int limit)
+{
+	tosabl_limit = (limit ? 1 : 0);
+	tosabl_send_intensity(current_intensity);
+}
+EXPORT_SYMBOL(tosabl_limit_intensity);
+
+
+static struct backlight_properties tosabl_data = {
+	.owner		= THIS_MODULE,
+	.get_power      = tosabl_get_power,
+	.set_power      = tosabl_set_power,
+	.max_brightness = TOSA_MAX_INTENSITY,
+	.get_brightness = tosabl_get_intensity,
+	.set_brightness = tosabl_set_intensity,
+};
+
+static struct backlight_device *tosa_backlight_device;
+
+static int __init tosabl_probe(struct device *dev)
+{
+	
+	tosa_backlight_device = backlight_device_register ("tosa-bl",
+		NULL, &tosabl_data);
+	if (IS_ERR (tosa_backlight_device))
+		return PTR_ERR (tosa_backlight_device);
+
+	tosabl_set_intensity(NULL, TOSA_DEFAULT_INTENSITY);
+
+	printk("TOSA Backlight Driver Initialized.\n");
+	return 0;
+}
+
+static int tosabl_remove(struct device *dev)
+{
+	backlight_device_unregister(tosa_backlight_device);
+
+	tosabl_set_intensity(NULL, 0);
+
+	printk("TOSA Backlight Driver Unloaded\n");
+	return 0;
+}
+
+static struct device_driver tosabl_driver = {
+	.name		= "tosa-bl",
+	.bus		= &platform_bus_type,
+	.probe		= tosabl_probe,
+	.remove		= tosabl_remove,
+	.suspend	= tosabl_suspend,
+	.resume		= tosabl_resume,
+};
+
+static int __init tosabl_init(void)
+{
+	return driver_register(&tosabl_driver);
+}
+
+static void __exit tosabl_exit(void)
+{
+ 	driver_unregister(&tosabl_driver);
+}
+
+device_initcall(tosabl_init);
+module_exit(tosabl_exit);
+
+MODULE_AUTHOR("Dirk Opfer");
+MODULE_DESCRIPTION("TOSA Backlight Driver");
+MODULE_LICENSE("GPLv2");

