diag: dci: Handle dci mutex correctly

diag driver uses dci_mutex to protect the global buffer for dci.
While sending a packet to the peripheral, this mutex is not
released on error. This patch release the mutex on error.

Change-Id: Idd84e6533b2c8e748d9761e061d06e188a5a4bac
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
msm: camera: Fix for raw snapshot

Issue a reg update command in case of raw
snapshot to fix the failure of raw snapshot

Change-Id: I38dce970979d34ad720ba61fb8a1b65dc53cff66
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
wcnss: Collect WCNSS register dump on PIL failure

We have seen rare WCNSS PIL failure instances; to collect more
information on the PIL failure, add WCNSS register dump on PIL
failure.

Change-Id: I5908edea38099334a4a08a9cad7cb26c194709a7
CRs-Fixed: 518707
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
ASoC: msm: Fix error recovery in register & deregister vol table

Modify the register & deregister volume table functions
in the voice driver so that no error is returned when
successful. Add error returns for cal reg & dereg
functions and improve error recovery.

Change-Id: I05d14c815cadebc064bee60aada0bf07588e4b6e
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
power: qpnp-bms: qpnp-charger: prevent loading null batterydata

Currently, the BMS and Charger tries to load battery properties from
the devicetree battery data node. However, currently the drivers only
check for a non-negative number before loading the properties. This
can cause null batterydata nodes to be loaded as 0s for all
properties.

Fix this by first intializing the properties to -1 before loading the
batterydata.

CRs-Fixed: 518407
Change-Id: Iede14a6ba5dd0d307a1bdd8f813c509f718acfe6
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
USB: android: Handle error conditions if usb_add_config fails

When bind_config() of any function driver fails, we go ahead and do a
usb_gadget_connect() due to which remove_config is called during
next disconnect process and a crash is observed as we delete the
config->list once again.

So if the bind_config of any function driver fails, don't call
usb_gadget_connect(), instead handle the possible error conditions.

CRs-Fixed: 488052
Change-Id: I974e2838ef5c36e586f49ae783e8608150770883
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
socinfo: msm8926: add support for QRD subtype SKUG

Add QRD subtype SKUG to indicate the MSM8926 alpha
customer hardware.

Change-Id: I8560dfe089e08c36cf9eae3202d960fe0978c25b
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
arm/dt: 8084: Add device bindings for power management drivers

Add device bindings for RPM, SPM and other low power management drivers.

Change-Id: I8bd81a33140f4d520c9f4afc20228b174bf8f388
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
ARM: dts: msm: Add krait-regulator-pmic devices to support the gang leader

Add entries to describe the gang leader and its associated peripherals.

On 8974v1, 8974v2, and 8974pro-ab based devices, PMIC 8841 SMPS 5
regulator is the gang leader.

On 8974pro-ac PMIC 8084 SMPS 8 regulator is the gang leader.

Change-Id: I67e2aea81743ab1f463cca8961d7700e48dc6283
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
msm: krait-regulator-pmic: Add krait-regulator-pmic driver

Read the register configurations of regulators in the gang and
bug if the gang is not setup correctly.

Importantly, fix the voltage overshoots observed during PFM-PWM
transitions by implementing the following steps.

PFM -> PWM
After the buck is set to PWM mode, wait 50uS and then set the PWM
current limit to 3.5A.

PWM -> PFM
After the buck is set to pfm mode, immediately lower the PWM current limit
to 2A (no delay required).

Change-Id: I15af09aaf8427e75253a4e12878ee1f0a1265454
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
ARM: dts: msm: Correct BMS irqs for MSM8226 and MSM8610

The BMS peripheral interrupts were reversed for MSM8226 and MSM8610.
This may cause accidental wakeups during sleep because the sw_cc_thr
irq is switched with good_ocv. Since the BMS driver registers
sw_cc_thr as a wakeable interrupt and sw_cc_thr actually registers
the good_ocv irq, the device will wake up every time the BMS
peripheral gets a good OCV reading.

Fix this by correcting all the IRQs in the BMS device tree node.

CRs-Fixed: 519868
Change-Id: I2e3ae128fa2a79bd527d6293d8ac592790847b58
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
gpio: msm-common: Add support to configure SDC1 RCLK pin

eMMC5.0 specification adds a new RCLK pin to the eMMC interface. Add a
tlmm entry to support configuring its pull state.

Change-Id: I29d2248e4660bf3b65143bac97a1c9a594a0eec0
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
msm: camera_v2: protect cmd_ack_q around mutex

Insertions and deletions into the session based command
ack queue need to be synchronized since they may be accessed
from more than one context.

CRs-fixed: 516599
Change-Id: Ia8b4c10666ceede41352baa652f28e7e4ed8e5fc
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
Merge "wcnss: Collect WCNSS register dump on PIL failure"
Merge "power: qpnp-bms: qpnp-charger: prevent loading null batterydata"
diag: dci: Fix timestamps on dci events

The first event generated by diag on the peripherals will have a
valid timestamp bytes and the subsequent events generated at the
same time will have reduced timestamp bytes to conserve
space in the buffer. Diag driver zeroed out the timestamp bytes
when it encounters DCI events with reduced timestamp bytes. This
patch adds the valid timestamp for those events.

Change-Id: I80b1a7450f605af9bfd8959ea1f26bc9d83b370e
CRs-Fixed: 521415
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Merge "msm: camera_v2: protect cmd_ack_q around mutex"
Merge "arm/dt: 8084: Add device bindings for power management drivers"
Merge "diag: dci: Handle dci mutex correctly"
Merge "gpio: msm-common: Add support to configure SDC1 RCLK pin"