ARM: dts: msm: Add pm-qos-latency to GPU dtsi

Currently the code has a fixed CPU latency vote from
the GPU driver. Some targets have different latency
requirements to allow various low latency PC modes.
Allow the CPU latency vote to be programmable based
on target. 701us PM QOS allows the A7 targets select
Low Power Mode which is better in terms of power.
This will help save static leakage of A7 during
graphics use cases.

Change-Id: I38a7ae76a4ebe0c4c98e6bc6d58353989e94c611
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
msm: kgsl: get pm-qos-latency from device tree

pm-qos-latency parameter can be configured from
device tree as well. Will set to default value if
entry not found in target device tree.

Change-Id: I76271f4fdc26e191431e5dfe2a6de9e2b3ab426f
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
msm: thermal: Don't initialize hotplug thread when not configured

Do not initialize the hotplug thread if the device tree
entry for hotplug thresholds are missing for a target.

CRs-fixed: 580249
Change-Id: I8ed99a757a2bd66a6a669ad78d7c4fe632b56012
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
cpufreq: Fix policy getting stuck when user & kernel min/max don't overlap

Every __cpufreq_set_policy starts with checking the new policy min/max has
some overlap with the current policy min/max. This works out fine until we
end up with the policy min/max being set to a range that doesn't overlap
with the user policy min/max. Once we get into this situation, the check at
the start of __cpufreq_set_policy fails and prevents us from getting out of
this state.
This only happens when one of the CPUFREQ_ADJUST/CPUFREQ_INCOMPATIBLE
notifiers called inside __cpufreq_set_policy pick a min/max outside the
range of user policy min/max.
The real intent of the check at the start of __cpufreq_set_policy is to
make sure userspace can't set user policy min > user policy max. Since
__cpufreq_set_policy always gets called only with current user policy
min/max except when the actual user space policy min/max is changed, we can
fix the issue by simply checking the new policy min/max against current
user policy min/max.

Change-Id: I64211d1304b5c250b8b2fdc7a2ad112c73925c28
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
ARM: dts: msm: set cpu_dma_latency to 701 usec

Vote for 701 usec so as to allow the core to go to
stand-alone power collapse.

CRs-fixed: 636365
Change-Id: I456aa4936b2a8104f2146786fa819839500d73b7
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
msm: lpm_levels: remove rpm handshake in l2_gdhs mode

Remove rpm handshake in l2_gdhs mode and adjust the
latency, time overhead and energy overhead values for
l2_gdhs mode.

CRs-fixed: 604873
Change-Id: I9eeae5fada4f84ee2ca2eb9d67707dee1adf56ac
Signed-off-by: Anil kumar mamidala <amami@codeaurora.org>
msm: acpuclock-8226: update corner mapping for 1.2 and 1.4 GHz speedbins

Update the voltage corner mappings for APPS processor turbo frequencies in
the tables for 1.2 and 1.4 GHz speedbins of msm8226 and msm8926. Specifying
unique virtual voltage corner values for each turbo frequency allows the
CPR controller to scale down the voltage used at these frequencies in order
to save more power.

CRs-Fixed: 597721
Change-Id: Ie5992361a79950614d9e2b04a6bfb373e26088a3
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Signed-off-by: Ke Liu <keliu@codeaurora.org>
Merge "msm: acpuclock-8226: update corner mapping for 1.2 and 1.4 GHz speedbins"
Merge "msm: thermal: Don't initialize hotplug thread when not configured"
msm: thermal: Add support for emergency frequency mitigation

Add emergency frequency mitigation support to Kernel Thermal
Monitor. This feature enables KTM to mitigate the cpu's max
frequency when the temperature crosses the preset threshold.

CRs-Fixed: 538981
Change-Id: I756e82e577b19c18f32b3297aa97fa2942d8b77d
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Merge "msm: thermal: Add support for emergency frequency mitigation"
msm: thermal: Add IOCTL interface support to Kernel Thermal Monitor

Kernel Thermal Monitor exposes an IOCTL dev interface,
which can be used for user space cpu frequency
mitigation.

CRs-Fixed: 538981
Change-Id: Idb8b836970f7d5d029fea606aaa4f7958c982f68
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Merge "msm: thermal: Add IOCTL interface support to Kernel Thermal Monitor"
msm: thermal: Initialize per cpu variables during thermal init

Initializing the per cpu variables inside frequency/hotplug
probe function has a possibility that it may result in
uninitialized variables. So initialize the per cpu variables
in the thermal drivers init function.

Change-Id: I4cac01defeedcea2ae7447a81cc6e4f9584db010
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Merge "msm: thermal: Initialize per cpu variables during thermal init"
Merge "ARM: dts: msm: Add pm-qos-latency to GPU dtsi"
msm: acpuclock-8226: Limit DDR to 200MHz for APSS frequency

For APSS frequency of 600 and 787MHz, DDR frequency still required to be at
SVS of BIMC frequency.

CRs-Fixed: 644461
Change-Id: I3b866fd4ee063c61909055d9b2b30641fbc764ea
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Merge "msm: kgsl: get pm-qos-latency from device tree"
Merge "ARM: dts: msm: set cpu_dma_latency to 701 usec"
Merge "msm: acpuclock-8226: Limit DDR to 200MHz for APSS frequency"