purge intelliplug
 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: klozz <xxx.reptar.rawrr.xxx@gmail.com>

Conflicts:
	sound/soc/msm/msm-lowlatency-pcm-q6.c
 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: klozz <xxx.reptar.rawrr.xxx@gmail.com>

Conflicts:
	sound/soc/msm/msm-lowlatency-pcm-q6.c
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: flar2 <asegaert@gmail.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
arm: add own hotplug driver

Simple SMP hotplug driver, based on @franciscofranco implementation.

For now without the suspend/resume logic, since this needs
to be redone.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: delete deprecated earlysuspend handler

There is no proper support of earlysuspend in this kernel,
so better delete this stuff until there is a better option
available.
Also adjusting a few tunables.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: add tunable sysfs entries

Allowing to change the current sampling_rate as well
as the first threshold (single core) and second threshold
(all cores).
Actual path will be: /sys/kernel/hotplug_control

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: remove single_core_load and all_core_load

Those sysfs caused instability, which is something i don't want.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: delay initial workqueue start

By delaying it a bit, we workaround some kind of
race condition. Enabling effectively four cores
during boot might be a good idea anyway.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: fix core 4 would eventually not go down

We only check if our current cpu is online, not thinking about
which position it might be currently. This would result in a very
long uptime for the fourth cpu even when there is zero load.

The solution is actually pretty simple; we just check every case
and offline accordingly to that. Also reducing the overhead of the
driver a bit and cleaning up unneeded stuff.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: add back suspend/resume logic

Using @faux123 powersuspend driver here to get the same
functionality like with androids earlysuspend handlers.

This will effectively turn all cpus (except 0) off during
screen off and turn on the second cpu when screen is on
again.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: add sysfs for first threshold

And doing some random cleanups.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: add simple debug option

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: fix cpus won't offline when zero load

If the workload drops immediatly down to zero and the
counters were basically resetted to 0, each onlined
cpu won't go offline until the next workload.

Fix this with a simple greater-equals.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: optimize put_cpu_down() and sampling rates

The code might seem to be more complex, but it should be
more efficient then the previous one. Each case gets handled
very surely.

Also changing the behaviour of the sampling rates. The tunable
is now a multiplier of HZ to ensure consitency. This fixes
also a bug where the sampling rate could go wild in some cases.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
ARM: smp: Wait just 1 second for other CPU to halt

Currently, the busyloop waiting for a 2nd CPU to stop takes about 4
seconds.  Adjust for the overhead of the loop by looping every 1ms
instead of 1us.

Signed-off-by: Chris Fries <C.Fries@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/537864
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Reviewed-by: Russell Knize <rknize2@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: use power efficient workqueue for suspend

Since the last commits, this seems to be the right way to enter
into earlysuspend/lateresume.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: reduce overhead for avg load

Before this patch when we did our load calculations, we could
end up in some sort of faked data. We would calculate the load
for all cpus 2^2^2 times (in the best case with only two cpus
online). When all cpus are online we would end up in some sort
of strange data.

Also introduce a new tunable min_online_time which sets
the minimum amount of time for a cpu to stay online.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: fix compile derp

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
hotplug: add a tunable for all_cpus_threshold

Previously adding a tunable for this parameter would end up in
some sort of deadlock as soon as the device enters deepsleep.
This is now avoided by allocating the right amount of memory
for the hotplug data.
Since the hotplug driver is enabled by default and shouldn't be
replaced by userspace we don't need to bother about freeing up the
memory.

This commit also contains a big cleanup for various things.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>