Re: [PATCH 5/7] usb: musb: add musb_host_setup() and musb_host_cleanup()

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

 



On 05.04.2013 15:07, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Apr 04, 2013 at 09:50:11PM +0200, Daniel Mack wrote:
>> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
>> index d564580..d298be7 100644
>> --- a/drivers/usb/musb/musb_host.c
>> +++ b/drivers/usb/musb/musb_host.c
>> @@ -2649,6 +2649,27 @@ void musb_host_free(struct musb *musb)
>>  	usb_put_hcd(musb->hcd);
>>  }
>>  
>> +int musb_host_setup(struct musb *musb, int power_budget)
>> +{
>> +	int ret;
>> +	struct usb_hcd *hcd = musb->hcd;
>> +
>> +	MUSB_HST_MODE(musb);
>> +	musb->xceiv->otg->default_a = 1;
>> +	musb->xceiv->state = OTG_STATE_A_IDLE;
>> +
>> +	otg_set_host(musb->xceiv->otg, &hcd->self);
> 
> you don't want to do these by default. You might screw things up for OTG
> builds where you *must* start in b_idle state.

Which is why my initialitation code calls musb_gadget_setup() *after*
musb_host_setup(), so things are configured properly for OTG. Any better
idea on how to solve that?

>> +	hcd->self.otg_port = 1;
>> +	musb->xceiv->otg->host = &hcd->self;
>> +	hcd->power_budget = 2 * (power_budget ? : 250);
> 
> not sure you should default to 500mA budget. you might burn some boards
> which aren't passing proper power_budget here.

These values were taken from the original implementation, I just copied
them over.


Daniel


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