mako_hotplug: new algorithm

Every 0.1 second it polls for load. if the load is higher than the "threshold"
(configurable via first_level), it scores 1 point. If the load is lower than
the "threshold", it takes away 1 point. On the scoreboard, if the points reach
10 --> 4 cores -> polls every 0.25 second from now on. Whenever the points
on the scoreboard drops below 10 --> 1 core operation --> polling
(frequency of calculating scores) back to 0.1 second.

So basically the hotplug driver has either 1 core or 4 cores. And 2 cores are
up by touch boosts.

"lighter games" will have 4 cores too because the load is not calculated from
all the cores. Instead the new driver only takes the load from cpu0
(most games, esp light ones focus on stressing cpu0) so there will be a higher
chance to reach 10 points on the scoreboard --> 4 cores --> points dont drop
because of constant gaming --> constant 4 cores ->> ultimate fps while gaming.

My theory is that whenever you game, you dont care about battery and so the
kernel gives best fps. Out of gaming? The prevention of unnecessary cores
jumping will save more juice!

Also for anyone worrying about the scoreboard having too many points, the
maximum points for the cpus to score is 50.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: wrongly deleted a line on latest commit. Also move the touch boost call up in the work function.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: remove input_boost, its obsolete now.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: re-implement cores_on_touch and freq boost to the onlined core(s) as well.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Change int to long to prevent overflow.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: ondemand: remove dbs_refresh_Callback tied to a workqueue that was enabled on touch event. Instead of relying on that just had to add the logic to work with my custom code on the touch driver. Simple and effective.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: conservative: add logic to work with mako_hotplug.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: workaround to help on light games performance. Also fix the ktime_get() overflow of freq_boosted_time by converting to ms instead of us.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Change freq_boosted_time to u64 from long and convert ktime_get() to ms from us.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: ondemand: forgot to update this to ktime_to_ms.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm_otg: hack to allow externally powered usb host mode

Force ID_A (host mode + charging) on detection of proprietary charger (Apple-compatible charger with voltage on D+/D-).
Unforce ID_A on PMIC: BSV clear (detection of loss of charger).
Simulate ACA since using ID_A for host mode (prevents host from getting stuck in suspended state).
Two test cases for detection of actual proprietary charger (extra debug output for now).
Remove charge current limit in host mode (ID_A).
Enable debugfs /sys/kernel/debug/msm_otg/mode for manual otg mode manipulation.
Always force requested mode (debugfs).

Note: ID pin detection not working (perhaps due to Slimport), hence the "alternate" triggers used to switch to/from host mode.
msm_otg: move ID_A forcing to ACA detection (workaround for proprietary chargers)
Move ID_A forcing to ACA detect so that automatic host mode can be disabled by disabling ACA (# echo disable > /sys/kernel/debug/msm_otg/aca).
No longer need to simulate ACA since (debug) ACA will now be forced.
Remove test cases for actual proprietary chargers since they were causing false positives (manually disable ACA to use proprietary chargers).
msm_otg: start charging immediately when entering host mode (compatibility with proprietary chargers)
msm_otg: fix bad if-statement in last commit