Post Reply

[KERNEL PATCH] - Force AC (fast) or USB(slow) charging

28th March 2012, 08:51 PM   |  #1  
OP Senior Member
Thanks Meter: 9,453
 
1,883 posts
Join Date:Joined: Oct 2010
Donate to Me
This is for kernel devs only. The patch itself is useless to those who do not/can not compile their own kernel.

This patch allows one to force AC or USB charging for any charger. It also provides additional security when connecting to public charging stations because with either force AC or force USB mode on, USB transfers are disabled, protecting your data.

Fast charge can be toggled by issuing:

echo 1 > /sys/kernel/fast_charge/force_charge_mode

Slow charge:

echo 2 > /sys/kernel/fast_charge/force_charge_mode

and off:

echo 0 > /sys/kernel/fast_charge/force_charge_mode

Plug your phone into the charger AFTER toggling the desired mode.

In addition I have created a toggle fast charge widget that may be used to toggle fast/slow charge on and off right from your home screen:

https://play.google.com/store/apps/d...stchargewidget

I have not yet implemented the three way toggle into incredicontrol (free), but I will be. I have to change it to support slow charge also and haven't yet gotten the chance to. I will be implementing it when I get the chance though so you guys have a convenient free way to toggle also.

For the widget (or any fast/slow charge toggle) to work, you MUST be running a kernel that has this patch implemented.

As a good gesture to support a fellow dev, I ask that if you implement the patch into your kernel, please link to my widget as one means to toggle it. You are of course free to provide other ways to toggle it as well if you so desire.

Kernel devs, if you would like to test the widget yourself to confirm its working, and for convenience of testing, please contact me and I will provide you with a copy. You must show that you are a kernel dev though (i.e. link me to your kernel post so I can match your username).

Good luck have fun!

http://www.incredikernel.com/wp-cont...t_charge.patch

Here is the neoblaze kernel (stock froyo/gb, not AOSP) patched with the mod so that you guys can test. I will not be supporting anything regarding this kernel except the charging mod itself!

http://chad0989.dyndns.org/mirror/o2..._neoblaze2.zip
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2012-05-07-13-22-44.jpg
Views:	674
Size:	19.5 KB
ID:	1052983   Click image for larger version

Name:	2012-05-07_13-32-00.jpg
Views:	535
Size:	33.0 KB
ID:	1052984   Click image for larger version

Name:	2012-05-07_13-32-27.jpg
Views:	534
Size:	33.4 KB
ID:	1052985   Click image for larger version

Name:	2012-05-07_13-32-41.jpg
Views:	476
Size:	33.9 KB
ID:	1052986  
Last edited by chad0989; 10th May 2012 at 07:10 PM.
The Following 30 Users Say Thank You to chad0989 For This Useful Post: [ View ]
28th March 2012, 08:55 PM   |  #2  
Senior Member
Flag Ulm
Thanks Meter: 67
 
245 posts
Join Date:Joined: Feb 2012
Donate to Me
More
Sounds interesting even though i dont own a car!
28th March 2012, 08:59 PM   |  #3  
OP Senior Member
Thanks Meter: 9,453
 
1,883 posts
Join Date:Joined: Oct 2010
Donate to Me
Quote:
Originally Posted by langhaardack

Sounds interesting even though i dont own a car!

Its not necessarily just for car chargers, that's just the easiest example. It can be used with any charger that is detected as USB. Some powered hubs for example can easily put out 1A but would still be limited to 500mA by the phone. The patch will allow you to toggle force AC mode on/off via an app or widget.
28th March 2012, 09:09 PM   |  #4  
Senior Member
Flag Ulm
Thanks Meter: 67
 
245 posts
Join Date:Joined: Feb 2012
Donate to Me
More
Ya i got that but the only usb-charger besides the outlet that i use is my laptop, and i use it only for transferring files. still a great idea!
28th March 2012, 10:18 PM   |  #5  
Ferrum Master's Avatar
Senior Member
Flag Rīga
Thanks Meter: 272
 
916 posts
Join Date:Joined: Dec 2010
More
In other words. If you will be using USB port and cable as current source, The specification asks for Data + and - to be shortcut. And normally phone detects it and also the fifth sense pin and then high current charging must kick in. (although our LG phone uses also it to enter download mode)

If you use the widget and enable high current charging, you'll fry out your motherboards USB port probably...

Another warning. If someone has read about Lithium Cell charging methods AVR based documentation for example. Such high current charging decreases your battery cycle life. So consider those facts first of all!

And those with car chargers... especially cheap ones... in most of these devices are SMD LM317 or LM7805 etc family inside... it will dissipate 7V@1A=7W so these sticks will fry out and also blow up despite it can deliver 1.5A - the catch is with proper heat sink.

So So So... dear coders... consult your hardware guys before acting for the good deeds... the cons are more than the gain.
The Following 2 Users Say Thank You to Ferrum Master For This Useful Post: [ View ]
28th March 2012, 10:30 PM   |  #6  
OP Senior Member
Thanks Meter: 9,453
 
1,883 posts
Join Date:Joined: Oct 2010
Donate to Me
Quote:
Originally Posted by Ferrum Master

In other words. If you will be using USB port and cable as current source, The specification asks for Data + and - to be shortcut. And normally phone detects it and also the fifth sense pin and then high current charging must kick in. (although our LG phone uses also it to enter download mode)

If you use the widget and enable high current charging, you'll fry out your motherboards USB port probably...

Another warning. If someone has read about Lithium Cell charging methods AVR based documentation for example. Such high current charging decreases your battery cycle life. So consider those facts first of all!

