msm: camera: sensor: Update to use wait_for_completion.

Use wait_for_completion in place of wait_for_completion_interruptible

Change-Id: I960b334128e2b811b27c64721a65f7c7e773b085
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
msm: vidc: Amend calculation of buffer sizes in VENUS_BUFFER_SIZE

Add 8KB worth of padding for extradata. This is required to accommodate
some of the larger extradata types that didn't fit into the residual
space between the actual buffer size and its aligned size.

CRs-Fixed: 647378
Change-Id: I550f806079dfbdece229f68ffdfc5c0e20b3c9e1
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: camera: Fix improper memory free in failure case

Remove improper drv_priv free in failure case and
add NULL pointer check to avoid kernel panic

Change-Id: If074eba245e93bf8fead505993a2611582e4398d
Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
msm: camera: Fix race condition between camera driver and camera daemon

Delete checking command list before calling
wait_for_competion_timeout which could cause race condtion
if camera daemon may respond fast and there is one context swtich
between msm_enqueue and completion.

Change-Id: I28bdc4e344d2365acf49d422ba75dc64308a96aa
Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
NFC: Fix for wrong chip version.

Whenever an ioctl call is made to check the nfcc_version we now
wake-up the nfcc. Apparently the revision ID register (metal
revision no.) is updated only when the controller comes out of
sleep. Some recent changes in the DT meant that sometimes
the incorrect chip ID was being returned and so the patch was not
being applied.This is intended to fix this problem and removes
this detail from the caller method in the DT.

Change-Id: If2ed0e38a9d0803fa03e1b2110b9c0d090b74c0d
Acked-by: Umesh Jagga <ujagga@qti.qualcomm.com>
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
msm: rq_stats: Use cpufreq API to get the current frequency

Since the acpuclock APIs are deprecated, use the cpufreq to
get the current frequency of CPUs to calculate the cpu
normalized load value.

Change-Id: I6e381d584d6725ef964bad86c835d44f3046e9c3
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
msm: rq_stats: Fix wrong usage of cpufreq_quick_get()

cpufreq_quick_get() returns frequency in KHz, which is exactly what
cur_freq expect. Remove the wrong multiplication.

CRs-fixed: 645518
Change-Id: Ia8b080a188023964f5eee77c8586828097d11ad4
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
msm: vidc: Add AFD and CC metadata support to extradata

Add support and control for setting Active format
description and closed caption meta data in the
extradata. FW parses metadata and adds it to the
extradata. Client can use control to parse extradata
for the metadata information.

Change-Id: I79fb71e635927c95e0792862c9dea7d96f58e895
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
ARM: dts: mdss: Increase MDSS clock hysteresis cycles for msm8226

Increasing the number of cycles of MDSS clocks to stay active for
an additional 32 cycles before gated off.

Change-Id: Ia98b9d98ca59fd7bed408c775d8f58d35e6df5bb
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
mmc: sdhci-msm: fix issue with tuning command

As of now we ignore CRC/INDEX command failures to tuning command
and still wait for data from card but in case the card did not
receive the command, it won't send the data. This is causing
software request timeout for tuning commands. Hence, software
must not ignore such cmd errors for tuning commands but end the
request immediately after resetting the controller for both CMD
and DATA. Also, wait for 146 MCLK cycles for card to send out the
data and thus to move to transfer state. Its corresponding phase must
also be considered as bad phase.

CRs-fixed: 625855
Change-Id: Ic8462dd9c67e4f18a3ce73d972591772be8c6d10
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
msm: vidc: Add NULL pointer check before deiniting controls

Add NULL pointer check in deinit function, and return -EINVAL
when NULL pointer is found.
Without this change, accidentally, msm_venc_ctrl_deinit() will be called
with a null pointer parameter, which will cause kernel panic.

Change-Id: I80bb6c271dcd3277ddce5332c5f42328ca376128
CRs-Fixed: 652365
Signed-off-by: huiy <huiyQuic@codeaurora.org>
msm: vidc: do not check for session supported in executing state

The v4l2 video driver should check if the video session is supported
only prior to entering the executing state. Once video session is
in executing state, the session should be always honored.

Change-Id: Iaa59089ef05f03bbc821af8c7fd4fbc342067b3a
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Validate userspace buffer count

Makesure the number of buffers count is less than
the maximum limit to avoid structure overflow errors.

Change-Id: Icf3850de36325637ae43ac95f1c8f0f63e201d31
CRs-fixed: 563694
Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
hwmon: qpnp-adc-voltage: Update default scaling API

Update default scaling API to support absolute and
ratiometric calibration both to convert raw adc data
to voltages.

Change-Id: I45a109d77c388564c0063d1de926813a4a929c48
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
msm: ocmem: Call restore_sec_config() after every power collapse

As the QRIB is enabled, after every power collapse of ocmem, the
QRIB is reset to the maximum security state. Due to this the apps
processor cannot access the ocmem register space.

The restore_sec_config() scm call needs to be called before any
register is accessed after a power collapse to ensure that the
security configuration is restored. The clocks need to be turned
on before every call that is made into TZ to ensure that there
is no power collapse.

CRs-Fixed: 651324, 660089
Change-Id: Ieb6b635142057e219de29e811c93749f6500cec5
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: mdss: add property to set from device tree the overlap BW fudge factor

Current calculations apply one fudge factor to the final bandwidth
regardless if this is a result from the overlap or prefill calculation.
With this change the final bandwidth can be tuned up to apply a different
fudge factor when the bandwidth depends on the overlap calculation.

CRs-Fixed: 635005
Change-Id: Iaa9718bda3264a47bf70a2facba0d23e4b2414f3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
wcnss: Reset IRIS card before Starting IRIS XO configuration

Set iris_reset bit of PMU CFG register to reset the IRIS
card before Starting IRIS XO configuration.

Change-Id: Id1cfd7e3e3df29919089725b2233c6f95afbbfb5
CRs-Fixed: 664642
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
Merge "msm: mdss: add property to set from device tree the overlap BW fudge factor"
Merge "msm: vidc: Amend calculation of buffer sizes in VENUS_BUFFER_SIZE"
Merge "msm: vidc: Add AFD and CC metadata support to extradata"