Author: nick
Date: 2012-05-25 16:32:08 +0100 (Fri, 25 May 2012)
New Revision: 1879
Modified:
balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/usb_gadget_vbus.patch
Log:
set vbusDraw to 2 ma on modprobe and suspend
Modified: balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/usb_gadget_vbus.patch
===================================================================
--- balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/usb_gadget_vbus.patch 2012-05-24 16:58:53 UTC (rev 1878)
+++ balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/usb_gadget_vbus.patch 2012-05-25 15:32:08 UTC (rev 1879)
@@ -1,7 +1,7 @@
Index: linux-2.6.39.4/drivers/usb/gadget/composite.c
===================================================================
---- linux-2.6.39.4.orig/drivers/usb/gadget/composite.c 2012-05-01 13:59:14.000000000 +0100
-+++ linux-2.6.39.4/drivers/usb/gadget/composite.c 2012-05-01 14:02:26.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/usb/gadget/composite.c 2012-05-24 17:46:57.000000000 +0100
++++ linux-2.6.39.4/drivers/usb/gadget/composite.c 2012-05-24 17:48:40.000000000 +0100
@@ -71,6 +71,10 @@
module_param(iSerialNumber, charp, 0);
MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
@@ -51,8 +51,8 @@
cdev->suspended = 0;
Index: linux-2.6.39.4/drivers/usb/gadget/pxa27x_udc.c
===================================================================
---- linux-2.6.39.4.orig/drivers/usb/gadget/pxa27x_udc.c 2012-05-01 14:02:26.000000000 +0100
-+++ linux-2.6.39.4/drivers/usb/gadget/pxa27x_udc.c 2012-05-01 14:02:26.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/usb/gadget/pxa27x_udc.c 2012-05-24 17:46:56.000000000 +0100
++++ linux-2.6.39.4/drivers/usb/gadget/pxa27x_udc.c 2012-05-25 16:07:08.000000000 +0100
@@ -42,7 +42,10 @@
#include <mach/udc.h>
@@ -65,14 +65,49 @@
/*
* This driver handles the USB Device Controller (UDC) in Intel's PXA 27x
* series processors.
-@@ -1695,6 +1698,10 @@
- struct pxa_udc *udc;
+@@ -1684,6 +1687,14 @@
+ return 0;
+ }
- udc = to_gadget_udc(_gadget);
+#ifdef CONFIG_BALLOON3_TT
++static void vbusDraw(unsigned mA)
++{
+ pr_info("%s: drawing %dma\n", __func__, mA);
+ samosa_write8((mA >= 500) ? SAMOSA_ADDR_USB_CHG_REG_SET : SAMOSA_ADDR_USB_CHG_REG_CLR, 1 << USB_CONFIGURED_BIT);
++}
+#endif
++
+ /**
+ * pxa_udc_vbus_draw - Called by gadget driver after SET_CONFIGURATION completed
+ * @_gadget: usb gadget
+@@ -1701,6 +1712,9 @@
+ struct pxa_udc *udc;
+
+ udc = to_gadget_udc(_gadget);
++#ifdef CONFIG_BALLOON3_TT
++ vbusDraw(mA);
++#endif
if (udc->transceiver)
return otg_set_power(udc->transceiver, mA);
return -EOPNOTSUPP;
+@@ -2487,6 +2501,10 @@
+ struct pxa_udc *udc = &memory;
+ int retval = 0, gpio;
+
++#ifdef CONFIG_BALLOON3_TT
++ // start from a known state
++ vbusDraw(2);
++#endif
+ regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!regs)
+ return -ENXIO;
+@@ -2622,6 +2640,9 @@
+ udc_disable(udc);
+ udc->pullup_resume = udc->pullup_on;
+ dplus_pullup(udc, 0);
++#ifdef CONFIG_BALLOON3_TT
++ vbusDraw(2);
++#endif
+
+ return 0;
+ }