[Samsung Galaxy Nexus] highvista:
Boot Images with Modded Kernel for USB OTG with Power Via Y-Cable

It looks like it works! Both the phone and my 64GB flash drive are being powered via a USB charger connected to a Y-cable. As far as I can tell, the phone battery isn't being charged and may still be draining a bit--this may depend on the current delivered by the USB charger. But I've been playing music for hours from an attached USB flash drive with my screen on and the battery level is still sitting at 98%.

I've attached ZIP files with a boot image containing the kernel. The yakju boot image was created by replacing the stock kernel in a Nandroid boot image obtained from the Galaxy Nexus described in my sig. The other boot images were created from the boot image included with the Google factory ROM. I can't test these, so use with caution. NOTE!!! Make sure you do a Nandroid backup of your phone before trying out the attached boot images. Things can go wrong and you want to be able to recover.

This was posted earlier in the thread, but credits for the kernel code tweak, along with details, go to the contributor to this thread

http://rootzwiki.com/topic/30615-can-you-charge-usb-host-mode-simultaneously/

Have fun! :)

-----------------------------

10/09/12:

I've added two more ZIP files. These contain boot images with the code modded such that the phone battery is charged when using the Y-cable. NOTE: The phone will think it is being charged any time a USB OTG cable is connected. I haven't figured out a way around this yet. This doesn't really hurt anything, except if you have your phone set to stay on when charging, you could end up running down your battery! Important safety tip. :)

-----------------------------

10/15/12:

I've replaced the previous ZIP files with two new ones. These contain boot images for takju and yakju JRO03C/4.1.1 that provide USB OTG+charging, with the added benefit that you can still use a standard USB OTG cable to connect an external device. As in the stock kernel, the phone will provide power for the external device. In other words, the new kernel in the ZIP archives auto-detects if there is a charger attached via a y-cable and uses it to power the external device and charge the phone, if it's found.

I've also fixed the problem where the phone would show a charging icon in the notification bar if a USB OTG cable was attached without any external device connected to it.

-----------------------------

12/10/12:

NOTE: THESE ZIP FILES ARE NOT MEANT TO BE FLASHED TO YOUR PHONE. These files contain a file called boot.img that can be flashed to your rooted phone from your computer via ADB with the commands

fastboot flash boot /path/to/<boot>.img

fastboot reboot

You can learn more about using fastboot at http://wiki.cyanogenmod.org/wiki/Fastboot.

-----------------------------

12/28/12:

Version V4 is replacing V3. This new version fixes the bug where detaching external power from the USB OTG y-cable or USB hub wasn't detected by the phone. Now, when power is detached, the phone switches to battery power, including supplying battery power to any attached USB devices.

Note that the reverse is not true. If you connect external power when the phone and external USB devices are being powered by battery, the phone will continue to use battery power. The external power is not detected. When in doubt, disconnect and reconnect the USB OTG cable to cause the phone to recognize what's attached.