ARM: dts: msm: Fix SPI0 chip select definitions on 8974

In the process of updating SPI device tree definitions,
commit 9305cdd564c7ed68fc0660f97b32e37645a603c2 redefined
GPIO 9 as SPI CS0 instead of CS2, causing the KS8851 SPI
Ethernet controller (which is tied to SPI0 CS2) to stop
working.

Change-Id: I421c0b9a6fc00324acd5b1e939997a2af417c587
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
qpnp-rtc: clear alarm register when rtc irq is disabled

The rtc alarm register should be cleared when the rtc irq is
disabled

Change-Id: I97a8bf989ff610093240a6b308a297702da6cb89
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
msm_serial_hs: fix unbalanced clock vote during port close

This change fixes the clock voting logic when the port is closed and
prevents the clock votes from going negative. Clocks are voted for when
the port is being closed and the conditional unvote based on the clock
state will always be true if the earlier vote is not downvoted before
this check is done. This change also protects agains erroneous, unbalanced
client votes, leading to instabilities.

CRs-Fixed: 550668
Change-Id: I391ac69601314757821b3ffb931a00647a64c583
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
msm: kgsl: prevent kgsl_get_pagetable from returning a destroyed pt

A race condition exists between kref_get_pagetable and
kref_put_pagetable such that is is possible to put the last
reference to a pagetable slightly before it has been removed
from the list. By checking kref_get_unless_zero we can determine
if the last reference has already been released. This is safe
because the list is protected by a ptlock.

Change-Id: If6a75e9ca0dec6a12bda5739f835c936a4c3a3b4
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
msm: kgsl: Add check for NULL value from dev_get_drvdata

Check to see if dev_get_drvdata returns NULL and handle it.

CRs-Fixed: 552580
Change-Id: Ic0dedbad426dbbe15896608213067ee7337f3b34
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
spi_qsd: Free Chip Select GPIO for each Transfer.

Currently  msm_spi_process_message is freeing Chip
Select GPIO only when error occurs instead of
freeing it for every transfer. This patch releases
Chip select GPIO for each transfer complete.

CRs-Fixed: 579737
Change-Id: I3f24fda283714ee8422e42b297f9c10dc3367b65
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
msm_serial_hs_lite: Remove kernel panic

Donot use panic() when tx operation timeouts,which
leads to kernel panic causing crash.
Instead of panic which effects the driver stability,
resetting the transmitter will works good and keeps
transmission perfect

CRs-Fixed: 578961
Change-Id: I3449cf152cecb1d557b24f770e4fb71e1f2bde00
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
mdss: mdp3: enhance vsync event report for mdp3

It is possible for client to register for vsync event before we
have commited a frame to display. It is in this case that we need
to fake vsync as it is not possible to get real vsync until we have
sent frame to be displayed.

Change-Id: Ied1821c847f22dbe703745fee1443c1dabdc4682
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
mdp3: Add battery FET regulator usage

During idle power-collapse using smart-panel, when PMIC chip goes
to sleep, it puts battery FET (batfet) to low power mode (LPM)
which allows less than 100mA current to be drawn. Since
smart-panel is in self-refresh mode, it can still draw more than
100mA current causing PMIC and MSM reset. To fix this issue,
batfet has to be kept in high power mode (HPM). In order to keep
batfet in HPM, display driver enables batfet regulator whenever
display panel is on.

Change-Id: Ibc41ec2db6ba5b8510a02f3950d7453aa2803606
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
ASoC: msm: DTS parameter validation

Validate the modelIdLength before proceeding and copying
the user data.

Change-Id: I659d83376cc893340851d6889019a82d169b2134
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
msm: camera: Fix possible NULL pointer dereference.

The result of memory allocation in msm_isp_get_buf is not checked for
success before use. This can lead to NULL pointer dereference.

Change-Id: I83cb56bbcd5e7526bf57a6de1077a30f9a2b5349
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
msm: camera2: add api for set actuator for manual af

this is to support fr18291 manually set focus position

Signed-off-by: Yongui Mao <yongguim@codeaurora.org>
ARM: dts: msm: tuning 8x12 skuab hx8389b panel with gamma 2.2

Panel's gamma curve should be standard 2.2 or 2.6 curve.
Tuning 8x12 skuab hx8389b panel to standard 2.2 curve.

Change-Id: I9aad5ba006bb75e6650ae53933ea88acc206e4c5
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
ARM: dts: msm: adjust 8x12 skuab HX8389B mipi clock to 240.42MHZ

Currently, mipi clocking running at 276MHZ which affects GSM signal
on 8x12 SKUAB Himax8389b panel. Changing the mipi clock frequency
to 240.42MHZ to avoid RF interference.

Change-Id: I3fb3d3d3303464056cc71f48b6356698195c4b55
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
power: qpnp-charger: allow 0 mA iusbmax request

Currently 0 mA requests for qpnp_chg_iusbmax_set
are rejected.
Fix this by allowing 0 mA and configuring IUSB_MAX
to the lowest setting of 100 mA (0x00).

Change-Id: Iff1ee312e85e3fe33d6421630215196125c1136f
CRs-Fixed: 580614
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
msm: gpiomux: add the hisense nfc gpio

Add the nfc gpio for the hisense device, and add the
compatibility of mtp device.

Change-Id: I40f5a2aad3ea682ad553b5974c1cc34803cff842
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
Signed-off-by: Pan Fang <fangpan@codeaurora.org>
msm: gpiomux: remove conflict between nfc and camera on Hisense

stop camera from holding pin8 low
enable nfc to use pin8 for i2c

Change-Id: I0cb9e1fbc9de40fdac728cb66d9a0bc422c98e22
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
msm: clock-8x10: Update lookup table for NFC clocks for PVT

I2C clock and GP clock configuration
for QCA199x NFCC on PVT devices.

Change-Id: Ie9bee72e0b62255e3d2610c60f5f69fcdf69bfdc
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
NFC: Implement GP clock for 8610 qrd V2 skuaa devices

Enable General purpose clock 1 for 8610 qrd skuaa V2 devices from nfc-nci device.

Change-Id: Ia4f88b670d691d0202f452b3228eacf333b4e812
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
ARM: dts: msm: Add NFC device for PVT device

Add nfc nci device to the device tree for PVT device

Change-Id: Ib582efaead9a6dba038b332f30ef8e3a40211fd4
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>