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 10:10:46AM +0200, ext Felipe Balbi wrote:
>On Wed, Sep 22, 2010 at 02:52:50AM -0500, Krogerus Heikki (EXT-Teleca/Helsinki) wrote:
>>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);
>>+
>>+	old_ma = mA;
> 
> to me, you should always notify calls to usb_gadget_vbus_draw(), even if
> it's enumerated with 0mA. It'll help us tracing down problems with
> gadget drivers. If there are any.

Fair enough, but I would like to avoid resending notifications with
the same mA.

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