msm: rpm: Replace mutex_lock_interruptible with mutex_lock

mutex_lock_interruptible() bails on signal pending. Instead use the
mutex_lock() variant and let the caller handle the pending signal
condition.

Change-Id: Ib06953731a7e4eb367358148bde202dfbdf556df
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
mfd: pm8xxx-pwm: Add feature to configure LPG DTEST mode

PM8921 LPG banks can be configured to connect to DTESTx.
These DTEST lines can be used to observe LPG output.
Provide a feature that allows to enable DTEST modes for
a given LPG channel.

CRs-fixed: 337902
Change-Id: If881eb089aea2a66f7324af8ac906405eef4f81a
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
msm: board-8960-pmic: Add platform data for PWM driver

Add default platform data to enable DTEST configuration
for PM8921 LPG channels.
With the help of this feature, a given LPG channel can
be selected to drive the DTEST line.

Change-Id: I810ffac4a9498d9b8327ab503e3b067f04f4a873
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
msm: 8960: Add correct PASR mask support

The current system does not use the correct PASR masks for turning
off sections of memory. It will also crash if the SPARSEMEM section_size
is changed to smaller values.

This fix calculates the correct masks and removes the dependency on
the SPARSEMEM section_size. It will accurately calculate the mask
regardless of memory size and configuration.

MAX_NR_REGIONS has been increased to 32 to account for the largest
system containing four memory banks, each divided into 8 sections.

Change-Id: Idaf05a06c1430e6d353fddafa305b57e400dfb8c
CRs-fixed: 329575
Signed-off-by: Jack Cheung <jackc@codeaurora.org>
(cherry picked from commit d01fd83bf9182b0a37abb3c4a2b9cd5e8ced4bd5)
fmem: protect qcache statistics with lock

Some of the qcache statistics were being calculated
without being protected by a lock. In very rare cases
this might lead to a nonzero allocation count when
all qcache pages have been freed (and thus must be 0).

CRs-Fixed: 344939
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit f3b0aa3e7c50002d08c4ecda76ac25584849c055)

Change-Id: I4c6ce7a092d84db0618f5be6508548e918348bd6
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit a3930374acd8ee33b7084ca59965665b81ed8390)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: camera: Fix msm_camera_i2c_poll function call

Change-Id: Ie99e61811332054b2b7e4b0f3a05a932e988729c
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
CRs-Fixed: 348564
msm: lpass-8960: Avoid write to lpass wakeup register

LPASS SSR driver has a write to lpass wakeup register as part of
lpass shutdown process. But wakeup register falls under secure
space which is not accessible by HLOS. To avoid this, the write
has been moved to NMI call now. Hence remove this write to lpass
wake register from ssr driver

(cherry picked from commit 0a4aadf45ea80c715e8de9b7193eea09f23c953d)

Change-Id: I2c6b528f7217cf050e66554f58ee4013741b7d81
CRs-Fixed: 340872
Signed-off-by: Sriranjan Srikantam <cssrika@codeaurora.org>
msm: bam_dmux: send powerdown ack to A2

When bam_dmux disconnects to the bam hardware in response to the A2
powering down, send an ack back to the A2 signaling that bam_dmux got
the powerdown signal and processed it.

This change optimizes the response time for back-to-back shutdown and
powerup sequences instead of requiring a hard coded delay in the A2 state
machine.

(cherry picked from commit 0b13a3522c4a68cb337398bb7bf66d3623d5f098)

Change-Id: I6e0d8036d189efba87873092562b8c5563c0db80
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
qseecom: Add new dfab clock definition to the driver.

Currently, the qseecom driver uses the dfab clock definition
of scm driver. The new definition fixes this problem.
The driver should for NULL before setting the clock rate.

Change-Id: Iad653ee855b834a475b43502d36e4673c4bd03a3
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
qseecom: Enable DFAB clock during bus scaling.

