[PATCH] add ac charger power_supply

Andy Green andy at openmoko.com
Tue Dec 2 12:21:04 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Somebody in the thread at some point said:
| Balaji Rao wrote:
|> On Tue, Dec 02, 2008 at 09:32:51AM +0000, Andy Green wrote:
|>
|>> -----BEGIN PGP SIGNED MESSAGE-----
|>> Hash: SHA1
|>>
|>> Somebody in the thread at some point said:
|>>
|>> | This adds an appropriate ac power_supply class and shows usb only when
|>> | at the appropriate current limit.
|>>
|>> What do you think Balaji?  At first it seemed to me that adding another
|>> power_supply is broken for generic pcf50633 case, but actually, if it is
|>> cleared for 1A on USB for example then there is definitely an AC adapter
|>> involved.  Is this OK for you?
|>>
|>>
|>
|> I strongly feel it's wrong to pollute the driver with application
|> specific stuff.
|>
|> Sean, why can't we use the PROP_CURRENT_AVG to decide on whether the usb
|> is connected to a host or an adapter ? Adding that field should be
|> trivial and preserves the generic nature of the driver. What do you
|> think ?
|
| I can live with or without the ac power_supply. I was of the opinion it
| might be nice to know the difference between having USB power or AC.
| Sounds like providing the current would be sufficient. But is it legal
| for USB current to be 1A? Android will happily fail to find ac and

How do we mean legal... legal by GTA02 or 03 design, yes... legal by
standards... sort of OTG appears to allow large incoming currents but
uses a different electrical signalling method than we do to show that it
is happening.  Legal by pcf50633 datasheet, yes.

For the PCF50633 driver point of view it doesn't know itself that we use
AC adapter, it just suddenly hears from machine stuff (which looked for
our magic 47K resistor) that it's OK to pull 1A.  Its private concept of
AC adapter presence is solely this "adapter" path we don't use.  If we
did use it, we just rename that "ac" and we would all be happy.

| continue on without a problem, but it does look for an ac power_supply.

Yes the issue isn't really solving adapter detection but only logical
interfacing to Android with minimal trouble.

It's OK Balaji doesn't like it for upstream reason, what I will do is
stick it in andy-tracking for now and carry it as a local patch to give
Android a smoother ride.  Maybe later it will go away suddenly if it
makes trouble but it can be there for now.

- -Andy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkk1GiAACgkQOjLpvpq7dMrVWgCeJwanpQQRfiUnZae8Gt7h/OBQ
FhYAn00GA2CCLHmU1EAOkvhALTqoQKRy
=Z2rY
-----END PGP SIGNATURE-----



More information about the openmoko-kernel mailing list