On Wed, Sep 22, 2010 at 1:22 PM, Krogerus Heikki (EXT-Teleca/Helsinki) <ext-heikki.krogerus@xxxxxxxxx> wrote: > From: Heikki Krogerus <ext-heikki.krogerus@xxxxxxxxx> > > Inform charging HW/SW how much it's allowed to draw. > > Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@xxxxxxxxx> > --- > drivers/usb/musb/musb_gadget.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c > index 6fca870..40d3c13 100644 > --- a/drivers/usb/musb/musb_gadget.c > +++ b/drivers/usb/musb/musb_gadget.c > @@ -1519,8 +1519,15 @@ static int musb_gadget_vbus_session(struct usb_gadget *gadget, int is_active) > > static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) > { > + static unsigned old_ma; > struct musb *musb = gadget_to_musb(gadget); > > + if (mA != 0 && old_ma != mA) > + blocking_notifier_call_chain(&musb->xceiv->notifier, > + USB_EVENT_ENUMERATED, &mA); > + You will need an atomic notifier since this gets called from Interrupt context. Regards, Maulik -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html