From d71781ed125fbb87361582f8b577798b12a33c41 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Fri, 21 Oct 2011 12:20:05 +0530 Subject: 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 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34799 Reviewed-by: Mian Yousaf KAUKAB Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR Reviewed-by: Praveena NADAHALLY --- drivers/power/ab5500_charger.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/power') 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 */ -- cgit v1.2.3