Forced Fast Charge v1.2b

SysFS interface :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB
 *   2 - use custom mA configured through sysfs interface (see below)
 *
 * /sys/kernel/fast_charge/ac_charge_level (rw)
 *
 *   rate at which to charge when on AC (1.0A to 1.5A)
 *
 * /sys/kernel/fast_charge/usb_charge_level (r/w)
 *
 *   rate at which to charge when on USB (0.475A to 1.0A)
 *
 * /sys/kernel/fast_charge/failsafe (rw)
 *
 *   0 - disabled - allow anything up to 2.1A to be used as AC / USB custom current
 *   1 - enabled  - behaviour as described above (default)
 *
 * /sys/kernel/fast_charge/version (ro)
 *
 *   display fast charge version information
1600MHz CPU OC

Corrected CPU freq. going above scaling_max (even if only fractions of seconds)

Dynamically adjust cpufreq_max_limit according to scaling_max setting without breaking power save mode
mmc: Enable support for Triangle Away

Exposes /dev/block/mmcblk0boot0 and /dev/block/mmcblk0boot1, where
the custom binary flash count is stored.  Re-exposing these enables
the use of utilities like Triangle Away to reset the counter.

Origin : https://github.com/CyanogenMod/android_kernel_samsung_smdk4210/commit/5025d575e228923211ae5fcda2a1bb348756f913
fs/dyn_sync_cntrl: dynamic sync control

The dynamic sync control interface uses Android kernel's unique early
suspend / lat resume interface.

While screen is on, file sync is disabled
when screen is off, a file sync is called to flush all outstanding writes
and restore file sync operation as normal.

Signed-off-by: Paul Reioux <reioux@gmail.com>
Cherrypicked from faux's SGS3 kernel

Remove ARM sha1 routines

Since commit 8827a4a6b397b07a341ba7fd36ffb91a7835207d
("lib/sha1: use the git implementation of SHA-1"), the ARM SHA1
routines no longer work. The reason? They depended on the larger
320-byte workspace, and now the sha1 workspace is just 16 words
(64 bytes). So the assembly version would overwrite the stack randomly.

The optimized asm version is also probably slower than the new improved
C version, so there's no reason to keep it around.  At least that was
the case in git, where what appears to be the same assembly language
version was removed two years ago because the optimized C BLK_SHA1 code
was faster.

Reported-and-tested-by: Joachim Eastwood <manabian@gmail.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/sha1: use the git implementation of SHA-1

For ChromiumOS, we use SHA-1 to verify the integrity of the root
filesystem.  The speed of the kernel sha-1 implementation has a major
impact on our boot performance.

To improve boot performance, we investigated using the heavily optimized
sha-1 implementation used in git.  With the git sha-1 implementation, we
see a 11.7% improvement in boot time.

10 reboots, remove slowest/fastest.

Before:

  Mean: 6.58 seconds Stdev: 0.14

After (with git sha-1, this patch):

  Mean: 5.89 seconds Stdev: 0.07

The other cool thing about the git SHA-1 implementation is that it only
needs 64 bytes of stack for the workspace while the original kernel
implementation needed 320 bytes.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Nicolas Pitre <nico@cam.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ARM: net: JIT compiler for packet filters

based of Matt Evans's PPC64 implementation.

The compiler generates ARM instructions but interworking is
supported for Thumb2 kernels.

Supports both little and big endian. Unaligned loads are emitted
for ARMv6+. Not all the BPF opcodes that deal with ancillary data
are supported. The scratch memory of the filter lives on the stack.
Hardware integer division is used if it is available.

Enabled in the same way as for x86-64 and PPC64:

	echo 1 > /proc/sys/net/core/bpf_jit_enable

A value greater than 1 enables opcode output.

Signed-off-by: Mircea Gherzan <mgherzan@xxxxxxxxx>
---

Changes in v7:
 * fix the intruction generation for LDX_MSH, OR_X, LSH_K,
   RSH_K and JMP_JA
 * fix the condition for saving the A register
 * use fls() instead of the compiler builtin
 * punt to the interpreter on absolute loads with K < 0
 * check for invalid data references
 * support the NEG opcode
 * clear X in the prologue based on a context flag
 * simplify the conditional jumps

Changes in v6:
 * fix the code generation for the ANC_CPU opcode

Changes in v5:
 * replace SEEN_LEN with SEEN_SKB
 * set ctx->seen when handling some ancillary data opcodes

Changes in v4:
 * first check if the JIT compiler is enabled
 * fix the code generation for the LDX_MSH opcode

Changes in v3:
 * no longer depend on EABI and !Thumb2
 * add BLX "emulation" for ARMv4 without Thumb
 * use the integer divide instruction on Cortex-A15
 * fix the handling of the DIV_K opcode
 * use a C wrapper for __aeabi_uidiv
 * fix the generation of the epilogue (non-FP case)

