Revert "Revert "suspend: remove disable/enable cpus every time suspend is called (which is called every damn 5 seconds -.-).""

This reverts commit 33dac936dd839354359e2f0002136749d1e0339e.
Revert "drivers: bcmdhd: filter only unicast packets during suspend, hopefully to reduce the wlan_rx wakelock specially during very crowded Wi-Fi networks."

This reverts commit 6076d5a4d5724b6f941a0ca86d62708786cdab84.
mako_hotplug: queue the screen on/off works to a dedicated workqueue instead of pushing them to the global system queue. Also increase the minimum online time of a CPU from 1 second to 2 second.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
load_stats: small optimization to save 2 calls and inline both functions.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
charger: be quiet please.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Gamma: WIP DO NOT MERGE DO NOT MERGE.
Just pushing this here for safety as I wanna come back here soon. This was just used for debugging, its nowhere near anything ready for users to play.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: Set MAX_DTIM_ALLOWED_INTERVAL to 600

Change-Id: Ie4d9cac1e0828651a142d64762b251537431ea99
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: enable TDLS_auto_mode

	Requirement :
	1. enable auto mode for SETUP request
	2. disable auto mode for TEARDOWN request
	bug : 11632025 TDLS hybrid mode support

Change-Id: Idc0cb60e65a45bb32b8beb2bb3daf72c9112eab6
Signed-off-by: Ecco Park <eccopark@broadcom.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>

Conflicts:
	drivers/net/wireless/bcmdhd/wl_cfg80211.c
net: wireless: bcmdhd: Enable IPv6 RA filter feature

1) We will block IPv6 Router Advertisement multicast packet in suspend mode to save power on device.

Bug: 11638281
Signed-off-by: Ecco Park <eccopark@broadcom.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: Change the parameter for TDLS

	1) tuned the parameter for TDLS connection to transit between AP
	and TDLS smoothly.
	2) tdls_rssi_high : -70 dbm -> -60 dbm (for setup)
	   tdls_rssi_low : -80 dbm -> -70dbm (for teardown)
	bug : 11632025
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers: thermal: add more steps to prevent L1/TLB panic on weaker hardware. Before this commit it was easily reproduced by running Antutu Benchmark and it would crash on the CPU Floating point test. It won't crash anymore with the current settings due to be already throttled point when reaching that stage.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
ASoc: Reduce number of periods in low latency driver.

- Reduce number of periods to 2 from 4.

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
ASoc: msm: Increase max buffer size to 4k for lowlatency playback

- Small buffersize is resulting in scheduling issues.
- Increase max buffer size so that user space can
  configure large buffer size to avoid scheduling
  issues.

bug-id: 6865729
Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
ASoC: msm: Reduce min buffer size for low latency

The current low latency driver has 512 bytes as
the min buffer size threshold. With this reducing
the playback time to lower values is not possible.
Setting it to 128 bytes gives us more room
to try out lower buffer sizes from the user space

Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
ASoC: msm: Change QOS value for low latency path

There were variations in the time taken to
return from each write. This was due
to the delay in switching in and out of
power collapse. To manage this set QOS
value to 1ms so that the core has enough
time to wake up from power collapse

Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Merge remote-tracking branch 'franco/android-msm-hammerhead-3.4-kk-r1' into android-msm-hammerhead-3.4-kk-r1
Add backlight dimmer option

This is based on n5dim by @mzhou  https://github.com/mzhou/n5dim
mdss_dsi: do not power down panel when sweep2wake is enabled In order to detect touches during suspend, the panel must be powered on. When sweep2wake is enabled, change one of the panel-off-cmds in mdss_dsi_panel.c from 0x10 to 0x11.

Signed-off-by: flar2 <asegaert@gmail.com>
mdss_dsi_panel: keep the panel gpio active and don't trigger a reset

This way we will suffer minimum leakage when sweep2wake is being used.
All that is kept online here is the chip controlling the panel and touch panel.
That chip is probably some pmic but either way, keeping it online will cause
minimum leakage. This is an improvement upon the original patch by flar2 which
led to massive leakage from the display regulators since all were kept online.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
sweep2wake: massive update, bring on par with s2w2 except algorithm

This patches sweep2wake on par with s2w2, minus the detection algorithm.
Changes in detail:
- Remove dependency on a power key setter, use a dummy device.
- Remove dependency on a touchscreen driver, use an input callback
- Remove dependency on external sysfs functions
- Remove dependency on external reset calls
- Migrate all of this into sweep2wake

Porting to new devices is now easier than ever:
1. Define your device parameters in the Sweep2wake tuneables
2. Check if the android_touch_kobj is already used by your touchscreen driver
2a. If it is export it and define S2W_ANDROID_TOUCH_DECLARED
(This will prevent s2w from spawning it's own kobj)
3. Force the touchscreen driver to deliver signals in suspend and you are done.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

Conflicts:
	drivers/input/touchscreen/Kconfig
	drivers/input/touchscreen/sweep2wake.c
	drivers/input/touchscreen/touch_synaptics.c
	drivers/input/touchscreen/touch_synaptics_ds5.c
	include/linux/input/sweep2wake.h