From af37d866c8aa1b8b61650629a53c6fab2a17e867 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sat, 24 Dec 2016 02:01:25 +0200 Subject: [PATCH] twl4030_charger: increase end-of-charge current 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index d8467d2994e5..ecb7274b086c 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c @@ -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))) -- 2.39.2