fix compile latest wifi drivers
misc: add dynamic writeback interface

Before this patch, the deamon for flushing
dirty pages kicks in every 600 ms. This patch
changes the behaviour a little bit. While suspended
it flushes more pages (every 500 ms) and while the
the device is awake and in use it flushes only every
4 s to gain a little performance boost.

This is fully controllable;

echo 1 > /sys/class/misc/wirteback/writeback_enabled
(1 = On (default), 0 = off (and behaviour before this
patch).

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

Conflicts:
	arch/arm/configs/mapphone_defconfig
	drivers/misc/Kconfig
	drivers/misc/Makefile
	mm/page-writeback.c
display: add basic display control

While i am trying to solve the wakeup delay i noticed
that the panel driver uses different brightness values
for different phones (red / green lense).
With a small display control driver those values
can be easily exposed to userspace.
Green ones used to have 0x09, those colors looked a bit
washed out.

echo xx > /sys/class/misc/display_control/display_brightness_value

Where xx can be (theoretically) a value between 0 and 255.
0  will set the screen to almost 0,
9  will set the screen to some kind of blue-washed colors,
31 will set the screen to more warmer colors (new default).

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

Conflicts:
	arch/arm/configs/mapphone_defconfig
	drivers/video/omap2/displays/panel-mapphone.c
add extra free kbytes tunable

Add a userspace visible knob to tell the VM to keep an extra amount
of memory free, by increasing the gap between each zone's min and
low watermarks.

This is useful for realtime applications that call system
calls and have a bound on the number of allocations that happen
in any short time period.  In this application, extra_free_kbytes
would be left at an amount equal to or larger than than the
maximum number of allocations that happen in any burst.

It may also be useful to reduce the memory use of virtual
machines (temporarily?), in a way that does not cause memory
fragmentation like ballooning does.

[ccross]
Revived for use on old kernels where no other solution exists.
The tunable will be removed on kernels that do better at avoiding
direct reclaim.

Change-Id: I765a42be8e964bfd3e2886d1ca85a29d60c3bb3e
Signed-off-by: Rik van Riel<riel@redhat.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Blechd0se <alex.christ@hotmail.de>

Conflicts:
	kernel/sysctl.c
fs: disable dyn fsync and enable fsync

Some users reported turning off dynamic fsync
may prevent the data corruption bug, so i will
disable it by default and enable fsync back to
its original state.

This may cost a bit of performance, but at least
it can be considered as stable.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
fix compile latest wifi drivers
misc: add dynamic writeback interface

Before this patch, the deamon for flushing
dirty pages kicks in every 600 ms. This patch
changes the behaviour a little bit. While suspended
it flushes more pages (every 500 ms) and while the
the device is awake and in use it flushes only every
4 s to gain a little performance boost.

This is fully controllable;

echo 1 > /sys/class/misc/wirteback/writeback_enabled
(1 = On (default), 0 = off (and behaviour before this
patch).

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

Conflicts:
	arch/arm/configs/mapphone_defconfig
	drivers/misc/Kconfig
	drivers/misc/Makefile
	mm/page-writeback.c
display: add basic display control

While i am trying to solve the wakeup delay i noticed
that the panel driver uses different brightness values
for different phones (red / green lense).
With a small display control driver those values
can be easily exposed to userspace.
Green ones used to have 0x09, those colors looked a bit
washed out.

echo xx > /sys/class/misc/display_control/display_brightness_value

Where xx can be (theoretically) a value between 0 and 255.
0  will set the screen to almost 0,
9  will set the screen to some kind of blue-washed colors,
31 will set the screen to more warmer colors (new default).

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

Conflicts:
	arch/arm/configs/mapphone_defconfig
	drivers/video/omap2/displays/panel-mapphone.c
add extra free kbytes tunable

Add a userspace visible knob to tell the VM to keep an extra amount
of memory free, by increasing the gap between each zone's min and
low watermarks.

This is useful for realtime applications that call system
calls and have a bound on the number of allocations that happen
in any short time period.  In this application, extra_free_kbytes
would be left at an amount equal to or larger than than the
maximum number of allocations that happen in any burst.

It may also be useful to reduce the memory use of virtual
machines (temporarily?), in a way that does not cause memory
fragmentation like ballooning does.

[ccross]
Revived for use on old kernels where no other solution exists.
The tunable will be removed on kernels that do better at avoiding
direct reclaim.

Change-Id: I765a42be8e964bfd3e2886d1ca85a29d60c3bb3e
Signed-off-by: Rik van Riel<riel@redhat.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Blechd0se <alex.christ@hotmail.de>

Conflicts:
	kernel/sysctl.c
fs: disable dyn fsync and enable fsync

Some users reported turning off dynamic fsync
may prevent the data corruption bug, so i will
disable it by default and enable fsync back to
its original state.

This may cost a bit of performance, but at least
it can be considered as stable.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
Disable bt network testing, enable hciuart
Merge branch 'AeroKernel' of https://github.com/Quarx2k/jordan-kernel.git into AeroKernel
Support OTG, thanks SlugZero.

Conflicts:
	arch/arm/configs/mb526_cm10.1_defconfig
fix usb battery drain
cpufreq: interactive: make high priority for input boost

 * instead of calling speedchange here, we can queue
   the input boost up and skip some code which might
   help decreasing the overall latency. Also if interactive
   is sleeping, we don't need to wake it up.
   (taken from @franciscofranco)

 * This won't touch the workqueue for our input_connect.
   Most devices handles such input conntect things in their
   PowerHAL, but since we don't want this, we leave it here.

 * Also removing some deprecated stuff like the attributes
   for input_boost and boost, they aren't needed anyway.
   Furthermore change some tunables for a sligthly increased
   smoothness.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
cpufreq: interactive: add sampling_down_factor

Ondemand has a nice technique for heavy workloads.
It features a sampling_down_factor attribute, which
is a multiplier for the sampling rates on max freq
workloads. This has one benefit; it doesn't have to
consider to make any freq jumps while its working,
which increases perfromance a little bit.

Port this very handy feature to our interactive, it
should become very useful when we are playing games
and such to keep the performance up. Its default value
is 4, meaning 4 times min_sample_time.

Taken and modified from; https://github.com/labodj/hammerhead-linaro/commit/b9fd772738a022a89a245532164f994d536de1c1

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
touchscreen: add sweep2wake functionality

Big shout out to @showp1984 who developed this nice
feature.
I was tired of pressing the power button over and over
again and since i flash plenty of kernels a day, i needed
a "smarter choice".
This adds the sweep2wake functionality, controllable via;
echo 1 > /sys/android_touch/sweep2wake

Its off by default, since i don't know how much it will
affect battery life.

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

Conflicts:
	arch/arm/configs/mapphone_defconfig
	drivers/input/touchscreen/Makefile
merge: fix merging compile errors

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
touchscreen: teach driver to handle sweep2wake

 * First of all, motorola did no error check in their
   suspend/resume logic, so i have fixed that too.

 * Disable all irqs and workqueues while sweep2wake is
   enabled. This will cause the touchscreen to stay
   powered on as long as the sweep2wake feature is enabled.

 * Also fixing a issue in the sweep2wake driver where it would
   only work one time;
   we should reset our values when the display is finally on,
   not only when there is no touch input anymore.

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

Conflicts:
	drivers/input/touchscreen/qtouch_obp_ts.c
cpufreq: interactive: stop unnecessary freq jumps

 * Adjust tunables to avoid freq jumps from 300 Mhz to 1 Ghz

 * Delete suspend logic to raise lock to 600 Mhz (this will
   lock the freq to the desired value without using any higher
   freq).

 * Also another safety patch to avoid null pointers

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