Re: Adding OTG support to xHCI

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

 



On 2/19/2012 9:20 PM, Ido Shayevitz wrote:
> 
> Hi,
> 
>> BTW, you should write your patch on top of the two patches I sent adding
>> support for xhci on dwc3. It's on the archives of the mailing and this
>> is the second time I suggest you do that.
>>
> 
> OK, I see, sorry about that.
> So I guess it should be part of xhci_plat_probe() ?
> 
>>> I mean, the "set_host" API is a generic one defined in otg.h as part of
>>> the general otg framework, no pltaform specific.
>>> Actually it will serve any otg driver, on any core that supports xHCI
>>> interface, not just for the dwc3 core.
>>> How do you suggest to do this otherwise?
>>
>> like I said on the other mail. ->set_host() needs to be called way
>> before that. When you get ID pin grounded, if your controller doesn't go
>> into host mode automagically, you call ->set_host(). You should have
>> some sort of ID ground event to handle that.
>>
> 
> Sorry, I missed you here. Isn't the otg_set_host() should be called just
> after hcd instance was created (in xhci_plat_prob?) for notifying the otg
> about the instance of the host driver? Why it is related to ID ground
> event? maybe you talked about ->start_host() ?
> 
> And one more question, please:
> If indeed the place to call otg_set_host is in xhci_plat_probe(), then if
> otg instance exists (otg_get_transceiver()!=NULL) then the otg_set_host()
> should be called instead of the 2 calls to usb_add_hcd(), right ?
> If so, do need to call otg_set_host with the primary hcd? , but when the
> otg->start_host is activated then call to usb_add_hcd() twice on both the
> primary and the secondary (using the shared_hcd reference) ?
> 

A similar discussion happened some time back.

Please see

http://www.spinics.net/lists/linux-usb/msg35808.html
http://www.spinics.net/lists/linux-arm-msm/msg01989.html

Summary of the problem:

OTG driver monitors VBUS and ID lines. When VBUS is valid & ID is float,
it activates gadget by calling usb_gadget_vbus_connect() API. When Id is
grounded, OTG should activate HCD. But there is no standard USB core API
for this. Some MSM SoC has ci13xxx USB controller in which host and
device share the same register address space. To make
sure that HCD never access (via sysfs/debugfs & runtime PM/system PM)
hardware when peripheral mode is active, we unload HCD (usb_remove_hcd).
When Id is groundedm HCD is loaded by calling usb_add_hcd(). This works
great for Micro-A/B cable connect and disconnect. But we can not meet
HNP (Host Negotiation Protocol i.e switching to host mode from
peripheral mode) timings.

As per my knowledge, dwc has separate address space for host and gadget.
So we might not need to completely load/unload HCD. But we should have
an API in USB core or struct hc_driver to notify host that it is no
longer active. But if we don't unload HCD completely, khubd exists for
root hub and will be running for every system resume cycle. I am not
sure of side-effects of it.

Hope this post is appropriate in this thread.

Thanks,
Pavan
-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
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