Re: i.MX31 usb device support and power supply

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, 5 Mar 2007, Valentin Longchamp wrote:

> Now I have a more precise question about the actual implementation of 
> Freescale i.MX31 kernel release (here is the patch: 
> http://bitshrine.org/gpp/linux-2.6.16-mx31-usb-2.patch). It works well, but 
> only with low-current devices (I have tested the ehci support with USB 
> pendrive flash disk). But when I try to plug in some higher current consumers 
> like a wifi pendrive for instance, which needs 300 mA, the configuration is 
> rejected because of this from the choose_configuration function in 
> drivers/usb/core/hub.c :
> 
> > 		/*
> > 		 * The next test may not be as effective as it should be.
> > 		 * Some hubs have errors in their descriptor, claiming
> > 		 * to be self-powered when they are really bus-powered.
> > 		 * We will overestimate the amount of current such hubs
> > 		 * make available for each port.
> > 		 *
> > 		 * This is a fairly benign sort of failure.  It won't
> > 		 * cause us to reject configurations that we should have
> > 		 * accepted.
> > 		 */
> >
> > 		/* Rule out configs that draw too much bus current */
> > 		if (c->desc.bMaxPower * 2 > udev->bus_mA)
> > 			continue;
> 
> >From what I understand (I'm not very familiar with kernel USB code) 
> c->desc.bMaxPower is what the hub makes available for each port and 
> udev->bus_mA is what the device requests.

It's the reverse: (c->desc.bMaxPower * 2) is what the device requests and 
udev->bus_mA is what the hub makes available.

>  This has failed for me with a 
> device requesting 300 mA.
> 
> Now I was not able to find in the code where this limit is fixed for my ehci 
> hardware. Because I haven't found a current limitation in the USB block or 
> transceiver (Phillips ISP1504) documentation (quick look).

Search for "power_budget" in the source code for your bus glue.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.