new method at installation for S-on users
USB forced fast charge

Conflicts:

	arch/arm/mach-msm/Makefile
defconfig: update defconfig
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.
USB forced fast charge v3

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.

For informational purposes I've also added a read-only sysfs file that indicates if fast charge is currently being forced :

 * /sys/kernel/fast_charge/is_fast_charge_forced (ro)
 *
 * The current force state will be returned in clear text (Yes/No).
 *
 * (requested by hawkeyexp)
USB forced fast charge v3.1

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 the following read-only sysfs files :

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

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

 * /sys/kernel/fast_charge/is_fast_charge_forced (ro)
 *
 * The current force state will be returned in clear text (Yes/No).
 *
 * (requested by hawkeyexp)

New :

 * /sys/kernel/fast_charge/current_charge_mode (ro)
 *
 * The current charge mode will be returned in clear text (Discharging/AC/USB).
 *
 * (requested by hawkeyexp)
mach-msm: Add msm_mpdecision Kconfig & Makefile hooks

Signed-off-by: showp1984 <showp1984@gmail.com>

Conflicts:

	arch/arm/mach-msm/Kconfig
mach-msm: Add msm_mpdecision

This currently only does the following thing:
Screen on -> CPU1 online
Screen off -> CPU1 offline

More to come.

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: small cleanup

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: add load based decision making

This now works like the mpdecision binary from QCOM.
CPU hotplugging/unplugging based on system load.

A sysfs interface will be built in with a later commit.

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: restructure locks, add delay

The new delay allows the CPU to come up before any other action is taken.
This prevents fast plugging and also ensures the CPU hotplug process
is really done, before trying to unplug it again (or plug it).

The new locks are more efficient, and only used if necessary.

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: pause if CPU is unplugged outside of mpdecision

This fixes cpu wars if something else tries to control the cpus.
default delay: 10000ms

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: change early_suspend_level to blank_screen

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: don't start immediately

Signed-off-by: showp1984 <showp1984@gmail.com>
HACK: for some reason some roms keep hotplugging cpu1. Stop that.

This also affects oc apps, which now will not be able to hotplug cpu1
to change the frequency on cpu1. So the only way to get a frequency
change on both cpus 'on-the-fly': Starting a benchmark (cpu1 comes up) and then set
the freq.

The preferred method should be flashing the kernel with the right khz
values from recovery.
I hope that the problem is solved soon so this can get reverted eventually.
(it appears to be fixed in newer cm9 nightlies)

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: always set the suspend var

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: show cpumask after up/down

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: remove debug output

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: remove up/down delay, our default delay is large enough

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: add email to (c)

Signed-off-by: showp1984 <showp1984@gmail.com>