Skip to content

Commit

Permalink
ab8500-charger: Run detect workaround only on AB8500
Browse files Browse the repository at this point in the history
Only AB8500 has this hardware bug, so these works only need to be run
there.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Martin SJOBLOM <martin.w.sjoblom@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
  • Loading branch information
Rabin Vincent authored and Lee Jones committed Mar 7, 2013
1 parent aee2b84 commit 261c513
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ static void ab8500_charger_set_usb_connected(struct ab8500_charger *di,
mutex_lock(&di->charger_attached_mutex);
mutex_unlock(&di->charger_attached_mutex);

queue_delayed_work(di->charger_wq,
if (is_ab8500(di->parent))
queue_delayed_work(di->charger_wq,
&di->usb_charger_attached_work,
HZ);
} else {
Expand Down Expand Up @@ -2622,7 +2623,9 @@ static irqreturn_t ab8500_charger_mainchplugdet_handler(int irq, void *_di)

mutex_lock(&di->charger_attached_mutex);
mutex_unlock(&di->charger_attached_mutex);
queue_delayed_work(di->charger_wq,

if (is_ab8500(di->parent))
queue_delayed_work(di->charger_wq,
&di->ac_charger_attached_work,
HZ);
return IRQ_HANDLED;
Expand Down Expand Up @@ -3690,14 +3693,16 @@ static int ab8500_charger_probe(struct platform_device *pdev)
ch_stat = ab8500_charger_detect_chargers(di, false);

if ((ch_stat & AC_PW_CONN) == AC_PW_CONN) {
queue_delayed_work(di->charger_wq,
&di->ac_charger_attached_work,
HZ);
if (is_ab8500(di->parent))
queue_delayed_work(di->charger_wq,
&di->ac_charger_attached_work,
HZ);
}
if ((ch_stat & USB_PW_CONN) == USB_PW_CONN) {
queue_delayed_work(di->charger_wq,
&di->usb_charger_attached_work,
HZ);
if (is_ab8500(di->parent))
queue_delayed_work(di->charger_wq,
&di->usb_charger_attached_work,
HZ);
}

mutex_unlock(&di->charger_attached_mutex);
Expand Down

0 comments on commit 261c513

Please sign in to comment.