summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorArun Murthy <arun.murthy@stericsson.com>2011-10-21 12:20:05 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:01:08 +0200
commit2eebbbe339b9599d9991fe3ea80eeaee1778c121 (patch)
tree6b0a3ae3e7e36cd7901007bb9ab51dda30112d80 /drivers
parent4626e363d582062fdb3db76354cb17f335dab99e (diff)
power:ab5500-charger: check the usb type in notifier call
When a usb notifier is called, update the notified current only if the plugge in device is a standard host else do not update the current just return. The notifier call that is called in the usb driver is not only for the battery driver but other usb instances, hence usb cannot stop calling the notifier call and do a check to call only if it is a standard host. Hence this check is done in the battery driver, and if relevant update else just return. ST-Ericsson Linux next: NA ST-Ericsson ID: 362955 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I83026aba60b8a60c9f80e2a699b8eded285f8a09 Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34799 Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com> Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/power/ab5500_charger.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/power/ab5500_charger.c b/drivers/power/ab5500_charger.c
index 4ac35fcb1e8..f57e2088a4a 100644
--- a/drivers/power/ab5500_charger.c
+++ b/drivers/power/ab5500_charger.c
@@ -1531,6 +1531,11 @@ static int ab5500_charger_usb_notifier_call(struct notifier_block *nb,
enum ab5500_usb_state bm_usb_state;
unsigned mA = *((unsigned *)power);
+ if (event != USB_EVENT_VBUS) {
+ dev_dbg(di->dev, "not a standard host, returning\n");
+ return NOTIFY_DONE;
+ }
+
/* TODO: State is fabricate here. See if charger really needs USB
* state or if mA is enough
*/