This is the v2 patch, fixed comment from Sergei. >From 77a644b2dee131b237a1126c94835ba4a1f30fbf Mon Sep 17 00:00:00 2001 From: Hao Wu <hao.wu@xxxxxxxxx> Date: Mon, 29 Nov 2010 15:05:56 +0800 Subject: [PATCH] usb: composite gadget: set vbus_draw current limitation during suspend. This patch modifies the composite gadget to set vbus_draw current limitation during suspend state. This current limitation in suspend state shouldn't be more than 2.5mA Signed-off-by: Hao Wu <hao.wu@xxxxxxxxx> --- drivers/usb/gadget/composite.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 7b5cc16..2874451 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1188,6 +1188,8 @@ composite_suspend(struct usb_gadget *gadget) composite->suspend(cdev); cdev->suspended = 1; + + usb_gadget_vbus_draw(gadget, 2); } static void @@ -1195,6 +1197,7 @@ composite_resume(struct usb_gadget *gadget) { struct usb_composite_dev *cdev = get_gadget_data(gadget); struct usb_function *f; + u8 maxpower; /* REVISIT: should we have config level * suspend/resume callbacks? @@ -1207,6 +1210,11 @@ composite_resume(struct usb_gadget *gadget) if (f->resume) f->resume(f); } + + maxpower = cdev->config->bMaxPower; + + usb_gadget_vbus_draw(gadget, maxpower ? + (2 * maxpower) : CONFIG_USB_GADGET_VBUS_DRAW); } cdev->suspended = 0; -- 1.6.0.6 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html