5,593,650 Members 39,889 Now Online
XDA Developers Android and Mobile Development Forum

[KERNEL PATCH] Force AC (fast) Charging

Tip us?
 
chad0989
Old
#1  
Senior Member - OP
Thanks Meter 9448
Posts: 1,883
Join Date: Oct 2010

 
DONATE TO ME
Default [KERNEL PATCH] Force AC (fast) Charging

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:	725
Size:	4.5 KB
ID:	996506   Click image for larger version

Name:	on.jpg
Views:	700
Size:	9.4 KB
ID:	996507  
The Following 11 Users Say Thank You to chad0989 For This Useful Post: [ Click to Expand ]
 
veitograf
Old
#2  
Senior Member
Thanks Meter 22
Posts: 261
Join Date: Jan 2011
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!
nexus 4 - paranoid android

www.veitograf.de
 
chad0989
Old
(Last edited by chad0989; 12th April 2012 at 11:05 PM.)
#3  
Senior Member - OP
Thanks Meter 9448
Posts: 1,883
Join Date: Oct 2010

 
DONATE TO ME
Quote:
Originally Posted by veitograf View Post
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.
The Following 3 Users Say Thank You to chad0989 For This Useful Post: [ Click to Expand ]
 
fridgie
Old
#4  
fridgie's Avatar
Senior Member
Thanks Meter 14
Posts: 132
Join Date: Jan 2012
Location: Brisbane
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
CURRENT DEVICE: Samsung Galaxy S3 LTE - I9305
ROM: Ripper Rom V13 - MOTO MOTO theme
KERNEL: Perseus

DEVICE #2: Samsung Galaxy Tab2 10.1 - GT-P5100
ROM: Ripper Rom V5

DEVICE #3: HTC One SV - C525e
Stock as a rock......Awaiting some development
 
veitograf
Old
#5  
Senior Member
Thanks Meter 22
Posts: 261
Join Date: Jan 2011
Quote:
Originally Posted by chad0989 View Post
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.
nexus 4 - paranoid android

www.veitograf.de
 
chad0989
Old
#6  
Senior Member - OP
Thanks Meter 9448
Posts: 1,883
Join Date: Oct 2010

 
DONATE TO ME
Quote:
Originally Posted by veitograf View Post
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.
 
Riyal
Old
#7  
Senior Member
Thanks Meter 1281
Posts: 2,699
Join Date: Dec 2011
Location: Iloilo City

 
DONATE TO ME
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
 
itandy
Old
(Last edited by itandy; 24th April 2012 at 11:02 AM.)
#8  
itandy's Avatar
Senior Member
Thanks Meter 934
Posts: 1,496
Join Date: Apr 2010
Location: Hong Kong
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!
My phone
Sony Xperia ZR | Rooted Stock ROM 4.3 | Stock kernel | Dual CWM/TWRP recovery | Samsung 32GB UHS-I

HTC Incredible S | Blackrose 2.02 HBOOT | 4EXT Touch | CM11 VivoKat | TESCO Kernel 3.0.101 | 3831.18.00.28 radio | SanDisk Ultra UHS-I 32GB

My work
Photo Grid/Frame Widget | Android Phone Vibrator - Xposed | Ringer & Notification Volume Unlink in ICS/JB - Xposed | Notification Direct Launcher - Xposed | Xperia Stamina LED - Xposed
 
Silversniper
Old
#9  
Silversniper's Avatar
Senior Member
Thanks Meter 316
Posts: 1,214
Join Date: Nov 2011
Location: Linz
Quote:
Originally Posted by chad0989 View Post
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
the attitude on xda is essentially "yeah, we'll help you. but make damn sure you try to help yourself first, and thank those that helped you
 
highKo
Old
#10  
Senior Member
Thanks Meter 67
Posts: 454
Join Date: Jul 2009
Location: Altenburg, Thuringia, Germany
ignore---sry

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Windows Phone 8.1 Developer Preview Now Available!

About two weeks ago at the BUILD conference in San Francisco, Microsoft unveiled Windows … more

Prevent Unwanted Butt Dialing with Smart Pocket Guard

You may recall that back in August of last year, we took a look atAir SwiperbyXDA … more

Google ATAP Details Project Ara in Developers’ Conference

Earlier today, the Google ATAP teamkicked offits first ever Project Ara … more