Changes in v2:
 * enable the compiler only for ARMv5+ because of the BLX instruction
 * use the same comparison for the ARM version checks
 * use misaligned accesses on ARMv6
 * fix the SEEN_MEM
 * fix the mem_words_used()
ARM: net: JIT compiler for packet filters enabled by default
netfilter: qtaguid: initialize a local var to keep compiler happy.

There was a case that might have seemed like new_tag_stat was not
initialized and actually used.
Added comment explaining why it was impossible, and a BUG()
in case the logic gets changed.

Change-Id: I1eddd1b6f754c08a3bf89f7e9427e5dce1dfb081
Signed-off-by: JP Abgrall <jpa@google.com>
netfilter: xt_qtaguid: fix ipv6 protocol lookup

When updating the stats for a given uid it would incorrectly assume
IPV4 and pick up the wrong protocol when IPV6.

Change-Id: Iea4a635012b4123bf7aa93809011b7b2040bb3d5
Signed-off-by: JP Abgrall <jpa@google.com>
net: check return value for dst_alloc

return value of dst_alloc must be checked before use

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
ipv6: check return value for dst_alloc

return value of dst_alloc must be checked before use

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
af_ipx.c : badly chose struct name "ipx_proto" since there's a function "ipx_proto" in "xt_qtaguid.c" with the same name.

xt_qtaguid.c : function  "ipx_proto" was declared twice after merge in this file, removed one.
mali: reduce utilization sampling timeout (AndreiLux)

Signed-off-by: Andrei F <luxneb@gmail.com>

samsung-mali: disable state tracking (AndreiLux)

Signed-off-by: Andrei F <luxneb@gmail.com>
Added support for scaling_available_frequencies sysfs interface
Fading Notification LED

Slowly pulse led (by xplodwild)
Make led fade switchable (echo "0">led_fade to disable fading, 1 to enable) (by xplodwild)
No hacksung :( (by xplodwild)
an30259: support reading of led_fade sysfs (by codeworkx)
an30259a: don't restrict led brightness in user case (by codeworkx)

Change-Id: I665a178771708f64ce1d23455dab91cf72e38b4d

Modified sysfs interface, store only accepts 0 or 1 (disable or enable), show will be more helpful

LED max. intensity user customizable, normal (= Samsung) or high (=CyanogenMod)
Boeffla-Sound Engine 1.6.0 by AndiP (andip71)
staging: android: lowmemorykiller: Add config option to support oom_adj values

The conversion to use oom_score_adj instead of the deprecated oom_adj
values breaks existing user-space code. Add a config option to convert
oom_adj values written to oom_score_adj values if they appear to be
valid oom_adj values.

Change-Id: I68308125059b802ee2991feefb07e9703bc48549
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Adapted from Linux 3.4 from Android kernel common

Signed-off-by: faux123 <reioux@gmail.com>
max77686 : Keep dmesg from getting flooded by every status change

If needed, uncomment "#define MAX77686_DEBUG".
Add lulzactiveq governor (tweaked)

credits to Gokhanmoral, Roberto, Tegrak and AndiP71
SIO scheduler

Modified as per gokhanmoral's & AndreiLux's S3 kernels
ROW scheduler v4

The ROW I/O scheduler gives priority to READ requests over the WRITE requests when dispatching, without starving WRITE requests. Requests are kept in priority queues. Dispatching is done in a RR manner when the dispatch quantum for each queue is calculated according to queue priority.

Most suitable for mobile devices.

Source : https://patchwork.kernel.org/patch/1862271/
mdnie: black crush fix

credits to AndreiLux, AndiP71
Early Suspend Delay v1.0a - SysFS interface

 * /sys/kernel/early_suspend/early_suspend_delay (rw)
 *
 *   time to pause in miliseconds (0 - 700ms)
 *
 * /sys/kernel/early_suspend/version (ro)
 *
 *   display early suspend delay version information
YankasusQ governor

Based on PegasusQ. Introducing cpu frequency limitations based on the number of cores online and for standby (screen off).

sysfs interface :

- cpu_max_freq_1 : max. freq. applied when running on 1 core (defaults to 1.0GHz)
- cpu_max_freq_2 : max. freq. applied when running on 2 cores (defaults to 1.1GHz)
- cpu_max_freq_3 : max. freq. applied when running on 3 cores (defaults to 1.2GHz)
- cpu_max_freq_4 : max. freq. applied when running on 4 cores (defaults to 1.4GHz)
- cpu_max_freq_stdby : max. freq. applied when screen off (defaults to 800MHz)
- cpu_max_freq_current : currently applied max. frequency (read-only)

NB: hotplug frequencies and rq thresholds have been revised up to keep the device running on as little cores as possible.
Yank555.lu v3.3 config