Hi All, I've spent some time today dithering on the Nexus S and host mode and I think the way to approach this is different from the Nexus 1 host driver hack.
The Nexus S uses a Fairchild USB switch (fsa8480) to detect device connections. I believe the point is to allow the device to handle multiple functions like charging, UART and USB access simultaneously. The Switch will detect OTG connections. Plugging in a microB to A convertor with pin 4 grounded to 5 causes the fas9480 driver to wake up and report an OTG attachment. It also calls into the S3C_UDC_OTG driver to configure it up and create a vbus session. (start charging) The problem is that in the Nexus S kernel, this driver is device mode only. There is no code to put it into Host mode and the chip can only be in Host or device mode. It can't do both at the same time. Also, the few people that have tried to use host drivers have found that they must disable the device code (including charging capability) to get the hubs to enumerate. It appears that the OTG core in the samsung part is from DesignWare. There are synopsis reference drivers up here: http://www.hackchina.com/en/r/96900/host-_-usb_otg-_-dwc_otg_cil.c__html The register map appears the same, and the code supports host and device mode as well as dynamic switching based on HNP negotiation. It seems like the best way to approach this would be to integrate this code and use the fsa9480 discovery as the hook to force host mode (when OTG is detected) or device mode when other devices are detected. The demo we were under the gun to support will probably just use Nexus one, however I thought the rest of you guys would want to see this. I think if done right, you could have host mode, gadget mode and charging all in the same kernel. Steve -- Steve Modica CTO - Small Tree Communications www.small-tree.com -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel