LZ4 Commits

decompressor: add LZ4 decompressor module

Add support for LZ4 decompression in the Linux Kernel.  LZ4 Decompression
APIs for kernel are based on LZ4 implementation by Yann Collet.

Benchmark Results(PATCH v3)
Compiler: Linaro ARM gcc 4.6.2

1. ARMv7, 1.5GHz based board
   Kernel: linux 3.4
   Uncompressed Kernel Size: 14MB
        Compressed Size  Decompression Speed
   LZO  6.7MB            20.1MB/s, 25.2MB/s(UA)
   LZ4  7.3MB            29.1MB/s, 45.6MB/s(UA)

2. ARMv7, 1.7GHz based board
   Kernel: linux 3.7
   Uncompressed Kernel Size: 14MB
        Compressed Size  Decompression Speed
   LZO  6.0MB            34.1MB/s, 52.2MB/s(UA)
   LZ4  6.5MB            86.7MB/s
- UA: Unaligned memory Access support
- Latest patch set for LZO applied

This patch set is for adding support for LZ4-compressed Kernel.  LZ4 is a
very fast lossless compression algorithm and it also features an extremely
fast decoder [1].

But we have five of decompressors already and one question which does
arise, however, is that of where do we stop adding new ones?  This issue
had been discussed and came to the conclusion [2].

Russell King said that we should have:

 - one decompressor which is the fastest
 - one decompressor for the highest compression ratio
 - one popular decompressor (eg conventional gzip)

If we have a replacement one for one of these, then it should do exactly
that: replace it.

The benchmark shows that an 8% increase in image size vs a 66% increase
in decompression speed compared to LZO(which has been known as the
fastest decompressor in the Kernel).  Therefore the "fast but may not be
small" compression title has clearly been taken by LZ4 [3].

[1] http://code.google.com/p/lz4/
[2] http://thread.gmane.org/gmane.linux.kbuild.devel/9157
[3] http://thread.gmane.org/gmane.linux.kbuild.devel/9347

LZ4 homepage: http://fastcompression.blogspot.com/p/lz4.html
LZ4 source repository: http://code.google.com/p/lz4/

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Yann Collet <yann.collet.73@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
lib: add support for LZ4-compressed kernel

Add support for extracting LZ4-compressed kernel images, as well as
LZ4-compressed ramdisk images in the kernel boot process.

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Yann Collet <yann.collet.73@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
arm: add support for LZ4-compressed kernel

Integrates the LZ4 decompression code to the arm pre-boot code.

Change-Id: I6b14b82778947e5966cddbdd98f1cc5269278bd9
Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Yann Collet <yann.collet.73@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
ARM: dts: msm: i2c: change  clock rate to 19.2 MHz

For standard  requirement, I2C source
speed of 50MHz causes high power usage, hence
this patch change the clock rate to 19.2 MHz
to save power.

CRs-Fixed: 552956
Change-Id: Ifb17fb79062a390a19881d247a2ac0ca5cc55d80
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
qup_i2c: Initialize I2C resource before registering.

Due to mismatch in sequence of initializing the
I2C resources  and registering device,  issues seen
while probing clients. This patch corrects the sequence.

CRs-Fixed: 581007
Change-Id: I98f0e73ce1ed1213409d5700f7a78e722e451ec0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

qup_i2c: Correct free memory call

Correct freeing of memory, which is allocated using
the devm prefixed API, to free it using devm_kfree rather
then kfree.

CRs-Fixed: 582597
Change-Id: If1aa9bcd86bb3a7d35adc5630ff19ad08bbdf762
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: dump gpio config on error

Dump the configuration of relevant GPIOs
on timeout error.

Change-Id: Iab5aa57befc146c232d12759990b0b8a23a68fe1
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>

qup_i2c: improve PM functionality

Move system-PM functionality to noirq stage. Remove
the incorrect active-only clock path-voting setting.
Resolve synchronization of concurent transition of
system and runtime PM.

Change-Id: I2753557482da7a48a596e4b660165b4e2af0f854
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: support for configuarable noise rejection

allow to configure noise rejection value from device tree
which helps filter spikes in the i2c lines.

CRs-Fixed: 626250
Change-Id: If66132c8cc444294e4e6e275ece8b85108cf7abb
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>

qup_i2c: Improve recovery from core and slave bad state

Unexpected noise, and/or unexpected behavior from a slave
may put the whole I2C bus in unworkable state. Clear I2C
bus state using HW command instead of bit-banging to avoid
assumption about GPIO recovery config.

Change-Id: I8d1d0002392f9ec9bc0db146aa0ce3e138334644
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
qup_i2c: Initialize I2C resource before registering.

Due to mismatch in sequence of initializing the
I2C resources  and registering device,  issues seen
while probing clients. This patch corrects the sequence.

CRs-Fixed: 581007
Change-Id: I98f0e73ce1ed1213409d5700f7a78e722e451ec0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

qup_i2c: Correct free memory call

Correct freeing of memory, which is allocated using
the devm prefixed API, to free it using devm_kfree rather
then kfree.

CRs-Fixed: 582597
Change-Id: If1aa9bcd86bb3a7d35adc5630ff19ad08bbdf762
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: dump gpio config on error

Dump the configuration of relevant GPIOs
on timeout error.

Change-Id: Iab5aa57befc146c232d12759990b0b8a23a68fe1
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>

qup_i2c: improve PM functionality

Move system-PM functionality to noirq stage. Remove
the incorrect active-only clock path-voting setting.
Resolve synchronization of concurent transition of
system and runtime PM.

Change-Id: I2753557482da7a48a596e4b660165b4e2af0f854
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: support for configuarable noise rejection

allow to configure noise rejection value from device tree
which helps filter spikes in the i2c lines.

CRs-Fixed: 626250
Change-Id: If66132c8cc444294e4e6e275ece8b85108cf7abb
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>

qup_i2c: Improve recovery from core and slave bad state

Unexpected noise, and/or unexpected behavior from a slave
may put the whole I2C bus in unworkable state. Clear I2C
bus state using HW command instead of bit-banging to avoid
assumption about GPIO recovery config.

Change-Id: I8d1d0002392f9ec9bc0db146aa0ce3e138334644
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:
	Documentation/devicetree/bindings/i2c/i2c-qup.txt
	arch/arm/mach-msm/include/mach/board.h
	drivers/i2c/busses/i2c-qup.c
GPU: add optimization flags to GPU drivers

Change-Id: Iab8046fc205e3995b80fcd9ce24e396336dc94b6
Signed-off-by: Lens-F <tnoah12@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
GPU: optimize build with -Ofast
msm: kgsl: Do not detect faults when GPU core is idle

Do not detect GPU faults when GPU hardware status is idle,
this leads to incorrect fault detection.

Conflicts:
	drivers/gpu/msm/adreno.h

Change-Id: I7a9f8c49eb819241698f99fd50aaed400aadd4f4
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
(cherry picked from commit 8002a0061d3ccfeccb93af50bce4ef44977845af)
USB Fast Charge for Nexus 5

Increases input current limit to 900mA when charging via USB.
This patch does not force AC mode because this device is capable
of a charging at a much higher current limit than some USB ports
are able to deliver.

Change-Id: I8e488f3fbb1d275fa01b1f07440b1f7fae18486e
Signed-off-by: flar2 <asegaert@gmail.com>
block: fiops ioscheduler core

FIOPS (Fair IOPS) ioscheduler is IOPS based ioscheduler, so only targets
for drive without I/O seek. It's quite similar like CFQ, but the dispatch
decision is made according to IOPS instead of slice.

