I am going to leave this here for the benefit of others who wishes to use this into their own handset - this will vary across different kernels.
Someone emailed me, and was trying to fit it within their LG Optimus 3D (P920), this is what I replied to this person,
Quote
Was looking at the Gerrett-RoadRunnerKernel-Cosmos, in
drivers/mfd/twl_core.c which *I* think is where the battery
regulator is...
And judging by the module itself, it looks like redirecting a value
to a sysfile is not a requirement here (that is in relation to the
MSM architecture in which USB Charge Commander does it in that
fashion), rather, more so, ioctl calls would have to be made, as
there's read/write functions in there, used in conjunction with
drivers/mfd/twl6030-gpadc.c (*/static long
twl6030_gpadc_ioctl(struct file *filp, unsigned int cmd, unsigned
long arg) /*)but this part caught my eye within twl_core.c
In the function *static void _init_twl6030_settings * there's this:
/* CHARGERUSB_CTRL3 */
twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x21, 0xEA);
so I'd imagine an ioctl call to write a value to 0x21 (perhaps that
is a command you pass into the ioctl?), a value probably an inverse
of 0xEA to indicate no charge? (I am not 100% certain as am not
familiar with OMAP architecture - and please don't try write to it
directly for my fear due to limited knowledge of the said
architecture and perhaps risking damaging the battery)
So it will depend on your chipset and kernel. This Optimus as in this case, in which I received that in email was my actual reply above. USB Charge Commander only works with the msm architecture - specifically, msm7227 which uses the MSM battery driver built into the kernel which from there, bore the idea of USB Charge Commander.
All in all, you need to look through the kernel sources depending on your chipset and possibly would require an ioctl call to the driver itself to disable it for your handset.
Now, disclaimer follows - please do not try this on your handset and assume that in my reply to the person, that is to be taken as a given for your handset.