KGSL: Add a simple GPU governor for Adreno xxx GPU series

initial coding for a Simple GPU governor based on my own work 2 years ago
from Sensation GB kernel commit: c1ea8f64167270d67915b4d4fb00910b1c0f513f

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
KGSL: make simple govenor a selectable option, co-exist with ondemand

also removed some hardcoded values

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
KGSL: simple governor: expose tunables to sysfs interface via module_param

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
KGSL: Simple Governor: fix minor logic issue

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
KGSL: Simple Governor: some styling changes, early returns instead of assigning a val and returning in the end of the function call and change the copyright/author from the middle of the file to the header.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Update franco_defconfig.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
load_stats: we couldn't care less about msm_rq_stats in this Kernel because we don't use mpdecision, so all this workqueued routines and locks are unnecessary. Although we need the load calculator so disable msm_rq_stats on the config and copy/paste the load calculator part into a separate file called load_stats.c. Functionality is unchanged, but we get to run the device with less crap running (bye msm_rq_stats workqueue) and less locks (mutex_lock/unlock) since its a separate business now.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
KGSL: Simple Governor: so I kinda butchered in a good way of course the original code from faux, but the simplicity is still here. Added an history so that we can track the average do that the frequency scaling is much more proporcional to the actual GPU load rather than having is ramp up every now and then due to spurious load spike. Also remove two useless ifs.

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