[HTC Sensation] Yank555:
About chargers and cables ... ?!

Hi,

Been doing some further testings with charging ...

The wall charger of my old htc HD2, labeled 1A, was only charging my Sensation at ~300mA, even though it was detected correctly as a USB DCP (Dedicated Charging Port), which by standards can deliver up to 1.5A.

This was while I was using a slightly longer USB cable than the one that came stock with it.

=> In this case, forced fast charge won't help, there's not enough current going through the cable, no solution on the phone end can change that !!

Now as I tested

the same old charger

using the stock htc USB cable that came along with it, charging current went up

to ~800mA

!

Then I tested still

the same old charger

using another third party USB cable (thicker than the other third party cable, that is the only difference I could tell), and it's loading at ~650mA. Better, but still not stock htc quality.

So the cable does make a hell of a difference ... only if everything fits will it work optimally :rolleyes:

So then I switched the test subject, and I tested all of the cables on my car charger.

And guess what, all were charging

at way over ~800mA

?!

So it is the mix of both you need to consider ! :confused:

My rec on this :

1) check how the charger is rated, that's the source of the power, to fast charge it needs to be 1A, not 500mA

2) if your Sensation is charging below 500mA, enable fast charge

3) if it then charges at a correct rate 650-900mA, your charger is wrongfully detected as USB SDP (Standard Downstream Port, limited to 500mA by standards) and forced fast charge is the way to go

4) if it still is not charging right, test all of the above with different cables, the cable is potentially still an issue

Hope this helps ;)

NB: This is worthwhile reading if you're interested in the topic : http://en.wikipedia.org/wiki/Universal_Serial_Bus

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

And by the way, the newer "soft force" fast charge is working correctly, so if faux pulls it from my repository and adds it to his kernel, you can go for that.

What forced fast charge v2 will do, is :

echo 0 > /sys/kernel/fast_charge/force_fast_charge

No fast charge is done, stock behaviour. Default in the code, so no need to do anything if this is what you want.

echo 1 > /sys/kernel/fast_charge/force_fast_charge

Fast charge is forced, no matter what you connect your Sensation to (this is what forced fast charge v1 does).

Works, but could harm "cheap" implemented USB 2.0 ports, which do not shut themselves off if too much current is drawn from them and only if they then overheat.

echo 2 > /sys/kernel/fast_charge/force_fast_charge

Fast charge is forced only if the attached device

is not detected

as a USB device (a PC is detected as USB device for instance).

So on a wrongfully detected car charger like mine, it will fast charge, on a PC it won't.

This is the safest I could find to protect "cheap" PC hardware.

NB: I tested connecting my Sensation in this mode to my AC powered USB hub while the hub was not connected to a PC, it was not detected as a USB device and fast charge kicked in. Connecting it to that very same hub while the hub was connected to my PC made slow charge happen in this mode. So there is still a residual risk, even if extremely tiny.

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

I have also added a read-only sysfs file that tells you if a device is detected on the USB port. This will work no matter how fast charge is configured :

cat /sys/kernel/fast_charge/USB_peripheral_detected

If this returns :

0 - no USB device is currently attached (even though a charger could very well be attached !)

1 - a real USB device is currently attached (like a PC)

This can help debugging when looking for a good charger / cable !

JP.

PS: Thanx to show-p who gave me the kick to investigate deeper and the idea to find a way to use device detection to influence fast charge behaviour ! We found the very same solution at more or less the same time while working on this seperately, so it can't be too bad :laugh: