RE: [PATCH v2] charger_manager: update charge profile upontemperature zone change

From: Pallala, Ramakrishna
Date: Tue May 08 2012 - 13:15:58 EST


> > This patch allows the Charger-Manager to adjust the charging
> > parameters upon events like VBUS rise or drop and allows batteries to
> > have multiple charge profiles for different temperature zones.
> >
> > Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@xxxxxxxxx>
>
> I don't see how the parameters are changed when update_charger is true.
My initial thought was to keep these details hide from CM.

> Are you intending to do it at userspace after getting uevent_notify()? (I don't think
> it's good)
No, we will do it from driver only.

> If the intension is to update some of the charger-manager internal parameters (struct
> charger_manager's struct charger_desc) according to the temperature, we'd need a more
> general method that can also update values in the charger-manager context.
>
> For example, instead of simply putting a callback to determine whether an update is
> required or not, a table of (including hysterisis) temperatures and values to be updated
> (or callbacks to update charger_desc based on the temperature) might be a starting
> point. You may also need to consider using notifier chain w/ temperatures.
>
Yes I agree, I will submit another patch with these changes.

As part of charge enablement we generally program charge current, charge voltage
into the charger chip.

We can pass the charging parameters CC and CV in two ways.
1. Add these params in charger_desc struct and the charger regulator can get these
params using container_of() call? but becomes complex.

2. use regulator_set_voltage()/regulator_set_current_limit() functions to set the CV and CC params.
but not suitable as is, we have add support in regulator framework

3. use regulator_get_drvdata()/regulator_set_drvdata() to set CC & CV params. These functions
allow us to add more params in future if required.

I am thinking of using option 3.

Let me know your feedback.

Thanks,
Ram

N떑꿩ìr¸›y鉉싕b²XФ푤vØ^–)頻{.nÇ+돴¥Š{±묎çzX㎍썳變}©옽Æ zÚ&j:+v돣¾«묎çzZ+€Ê+zf"·hš닱~넮녬iÿ鎬z¹®wⅱ¸?솳鈺Ú&¢)刪f뷌^j푹y§m끷@A«a뛴ÿ 0띠h®å’i