Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753463AbbGXELz (ORCPT ); Fri, 24 Jul 2015 00:11:55 -0400 Received: from mga09.intel.com ([134.134.136.24]:26277 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbbGXELw convert rfc822-to-8bit (ORCPT ); Fri, 24 Jul 2015 00:11:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,536,1432623600"; d="scan'208";a="770268252" From: "Du, Changbin" To: Andrzej Pietrasiewicz , Felipe Balbi CC: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] usb/gadget: make composite gadget meet usb compliance for vbus draw Thread-Topic: [PATCH] usb/gadget: make composite gadget meet usb compliance for vbus draw Thread-Index: AdDFQ/v32ELIUcFWTwaMp7sIW5cuU///mb2A//6andA= Date: Fri, 24 Jul 2015 04:11:41 +0000 Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A01D49C90@SHSMSX103.ccr.corp.intel.com> References: <0C18FE92A7765D4EB9EE5D38D86A563A01D14FD5@SHSMSX103.ccr.corp.intel.com> <55B0FA29.5080402@samsung.com> In-Reply-To: <55B0FA29.5080402@samsung.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2029 Lines: 65 Thanks, Pietrasiewicz. > From: Andrzej Pietrasiewicz [mailto:andrzej.p@samsung.com] > W dniu 23.07.2015 o 14:34, Du, Changbin pisze: > >>From 0a8e0d63a9887735c6782d7b0c15c2c1fdf1952a Mon Sep 17 00:00:00 > > void composite_disconnect(struct usb_gadget *gadget) > > { > > struct usb_composite_dev *cdev = get_gadget_data(gadget); > > @@ -2095,7 +2119,7 @@ void composite_suspend(struct usb_gadget > *gadget) > > > > cdev->suspended = 1; > > > > - usb_gadget_vbus_draw(gadget, 2); > > + usb_gadget_vbus_draw(gadget, USB_VBUS_DRAW_SUSPEND); > > } > > This looks like an unrelated change. I think it should go first > in a separate patch which eliminates usage of "magic" numbers. > This change does make sense. As you know, when device is reset, it is in a 'unconfigured' state. Compliance Test equipment may also measure vbus current at this moment. > > } > > @@ -2132,7 +2157,7 @@ static const struct usb_gadget_driver > composite_driver_template = { > > .unbind = composite_unbind, > > > > .setup = composite_setup, > > - .reset = composite_disconnect, > > + .reset = composite_reset, > > .disconnect = composite_disconnect, > > > > A similar "template" is in drivers/usb/gadget/configfs.c. Shouldn't the "reset" > method be changed there as well? > Yes, it also need to change. I will change it as well. > > > > > +/* USB2 compliance requires that un-configured current draw <= 100mA, > > + * USB3 requires it <= 150mA, OTG requires it <= 2.5mA. > > + */ > > +#define USB2_VBUS_DRAW_UNCONF 100 > > +#define USB3_VBUS_DRAW_UNCONF 150 > > +#define USB_OTG_VBUS_DRAW_UNCONF 2 > > > > +#define USB_VBUS_DRAW_SUSPEND 2 > > separate patch > Sorry, I didn't get your idea. Why separate these macros definition? > > Thanks, > > AP Regards Changbin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/