Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

From: Felipe Balbi
Date: Tue Sep 06 2016 - 03:42:41 EST



Hi,

NeilBrown <nfbrown@xxxxxxxxxx> writes:
> Firstly, you have made the current limit associated with each cable type
> configurable (__usb_charger_set_cur_limit_by_type). This is nonsense.
> The standard (e.g. BC-1.2) declares what the current limits are. There
> is no reason for those not to be hard coded.

I had raised the same concern WRT configuration current limits.

> Secondly, you treat each charger type as having a single "cur_limit" and
> utilize that limit by telling the PMIC to draw that much current.
> Again, this is inconsistent with the specification.
> BC-1.2 defines, for each charger type, a minimum and maximum current
> level.
> The minimum should always be available. Attempting to draw more than
> that (but less that the max) might work or might cause the charger
> to shut down, but you can be sure that the charger will respond to the
> increased load by first reducing the voltage, and will not shut down
> until the voltage has dropped below 2V.
> If you try to draw more current than the maximum, then the charger might
> shut down before the voltage drops below 2V.

Very well put :-)

> Given this understanding of the current available from the charger,
> there are two approaches the PMIC might take.
> 1/ if the PMIC is able to exercise fine control over the current it
> draws, and if it can monitor the voltage on the charger, then it
> could gradually increase the power being requested until the voltage
> drops below some threshold (e.g. 4.75V), and then (probably) back off
> a little. It should only increase at most up to the maximum, even if
> the voltage remains high. It should probably start at zero rather
> than at the minimum. This allows for lossage elsewhere.

That's what most charging control SW I've seen in the past ends up
doing. Correct

> 2/ If the PMIC cannot measure voltage, or doesn't have sufficiently fine
> control of the current requested, then it should request only the
> minimum available current. Any more is not safe.

correct

--
balbi

Attachment: signature.asc
Description: PGP signature