[KERNEL][ICS][anykernel] USB Host mode (OTG) driver for Nexus S [BUILD 5]

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
876
0
London
sztupy.hu
USB Host mode driver for Nexus S

Also available on the Samsung Captivate and Samsung Galaxy S

(main post and more info at the SGS dev site)​

Disclaimer: This kernel will enable some very early, and rough usb OTG support for your phone. Currently the phone DOES NOT give out power, so you NEED an external power source to be able to use this kernel. This is true for ALL USB devices, even with those that have their own power source, and doesn't requre external bus powering. Solving this limitation is a TODO, but we cannot guarantee anything. There are some other phones that have usb host support the same way this kernel has (eg. they need external power), like the Nexus One, and there is also a community using this, so if you're saying that usb host support has no sense if you need an external power source then you are definitely mistaken.

This kernel is built upon the official ICS kernel from google's git repository. It is possible to port this to older ROMs (like CM7, or stock Gingerbread). Ask your favourite kernel developer to do this for you.

Credits goes to:
  • The misterious guy at Samsung(?) called chul2 for the original s3c host drivers
  • Kevin Hester (kevinh, probably also nicknamed geeksville, punkgeek and humcycles) for fixing the s3c host driver for the Samsung Galaxy Tab
  • Ever kernel developer at teamhacksung for bringing ICS goodness to Galaxy S

This is a very early, and very rough usb host support. Expect crashes, freezes and things that are not working! You will also need external power (probably through a Y-cable or a powered usb hub, see the device connection guide below). Also make sure you are only using USB 2.0 (high-speed) devices. The driver does has some quirks with USB 1.x low-speed and full-speed devices, like mice, keyboards and similar things. Read the FAQ for more information about them. And of course it doesn't work with USB 3.0 (super-speed) devices.

Device connection guide:


FAQ: see post 2 at SGS
ChangeLog: see post 3 at SGS
Developer notes: see post 4 at SGS
Download links: see post 6 at SGS

Usb Host Controller: see it's own topic
 
Last edited:

coolfranz

Senior Member
Jan 24, 2011
93
18
28
Thanks sztupy for porting this to the Nexus S!

I flashed your Kernel to my Nexus S (i9023). First of all it does boot, everything seems to work, did not brick my phone :)

The Nexus also found my hub in way, but i couldn't see any devices. But i won't say it is a problem with your kernel, i think it is more a problem with my insufficient wiring because i have not enough cables/adapters yet, but i will get some this week, so i can do more testing then!

So here is what UHC showed so far:
 
Last edited:
  • Like
Reactions: densinyo and sztupy

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
876
0
London
sztupy.hu
Thanks sztupy for porting this to the Nexus S!

I flashed your Kernel to my Nexus S (i9023). First of all it does boot, everything seems to work, did not brick my phone :)

The Nexus also found my hub in way, but i couldn't see any devices. But i won't say it is a problem with your kernel, i think it is more a problem with my insufficient wiring because i have not enough cables/adapters yet, but i will get some this week, so i can do more testing then!

So here is what UHC showed so far:
It does seem to be working according to this picture. Thanks for testing!
 
  • Like
Reactions: Darrien13

qtwrk

Senior Member
Sep 9, 2011
2,717
867
0
30
Barcelona
ok....a noopie question , what is this for ?

just make phone like computer which can control other USB devices , like extrac pictures from Camera and something like that ?
 

Flukzr

Senior Member
Nov 24, 2011
66
39
0
It would enable you to connect any storage usb storage device to your NS, think usb drives, memory cards, external HDDs.
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
876
0
London
sztupy.hu
Works, but wifi doesn't work. Will this work if I just use a usb micro cable then a f-f coupler with a powered hub? I made a CWM installable package - attached below.
Did you install the wifi modules too from the zip package? Are they installed to the correct location (I don't know where they need to be, sorry)
 

Epic_VS

Senior Member
Dec 6, 2011
173
42
0
Did you install the wifi modules too from the zip package? Are they installed to the correct location (I don't know where they need to be, sorry)
they weren't in the right position. I think they have to be in /system/modules/driver.ko instead of /system/lib/modules/driver.ko

I moved it, but it still wasn't working.
 

developersdevelopers

Senior Member
May 24, 2011
154
32
0
I briefly tested out the flashable version compiled by Epic_VS. My setup was with a micro USB OTG connector and an externally powered hub. I also tried my own hacked together USB cable, in place of the OTG connector.

In short, I was only able to get the message "Root hub found". I tried connecting a mouse (which I know is usb 1.1, but I thought I'd try anyways), a 360 controller, and a few different USB thumb drives. None of the thumb drives showed up as listed devices, and they did not show up in the mount point under /mnt.

Works, but wifi doesn't work. Will this work if I just use a usb micro cable then a f-f coupler with a powered hub? I made a CWM installable package - attached below.
I don't think that would work. You'll need to make sure that the unused pin on the micro USB side is soldered to its ground pin (as seen here: http://forum.xda-developers.com/showthread.php?t=1068197
 

Epic_VS

Senior Member
Dec 6, 2011
173
42
0
I briefly tested out the flashable version compiled by Epic_VS. My setup was with a micro USB OTG connector and an externally powered hub. I also tried my own hacked together USB cable, in place of the OTG connector.

In short, I was only able to get the message "Root hub found". I tried connecting a mouse (which I know is usb 1.1, but I thought I'd try anyways), a 360 controller, and a few different USB thumb drives. None of the thumb drives showed up as listed devices, and they did not show up in the mount point under /mnt.



I don't think that would work. You'll need to make sure that the unused pin on the micro USB side is soldered to its ground pin (as seen here: http://forum.xda-developers.com/showthread.php?t=1068197
I made one and it works. If you read his sgs thread, he said cables without pin 5 grounded will work in host and auto-host, but not in otg mode. I got a flash drive to show up in the app, but it would not mount to /mnt/ehdd/

I attached 2 pics.
 

Attachments

developersdevelopers

Senior Member
May 24, 2011
154
32
0
I made one and it works. If you read his sgs thread, he said cables without pin 5 grounded will work in host and auto-host, but not in otg mode. I got a flash drive to show up in the app, but it would not mount to /mnt/ehdd/

I attached 2 pics.
Oh cool, I didn't see that. I'll give it a try again when I get home later today.

Is your flash drive ntfs or fat32 partitioned?


Sent from my Nexus S using XDA App
 

Epic_VS

Senior Member
Dec 6, 2011
173
42
0
Oh cool, I didn't see that. I'll give it a try again when I get home later today.

Is your flash drive ntfs or fat32 partitioned?


Sent from my Nexus S using XDA App
It is fat32 4gb. I will try a 2gb flash drive now.

2gb flash drive now comes up with a mount option like the one shown here:



I click the mount button, but it still doesn't mount
 
Last edited: