From mboxrd@z Thu Jan 1 00:00:00 1970 From: Soeren Moch Date: Thu, 7 Apr 2016 13:31:58 +0200 Subject: [U-Boot] [PATCH 1/8] usb: gadget: Move CONFIG_USB_GADGET_VBUS_DRAW to Kconfig In-Reply-To: <570415D7.7090609@denx.de> References: <1459874197-14460-1-git-send-email-semen.protsenko@linaro.org> <1459874197-14460-2-git-send-email-semen.protsenko@linaro.org> <5703F77A.5010407@wwwdotorg.org> <570415D7.7090609@denx.de> Message-ID: <5706452E.2050007@web.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/05/16 21:45, Marek Vasut wrote: > On 04/05/2016 07:35 PM, Stephen Warren wrote: >> On 04/05/2016 10:36 AM, Semen Protsenko wrote: >>> From: Sam Protsenko >>> >>> The description was borrowed from kernel, but allowed range was changed >>> from 2..500 to 0..500, because some boards require this option to be 0. >> >> Do they /require/ the value to be 0, or simply currently have it set to >> 0 because whoever set the value in U-Boot wasn't aware that a value of 0 >> could cause issues with some hosts? For TBS2910 I set the value to 0 because the board does not need any power from the host. It is always self-powered and cannot be driven from USB. And yes, I was not aware that a value of 0 could cause problems. >> I'd be tempted to keep the same range as the Linux kernel and bump all >> boards up to a minimum value of 2. > > Right. VBUS draw 0 might confuse some non-Linux systems. >> Presumably there's some good reason >> the kernel chose a minimum of 2, and in practice I expect increasing all >> boards to 2 isn't going to make any negative difference. >> >>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig >> >>> +config USB_GADGET_VBUS_DRAW >>> + int "Maximum VBUS Power usage (2-500 mA)" >>> + range 0 500 >>> + default 2 >>> + help >>> + Some devices need to draw power from USB when they are >>> + configured, perhaps to operate circuitry or to recharge >>> + batteries. This is in addition to any local power supply, >>> + such as an AC adapter or batteries. >>> + >>> + Enter the maximum power your device draws through USB, in >>> + milliAmperes. The permitted range of values is 2 - 500 mA; >>> + 0 mA would be legal, but can make some hosts misbehave. >> >> In particular, I'm thinking of that last sentence. Is the problematic value of zero forbidden in some spec, or is actually a bug in the host driver (to be fixed there) causing confusion? On the other hand, if no bus power is needed a maximum power value of 2mA should not hurt. Regards, Soeren