More on the charging USB OTG Nexus 7

So i can reliably charge now with the USB OTG cable.

I found I had a problem wit the cable I had bought: it should have 100K between pin 4 & pin 5, but pin 4 was No-Connect. E.g. see here.

I cut the shield off the cable i was using with an xacto knife (this is pretty easy, there’s a seam).


From here I could see it not only didn’t have the resistor on pin 4-5, but it didn’t even bring pin-4 out to the little ‘circuit board’ for soldering to. Crap.


Fortunately USB cables are the cockroaches of our generation, and i had a few to sacrifice to the cause just laying around.  So i slit the next one open, spliced two cables (red-red, black-black, 100K from pin 4-5, and white/green one-off to one connector). [Note: later i learned this needs to be 124K. the online site i found was wrong, i looked it up in the USB Battery Charging standard]


Now the system detects that its a OTG charging cable, and starts/stops the charging when I plug in power.

With my patch in msm_otg.c, I call the smb345 charger instead of the pm8921 charger. But i run into some other troubles. The smb345 driver does not implement the ‘power properties’ (e.g. see the smb349 driver which does, e.g. see POWER_SUPPLY_PROP_CURRENT_MAX). So msm_otg_notify_power_supply() fails (since power_supply_set_current goes nowhere).

I’m also not sure what to stub in for pm8921_charger_vbus_draw.

So without this, it seems to leave the actual device in b_idle state, which is pointless. I can charge but no accessories!






3 Responses to “More on the charging USB OTG Nexus 7”

  1. greg

    Love the duct-tape + twine hack to solder that full-size through-hole resistor onto the cable, and thanks much for your ongoing work to share the results of your kernel hacking on these drivers.

    Have you tried the following USB cables from amazon:
    “Micro USB Host OTG Cable with Micro USB Power for Nexus 7 Galaxy S III & Galaxy Nexus by GMB” — $6.99
    “Micro USB Host OTG Cable with Micro USB Power for Samsung i9100 i9300 i9220 i9250 by AtomicMarket” — $9.99

    I use cables like these to support simultaneous printing + charging on Nexus 7 v1 tablets, and they work well. You can get these cheaper from China via eBay, but in that case they take weeks to ship.

    Here’s the weird thing though — I just measured the resistance between pin 4 + 5 on my OTG cable (works for host mode + charging with my nexus 7 v1), but I get 0 ohms. I’m using the 200k-ohm range on my multi-meter. I guess it is possible that my multi-meter is inaccurate. I don’t have any 100k-ohm or 124k-ohm resistor handy to test, but as far as I can tell, these cables (advertised as USB OTG charge Y cables) just short pins 4 & 5 together w/o a resistor.

    Did you start out with one of these cables and add your resistor after they were not working?

  2. Don Bowman

    so i have bought several of those cables. they also all have a dead short between those pins. on the ‘2013’ nexus 7, and they do not cause me to charge.
    the 1st gen nexus 7 didn’t charge either until some work by Timur. But he made it unconditionally charge I believe.

  3. bharath

    I use 100k resistor between pin 4&5 ,it works as a charger but failed to work as a otg

Leave a Reply

Your email address will not be published. Required fields are marked *