The algorithm is simple. Drive has a service tree, and each task lives in
the tree. The key into the tree is called vios (virtual I/O). Every request
has vios, which is calculated according to its ioprio, request size and so
on. Task's vios is the sum of vios of all requests it dispatches. FIOPS
always selects task with minimum vios in the service tree and let the task
dispatch request. The dispatched request's vios is then added to the task's
vios and the task is repositioned in the sevice tree.

Unlike CFQ, FIOPS doesn't have separate sync/async queues, because with I/O
less writeback, usually a task can only dispatch either sync or async requests.
Bias read or write request can still be done with read/write scale.

One issue is if workload iodepth is lower than drive queue_depth, IOPS
share of a task might not be strictly according to its priority, request
Bias read or write request can still be done with read/write scale.

One issue is if workload iodepth is lower than drive queue_depth, IOPS
share of a task might not be strictly according to its priority, request
size and so on. In this case, the drive is in idle actually. Solving the
problem need make drive idle, so impact performance. I believe CFQ isn't
completely fair between tasks in such case too.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	block/Kconfig.iosched
	block/Makefile

Change-Id: I165ff8ff656f663f7fd0de7b5dc811684929f324
cpufreq: Add Nightmare

Change-Id: I47661783c25277e224ed1795eb945107b490723a
Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
msm8974: oc to 2534.4Mhz & uc to 96Mhz

Change-Id: I865aaf8cf5573dc16241f7947a27789de6e7c911
Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
msm8974: Drop GPU Min to 100 MHz

Change-Id: I332e5f005da4a20fe960fa9bb6b851d05df418b1
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
GCC 4.9.1: fix compile warnings

Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
arch/arm/mach-msm/mpm-of.c: gcc 4.9.x fix up

Signed-off-by: Paul Reioux <reioux@gmail.com>
build: Fix some warnings with GCC 4.9

Change-Id: Iafb7943e1eb8896b288b1ffe8ddedc2cef225ff6
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: hotplug: Max 1036MHz during screen off
arm: hammerhead: Use LGE rfkill driver

Port rfkill driver from android-msm-dory-3.10-kitkat-wear.

Change-Id: I831666a8c45fa71d465db647561cc06f3ee8b0f9
backlight: fix a bug where the screen would be completely dark or near darkness with backlight_dimmer enabled when the display dimmed. The brightness level can't be any lower than dev->min_brightness and previous code allowed that to happen, so fix it.

Change-Id: I1ef4ed051e326d14e233770e565e442ad690efcc
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
drivers: video: Add backlight dimmer option

This is based on n5dim by @mzhou  https://github.com/mzhou/n5dim

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
video: backlight: enable backlight_dimmer by default. Auto-brightness looks great with this.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
backlight: fix a bug where the screen would be completely dark or near darkness with backlight_dimmer enabled when the display dimmed. The brightness level can't be any lower than dev->min_brightness and previous code allowed that to happen, so fix it.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
backlight: clean the code.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
backlight: add minimum backlight brightness module param.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
backlight: scale max current when the brightness level is below 15 instead of using always 0.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: Turn off backlight while power off

Turn off the backlight while shut down panel as it
could show white flicker depending on the panel.

Change-Id: Ic5d4e97e70c87e5b6e956e27a766136610d6f345
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mdss: display: remove the pwm gpio request from edp backlight

There is no use of the pwm gpio inside the driver so cleaning up the code
and removing it from devicetree.

Change-Id: I72c038f3082aa6ed18ea9142de75faecc1e1e0fd
Signed-off-by: Asaf Penso <apenso@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: Add missing BL lock around BL-related info

The bl_updated variable requires the BL lock. Otherwise, it can be
corrupted and cause backlight issues.

Change-Id: I55eb4b8d525765ede4f27a404f5c3f1f0b446719
Signed-off-by: Benet Clark <benetc@codeaurora.org>

Conflicts:

	drivers/video/msm/mdss/mdss_mdp_splash_logo.c

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: control backlight level during blank and unblank events

