usb: phy: ab8500-usb: fix last notifier arguments
authorFabio Baltieri <fabio.baltieri@linaro.org>
Wed, 3 Apr 2013 08:45:10 +0000 (10:45 +0200)
committerFelipe Balbi <balbi@ti.com>
Wed, 3 Apr 2013 09:02:21 +0000 (12:02 +0300)
Fix last ab->phy.notifier call to use vbus_draw as notifier argument, as
that's used in ab8500_charger to control charging current.

Also drop a related TODO comment, and the additional
ux500_musb_set_vbus(musb, 0), as with this patch it was causing an
erratic behaviour of gadget ep0 state machine.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/ux500.c
drivers/usb/phy/phy-ab8500-usb.c

index 88795f532370bedd31b04e50d3bf381cbe548519..2c80004e0a83029b52b7ea13f2d4c97194f40412 100644 (file)
@@ -114,7 +114,6 @@ static int musb_otg_notifications(struct notifier_block *nb,
                break;
        case UX500_MUSB_VBUS:
                dev_dbg(musb->controller, "VBUS Connect\n");
-               ux500_musb_set_vbus(musb, 0);
                break;
        case UX500_MUSB_NONE:
                dev_dbg(musb->controller, "VBUS Disconnect\n");
index fec260ee67d3fa1ef149c4f011529b1fce8f6a28..888dad65bf9b06fa424502c4bff7f086a4753bfc 100644 (file)
@@ -578,16 +578,12 @@ static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA)
 
        ab->vbus_draw = mA;
 
-       if (mA)
-               atomic_notifier_call_chain(&ab->phy.notifier,
-                               UX500_MUSB_ENUMERATED, ab->phy.otg->gadget);
+       atomic_notifier_call_chain(&ab->phy.notifier,
+                       UX500_MUSB_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 usb_phy *x, int suspend)
 {
        /* TODO */