cpufreq: bulk update from caf, restore comments, disable 2 phase ondemand

adding smartmax governor, enabling other governors
enabling interactive and conservative

Smartmax: original author Max Weninger @maxwen

Change-Id: Ie8dd7c841118abfb241892c248149732ba21bd78
net: wireless bcmdhd: Update to version 1.88.16

Code imported from google/android-3.4

Change-Id: I81220d179e70c5c2724075928ffc8f635742fe17
use Google AOSP bcmdhd
use ROW as default IO scheduler
use interactive as the default CPU governor
synaptics: fix touch screen to not report events when ts is off

when irq wake is set for s2w/l2w/h2w wake options touch events
should not be reported when the screen is off. Patch fixes the issue.

Change-Id: Ic6dfbda667e3bb3fe83d9146a2329b6dc7532119
msm: m7: set GPIOs used by msm_serial_hs

Change-Id: Ie364274aa27ad2a43ac87eda40bbf66478ea39b8
bluetooth: Add low-power mode to support Bluedroid

* Add wake_peer hooks to wake up the msm_serial_hs device

Change-Id: I2049e7d30de36051a9df5f99eebb7207370ac380
bluetooth: Fix race conditions in BT LPM

* Use workqueues and fix bugs in bluesleep (similar to JF).

Change-Id: I8ab86b31e36dcb2d917d5da7250e37e60f1955bb
net: wireless: enable HTC beacon functions only for BCMDHD_4335

Using HTC beacon functions with AOSP BCMDHD causes AP mode to fail to
initialize. Enable it only for HTC BCMDHD_4335.

Change-Id: I459ba7aec5ebe3df1f29f1f70231aa484e14fc8f
m7: build modules into kernel where possible

Change-Id: Id1b987bc386dfb81cbdcb935c48c680b956e084b
msm: cpufreq: fix a race between hotplug and cpufreq

When msm_cpufreq_target() is called without holding the policy
semaphore, there is a rare chance that the cpu gets hotplugged in
the acpuclk_set_rate. The probability of this issue increases
when cross-calling is used or using interactive governor which
tries to set all cpu frequencies from a single thread.

Add a hotplug notifier and set the device_suspended flag holding
the suspend mutex, when cpu is going down. This mutex is always
held when frequency changes are done.

Change-Id: Ide3aa6927ad60d2512d63761c51bb15117461250
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
(cherry picked from commit 56f5a6de7f2ab48ed0538da727ad52673fb801a2)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: cpufreq: Remove cross-calling limitation

Remove cross-calling limitations imposed by cpufreq. Clock drivers
and SPM driver now allow changing of frequencies from any core. Using
cpus_allowed mask to check for core affinity works well with workqueues
but do not port so well when the core requesting frequency change is a
kthread with the flag PF_TASK_BOUND not set.

Change-Id: Iab664ce8657780814440a11dff77cc925df597f8
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
(cherry picked from commit be01a17afb6b6e85456217caa1ac11eb0b6674e1)
(cherry picked from commit bd97cdfeb87eda0373721baaea744b02a27822f5)
msm: cpufreq: Implement suspend/resume for cpufreq driver

Cpufreq suspend variable get's updated in kernel pm notifier
callback which gets called in process context. This will create
window where cpufreq governor may try to change the frequency
before suspend variable is updated while resume.

Define suspend/resume for cpufreq driver to update suspend variable
in atomic context.

Don't update the policy->cur upon cpufreq driver failure.

CRs-fixed: 423791
Change-Id: Id78705f5c3b8bf801c6253e9362299280903769f
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
Revert "msm: cpufreq: Remove cross-calling limitation"

This reverts commit be01a17afb6b6e85456217caa1ac11eb0b6674e1.

Re-introduce cross calling in cpufreq to prevent race conditions in the
hardware when changing PLLs.

A core could be in retention, while another core, could try and set the
frequency of the core in retention, causing a change in PLL and when the
core exits retention, the PLL mismatch could hang the SPM state machine.

Change-Id: I99b454a0f146652f2d8a369f79f6d35748160dcb
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
msm: cpufreq: increase priority of thread that increases frequencies

When the cpufreq governors request for increase in frequency from kworker
threads, there is chance that the kworker thread is cpu starved due to
other high priority threads, leading to undesirable increase in frequency
ramp-up latency. Add the calling thread to SCHED_FIFO policy when
requesting for increase in frequency and restore back to original policy
after ramp-up is completed.

Change-Id: Ie4fa199b7f9087717cb94dfcc2eddea27cc0012b
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/cpufreq.c
Revert "cpufreq: fix interactive bug during hotplug."

This reverts commit c5d82e843dc210898d67edc3362cfece50016c77.
cpufreq: interactive: take idle notifications only when active

Register an idle notifier only when the governor is active.  Also
short-circuit work of idle end if the governor is not enabled.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: I4cae36dd2e7389540d337d74745ffbaa0131870f
cpufreq: interactive: keep freezer happy when not current governor

Fix a problem where the hung task mechanism was deeming the interactive
clock boost thread as hung.  This was because the thread is created at
module init but never run/woken up until needed.  If the governor is not
being used this can be forever.  To workaround this explicitly wake up
the thread once all the necessary data structures are initialized.  The
latter required some minor code shuffle.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: Ie2c058dd75dcb6460ea10e7ac997e46baf66b1fe
cpufreq: interactive: handle speed up and down in the realtime task

Not useful to have a separate, non-realtime workqueue for speed down
events, avoid priority inversion for speed up events.

Change-Id: Iddcd05545245c847aa1bbe0b8790092914c813d2
Signed-off-by: Todd Poynor <toddpoynor@google.com>