On Thu, Dec 03, 2009 at 12:31:56AM +0200, Felipe Balbi wrote:Hi,
On Wed, Dec 02, 2009 at 10:54:42PM +0100, ext Anton Vorontsov wrote:
>As for the default USB VBUS current value, it could be Kconfig
>option (something alike to USB_GADGET_VBUS_DRAW) and/or module
>parameter, or hw default, or hardcoded for now. Either will
>work.
cannot be Kconfig, it's mandated by usb battery charging spec 1.x to
be 100mA for 100ms, then if you don't enumerate, you have to cut
charging.
Oh, I thought TWL4030 does the USB stuff somewhat transparently
so the checks in twl4030_charger_check_vbus() would be enough.
Is there any TWL4030 reference manual available?
If TWL4030 just draws the VBUS directly, then it might be a good
idea to integrate the driver with OTG framework, as an example
see
commit 5bf2b994bfe11bfe86231050897b2d881ca544d9
Author: Philipp Zabel <philipp.zabel@xxxxxxxxx>
Date: Sun Jan 18 17:40:27 2009 +0100
pda_power: Add optional OTG transceiver and voltage regulator support
Though, instead of just a boolean is_usb_online() stuff, you'll
have to get the allowed current draw value and configure the
charger appropriately.
Will this work?