Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
chad0989
Old
#1  
Senior Member - OP
Thanks Meter 8970
Posts: 1,726
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:	712
Size:	4.5 KB
ID:	996506   Click image for larger version

Name:	on.jpg
Views:	687
Size:	9.4 KB
ID:	996507  
The Following 10 Users Say Thank You to chad0989 For This Useful Post: [ Click to Expand ]
 
veitograf
Old
#2  
Senior Member
Thanks Meter 18
Posts: 251
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!
samsung galaxy nexus - paranoid android

www.veitograf.de
 
chad0989
Old
(Last edited by chad0989; 12th April 2012 at 11:05 PM.)
#3  
Senior Member - OP
Thanks Meter 8970
Posts: 1,726
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 13
Posts: 110
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 V8 - MOTO MOTO theme

DEVICE #2: Samsung Galaxy Tab2 10.1 - GT-P5100 away for repair since 4th Feb 2013, still to come back!!!
ROM: Cyanogenmod 10.1

DEVICE #3: HTC One SV - C525e
Stock as a rock......Awaiting some development
 
veitograf
Old
#5  
Senior Member
Thanks Meter 18
Posts: 251
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.
samsung galaxy nexus - paranoid android

www.veitograf.de
 
chad0989
Old
#6  
Senior Member - OP
Thanks Meter 8970
Posts: 1,726
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 1009
Posts: 2,064
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 602
Posts: 1,037
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!
HTC Incredible S | Blackrose 2.02 HBOOT | 4EXT Touch | Unofficial CM10.1 | 3.0.67-lc-7.5+ Kernel | 3831.18.00.28 radio | SanDisk Ultra UHS-I 32GB
 
Silversniper
Old
#9  
Silversniper's Avatar
Senior Member
Thanks Meter 254
Posts: 1,018
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 61
Posts: 386
Join Date: Jul 2009
Location: Altenburg, Thuringia, Germany
ignore---sry

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Open Source CPU Info App for Windows

So you’re playing with your shiny new Windows 8 tablet PC, when one of your like-minded geeky … more

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more