ARM: dts: msm: configure APC supply regulator S2 to auto mode for msm8226

Configure PMIC PM8226 regulator SMPS 2 for auto mode.  When
operating in auto mode, the regulator automatically switches
between PWM (high power) and PFM (low power) modes based upon
real-time current consumption.  This results in lower aggregate
power consumption since PFM mode has lower ground current than
PWM mode.

Change-Id: I4868a965e033000a27d55db43f37140910eeba8b
CRs-Fixed: 522545
Signed-off-by: David Collins <collinsd@codeaurora.org>
arm/dts: msm8974: Change qseecom device tree setting

set the flag of support-bus-scaling and change ab & ib
value to support bus bandwidth scaling.

Change-Id: Ia509729675b5c8ce13a9367f8909dc29a1c89944
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm: sps: Add probe deferral support in sps driver

Add probe deferral support in sps driver.

Change-Id: If65d2ebbcdece256fdfa000097ac25874c9a5000
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
input: touchscreen: Change late_init call to module_init

Change late_initcall usage in goodix driver to module_init.

Change-Id: I59681138448584fc7a04c95dc8af3d4c3d395ff0
CRs-fixed: 563946
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
input: touchscreen: Convert Goodix driver to dev_pm_ops

Convert Goodix driver to dev_pm_ops.
Add return type and parameters for suspend/resume for
Goodix driver.

Change-Id: I5243d9ab801f6964e675ad37c2161beda3586dfe
CRs-fixed: 567703
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
msm: kgsl: fix a race condition when calling kref_put

Fix a race condition which can occur if a thread tries to acquire
a reference to a mem_entry or context while another thread has
already decremented the refcount to 0 and is in the process of
destroying said mem_entry or context.

Change-Id: I6be64ca75f9cb12b03e870b9ca83588197c64e5e
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
ARM: dts: msm: Removing UART Entry at f995e000

Removing the UART structure @f995e000 as 8226 chipset
doesnt have UART Core at f995e000 Address

CRs-Fixed: 581118
Change-Id: I215f2d0a40e3a1b3942c15796e336948bcd0f0b6
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
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>
Git-commit: 92189d47f66c67e5fd92eafaa287e153197a454f
Git-repo: https://android.googlesource.com/kernel/common/
[bhargavuln@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Bhargav Upperla <bhargavuln@codeaurora.org>
msm: Do not use offset, when reporting  image version string

As per requirements we have to report untouched image version string,
which includes numbers before the string: "00:BOOT.BF.2.1-2.1.0890",
instead of "BOOT.BF.2.1-2.1.0890".

Change-Id: Ie2b60ce867ff52fc38487edd403c18f840cce527
Signed-off-by: Yulian Shandorov <jshandorov@codeaurora.org>
msm: mdss: Enable hardware reset line based on panel setting

DSI clock and data lanes should be in LP11 state before
enabling the hardware reset line for some panels. These
panels might need initialization delay after DSI host and slave
in LP11 state to reach functional. No data traffic
is allowed for such panels during this master delay.

CRs-fixed: 572179
Change-Id: I6a004f55a117f1adfbfbfce85231ef45997e4e6f
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: Replace enums with strings in panel dtsi

To make dtsi files more readable, enums or u32
values that referred to strings in the panel
dtsi files are replaced by strings.

Change-Id: I516358c7027fe9ed05541b56c2de47280a23baab
CRs-Fixed: 511801
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
ARM: dts: msm: correct ssd2080m panel commands and timing

Update ssd2080m panel on/off commands,vertical/horizontal
porch values and timing according to vendor's suggestion

CRs-fixed: 569455
Change-Id: Ia60bb8caf55ebbff96751f6b9706f9ef682428c7
Signed-off-by: Ray Zhang <rayzhang@codeaurora.org>
msm: vidc: Check input arguments correctly

This commit fixes some minor bugs in which input arguments or malloc
return values were being insufficiently validated.

Change-Id: Ib0b3d2ded29384b49ec61a5fc275d3aca1fd6e14
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
CPU hotplug, debug: detect imbalance between get_online_cpus() and put_online_cpus()

The synchronization between CPU hotplug readers and writers is achieved
by means of refcounting, safeguarded by the cpu_hotplug.lock.

get_online_cpus() increments the refcount, whereas put_online_cpus()
decrements it.  If we ever hit an imbalance between the two, we end up
compromising the guarantees of the hotplug synchronization i.e, for
example, an extra call to put_online_cpus() can end up allowing a
hotplug reader to execute concurrently with a hotplug writer.

So, add a WARN_ON() in put_online_cpus() to detect such cases where the
refcount can go negative, and also attempt to fix it up, so that we can
continue to run.

Change-Id: I144efeaa5899a2e8a3cddd21f010679cbaaa2459
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: 075663d19885eb3738fd2d7dbdb8947e12563b68
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
msm: cpr-regulator: change device tree vendor prefix to 'qti'

New policy requires changing device tree vendor prefix from 'qcom'
to 'qti'. Also change device tree files for msm8610, msm8226 and msm8926.

Change-Id: I57c8c9d14ffa3ddd3671f406cfa2011eb23e66e4
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: cpr-regulator: change cpr_read_efuse_row api

Add a flag in cpr_read_efuse_row api to make it choose
to read register directly or read through SCM.

Change-Id: I3031dfd1c7cfffb880c49e5f1708b1436fdd2897
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: cpr-regulator: add support for conditional minimum voltage

Certain targets have VDD_APC minimum voltage constraints which are
imposed if the mem-accel fuse has not been programmed. Add two new
device tree properties to capture the row offset and expected value
of the mem-accel fuse as well as to capture the minimum VDD_APC voltage
to enforce if the mem-accel fuse has not been programmed with the
expected value.

CRs-Fixed: 580585
Change-Id: Ifd770b33d74b2bc9cf37dd2b1817e1424a5ee8f3
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: specify conditional VDD_APC minimum voltage for msm8226

Restrict the minimum APC voltage to 1.14V when the mem-accel fuse has not
be programmed as expected.

CRs-Fixed: 580585
Change-Id: Ia506efb15c7599d79c5561163879d82910db84f8
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: reduce CPR turbo floor voltage for msm8226

The device tree property qti,cpr-cond-min-voltage = <1140000> along with
an appropriate qti,cpr-cond-min-volt-fuse property value ensure that the
CPR turbo floor voltage is restricted to 1.14 V on devices that cannot
operate at lower voltages.

Therefore, reduce the default CPR turbo floor voltage to 1.1 V in order
to save power on devices that can operate at the lower voltage.

Change-Id: Ic939d4a7b1c4da0a28dd779fe6a900310ae9fab7
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: cpr-regulator: modify the dts definition for cond-min-volt

Previously, cpr-cond-min-volt-fuse defined the fuse row number and the
value used to compare with the whole row efuse value. The cpr-regulator
driver would then conditionally apply a higher CPR floor voltage for all
voltage corners if the efuse value differed from the expected value.

However, only a subset of the bits in the efuse are used for the
cond-min-volt feature. If any of the other bits in the fuse are set, then
the cpr-regulator driver incorrectly applies the higher floor voltage even
if the cond-min-volt bits are set correctly.

Modify the cpr-regulator driver and the cpr-regulator device tree
properties so that only specific bits in the fuse are compared to the
expected value. If the value of the cond-min-volt bits in the fuse is
not equal to the value defined in device tree, then set the MIN_VOLTAGE
flag.

Change-Id: I7de04e17dfa93fcb638e29a1dcc5e9072de26cb8
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
Signed-off-by: Ke Liu <keliu@codeaurora.org>