Storage [Q] Where in the source code is AC charging handled?

Could someone please direct me to the file in the manta source code what decides if the tablet should be charging or not?

I am trying to learn how to do some kernel hacking, and would like to start with a simple project.

I just got a Nexus 10 for Christmas, and I love it. I got a powered OTG cable and usb hub. Keyboard, mouse, and gamepad work flawlessly in CM, but the Nexus doesn't charge while I'm using them. I also have an Atrix 2, which I'm not very fond of, but it charges just fine under the same setup. The source for the Atrix 2 isn't available, so I got the source code for the Droid Bionic which I believe is close to identical if it's not the same phone. Once upon a time, I knew how to code, and I want to re-learn. I have plenty of manuals laying around.

What I'd like to do is re-compile the kernel with better behavior for OTG. I want it to check for incoming voltage, and AC charge if it sees it.

The only problem is that I'm completely unfamiliar with the kernel and system sources. I see the source for manta here:
(woops! Can't post links. Github. android_kernel_samsung_manta)

and the Droid Bionic here:
(Ditto. Sourceforge. droidbionic)

I was hoping someone could tell me whereabouts in the CM code it actually detects that a USB cable has been plugged in, and decides what actions to take. I can look back and forth between the two and sort it out, and learn a bit about how it's plumbed together. Additional commentary on how I should proceed would be most appreciated.

Thanks!