[EVO 4G Q&A, Help & Troubleshooting] spotopolis:
So I was trying to find a way to force my EVO to charge on USB at 1A (1000mA) while connected to my PC. My machine is new enough and strong enough to support this. I do a lot with my phone and PC to Phone charging is the best solution for me. I don't want to mod my USB cable because then I cant transfer data to the phone while charging. I don't want an extra battery either. Thats not the point. I would like the full charge effect while in USB to PC mode. I found this code in another post and removed the "debug" line from "cat /sys/kernel/debug/htc_battery/charger_state" to make it work with CM7, But I don't see a difference. Phone still shows USB connected not AC. Would this not effect the charge like it was suggested? Is there another way? I have seen multiple topics on this but no one ever gave a straight answer to the OP question. They always gave alternatives and cautions. This code is the closest I found to an actual solution.

> adb shell
$ su
# mount -t debugfs none /sys/kernel/debug/
# cat /sys/kernel/htc_battery/charger_state
1

ok all is good, 1 is slow charging and since we are connected to USB that is correct

(I never go the "cat /sys/kernel/htc_battery/charger_state" to work, and was never displayed a "1" or any number, so I moved on.)

Next, lets get some battery information

# cat /sys/class/power_supply/battery/uevent
POWER_SUPPLY_NAME=battery
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CAPACITY=41

ok, all good. Now lets stop the phone from charging

# echo 0 > /sys/kernel/htc_battery/charger_state

now, lets check the battery information

# cat /sys/class/power_supply/battery/uevent
POWER_SUPPLY_NAME=battery
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CAPACITY=41

Ok, seems to work (though at this point cat charger_state returns 'charger_state: invalid length')

let's try setting it to fast charge

# echo 2 > /sys/kernel/htc_battery/charger_state

charger_state is still giving invalid length but if we check the battery information

# cat /sys/class/power_supply/battery/uevent
POWER_SUPPLY_NAME=battery
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CAPACITY=41

EDIT: I never got the "invalid length" error it mentioned either, but the "POWER_SUPPLY_STATUS=" did change from "Discharging" to "Charging"

I did dig around with ES file Explorer and found that "/sys/class/power_supply/" has an "AC", "Battery", and "USB" folder and each has an "uevent" file. When opened in text "AC" shows:

POWER_SUPPLY_NAME=ac
POWER_SUPPLY_ONLINE=0

"USB" shows:

POWER_SUPPLY_NAME=usb
POWER_SUPPLY_ONLINE=1

So if I changed

POWER_SUPPLY_NAME=usb
POWER_SUPPLY_ONLINE=1

to

POWER_SUPPLY_NAME=usb
POWER_SUPPLY_ONLINE=0

would that make it work? Just a thought...

EDIT... Again: Tried that and the opposite for the "AC" and it just reverted. I did notice if you go to "/sys/class/power_supply/(any folder)/subsystem" it seems almost never ending how far down the folders and files repeat deeper and deeper.