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>
ASoC: wcd9310: Add plug detection through mechanical switch

Use mechanical switch on the phone jack to detect headset/headphone
insertion and removal.  Mechanical switch is beneficial to avoid fake
button press and high impedance microphone headset detection.

CRs-fixed: 341402
Change-Id: I9eab7285617b9116671e9facb39a878a8ddb464e
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit d7cf2e931cea51c7ff0a40e6b930edf99b320d8e)
ASoC: msm8960: properly protect external mclk control function

Both audio path and MBHC accessory detection logic need master clock
enabled along with bandgap and clock block of CODEC. Clock control
is managed by the machine driver. Calls to clock control function from
audio and MBHC detection paths can be nested. As a result, reference
counter of master clock is incremen/decrement out of order and cause
master clock not enabled when audio path is enabled. Without master clock
CODEC will not consume data and this leads to SLIMBUS overflow error.

Change-Id: Ic29b9740a28256251a8fb2aaf773082562a8fe40
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit 28f49c84acb4e691b630b26c37ab6d206109482f)
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)
msm: vidc: Fixes a bug in firmware download.

Fixes a bug in firmware download for secure
playback.

Change-Id: I6f1fcd89a997c76fe3ae1d0b9144dfae372bde40
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
mmc: block: support no access to boot partitions

Intel Medfield platform blocks access to eMMC boot partitions which
results in switch errors.  Since there is no access, mmcboot0/1
devices should not be created.  Add a host capability to reflect that.

Change-Id: I67d7e1301bb13ce6b01fb44e511ea21cfbf7e4bd
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
[subhashj@codeaurora.org: Fixed merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
(cherry picked from commit 48ec4d1ef38a243fe047260a033367276d17507b)

Conflicts:

	include/linux/mmc/host.h

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: msm_sdcc: advertise MMC_CAP2_BOOTPART_NOACC

Since there is no access required to boot partitions,
mmcboot0/1 devices should not be created. Advertise
MMC_CAP2_BOOTPART_NOACC host capability to reflect this.

Change-Id: If3adbc6585e3ba652183ee3ede117503d709ce70
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
(cherry picked from commit 0a0c627d35e128d952a12263f608cc63c1a127ab)

Conflicts:

	drivers/mmc/host/msm_sdcc.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Revert "fmem: turn off fmem"

This reverts commit 7d1d4800142ba73fb70d7fe8c026f70fe18cc63a.

Commit 6f8dad6cd7cb2454e6bdc804a69cc2ab31d09a88
(Revert "fmem: reinitialize some qcache data upon returning to T-state")
fixes instability problems associated with fmem. Turn f-mem back
on since fmem was only turned off due to instability problems.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
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: I92f9cb0716a1ba1e3191adf764d2583c4bb8c256
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
Revert "fmem: reinitialize some qcache data upon returning to T-state"

This reverts commit 111ea32d6eafbfd14ad887c634a6b94104c541a5.

That commit has been shown to cause crashes in testing.

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

Change-Id: I3adf6d20a13d8fb9529689ec8e0ffa9c8fca4bba
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
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>
defconfig: msm7630: Add support for 1GB RAM

Enable Highmem and increase the vmalloc reserve area to 416MB, to
support 1GB RAM on 7630 device. Increase in vmalloc reserve area
is equal to 512MB RAM device.

CRs-Fixed: 341201
Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>
(cherry picked from commit 65e7225e94308fdf103c90cbeb15359755fbb6c0)

Change-Id: I37b50f1dc50c050ad229dd496f9ea1049b82dc81
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Bluetooth: Modify security level at remote_features event for BT2.0 devices

For non SSP devices, MEDIUM_SECURITY has to be used for pairing. This
can be determined and set while receiving remote supported features
event for BT2.0 devices.

CRs-fixed: 345945
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
(cherry picked from commit 9f08bfda36018fe9786896bdda14f416a03aec74)

Change-Id: I4c66a90933a23c047fcb688174cb5d818e139b63
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: display: Assign proper destination rectangles to mdp blit

Add check for (90 + Flip Horizontal) and Flip Vertical cases to assign
proper destination rectangle parameters to avoid corrupted frame
buffer content.

CRs-Fixed: 344807
Change-Id: I7e7b0b8d26f08f63a6f9c55eedd37f31cf0348d7
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
(cherry picked from commit 07c82d6ca63c6be28ab897fdb3ccfc1a448c342f)
msm: 7x27A: Increase pmem size to allow H.264 720P decoding

Increase size of pmem_adsp region to enable high resolution
video decode (720P) using neon optimized SW codecs

CRs-Fixed: 343694
Signed-off-by: Mahesh Lanka <mlanka@codeaurora.org>
(cherry picked from commit c054d353aca172b84740272d6c55869923145fa2)

Conflicts:

	arch/arm/mach-msm/board-qrd7627a.c

Change-Id: I169dd2de1bb6228e4bd239e70d447da4fc04333e
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm: bam_dmux: pin rx workqueue to core 0

Pin the receive workqueue so that it always runs on core 0.  Do this to
eliminate a race condition caused by the workqueue moving between cores in
the middle of a downlink data transfer.  If hit, the race condition will
cause the TCP/IP framework to process packets out of order for a short time
which could cause performance degradation due to unnecessary
retransmissions.

CRs-Fixed: 346788
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
power: pm8921-charger: avoid schedule while atomic bug

If the loop_change interrupt handler directly invokes the
unplug_check_worker which uses msleep causing a bug.

Fix this by scheduling the work directly rather than invoking
the work function.

Change-Id: Id1ce75eddc1b7f09b7476af12b68ec8ae8ff1f24
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
(cherry picked from commit b57db9e0e6240acc06ee2fab03fe57d8d6015611)
Merge "power: pm8921-charger: avoid schedule while atomic bug" into ics_chocolate_rb1.10