twl4030_charger: increase end-of-charge current sz_176
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 24 Dec 2016 00:01:25 +0000 (02:01 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 24 Dec 2016 00:01:25 +0000 (02:01 +0200)
The charger can only look at the current coming from the supply.
In the USB case, the OTG hardware is active and drawing ~80mA, so even
if the real charge current falls close to 0, the charger will see more
and continue charging, which means 80mA default is a bad choice.

On default OS this is not a problem because there is a daemon looking
at the real charge current reported by bq27500, this change is more for
people running custom OSes. Still a daemon should be preferred if
possible because if pandora is continuously kept busy and with the
screen on, the supply current may easily stay over 400mA (the maximum
possible end-of-charge setting).

drivers/power/twl4030_charger.c

index d8467d2..ecb7274 100644 (file)
@@ -79,7 +79,7 @@
 #define IRQ_CHECK_THRESHOLD    4
 
 /* By default, 80mA */
-static unsigned end_of_charge_current = 80000;
+static unsigned end_of_charge_current = 200000;
 module_param(end_of_charge_current, uint, 0);
 MODULE_PARM_DESC(end_of_charge_current,
        "Stop charging when the charger current goes below this threshold");
@@ -948,9 +948,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
         * usb_current as soon as a charger is plugged in).
         *
         * end_of_charge_current:
-        * defaults to ~400mA (can be set with the eoc_current option)
-        * This is as high as it can be set in the TWL4030. Seems to be a
-        * fairly sane value. Certainly more sane then the default 80mA.
+        * taken from the module parameter.
         */
        if ((ret = update_charge_parameters(bci,
                        500000, end_of_charge_current)))