summaryrefslogtreecommitdiff
path: root/drivers/power/battery/bat_trats.c
diff options
context:
space:
mode:
authorƁukasz Majewski <l.majewski@samsung.com>2013-06-25 13:28:15 (GMT)
committerMinkyu Kang <mk7.kang@samsung.com>2013-07-05 09:46:14 (GMT)
commit9dfa3d0734df4aad107def2c900d1514ac7510ac (patch)
tree1ee44c010011f8b5cc11fcae679de7d91a091cf3 /drivers/power/battery/bat_trats.c
parent9199fce23968c9657e00b74ee44f41d0e0fe68b5 (diff)
downloadu-boot-fsl-qoriq-9dfa3d0734df4aad107def2c900d1514ac7510ac.tar.xz
power:bat:trats: Break battery charging with ctrl+C
Add support for disabling battery charging with ctrl+C keyboard combination pressed. Moreover the battery update is done more frequently. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Tom Rini <trini@ti.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'drivers/power/battery/bat_trats.c')
-rw-r--r--drivers/power/battery/bat_trats.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/power/battery/bat_trats.c b/drivers/power/battery/bat_trats.c
index ca0d214..97a9661 100644
--- a/drivers/power/battery/bat_trats.c
+++ b/drivers/power/battery/bat_trats.c
@@ -41,18 +41,23 @@ static int power_battery_charge(struct pmic *bat)
for (k = 0; bat->chrg->chrg_bat_present(p_bat->chrg) &&
bat->chrg->chrg_type(p_bat->muic) &&
battery->state_of_chrg < 100; k++) {
- udelay(10000000);
- puts(".");
+ udelay(2000000);
+ if (!(k % 5))
+ puts(".");
bat->fg->fg_battery_update(p_bat->fg, bat);
- if (k == 100) {
+ if (k == 200) {
debug(" %d [V]", battery->voltage_uV);
puts("\n");
k = 0;
}
+ if (ctrlc()) {
+ printf("\nCharging disabled on request.\n");
+ goto exit;
+ }
}
-
+ exit:
bat->chrg->chrg_state(p_bat->chrg, CHARGER_DISABLE, 0);
return 0;