[KERNEL PATCH] Force AC (fast) Charging

Search This thread

chad0989

Senior Member
Oct 31, 2010
1,883
9,424
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/details?id=com.incredicontrol.fastchargewidget

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/details?id=com.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-con.../download.php?id=vivo_force_fast_charge.patch
 

Attachments

  • off.jpg
    off.jpg
    4.5 KB · Views: 793
  • on.jpg
    on.jpg
    9.4 KB · Views: 761

veitograf

Senior Member
Jan 11, 2011
362
52
www.veitograf.de
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! :)
 

chad0989

Senior Member
Oct 31, 2010
1,883
9,424
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/virtuous-quattro-vivo-fastcharge.zip

Enjoy.
 
Last edited:

fridgie

Senior Member
Jan 26, 2012
139
15
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 :cool:
 

Riyal

Senior Member
Dec 16, 2011
3,038
1,770
Iloilo City
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/drivers/usb/gadget/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

Senior Member
Apr 28, 2010
2,382
1,355
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!
 
Last edited:

vieose

Senior Member
Nov 20, 2011
1,376
334
Linz
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/details?id=com.incredicontrol.fastchargewidget

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/details?id=com.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-con.../download.php?id=vivo_force_fast_charge.patch

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

Sent from my HTC Incredible S using xda premium
 

JerryBYong

Senior Member
Aug 20, 2012
261
31
Hi, I'm using Nik's Project X and I would really really like to be able to force ac charge as I lost my original HTC charger. How can I go about doing this
 

JerryBYong

Senior Member
Aug 20, 2012
261
31
I just got the widget, and it says kernel not supported. What kernel must I use and how do I install it

Sent from my HTC Incredible S using xda premium
 

poondog

Inactive Recognized Contributor
Dec 11, 2011
14,998
12,953
Melbourne
I just got the widget, and it says kernel not supported. What kernel must I use and how do I install it

Sent from my HTC Incredible S using xda premium

A kernel with force ac charging included, like the one itandy made a while ago for ice cold sandwich
Edit: found it
http://xdaforums.com/showthread.php?t=1686995

Sent from my Nexus 7
 

JerryBYong

Senior Member
Aug 20, 2012
261
31
If you don't mind, will you pm me when there is a kernel for project x?

Sent from my HTC Incredible S using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    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/details?id=com.incredicontrol.fastchargewidget

    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/details?id=com.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-con.../download.php?id=vivo_force_fast_charge.patch
    3
    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/virtuous-quattro-vivo-fastcharge.zip

    Enjoy.
    2
    I am looking for a patch that works with ICS, as soon as I find it, I will add it. Please be patient, I am trying!