Re: [PATCH 2/2] usb: musb: notify USB_EVENT_ENUMERATED from musb_gadget_vbus_draw()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 22, 2010 at 03:31:50AM -0500, Maulik Mankad wrote:
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.

true, we need to patch otg notifier to change into atomic_notifier
instead of blocking.

--
balbi
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux