Re: [PATCH] usb: musb: only draw vbus if gadget driver asks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 25, 2009 at 11:36:27AM -0800, David Brownell wrote:
> On Wednesday 25 February 2009, Felipe Balbi wrote:
> > The default limits on vbus would cause strange behaviours
> > on bus-powered musb-based devices.
> 
> You actually have hardware that can run Linux from USB
> suspend currents?  I thought the only such hardware used
> 8-bit microcontrollers.  And that Nokia's devices have
> batteries, and are thus "self" powered, not bus powered.
> (Self powered doesn't mean "won't use VBUS".)

I didn't express myself nicely. I meant devices that charge battery over
usb.

> Recall that such hardware must suspend at about 0.5 mA
> current, though after enumeration into a "high power"
> configuration (such as 500 mA) it could use 2.5 mA.
> 
> > With a 500mA configuration, the vbus draw would not switch
> > from 0 to 500, it would have one step in either 8mA or 100mA
> > depending whether gadget have otg enabled or not.
> 
> I don't follow.  This function is called right after a USB
> reset.  No SET_CONFIGURATION has been done yet.  It's just

Exactly, which makes our device starts drawing 8mA (or 100mA if non-otg)
even though the gadget driver didn't ask it to.



> returning to the default state; no bug that I see.  Once
> the SET_CONFIGURATION is issued, it can use more current.

what would happen in this case is that we would try to charge at 8mA and
a few jiffies later we would have to change our charging profile to
500mA since we just got a high power configuration chosen.

What I mean with this patch is that musb shouldn't try to figure default
values for vbus_draw(); that should be the gadget driver's role to call
usb_gadget_vbus_draw(), right ?

Moreover, I don't see any other gadget controller driver calling their
vbus_draw() function themselves.

-- 
balbi
--
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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux