MSM THERMAL: Cleanup now used/broken NEW parts. need to fix later.

Or just use what we always had. temp check, freq cut, and cores on/off
Revert "MSM THERMAL: Cleanup now used/broken NEW parts. need to fix later."

This reverts commit 33804b843f9e00623c2dfcf08f2379d42e17b51b.

New REBASE will follow later!
Revert "MSM THERMAL: Convert new msm thermal to Intelli Thermal :) works great."

This reverts commit 6364037aa948771dcd41936cc5c16083d3b71502.

New REBASE will follow later!
Revert "msm: thermal: Update thermal subsystem"

This reverts commit d834620df686d0ad546f10b011400eb02906a317.

New REBASE will follow later!
I will use ONLY needed parts! we dont need:

*hotplug support
*enabling and disabling tsens trip
*emergency frequency mitigation
*IOCTL interface
MSM_THERMAL: After lost of work, here is NEW Intelligent Thermal!

I have merged only the good stuff from latest thermal subsystem
https://github.com/faux123/Nexus_5/commit/f9295cdbd03282f876ce9b882e936847c47dc81d

and from Intelligent Thermal V2 by @faux123
https://github.com/faux123/Nexus_5/commit/8a12801b55e96d188b95947b6dd5751194b7ef14

*Msm: thermal: Clean up msm cpufreq function calls
*Added new struct for Intelli INIT dunamic values.
*Merged new way to init and change min/max freq on termal limits.
*Merged msm_thermal_dev_exit
*Cleaned all 80 char lines.
*Merged info strings for dmesg
*Changed core_control sysfs name from enable to core_control_enable
This prevent ROM thermal code to mess with this control! see also userspace mods.
https://github.com/dorimanx/LG-G2-D802-Ramdisk/commit/a3e156b88aeec2ba9805c0a36634289b18dd132a
*Init Intelli Thermal as ON on boot.
*For LG, added fix for stuck min freq at high freq... usually 1.4Ghz so it's will be low min
if above 960Mhz as MIN FREQ.
*DEFAULT_POLLING_MS to 500
*Added comments to find all needed other functions in arch/arm/mach-msm/cpufreq.c
and include/linux/cpufreq.h

I have tested this driver for hours, and it's performing perfect!
ASoC: msm: Fix compress capture

 * Capture endpoints were not being properly registered, resulting in
   failure to record AMR_WB formats. Fix it.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
MSM HOTPLUG: set min fast lane freq to 2265600.

*I have set sync freq in ondemand to 1958400 so it's jumps to often.
msm: msm_rq_stats: Tone down mpdecision

Add a new Kconfig to enable more conservative computations sent
to mpdecision:

 * Do a time window weighted load computation instead of just a sum
 * Do an sliding window averaged time computation for number runnable

The purpose of these changes is to make mpdecision less likely to
keep extra cores online.  It currently has a tendancy to run more
cores running than needed and this can even cause some lag issues.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Compute avg_nr_running for RQ Stats

* We already compute avg_nr_running for intelli hotplug.
* Let's make it available for conservative stats of MSM RQ as
  well.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: msm_rq_stats: Add proper attribute to enable hotplug

* hotplug_disable attribute resets when device suspend and
  sets when device resumes.
* Thereby, the value is dynamic. Perhaps, this value is read
  by userspace, so we don't want to mess with it further.
* Restore hotplug_disable to original format of read-only.
* Introduce hotplug_enable attribute which will do the job.
* We have "enable" attribute for other hotplug drivers, so
  this implementation aligns with them.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Dorimanx Note:
Ported for my rq_stats code.
Enable more conservative computation of load and size of the run queue.

The purpose of these changes is to make mpdecision less likely to
keep extra cores online.  It currently has a tendancy to run more
cores running than needed and this can even cause some lag issues.

https://github.com/neobuddy89/hammerhead_kernel_caf/commit/1a6dc0a92a47f078a02d84aecce112a7f5319d83
RQ_STATS: mod suspend function.
MSM RQ STATS: Code cleanup: Read More!

*Dont use io_is_busy if CONFIG_MSM_RUN_QUEUE_STATS_BE_CONSERVATIVE
*Removed hotplug_suspend sysfs, it's useless!
As if we disable RQ_STATS counter, ROM mpdecision loose hotplug
ability, and stuck with one core! till service is STOP/START

So leave the suspend code as dummy.
net: wireless: bcmdhd: Disable OOB interrupt when WLAN is off

b/17446901 Change-Id: I99069c584fa7279b8bd5a61d64ce27764edbd1d8

Signed-off-by: Ritter Yeh <ryeh@broadcom.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/?h=aosp-common/android-3.4&id=acddfe97de2ccf22d05ccc944469a16e7308ac7a
ASoc: msm: MBHC skipped when using external headset detection

We don't need MBHC when using external headset detection. In that case,
skip the MBHC detection and then use external headset detection instead.

Author: Hyunsub Na <hyunsub.na@lge.com>
Signed-off-by: Hyunsub Na <hyunsub.na@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9320: Skip mbhc impedance detection

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
diag: Update SSIDs, event ids and log codes

The SSIDs, event IDs and log codes have fallen out of date.
Bring the SSIDs, event IDs and log codes up to date.

Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
diag: Bring SSIDs, Event Ids and Log Codes up to date

Diag ssids, event ids and log codes on the Apps were out of date.
This patch adds the new ssids, event ids and log codes.

Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
diag: Update SSIDs, event ids and log codes

The SSIDs, event IDs and log codes have fallen out of date.
Bring the SSIDs, event IDs and log codes up to date.

Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: c_prados <prados@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
SOUND: FIX LG goto in sound/soc/codecs/wcd9xxx-mbhc.c