Post Reply

[KERNEL PATCH] Force AC (fast) Charging

OP chad0989

11th April 2012, 12:09 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 was a pretty big hit on some other devices so I figured I'd give it a shot for you guys. This allows one to force AC charging for any charger that is detected as USB (e.g. many car chargers) and pull the full current the charger can support. It also provides additional security when connecting to public charging stations because by forcing AC charging, USB/adb data transfers are disabled, protecting your data.

It is essentially a software version of the modified charge only usb cables.

Fast charge can be toggled by issuing:

echo 1 > /sys/kernel/fast_charge/force_fast_charge

and off:

echo 0 > /sys/kernel/fast_charge/force_fast_charge

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

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

I have also implemented a toggle in IncrediControl (free) that will allow you to turn it on and off.

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

For the widget (or any fast 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).

http://www.incredikernel.com/wp-cont...t_charge.patch
Attached Thumbnails
Click image for larger version

Name:	off.jpg
Views:	737
Size:	4.5 KB
ID:	996506   Click image for larger version

Name:	on.jpg
Views:	706
Size:	9.4 KB
ID:	996507  
The Following 11 Users Say Thank You to chad0989 For This Useful Post: [ View ]
12th April 2012, 09:12 PM   |  #2  
Senior Member
Thanks Meter: 23
 
269 posts
Join Date:Joined: Jan 2011
More
i'm not a dev, but im very looking forward to seeing this in future kernel updates.

there are still many car chargers out there that could do 1ah charging but are recognized as standard usb chargers. with that you cant even use navigation without loosing battery over some time.

btw your apps are awesome!
12th April 2012, 10:20 PM   |  #3  
OP Senior Member
Thanks Meter: 9,453
 
1,883 posts
Join Date:Joined: Oct 2010
Donate to Me
Quote:
Originally Posted by veitograf

i'm not a dev, but im very looking forward to seeing this in future kernel updates.

there are still many car chargers out there that could do 1ah charging but are recognized as standard usb chargers. with that you cant even use navigation without loosing battery over some time.

btw your apps are awesome!

What kernel do you use? I'll patch it and build a copy for you real quick.

Edit: I looked at your signature and saw virtuous quattro. Here is the kernel built from the github from that ROM:
http://chad0989.dyndns.org/mirror/vi...fastcharge.zip

Enjoy.
Last edited by chad0989; 12th April 2012 at 11:05 PM.
The Following 3 Users Say Thank You to chad0989 For This Useful Post: [ View ]
13th April 2012, 01:50 PM   |  #4  
fridgie's Avatar
Senior Member
Flag Brisbane
Thanks Meter: 14
 
132 posts
Join Date:Joined: Jan 2012
More
I'm sure interested in this, am sick of my phone dying when connected to car charger. Hopefully someone can write this for affinity as I just don't have the skills.

Amazes me how you guys can do this stuff
13th April 2012, 01:56 PM   |  #5  
Senior Member
Thanks Meter: 23
 
269 posts
Join Date:Joined: Jan 2011
More
Quote:
Originally Posted by chad0989

What kernel do you use? I'll patch it and build a copy for you real quick.

Edit: I looked at your signature and saw virtuous quattro. Here is the kernel built from the github from that ROM:
http://chad0989.dyndns.org/mirror/vi...fastcharge.zip

Enjoy.

thanks man, appreciate that!

edit, does this work with sensation too? i got one lying around.
13th April 2012, 11:01 PM   |  #6  
OP Senior Member
Thanks Meter: 9,453
 
1,883 posts
Join Date:Joined: Oct 2010
Donate to Me
Quote:
Originally Posted by veitograf

thanks man, appreciate that!

edit, does this work with sensation too? i got one lying around.

Not yet, but if there is interest I can make a patch for the sensation also.
23rd April 2012, 01:27 AM   |  #7  
Senior Member
Flag Iloilo City
Thanks Meter: 1,676
 
2,877 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Hi chad! Would really like to port your patch to the Sony's Xperia Devices but I'm stuck at the moment on

msm72k_udc.c

Could I ask some help?

We don't have charger_detect() function so I'm lost on where to apply some of the patches on that file. If you want you could browse the file here

http://108.166.90.15/.rom/XPR/kernel...t/msm72k_udc.c

Or browse the entire kernel for Xperia 2011 devices here

http://108.166.90.15/.rom/XPR/kernel/

and tarball here if you want

http://108.166.90.15/.rom/XPR.tar
24th April 2012, 10:53 AM   |  #8  
itandy's Avatar
Senior Member
Hong Kong
Thanks Meter: 1,055
 
1,708 posts
Join Date:Joined: Apr 2010
More
Anyone knows if any existing IncS kernels support Force AC? I really like to use it to boost the charge time.

@chad0989, if possible, can you also mod the X-ICS AOSP V3 kernel for us? The source link is here. Many thanks!
Last edited by itandy; 24th April 2012 at 11:02 AM.
24th April 2012, 03:15 PM   |  #9  
Silversniper's Avatar
Senior Member
Flag Linz
Thanks Meter: 319
 
1,224 posts
Join Date:Joined: Nov 2011
More
Quote:
Originally Posted by chad0989

This is for kernel devs only. The patch itself is useless to those who do not/can not compile their own kernel.

This was a pretty big hit on some other devices so I figured I'd give it a shot for you guys. This allows one to force AC charging for any charger that is detected as USB (e.g. many car chargers) and pull the full current the charger can support. It also provides additional security when connecting to public charging stations because by forcing AC charging, USB/adb data transfers are disabled, protecting your data.

It is essentially a software version of the modified charge only usb cables.

Fast charge can be toggled by issuing:

echo 1 > /sys/kernel/fast_charge/force_fast_charge

and off:

echo 0 > /sys/kernel/fast_charge/force_fast_charge

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

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

I have also implemented a toggle in IncrediControl (free) that will allow you to turn it on and off.

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

For the widget (or any fast 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).

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

Can you make a Kernel for sense Rom with that and uv support?

Sent from my HTC Incredible S using xda premium
9th July 2012, 09:48 AM   |  #10  
Senior Member
Flag Altenburg, Thuringia, Germany
Thanks Meter: 67
 
455 posts
Join Date:Joined: Jul 2009
ignore---sry

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes