Optimus One support USB host mode? (update: working now!)

spaic

Senior Member
Dec 18, 2007
82
12
0
Bucharest
Finally got a usb otg cable... bought another CA-157 (with micro USB A plug) and managed to grind the corners that were in the way.

Also hacked a Y cable with two usb A male and one usb A female connectors (one of the male plugs is there only for the power - attached picture)

The bad thing is that my dmesg output looks nothing like the ones in the first kernel post...

Tried usb sticks, a usb hub and a camera...

there is nothing in the dmesg output except some
Code:
<7>[  599.272943] usb usb1: usb resume
<6>[  599.272981] msm_otg_resume: is_host()=0, replaced with 1
<6>[  599.273008] msm_otg_resume: usb exited from low power mode
<7>[  599.273039] msm_hsusb_host msm_hsusb_host.0: resume root hub
<7>[  599.305779] hub 1-0:1.0: hub_resume
and
Code:
<7>[  604.995753] hub 1-0:1.0: hub_suspend
<7>[  604.995824] usb usb1: bus auto-suspend
<7>[  604.995853] msm_hsusb_host msm_hsusb_host.0: suspend root hub
<6>[  604.996803] msm_otg_suspend: USB_CHG_TYPE = USB_CHG_TYPE__SDP
<6>[  604.996843] msm_otg_suspend: usb in low power mode
I have attached a file containing a longer dmesg.
I have no idea why it does not work...

If someone else can give e a hint...
 

spaic

Senior Member
Dec 18, 2007
82
12
0
Bucharest
1) voltage between VCC and GND when nothing is connected
2) voltage between D- and GND and the voltage between D+ and GND when only a charger is connected
3) resistance between D- and GND, and resistance between D+ and GND when nothing is connected
1) ~150mV (voltage only goes from the usb port to the phone not vice versa; maybe there is some way to activate the power flow from the phone to the usb port to enable sensing on pin 4 of the micro usb port and to power external devices? I've seen it somewhere)
2) -120 mV dc, 40mV ac on D-; -120mV dc 40mV ac on D+; some 1.2V AC without power connected
3) very high with no power, both on D- and D+;

EDIT:

Regarding enabling power from te phone to the usb port:

"The next problem is that as far as I know the hero cannot supply power on the USB bus, and I'm not daring to try enabling the USB bus power hardware registers until I know more about how the charging circuitry is implemented."

Found here, also on am MSM chipset, but it's the 7201.

And by the way (offtopic) this thread is all about this...
 
Last edited:

4silvertooth

Senior Member
Mar 23, 2011
1,424
137
0
Android Hell
Well I am not good at this but I just had a look at the thunderg kernel on github (getitnowmarketing) and I think there's drivers for cd-rom in the kernel. A USB cd-rom (self powered) would be great to work on.

Sent from my LG-P500 using XDA Premium App
 

haoto

Member
Apr 14, 2011
15
3
0
Finally got a usb otg cable... bought another CA-157 (with micro USB A plug) and managed to grind the corners that were in the way.

Also hacked a Y cable with two usb A male and one usb A female connectors (one of the male plugs is there only for the power - attached picture)

The bad thing is that my dmesg output looks nothing like the ones in the first kernel post...

Tried usb sticks, a usb hub and a camera...

there is nothing in the dmesg output except some
Code:
<7>[  599.272943] usb usb1: usb resume
<6>[  599.272981] msm_otg_resume: is_host()=0, replaced with 1
<6>[  599.273008] msm_otg_resume: usb exited from low power mode
<7>[  599.273039] msm_hsusb_host msm_hsusb_host.0: resume root hub
<7>[  599.305779] hub 1-0:1.0: hub_resume
and
Code:
<7>[  604.995753] hub 1-0:1.0: hub_suspend
<7>[  604.995824] usb usb1: bus auto-suspend
<7>[  604.995853] msm_hsusb_host msm_hsusb_host.0: suspend root hub
<6>[  604.996803] msm_otg_suspend: USB_CHG_TYPE = USB_CHG_TYPE__SDP
<6>[  604.996843] msm_otg_suspend: usb in low power mode
I have attached a file containing a longer dmesg.
I have no idea why it does not work...

If someone else can give e a hint...

Hi,

I did a bit more testing and figured out why it didn't work for me right from the start, and most likely why it doesn't work for you.

