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>

Conflicts:
	arch/arm/boot/dts/msm8226-regulator.dtsi
	arch/arm/boot/dts/msm8226-v2.dtsi
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>
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>
msm: cpr-regulator: add pvs voltage uplift workaround

There are some parts which require higher than expected voltage. Add a
workaround to check the condition in fuse and uplift the voltage and
quotient accordingly.

Change-Id: I59f821320e5e97fc2334ae7617a0045edb5cc970
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: cpr-regulator: add support for frequency based CPR quotient scaling

The current cpr-regulator driver implementation uses the same CPR target
quotient, which is read from a fuse, for all CPU frequencies handled by a
given voltage corner. This results in unnecessary additional power
consumption when operating the CPU at one of the lower frequencies handled
by one voltage corner. Hence change the driver to adjust the CPR quot value
according to the CPU frequency.

CRs-Fixed: 583719
Change-Id: Idc9a93a76475ba3512a648efe721dcd165f8dbb6
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: rpm-regulator-smd: limit current to RPM defined maximum

Modify the rpm_vreg_get_optimum_mode() function so that it
restricts the maximum current that can be sent for the 'ma' KVP
to the limit defined by the RPM.

Change-Id: I744e656c75a5e78a81df9c283a8f14a977c4c6ee
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: rpm-regulator-smd: remove incorrect rpm_regulator_get() unlock calls

The rpm_regulator_get() function calls rpm_vreg_unlock() in
failure paths after two kzalloc() calls.  However, there is no
corresponding rpm_vreg_lock() call before these calls.  Also, the
code being executed does not require mutual exclusion.  Thus,
remove the rpm_vreg_unlock() calls in order to avoid possible
locking problems if kzalloc() fails.

Change-Id: I0a0f2ffde5a6c54600a823e3ed12c3c47c3bac6a
Signed-off-by: David Collins <collinsd@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>
mdss: clock: add edp dynamic clock rate support.

Add edp both main link clock and pixel clock related
support functions so that clock rate of both clock can
be configured dynamically.

Change-Id: I749c79923d7e7db1d722dab6628d58f88d178de9
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>
msm: acpuclock: Delete legacy acpuclock-krait drivers

The acpuclock-krait driver and the corresponding chip specific files have
been replaced with the clock-krait and clock-krait-8974 driver and
corresponding DT nodes. So, delete the unused files.

Change-Id: I193f0ae37940b537dec4fdfc2a3638d8cb0bcf0a
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/Makefile
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>

Conflicts:
	arch/arm/boot/dts/msm8226-v2.dtsi
ARM: dts: msm: enable pvs voltage uplift workaround for msm8226

Some 8x26 parts have lower pvs voltage than expected. Enable uplift
workaround of 50 mV on those parts under the specified conditions.

Change-Id: I3d8689ca0c5d576b1dd9057e36f67ea3622b80a1
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
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>
msm: ipc: Possible memory corruption due to Sign Conversion

msm_ipc_router_skb_to_buf() takes an unsigned argument and assigns the
same to a signed local variable. This might cause issues when the value
of the argument is too high.

Change the datatype of the local variable to unsigned.

CRs-Fixed: 550606
Change-Id: I257a095681dd82fba05367fd6faf25820e95c719
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
lpm_levels: Do not consider latency during suspend

Currently, cpu mode selection does not consider pm_qos latency
values during suspend, allows cores to be power collapsed. But
the system mode selection considers pm_qos latency which causes
to not choose any deep sleep mode.

Change-Id: Ia9db8692e6eb081b29bb4d75a7c0816fec5695bc
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
msm: lpm_levels: remove debug print

remove a pr_info that was added for debug purpose. This is
causing excessive logging issues.

CRs-fixed: 589307
Change-Id: I1f7bcb5282b51734cb7bf30ff933d65714445cba
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
hsic_sysmon_test: Add check for userspace buffer size count

hsic_sysmon_test local buffer size limit is 4096 bytes. If user space
tries to write data with size greater than 4096 bytes, memory corruption
would happen. Hence, add check for userspace buffer size count before
writing data from userspace buffer to hsic_sysmon_test local buffer.

CRs-Fixed: 547489
Change-Id: I29b286451395bef68a879baa0366dcef56d489c4
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
clock-mdss-8974: Switch HDMI clocks to use the new PLL implementation

This change cleans up the HDMI VCO/PLL implementation. It implements
the HDMI VCO clock and uses generic div and mux clocks to align to
the HDMI PLL architecture.

CRs-Fixed: 456315
Change-Id: I19ef344aafc954935cd6d236f3725bf168658ec9
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>