msm: camera: exit camera incase axi gets timeout

AXI hits timeout while stopping due to sensor not streaming.
Simply returning error from here puts AXI and camif in still
running state whereas userspace proceeds with releasing the
buffers. This fix ensures we halt AXi and stop camif in sensor
not streaming case. Thus avoid page faults and a delay in
stopping camera.

Change-Id: I4159ac7b21d2a22a5684d7b4a614b0dfd8f06e46
Signed-off-by: Mohit Setia <msetia@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>
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: 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>
mdss: Move te parameters to dtsi file for 8x10

There may be need to fine-tune the te parameters depending on
panel. Move te parameters to panel dtsi file so that this can
be configured from panel dtsi file.

CRs-Fixed: 616178
Change-Id: I465b96f1631a96cddfa15c9c3004e3dbdcea5982
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
arm: boot: dts: Add TE paramters to truly wvga command mode panel

Add TE parametrs to truly wvga panel. These parametrs are used for
configuring the TE for this panel.

CRs-Fixed: 616178
Change-Id: I660decda5360a41161939cb0d7b35db8ccb0768a
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
msm: vidc: rewrite v4l2 cluster construction

V4L2 framework has limitation of not supporting
same control in multiple clusters. Overcome this
limitation by grouping all controls into one
super cluster.

Change-Id: I974199e1388a1b33ae5e56edd4b0af712eb9babf
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: fix a race condition in cluster construction

At start of video session, when the super cluster is
constructed, it refers to a global static variable.
If we have multiple instances running simultaneously,
there exists a race condition, causing the instance
to register wrong cluster. Later on when a control
gets set in encoder, if the control is not found in
the cluster, we hit a BUG_ON, crashing the device.

Change-Id: Ib4ee64d684d903bb4f22310a1b34619728405649
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Merge "mdss: Move te parameters to dtsi file for 8x10"
Merge "arm: boot: dts: Add TE paramters to truly wvga command mode panel"
Merge "msm: vidc: rewrite v4l2 cluster construction"
Merge "msm: vidc: fix a race condition in cluster construction"
msm: vidc: rewrite v4l2 cluster construction

V4L2 framework has limitation of not supporting
same control in multiple clusters. Overcome this
limitation by grouping all controls into one
super cluster.

Change-Id: I974199e1388a1b33ae5e56edd4b0af712eb9babf
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Merge "msm: vidc: rewrite v4l2 cluster construction"
msm: cpr-regulator: calculate quotient adjustment dynamically

Replace the fixed quotient adjustment algorithm with a new algorithm
that calculates quotient adjustments dynamically.

Calculate the quotient scaling factor according to fused target
quotients and application processor clock frequencies. A different
quotient adjustment value is applied to each voltage corner.

The formula for calculating the quotient adjustment value for each
voltage corner is:
quot_adjust = (freq_turbo_MHZ - freq_corner_MHZ) * scaling / 1000
where the "scaling" is determined using this equation:
scaling = min(max_scaling_factor,
1000 * (QUOT(fused_turbo) - QUOT(fused_norm)) /
(Freq_turbo_MHZ - Freq_normal_MHZ)).

In msm8x26 cpr-regulator device tree node, add a corner to frequency
mapping table, a speedbin + PVS version to max SVS/normal/turbo fuse
corner mapping table, a maximum quotient adjustment scaling factor,and
PVS version eFuse information. With the frequency to corner mapping
table specified in msm8x26 clock-a7 device tree node, this ensures that
1.6G msm8226v2 and msm8926 parts receive power saving when running
at turbo frequencies below the maximum possible turbo frequency.

CRs-Fixed: 597721
Change-Id: Ideecccc2f81762bed3668cfdf27d942c00df76ea
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
Signed-off-by: Ke Liu <keliu@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>
msm: camera: sensor: Update CCI WR comamnd buffer size to 11 bytes

I2C command length is of 11 bytes, it includes 10 bytes of data and
one byte of WR command. Use 11 bytes char array to create command.

Change-Id: Idf330fef6b8da79c6b7f5a2839d88a68e10a96f9
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Merge "msm: camera: sensor: Update CCI WR comamnd buffer size to 11 bytes"
msm: camera: sensor: Update CCI WR comamnd buffer size to 11 bytes

I2C command length is of 11 bytes, it includes 10 bytes of data and
one byte of WR command. Use 11 bytes char array to create command.

Change-Id: Idf330fef6b8da79c6b7f5a2839d88a68e10a96f9
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Merge "msm: camera: sensor: Update CCI WR comamnd buffer size to 11 bytes"