Re: [PATCH 0/7] usb: musb: add support for host support back

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

 



Hi,

On 05.04.2013 11:58, Felipe Balbi wrote:
> On Thu, Apr 04, 2013 at 09:50:06PM +0200, Daniel Mack wrote:
>> Hi all,
>>
>> here are some patches to separate the HCD and gadget part of the musb
>> driver so they can be deselected in Kconfig. They also make the driver
>> keep track of the configured port mode that is set from DT, so the
>> actual runtime configuration can be selected dynamically.
>>
>> One thing that is still broken is that once pm_suspend() was called on
>> a musb device on a USB disconnect, the port won't wake up again when a
>> device is plugged back in. I doubt this is related to my patches, but I
>> might be wrong. If that effect rings a bell to anyone, please let me
>> know.
>>
>>
>> Thanks,
>> Daniel
>>
>>
>> Daniel Mack (7):
>>   usb: gadget: drop unused USB_GADGET_MUSB_HDRC
>>   usb: musb: move function declarations to musb_{host,gadget}.h
>>   usb: musb: factor out hcd initalization
>>   usb: musb: add Kconfig options for HOST, GAGDET or DUAL_ROLE modes
>>   usb: musb: add musb_host_setup() and musb_host_cleanup()
>>   usb: musb: re-introduce musb->port_mode
>>   usb: musb: eliminate musb_to_hcd
> 
> pretty good, getting there. Here's what I'd to see though:
> 
> introduce musb_gadget_init() and musb_host_init(). Those two should
> contain everything necessary to initialize each side of the API.
> 
> Then we can simply:
> 
> switch(mode) {
> case HOST:
> 	musb_host_init();
> 	break;
> case PERIPHERAL:
> 	musb_gadget_init();
> 	break;
> case OTG:
> 	/* it's important to initialize gadget side first */
> 	musb_gadget_init();
> 	musb_host_init();
> 	break;
> }
> 
> code will look cleaner and initialization will be straight forward and a
> lot easier to understand.

Ok, thanks. I'll see how I can respin this.

> This means that the call to usb_add_hcd() from musb_gadget_start()
> should be removed.

That's already done in "usb: musb: factor out hcd initalization". Or do
I miss anything?



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