diff options
author | Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> | 2011-04-12 14:40:39 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@linaro.org> | 2011-07-22 15:40:42 +0200 |
commit | 91255c386e9f4b57071fe9831f9f5d16f86195e9 (patch) | |
tree | fc479d9c3f3098e2c3a07b68253e702bb4734199 | |
parent | e9419f3ceda0c0eba276474b42aa6ebe7100d3d5 (diff) |
usb: otg: ab8500-usb: report vbus draw in the notifier call
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
-rw-r--r-- | drivers/usb/otg/ab8500-usb.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index a3b23567b36..cfb6474d07c 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c @@ -223,7 +223,6 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) { u8 reg; enum ab8500_usb_link_status lsts; - void *v = NULL; enum usb_xceiv_events event; abx500_get_register_interruptible(ab->dev, @@ -256,7 +255,6 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) if (ab->otg.gadget) { ab8500_usb_peri_phy_en(ab); ab->mode = USB_PERIPHERAL; - v = ab->otg.gadget; } event = USB_EVENT_VBUS; break; @@ -265,7 +263,6 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) if (ab->otg.host) { ab8500_usb_host_phy_en(ab); ab->mode = USB_HOST; - v = ab->otg.host; } ab->otg.default_a = true; event = USB_EVENT_ID; @@ -283,7 +280,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) break; } - atomic_notifier_call_chain(&ab->otg.notifier, event, v); + atomic_notifier_call_chain(&ab->otg.notifier, event, &ab->vbus_draw); return 0; } @@ -356,16 +353,11 @@ static int ab8500_usb_set_power(struct otg_transceiver *otg, unsigned mA) ab->vbus_draw = mA; - if (mA) - atomic_notifier_call_chain(&ab->otg.notifier, - USB_EVENT_ENUMERATED, ab->otg.gadget); + atomic_notifier_call_chain(&ab->otg.notifier, + USB_EVENT_VBUS, &ab->vbus_draw); return 0; } -/* TODO: Implement some way for charging or other drivers to read - * ab->vbus_draw. - */ - static int ab8500_usb_set_suspend(struct otg_transceiver *x, int suspend) { /* TODO */ |