>From 84e4c7b0bffaa4d5955cc9936202687714fc614e Mon Sep 17 00:00:00 2001 From: Hao Wu <hao.wu@xxxxxxxxx> Date: Sat, 27 Nov 2010 13:30:59 +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 | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 7b5cc16..f427a4d 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 @@ -1207,6 +1209,9 @@ composite_resume(struct usb_gadget *gadget) if (f->resume) f->resume(f); } + + usb_gadget_vbus_draw(gadget, cdev->config->bMaxPower ? + (2 * cdev->config->bMaxPower) : 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