[U-Boot] [PATCH] sunxi: axp221: Use vbus-available rather then vbus-usable for vbus-detect

Paul Kocialkowski contact at paulk.fr
Sat Mar 28 09:27:21 CET 2015


Le vendredi 27 mars 2015 à 21:37 +0100, Hans de Goede a écrit :
> Hi,
> 
> On 23-03-15 17:38, Hans de Goede wrote:
> > Hi,
> >
> > On 23-03-15 17:33, Paul Kocialkowski wrote:
> >> Le lundi 23 mars 2015 à 17:28 +0100, Hans de Goede a écrit :
> >>> vbus-usable does not get set if power is provided through the power barrel
> >>> connector, even if external 5v is also present on the otg connector.
> >>>
> >>> vbus-available correctly always reflects if there is 5v present on the otg
> >>> connector.
> >>
> >> You (or I) could submit the very same change for the AXP209. It's the
> >> same bit for available (1 << 5).
> >
> > Yes I was about to mail you about that when I noticed that this seems to
> > break actual host mode support on the otg connector, it seems that
> > plugging in a micro-b to usb-a receptacle (aka host) convertor + a device
> > plugged into the usb-a receptacle also causes bit 5 to get set :|
> >
> > So my patch is no good, but powering the otg port while external 5v is present
> > also is not good (one side effect is that the tablet will power up immediately
> > after sending a power-off command to the axp221).
> >
> > If you've some time to tinker with this I would appreciate any ideas
> > you may have (assuming the same problem exists on the axp209)
> > simply plug in 5v power into the power barrel, as well as 5v power
> > (e.g. simply from your pc) and boot up the tablet, at least in my
> > case then it does not properly give the charger plugged in error.
> 
> Ok, so it took me a while but here is a follow up to this:
> 
> 1) My original patch is correct, but it took me a while to reproduce the
> original problem, I'll send an updated patch with the reproducer clearly
> spelled out in the commit msg as it is non obvious

Your patch seemed to work fine for me, indeed.

> 2) My original patch does introduce a *new* problem, or rather exposes
> an existing problem when turning of vusb to the otg port (when in hostmode,
> so vusb coming from the board) it takes a while for vusb to discharge and
> if we are to quick with reading vusb-detect after a reset when the vusb
> was on we see the residual charge and assume we've an external vusb, this is
> worse when vbus gets not only sensed, but also controller by the pmic,
> as then it does not get turned of on reset at all. I've patches fixing all
> of this now, which I will include in the patch-set which I'm about to send
> out. I'll put the fixes before this patch in the patch set so that the
> bug it exposes gets fixed before it is exposed.

Ahhh, that makes sense, well spotted! I think that in my case, there was
no charge left on vbus after reset, so I couldn't spot the problem. 

> I think this all does not have much influence on the axp209, because AFAICT
> we only ever do vbus sense through the pmic there and never vbus control.

That's right, we only do vbus detection, not vbus driving through the
AXP209 (at this point, perhaps it's possible though).

-- 
Paul Kocialkowski, Replicant developer

Replicant is a fully free Android distribution running on several
devices, a free software mobile operating system putting the emphasis on
freedom and privacy/security.

Website: http://www.replicant.us/
Blog: http://blog.replicant.us/
Wiki/tracker/forums: http://redmine.replicant.us/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150328/976aeb64/attachment.sig>


More information about the U-Boot mailing list