And those with car chargers... especially cheap ones... in most of these devices are SMD LM317 or LM7805 etc family inside... it will dissipate 7V@1A=7W so these sticks will fry out and also blow up despite it can deliver 1.5A - the catch is with proper heat sink.

So So So... dear coders... consult your hardware guys before acting for the good deeds... the cons are more than the gain.

Absolutely not. It would have no negative effects on your battery at all as the current isn't increased beyond what it is for AC charging.

Also you notice nowhere that my recommendations were for using it to charge from a motherboard. Despite that, the current pulled from the board is ultimately limited to the fuse at the port. Even if a device successfully tries to pull more than the board can provide (which the board won't put out anyway), the PPTC will cut off power to the device.

So So dear hardware guys, please read before jumping all over someone.
Last edited by chad0989; 28th March 2012 at 10:38 PM.
28th March 2012, 10:42 PM   |  #7  
Ferrum Master's Avatar
Senior Member
Flag Rīga
Thanks Meter: 272
 
916 posts
Join Date:Joined: Dec 2010
More
Quote:
Originally Posted by chad0989

Absolutely not. It would have no negative effects on your battery at all as the current isn't increased beyond what it is for AC charging.

Also you notice nowhere that my recommendations were for using it to charge from a motherboard. Despite that, the current pulled from the board is ultimately limited to the fuse at the port. Even if a device successfully tries to pull more than the board can provide (which the board won't put out anyway), the PPTC will cut off power to the device.

So hardware guy, how about you read before jumping all over something.

Then please why I have to repair broken motherboards that Ipad2 have fried a lot? Why? Because they are cheap mate, and fuse is the last resort. And No current limitations aren't implemented there...

I said once again. This 0.5A setting is the most green one, as many manufacturer use as a law!
The fact that some make a PR and tell our device charges faster doesn't overthrow simple chemistry and physics. Ok it will work. Charging the cell with higher current, raises temps and other chemical emissions and it deteriorates faster! So the philosophy is simple for them, the user will kill its battery faster in order to buy a new phone eh? Nice!
28th March 2012, 11:05 PM   |  #8  
OP Senior Member
Thanks Meter: 9,453
 
1,883 posts
Join Date:Joined: Oct 2010
Donate to Me
Quote:
Originally Posted by Ferrum Master

Then please why I have to repair broken motherboards that Ipad2 have fried a lot? Why? Because they are cheap mate, and fuse is the last resort. And No current limitations aren't implemented there...

I said once again. This 0.5A setting is the most green one, as many manufacturer use as a law!
The fact that some make a PR and tell our device charges faster doesn't overthrow simple chemistry and physics. Ok it will work. Charging the cell with higher current, raises temps and other chemical emissions and it deteriorates faster! So the philosophy is simple for them, the user will kill its battery faster in order to buy a new phone eh? Nice!

I agree with you that it shouldn't be used to charge from a motherboard, although many have taken the risk without issues.

Essentially it is a software version of the charging cables with bridged data lines ("charge only") that many buy and have no issues with. I'm just bridging the data lines in software so to speak. The current draw is never increased beyond the phone's spec. The most important thing is that the end user knows the source they are drawing from is capable of providing the current.

I do appreciate your concern for the community and desire to educate everyone. We need more people like you around.

So with that, each individual can make an informed decision on their own. If anyone is still interested in the mod, shoot me a PM if you want to test.
28th March 2012, 11:06 PM   |  #9  
Senior Member
Flag On The Run
Thanks Meter: 458
 
1,063 posts
Join Date:Joined: Nov 2009
More
Yup, there isn't much math to be done here.

Higher current means higher temps, and O2X already has trouble with temps as it is.

However, to each his own, and as long as people are aware of what they're doing there is no such thing as too many options... although me personally I would stay away from this one.

EDIT: Wait... so you're saying that O2X charges at 1A when connected to a wall charger and at 0.5A when connected with USB? I get the point now. So you only risk damaging the motherboard, and not the phone.

I'm guessing it would be more interesting for O2X users to do the opposite! A 'Force USB charging' because from what I see a lot of people get SoD while charging their phones overnight and this might fix it

What do you say Chad? Would you be interested in implementing this feature? I think I would use it!
Last edited by LarsPT; 28th March 2012 at 11:12 PM.
The Following User Says Thank You to LarsPT For This Useful Post: [ View ]
28th March 2012, 11:10 PM   |  #10  
Ferrum Master's Avatar
Senior Member
Flag Rīga
Thanks Meter: 272
 
916 posts
Join Date:Joined: Dec 2010
More
Quote:
Originally Posted by chad0989

I agree with you that it shouldn't be used to charge from a motherboard, although many have taken the risk without issues.

Essentially it is a software version of the charging cables with bridged data lines ("charge only") that many buy and have no issues with. I'm just bridging the data lines in software so to speak. The current draw is never increased beyond the phone's spec. The most important thing is that the end user knows the source they are drawing from is capable of providing the current.

I do appreciate your concern for the community and desire to educate everyone. We need more people like you around.

So with that, I guess each individual can make an informed decision on their own. If anyone is still interested in the mod, shoot me a PM if you want to try.

Yes, you have to set up proper warnings! Because there are always American(no offense) like users who will try to dry their own cat in microwave, because it wasn't prohibited in instructions . They will accuse you with headlines - you didn't say... etc - I know it from my personal work.

The Following User Says Thank You to Ferrum Master For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Optimus 2x Android Development by ThreadRank