diff options
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/charger-manager.c | 9 | ||||
-rw-r--r-- | drivers/power/ds2760_battery.c | 9 | ||||
-rw-r--r-- | drivers/power/jz4740-battery.c | 6 |
3 files changed, 8 insertions, 16 deletions
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c index 526e5c931294..7ff83cf43c8c 100644 --- a/drivers/power/charger-manager.c +++ b/drivers/power/charger-manager.c | |||
@@ -509,9 +509,8 @@ static void _setup_polling(struct work_struct *work) | |||
509 | if (!delayed_work_pending(&cm_monitor_work) || | 509 | if (!delayed_work_pending(&cm_monitor_work) || |
510 | (delayed_work_pending(&cm_monitor_work) && | 510 | (delayed_work_pending(&cm_monitor_work) && |
511 | time_after(next_polling, _next_polling))) { | 511 | time_after(next_polling, _next_polling))) { |
512 | cancel_delayed_work_sync(&cm_monitor_work); | ||
513 | next_polling = jiffies + polling_jiffy; | 512 | next_polling = jiffies + polling_jiffy; |
514 | queue_delayed_work(cm_wq, &cm_monitor_work, polling_jiffy); | 513 | mod_delayed_work(cm_wq, &cm_monitor_work, polling_jiffy); |
515 | } | 514 | } |
516 | 515 | ||
517 | out: | 516 | out: |
@@ -546,10 +545,8 @@ static void fullbatt_handler(struct charger_manager *cm) | |||
546 | if (cm_suspended) | 545 | if (cm_suspended) |
547 | device_set_wakeup_capable(cm->dev, true); | 546 | device_set_wakeup_capable(cm->dev, true); |
548 | 547 | ||
549 | if (delayed_work_pending(&cm->fullbatt_vchk_work)) | 548 | mod_delayed_work(cm_wq, &cm->fullbatt_vchk_work, |
550 | cancel_delayed_work(&cm->fullbatt_vchk_work); | 549 | msecs_to_jiffies(desc->fullbatt_vchkdrop_ms)); |
551 | queue_delayed_work(cm_wq, &cm->fullbatt_vchk_work, | ||
552 | msecs_to_jiffies(desc->fullbatt_vchkdrop_ms)); | ||
553 | cm->fullbatt_vchk_jiffies_at = jiffies + msecs_to_jiffies( | 550 | cm->fullbatt_vchk_jiffies_at = jiffies + msecs_to_jiffies( |
554 | desc->fullbatt_vchkdrop_ms); | 551 | desc->fullbatt_vchkdrop_ms); |
555 | 552 | ||
diff --git a/drivers/power/ds2760_battery.c b/drivers/power/ds2760_battery.c index 076e211a40b7..704e652072be 100644 --- a/drivers/power/ds2760_battery.c +++ b/drivers/power/ds2760_battery.c | |||
@@ -355,8 +355,7 @@ static void ds2760_battery_external_power_changed(struct power_supply *psy) | |||
355 | 355 | ||
356 | dev_dbg(di->dev, "%s\n", __func__); | 356 | dev_dbg(di->dev, "%s\n", __func__); |
357 | 357 | ||
358 | cancel_delayed_work(&di->monitor_work); | 358 | mod_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10); |
359 | queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10); | ||
360 | } | 359 | } |
361 | 360 | ||
362 | 361 | ||
@@ -401,8 +400,7 @@ static void ds2760_battery_set_charged(struct power_supply *psy) | |||
401 | 400 | ||
402 | /* postpone the actual work by 20 secs. This is for debouncing GPIO | 401 | /* postpone the actual work by 20 secs. This is for debouncing GPIO |
403 | * signals and to let the current value settle. See AN4188. */ | 402 | * signals and to let the current value settle. See AN4188. */ |
404 | cancel_delayed_work(&di->set_charged_work); | 403 | mod_delayed_work(di->monitor_wqueue, &di->set_charged_work, HZ * 20); |
405 | queue_delayed_work(di->monitor_wqueue, &di->set_charged_work, HZ * 20); | ||
406 | } | 404 | } |
407 | 405 | ||
408 | static int ds2760_battery_get_property(struct power_supply *psy, | 406 | static int ds2760_battery_get_property(struct power_supply *psy, |
@@ -616,8 +614,7 @@ static int ds2760_battery_resume(struct platform_device *pdev) | |||
616 | di->charge_status = POWER_SUPPLY_STATUS_UNKNOWN; | 614 | di->charge_status = POWER_SUPPLY_STATUS_UNKNOWN; |
617 | power_supply_changed(&di->bat); | 615 | power_supply_changed(&di->bat); |
618 | 616 | ||
619 | cancel_delayed_work(&di->monitor_work); | 617 | mod_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ); |
620 | queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ); | ||
621 | 618 | ||
622 | return 0; | 619 | return 0; |
623 | } | 620 | } |
diff --git a/drivers/power/jz4740-battery.c b/drivers/power/jz4740-battery.c index 8dbc7bfaab14..ffbed5e5b945 100644 --- a/drivers/power/jz4740-battery.c +++ b/drivers/power/jz4740-battery.c | |||
@@ -173,16 +173,14 @@ static void jz_battery_external_power_changed(struct power_supply *psy) | |||
173 | { | 173 | { |
174 | struct jz_battery *jz_battery = psy_to_jz_battery(psy); | 174 | struct jz_battery *jz_battery = psy_to_jz_battery(psy); |
175 | 175 | ||
176 | cancel_delayed_work(&jz_battery->work); | 176 | mod_delayed_work(system_wq, &jz_battery->work, 0); |
177 | schedule_delayed_work(&jz_battery->work, 0); | ||
178 | } | 177 | } |
179 | 178 | ||
180 | static irqreturn_t jz_battery_charge_irq(int irq, void *data) | 179 | static irqreturn_t jz_battery_charge_irq(int irq, void *data) |
181 | { | 180 | { |
182 | struct jz_battery *jz_battery = data; | 181 | struct jz_battery *jz_battery = data; |
183 | 182 | ||
184 | cancel_delayed_work(&jz_battery->work); | 183 | mod_delayed_work(system_wq, &jz_battery->work, 0); |
185 | schedule_delayed_work(&jz_battery->work, 0); | ||
186 | 184 | ||
187 | return IRQ_HANDLED; | 185 | return IRQ_HANDLED; |
188 | } | 186 | } |