Here are the exact steps one needs to follow to make the hardware act as USB host:
1. Turn off your phone (reboot doesn't work.)
2. Turn on your phone with both the microUSB-A cable and power source connected. It doesn't matter whether any USB device is connected or not.

Now you should be able to connect and use any USB device. I only included drivers for keyboard, HID mouse, usb-storage and some usb-serial drivers, but the rest would be easy.

You can plug/unplug USB devices any number of times, but once the power source is disconnected the USB controller will stop working before another cold start.

I think this behavior is consistent with some other device I read somewhere before, and I don't know if there is any workaround. Since I don't have much more spare time lately I'll have to live with it for now. Hope this helps.

Thanks for your tests btw :)
 

spaic

Senior Member
Dec 18, 2007
82
12
0
Bucharest
But we have common slot for microUSB and charging. ONLY ONE SLOT.
You will have to use a Y usb cable. There are some pictures of my cables, and a general schematic.

What he meant by "the microUSB-A cable and power source connected" was actually "provide USB power to the bus from an external source, because the phone does not provide power to the USB bus"

What I have is:

  1. otg cable from a nokia, with micro usb A male (modified to fit a B plug) and a USB A female.
  2. a Y cable with two USB A male plugs and one USB A female plug, as pictured in my post above (also a schematic)

What you do is connect the micro usb to the phone, the USB A male that has the data pins wired to the OTG adapter (in the USB A female cable) and the other USB A male either to a computer or to a charger that has a USB A female plug (the one that came with my phone is perfect).

When you do this you will:
  1. provide power to the usb bus for the connected devices
  2. charge your phone
 

Attachments

Last edited:
  • Like
Reactions: supertasty

spaic

Senior Member
Dec 18, 2007
82
12
0
Bucharest
still no luck for me...

I get
Code:
<6>[    4.043033] msm_otg_suspend: usb in low power mode
whatever I do. (I don't know if this means that USB is changing mode)

I attached 3 dmesg output files:
  1. first pluged in the micro usb port, pressed power after the battery chaging image appered.
  2. same as above, but screen timeout set to 10 minutes, so it does not enter "screen off" mode
  3. first pressed the power and then pluged in the micro usb plug, before (I hope) the system started to boot, same 10 minutes delay.

each time there was no usb device attached, and then I attached a USB stick.

Could it be because of the version of android I'm running?

I still use the stock romanian kernel, only with changed kernel and the patches for performance (hwacc and quadrant patch). And lately I've been using the franco kernel, except when testing this one.

my android version is 2.2 (not 2.2.1, not 2.2.2), build number FRF91, Software version LG-P500-V10b

Sorry I can't do more testing, but I am also kinda busy...

Although anyone could try and see if it works (mind the red warnings, though, but it's not that complicated nor very dangerous, if you know what you are doing. My phone did not fry), the more feedback the better.
 

Attachments

aaronbutton

Member
Jan 1, 2011
38
5
0
I too would like to have this functionality but i would like to keep with the franco kernel do to the improvements. Can the modules just be copied over with root explorer, ect? If more needs to be done to the kernel such as recompiled could some more information be given? such as the code that needs to be added.

I assume that as the moment the boot.img is just flashed using flash_img via terminal?

Very good work thank you
 

flaviopac

Senior Member
Jan 10, 2008
1,744
14
0
I believe it's supported from 3.1 onwards, 2.3.4 only supports accessory mode
maybe it should support standard usb devices too (self-powered)
I don't think it would be too hard to get it work ;)


Here some notes from the LG P500 service manual:
A. Features(MSM7227)
-USB 2.0 compliant high-speed USB core with limited OTG capabilities


3.9.11. USB
The MSM7227 IC supports one High Speed USB (HS-USB) USBH port with built-in PHY and one Full Speed
USB-UICC port. The MSM7227 IC supports USB interfaces using two controllers:
-The primary controller is the HS-USB port with an integrated physical layer (PHY). This�� HS-USB port is
also capable of supporting USB operations at low-speed and full-speed.
-The secondary controller is the FS USB-UICC port, which only supports host mode functionality.
 
Last edited:

aaronbutton

Member
Jan 1, 2011
38
5
0
As it was said in the early posts other phones (nook color, nexus, htc hero) have this pre-gingerbread (through hacking) and that the for usb host is included in the kernel source just not compiled with official builds. I believe the P500 could do better than the nook as the sense pin is connected so hopefully could switch automatically. The source for the nook and the thread can be found from here http://forum.xda-developers.com/showthread.php?t=1105497. If we had the sources from the OP perhaps we could port his changes into the franco source and maybe learn something from the nook colors sources. :cool: