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

--- linux-2.6.11-rc1/arch/arm/mach-pxa/corgi.c~corgi_base_extras-r7.patch
+++ linux-2.6.11-rc1/arch/arm/mach-pxa/corgi.c
@@ -33,7 +33,8 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/irq.h>
-#include <asm/arch/mmc.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/udc.h>
 #include <asm/arch/corgi.h>
 
 #include <asm/hardware/scoop.h>
@@ -117,6 +118,48 @@
 
 
 /*
+ * 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,
+};
+
+
+/*
  * MMC/SD Device
  *
  * The card detect interrupt isn't debounced so we delay it by HZ/4 
@@ -192,10 +235,35 @@
 };
 
 
+/*
+ * USB Device Controller
+ */
+static void corgi_udc_command(int cmd)
+{
+	switch(cmd)	{
+	case PXA2XX_UDC_CMD_CONNECT:
+		GPSR(CORGI_GPIO_USB_PULLUP) = GPIO_bit(CORGI_GPIO_USB_PULLUP);
+		break;
+	case PXA2XX_UDC_CMD_DISCONNECT:
+		GPCR(CORGI_GPIO_USB_PULLUP) = GPIO_bit(CORGI_GPIO_USB_PULLUP);
+		break;
+	}
+}
+ 
+static struct pxa2xx_udc_mach_info udc_info __initdata = {
+	/* no connect GPIO; corgi can't tell connection status */
+	.udc_command		= corgi_udc_command,
+};
+ 
+
 static struct platform_device *devices[] __initdata = {
 	&corgiscoop_device,
 	&corgissp_device,
 	&corgifb_device,
+ 	&corgikbd_device,
+	&corgibl_device,	
+ 	&corgibattery_device,
+ 	&corgits_device,	
 };
 
 static struct sharpsl_flash_param_info sharpsl_flash_param;
@@ -221,6 +289,8 @@
 	else
 		corgi_fb_info.phadadj=-1;
 
+	pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT);
+	pxa_set_udc_info(&udc_info);
 	pxa_set_mci_info(&corgi_mci_platform_data);		
 
 	platform_add_devices(devices, ARRAY_SIZE(devices));
--- linux-2.6.11-rc1/include/asm-arm/arch-pxa/corgi.h~corgi_base_extras-r7.patch
+++ linux-2.6.11-rc1/include/asm-arm/arch-pxa/corgi.h
@@ -39,6 +39,7 @@
 #define CORGI_GPIO_SD_PWR			(33) /* MMC/SD Power */
 #define CORGI_GPIO_CHRG_ON			(38)
 #define CORGI_GPIO_DISCHARGE_ON		(42)
+#define CORGI_GPIO_CHRG_UKN			(43)
 #define CORGI_GPIO_HSYNC			(44) /* LCD HSync Pulse */
 #define CORGI_GPIO_USB_PULLUP		(45)
 
