USB forced fast charge

Thanx to Chad Froebel for posting his mod for the Galaxy Nexus !
(http://rootzwiki.com/topic/19720-kernel-patch-devs-only-force-ac-fast-charging/)
USB forced fast charge v2

Soft force mode has been added (= mode 2).

In this mode fast charge will only kick in if no USB device is detected (as should be the case for wall/car chargers). Please note that in this case fast charge will NOT work on a USB 2.0 and 3.0 port on a computer !

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * 0 - No USB device currently attached
 * 1 - USB device currently attached

Consider this beta, it needs testing !

USB forced fast charge v2

Soft force mode (2) is validated.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * 0 - No USB device currently attached
 * 1 - USB device currently attached

For informational purposes I've also added a read-only sysfs file that indicates the USB port type : (new)

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

USB forced fast charge v2

Corrected wrong detection of USB cable unplugged to reset "USB_porttype_detected", just informational, so nothing important, but it was wrong nonetheless and needed correcting.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * 0 - No USB device currently attached
 * 1 - USB device currently attached

For informational purposes I've also added a read-only sysfs file that indicates the USB port type :

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

USB forced fast charge v2

/sys/kernel/fast_charge/USB_peripheral_detected returns clear text now as well.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * The state will be returned in clear text (Yes/No).

For informational purposes I've also added a read-only sysfs file that indicates the detected USB port type :

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

USB forced fast charge v2

Small correction, forgot to remove the old line of code.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * The state will be returned in clear text (Yes/No).

For informational purposes I've also added a read-only sysfs file that indicates the detected USB port type :

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.