
#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

--- linux-2.6.11-rc1/arch/arm/mach-pxa/corgi.c~corgi_base_extras-r3.patch
+++ linux-2.6.11-rc1/arch/arm/mach-pxa/corgi.c
@@ -35,16 +35,96 @@
 #include <asm/arch/corgi.h>
 
 #include <asm/hardware/scoop.h>
+#include <video/w100fb.h>
 
 #include "generic.h"
 
+
+/*
+ * Corgi SSP Device
+ */
 extern void corgi_ssp_lcdtg_send (u8 adrs, u8 data);
 
-static void __init corgi_init_irq(void)
-{
-	pxa_init_irq();
-}
+static struct platform_device corgissp_device = {
+	.name		= "corgi-ssp",
+	.id		= -1,
+};
+
+
+/*
+ * Corgi w100 Frame Buffer Device
+ */
+static struct w100fb_mach_info corgi_fb_info = {
+	.w100fb_ssp_send 	= corgi_ssp_lcdtg_send,
+	.comadj 			= -1,
+	.phadadj 			= -1,
+};
+
+static struct resource corgi_fb_resources[] = {
+	[0] = {
+		.start		= 0x08000000,
+		.end		= 0x08ffffff,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device corgifb_device = {
+	.name		= "w100fb",
+	.id		= -1,
+	.dev		= {
+ 		.platform_data	= &corgi_fb_info,
+ 		.parent = &corgissp_device.dev,
+	},
+	.num_resources	= ARRAY_SIZE(corgi_fb_resources),
+	.resource	= corgi_fb_resources,
+};
+
+
+/*
+ * Corgi Backlight Device
+ */
+static struct platform_device corgibl_device = {
+	.name		= "corgi-bl",
+	.dev		= {
+ 		.parent = &corgifb_device.dev,
+	},	
+	.id		= -1,
+};
+
 
+/*
+ * Corgi Battery and Power Device
+ */
+static struct platform_device corgibattery_device = {
+	.name		= "corgi-battery",
+	.id		= -1,
+};
+
+
+/*
+ * Corgi Keyboard Device
+ */
+static struct platform_device corgikbd_device = {
+	.name		= "corgi-keyboard",
+	.id		= -1,
+};
+
+
+/*
+ * Corgi Touch Screen Device
+ */
+static struct platform_device corgits_device = {
+	.name		= "corgi-ts",
+	.dev		= {
+ 		.parent = &corgissp_device.dev,
+	},		
+	.id		= -1,
+};
+
+
+/*
+ * Corgi SCOOP Device
+ */
 static struct resource corgi_scoop_resources[] = {
 	[0] = {
 		.start		= 0x10800000,
@@ -68,19 +148,21 @@
 	.resource	= corgi_scoop_resources,
 };
 
-static struct platform_device corgissp_device = {
-	.name		= "corgi-ssp",
-	.id		= -1,
-};
+
 
 static struct platform_device *devices[] __initdata = {
-	&corgiscoop_device,
 	&corgissp_device,
+	&corgiscoop_device,
+ 	&corgikbd_device,
+	&corgifb_device,
+	&corgibl_device,	
+ 	&corgibattery_device,
+ 	&corgits_device,
 };
 
 static struct sharpsl_flash_param_info sharpsl_flash_param;
 
-void corgi_get_param(void)
+static void corgi_get_param(void)
 {
 	sharpsl_flash_param.comadj_keyword = readl(FLASH_MEM_BASE + FLASH_COMADJ_MAGIC_ADR);
 	sharpsl_flash_param.comadj = readl(FLASH_MEM_BASE + FLASH_COMADJ_DATA_ADR);
@@ -91,6 +173,18 @@
 
 static void __init corgi_init(void)
 {
+	if (sharpsl_flash_param.comadj_keyword == FLASH_COMADJ_MAJIC) 
+		corgi_fb_info.comadj=sharpsl_flash_param.comadj;
+	else
+		corgi_fb_info.comadj=-1;
+
+	if (sharpsl_flash_param.phad_keyword == FLASH_PHAD_MAJIC) 
+		corgi_fb_info.phadadj=sharpsl_flash_param.phadadj;
+	else
+		corgi_fb_info.phadadj=-1;
+	
+	pxa_set_mci_info(&corgi_mci_platform_data);
+		
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 }
 
@@ -107,6 +201,11 @@
 		mi->bank[0].size = (64*1024*1024);
 }
 
+static void __init corgi_init_irq(void)
+{
+	pxa_init_irq();
+}
+
 static struct map_desc corgi_io_desc[] __initdata = {
 /*    virtual     physical    length      */
 /*	{ 0xf1000000, 0x08000000, 0x01000000, MT_DEVICE },*/ /* LCDC (readable for Qt driver) */
