Messages in this thread | | | Date | Thu, 19 Mar 2015 13:08:13 +0530 | Subject | Re: [RFC 11/19] dwc3: add OTG handling code | From | George Cherian <> |
| |
Hi Robert,
On Wed, Mar 18, 2015 at 7:34 PM, Robert Baldyga <r.baldyga@samsung.com> wrote: > > This patch introduces OTG support in DWC3 driver. OTG feature is responsible > for dynamic USB role switching (between host and peripheral modes) based > on detected cable type. > > Each role switch causes complete core reinitialization. In peripheral
Do you really want to do complete core reinitialization? While switching to HOST mode you might need to issue a LHRESET and while switching to Device mode make sure you re-initiallize the event buffer addresses.
If LHRESET is not used then you should do what you have done.
But I don't think adding and removing the platform_device for XHCI is the way to go. This might impact SoC's which really implement the OTG for DWC3.
I made an attempt on the same and could'nt work on it more. This still has some issues, but could be fixed. https://lkml.org/lkml/2014/11/25/600
> mode UDC device is activated using VBUS session control mechanism. In > host mode the new XHCI device is registered to make bus visible in system. > > This code is inspired by DWC3 driver from Hardkernel Linux sources [1]. > > [1] https://github.com/hardkernel/linux. > > Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Regards -George
| |