Add code to set the backlight level to zero for blank event
and restore the backlight level to its previous value during
unblank event. This will fix any unexpected panel flicker
that might show up on the screen during panel ON sequence.

CRs-Fixed: 608091
Change-Id: I871a067b0cc40d893b8b7e5a25103ebb914f9b7a
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: Fix error in BL linearity inverse LUT check

Associate the maximum index for the BL linearity inverse LUT with the
table size and not the maximum backlight value. The maximum backlight
value can cause an out of bounds index for the BL linearity inverse LUT.

Change-Id: I35fb276f8f1cc6be3be158fa25e6442be438cbf0
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Slim: Change name to avoid conflict with Intellidemand

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Slim: Change 2 phase name

* To avoid conflict

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Slim: Fix one more

Change-Id: I770b2bf0a3366bd5ed8f2d7432c89133ac363301
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
cpufreq: Add Intellidemand & IntelliActive

* Look below to see everything I added :)

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: InteractiveX CPU governor

Modified version of interactive with sleep+wake code

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: OnDemandX CPU governor

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: Lionheart CPU governor

A brave and agile conservative-based governor

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: SmartAssV2 CPU governor

A smart optimized governor based on OnDemand

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: LulzActive CPU governor

A new interactive governor developed by Tegrak.
For more information please visit:
http://tegrak2x.blogspot.com/2011/11/lulzactive-governor-v2.html

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: Adaptive CPU governor

This driver adds a dynamic cpufreq policy governor designed for
latency-sensitive workloads and also for demanding performance.
This governor attempts to reduce the latency of clock increases so
that the system is more responsive to interactive workloads in loweset
steady-state but to reduce power consumption in middle operation level
up will be done in step by step to prohibit system from going to max
operation level.

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: Hyper CPU governor

A tweaked OnDemand based smart and smooth optimized governor

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: BrazilianWax CPU governor

A slightly more agressive smart optimized governor

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

cpufreq: Intellidemand CPU governor

This is an 'ondemand' based CPU governor created by Faux123 (thanks to him for his awesome work)

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>

Fix

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
Intellidemand: Remove Dead Code

* Power Suspend is Depreciated and seeing it lingering sickens me.

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
cpufreq: intelliactive: initial coding and introduction!

intelliactive is based on Latest Google Interactive cpufreq governor from
Google.  The original Interactive provides smooth UI operations but suffers
slight battery drain due to its aggressive policies.  Intelliactive is an
improvement built on top of it.

It has the following enhancements added:
1. self-boost capability from input drivers (no need for PowerHAL assist)
2. two phase scheduling (idle/busy phases to prevent from jumping directly to
   max freq
3. Checks for offline cpus and short circuits some unnecessary checks to
   improve code execution paths
4. removed trace calls

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
intelliactive: fix race condition when unregistering input handlers

Signed-off-by: Paul Reioux <reioux@gmail.com>
cpufreq: intelliactive: set default hispeed freq

* I think 1728 MHz is a good number here.  No need to let it default to stock max becuase 1728 is still really smooth.

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
intelliactive: make touch boost interface generic

Signed-off-by: Paul Reioux <reioux@gmail.com>
intelliactive: add upstream patches

Signed-off-by: Paul Reioux <reioux@gmail.com>
intelliactive: Fix Compile Warnings

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
intelliactive: rework input register/unregister

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Intellidemand: Change 2 Phase ifdef to Intellidemand

I don't want things getting confused later if I decide to do a second phase on Ondemand as well. They shouldn't be stuck to the same max.

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
cpufreq: Add Intellidemand 2 phase to Kconfig

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
cpufreq: Update intellidemand

* Updates from Faux123 since I had an old version....

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
intellidemand: Selectively update parts to 5.5

Change-Id: Ib8b915797d9ee96d4a2186f37fb945ac8868496b
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Updated Defconfig for LZ4 and added governors

Change-Id: Iba136a03530145e2f73cfee7241fe3a3f2405441