Re: [PATCH V3 08/11] power: charger-manager: Make chraging decision focusing on battery status.

From: Pavel Machek
Date: Fri Dec 19 2014 - 19:24:48 EST


Subject: charging.


> In cm_monitor() where charging management starts, it checks various charging
> condition sequentially to decide next charging operation. However, as it

conditions.

> follows sequential process, cascaded IF statements, it does some duplicated
> jobs which is already done in previous stage. It results delay in decision

which are. It results in delay in the decision....?

> Both of problems mentioned above becomes clean if it manages battery charging

"become clear".


> @@ -249,6 +249,19 @@ static bool is_full_charged(struct charger_manager *cm)
> if (!fuel_gauge)
> return false;
>
> + /* Full, if it's over the fullbatt voltage */
> + if (desc->fullbatt_uV > 0) {
> + ret = get_batt_uV(cm, &uV);
> + if (!ret) {
> + /* Battery is already full, checks voltage drop. */

"check"

> --- a/include/linux/power/charger-manager.h
> +++ b/include/linux/power/charger-manager.h
> @@ -220,6 +220,7 @@ struct charger_desc {
> * saved status of battery before entering suspend-to-RAM
> * @charging_start_time: saved start time of enabling charging
> * @charging_end_time: saved end time of disabling charging
> + * @battery_status: Current battery status

"current" for consistency.

> */
> struct charger_manager {
> struct list_head entry;
> @@ -237,6 +238,8 @@ struct charger_manager {
>
> u64 charging_start_time;
> u64 charging_end_time;
> +
> + int battery_status;
> };

Should battery_status be some kind of enum?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/