The driver returns a failure when calling to vote for DFAB clock.
- The clock was not enabled and set when bus scaling client
  registration was successfull.
- Added warning messages when bus scaling ioctl requests fail.
- Initializing uninitialized variables.

Change-Id: I076218fcccbb9144609311efde1eb4225d1729bf
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
(cherry picked from commit e640e84a8e9a650e64ce082b8c6a43b23e37985f)
video: msm: wfd: Allow client to specify multiple slices per frame

Adds support for V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE, ..._MAX_BYTES ,
..._MAX_MB controls which allow clients in specify the numbers of slices
in a frame in terms of bytes or macroblocks.

Change-Id: I5e4e5bd9ebbb7a00714cbcb331f350c538289641
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
(cherry picked from commit 607fbf2a04256ad12504259a923d27936c39fd0a)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
video: msm: wfd: Allow client to specify number of buffers

As per the V4L2 spec, client is allowed to specify the number of output
buffers that it would like to use.

Change-Id: Ie70ddc82257f639cd704548988330c075829adf8
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
video: msm: wfd: Delete from free_queue before freeing memory

VSG has a stale pointer to deallocated memory that is accessed, causing
a page fault.

Change-Id: I036293950795f601c0592c39b6da20d3c0cbb77f
CRs-Fixed: 348977
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: vidc: Use pre-computed frame delta values in WFD use case

In WFD use case with frame skipping enabled, we wish to fool the core
into thinking that that the frames are coming at a consistent rate so
that we don't run into any issues with the core's rate control
mechanism.

The following change introduces a property that the client may set that
dictates what the timestamp delta between any two frames might be.

Change-Id: Iea3f97879227b7932543d3449d311758dc4a2f59
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: vidc: Adds API to request performance level.

Adds API to request for a particular performance
level from video core. This is needed for Wi-fi
display (WFD) to reduce end to end latency.

Change-Id: Ib4133b8cd62ccad286be1984f944911754b887c5
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
qseecom: Add error checks and logs

Adding/improving error logs and incorrect fd checks

Change-Id: Ia311e911eb8e5da3e7a3f413bb34b479389f3890
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
(cherry picked from commit a5f1aab25ea1da8cb26976072e95c01187d0437a)
Bluetooth: Hold ref on hci_conn when setting up A2MP fixed channel

Take a reference on the hci_conn and do not de-reference l2cap_conn
while setting up the A2MP fixed channel. l2cap_conn is not reference
counted and may go away before the channel is set up.

This fixes scenario where the ACL disconnects (and l2cap_conn goes
away) while amp_conn_ind worker is running or is on the workqueue
waiting to run.

CRs-fixed: 347079
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
(cherry picked from commit 072a51fd0e1f642d179358c5610d9115cbdba358)

Change-Id: I476ea4811fe23dca3384d21ba1f202aeaf411173
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
USB: OTG: msm: Add debugfs entry to read otg_state

This change add's support for reading the otg_state of the device
through debugfs.

CRs-Fixed: 346906
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
(cherry picked from commit f9a11546e992ac95a14308e7110313b288a303f1)

Change-Id: I109106e192b24757f41e5effebfbaf69b0b8256d
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Merge changes Ia311e911,Ib4133b8c,Iea3f9787,I03629395,Ie70ddc82,I2e4a6a9e,I076218fc,Ia7eb9646 into ics_chocolate

* changes:
  qseecom: Add error checks and logs
  msm: vidc: Adds API to request performance level.
  msm: vidc: Use pre-computed frame delta values in WFD use case
  video: msm: wfd: Delete from free_queue before freeing memory
  video: msm: wfd: Allow client to specify number of buffers
  video: msm: wfd: Allow client to specify multiple slices per frame
  qseecom: Enable DFAB clock during bus scaling.
  qseecom: Add new dfab clock definition to the driver.
Merge "Bluetooth: Hold ref on hci_conn when setting up A2MP fixed channel" into ics_chocolate