wcnss: Fix WCNSS register dump when common_ss is power collapsed

When WCNSS common_ss is power collapsed, do not log A2XB registers or
any other registers within common_ss. Also make sure that, power
collapse is disabled while collecting the register dump.

Change-Id: I5ee1073ccae4bfbdcf099805d81d34899aaeba22
CRs-Fixed: 493920
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
msm: kgsl: Do not try to resume the device from INIT state

If the device is still in INIT state there are no open instances
of it running.  Resume calls should be no-ops.  Do not attempt
to start the device at this point.

Change-Id: I1cb6d60581b0b5b0a2ab1b13418adc4ae3983c5e
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
ASoC: wcd9xxx: improve mbhc button release detection performance

MBHC hardware block monitors microphone's voltage when button is pressed
to detect button release event.  Reprogram release threshold to narrow
down the threshold voltage to be able to detect button release quickly.

CRs-fixed: 509925
Change-Id: I9802564ea5467f7b5b23a87191ded6ed2f10ab98
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
msm: kgsl: Option to disable GPU fault tolerance

When GPU Fault tolerance is set to KGSL_FT_OFF do not run
fault tolerance. When we turn off fault tolerance
a) If GPU continues executing commands then
   GPU stall detection is false
b) If GPU does not execute further commands then
   GPU stall detection is correct

When GPU stall detection is suspected to be false,
we can use this option to confirm stall detection.

Change-Id: Iac4d235377df015db223df9ec5597fb43d4c8878
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Do not wait 100ms before checking for GPU idle

When checking for GPU idle do not wait 100ms first, this
delays detection of GPU idle by 100ms.For example in
GPU fault tolerance we check for GPU idle, this
additional 100ms wait is delaying GPU FT by 100ms in
each step.

Change-Id: I028541f6e0ef765f505a2792b0b1c313665e1ba5
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Configure FT behaviour from sysfs instead of debugfs

FT behaviour is changed to be configured from sysfs
instead of debugfs. Sysfs control gives us the advantage
of configuring FT at bootup and also across bootups.
Persistant configuration across bootups helps
testing by configuring FT once and testing the FT
config across bootups.

Change-Id: Ia3378f214371a6a4b9f205f9f884976f58585971
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Get an active count before snapshotting GPU

Acquire an active count before attempting to capture a snapshot.
Doing so prevents instances of not being able to snapshot because of
switched off clocks.

CRs-fixed: 511878
Change-Id: Ib80b57c127566e274d4018001561f4da7ea38265
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
power: qpnp-charger: allow negative battery temperatures

Allow customers to use negative battery temperature voltages
when monitoring for JEITA compliance.

Change-Id: If1179346cf4c5991ae308439fce9cdcb8fb23cc5
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
msm: kgsl: Enable GPU hang interrupt

Enable and use GPU hang interrupt to detect GPU hangs.
If the GPU hang is not detected using the interrupt we
still have the hang timer to detect GPU hangs. When
hang is detected using GPU hang interrupt fault tolerance
is triggered. Fault tolerance time is less than 50ms with
GPU hang interrupt.

CRs-Fixed: 512795
Change-Id: I9327803f178ae1b5e8248fe3450499b7bba2a68d
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: wfd: Allow client to provide a tolerance for an acceptable FPS

In cases the driver's frameskipping is unacceptable, provide a tuning
parameter that controls the skip frequency.  fpsvariance is the
percentage for the fps that the driver can overshoot by, which allows
for the driver to skip fewer frames.  fpsvariance == 0 forces the driver
to strictly observe the fps, whereas fpsvariance == 100, allows the
driver to completely ignore the fps, allowing to run in a free-running
mode.

Change-Id: Ic25da25807008416246287e2d804d9bd64165320
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
USB: dwc3-msm: Fix LPM related issues with FLOATED charger connected

Currently dwc3-msm driver is putting HSPHY into RETENTION apart from
voting for VDD minimization when FLOATED charger is connected. This
results in spurious MPM interrupt getting triggered during system
suspend.  Due to this, charger detection will be performed endlessly
in case of FLOATED charger. Hence don't put HSPHY into RETENTION with
FLOATED charger connected and also fix bug in incrementing charger
retry count.

CRs-Fixed: 516013
Change-Id: If76fcacf60e880c8752d7461670adb4bab0f4b72
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
msm: kgsl: Option to not stall IOMMU V1 on pagefault based on FT policy

There are cases where GPU has a pagefault and executes
fine after pagefault without GPU stall. init.qcom.graphics.sh
script can be used to change FT pagefault policy
to not stall IOMMU V1 on pagefault and check if pagefault is harmless.

Change-Id: If061230b66181bfd94c697ea106e7bf4de352e91
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
ARM: dts: Add support for apq8074v2.2 hardware variants

Previously, apq8074v2.2 booted using a configuration inherited
from msm8974-v2.0-1.dtsi. Inherit settings from msm8974-v2.2.dtsi
instead.

Change-Id: I257e77ef0983a011ad3d9249a6c22fb32c15b0b7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: audio: qdsp6v2:  Check return code from audio_aio_open()

When audio_aio_open() is triggered in blocking fashion, it  frees audio
resouces and returns error code. In the current implementation,  callers
did not check the error code which can lead to dereference to freed
resources and cause system crash.  Update the callers to check return
code and then return error back to application to avoid the issue. In
the meanwhile, update the audio_aio_open not to free memory for caller
and leave the caller to free the memory in error condition.

CRs-fixed: 436653
Change-Id: If4dda158cb988c5837517817b1afa0572c30696e
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
msm: Makefile.boot: Refresh list of dtb files to build

Several MSM .dts files have been added to the kernel tree, but
corresponding dtb Make targets were not added to Makefile.boot.
Add the missing entries.

Change-Id: I7c34dba8a5d90bda06b31ac26fe1682ea63432a0
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
ASoC: wcd9xxx: Support to configure the code for media button

There is mismatch in button 0 code value that is used
in kernel and userspace. Configure the code for button 0
to match with that of userspace.

Change-Id: I3019807ee1e68e9990a12073fa11315e26575814
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
SoC: msm: Set soft step values to 0 to avoid noise

The abrupt steps in the curve are causing the noise. To avoid noise
smaller step size are recommended.

CRs-fixed: 513073
Change-Id: Ib9e7bb60bf4271c97aec7b1af208f06d22049960
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
arm/dt:apq8074-Dragon board: Add PCM GPIO lines

The audio connection between apq8074 and BT on Dragon Board is through
AUX PCM lines. Add support for MSM GPIOs used for PCM ports on
Dragon Board.

Change-Id: If1a9737f6b25af5bc27542b9b512064b2e17f16b
Signed-off-by: Tanya Finkel <tfinkel@codeaurora.org>
mdss: hdmi: Correct CEA format check

This change corrects the CEA format check to include all the supported
resolutions through which the audio should be routed to HDMI TV.

CRs-Fixed: 517950
Change-Id: Icd5c7503b2dc3a184bbf52205b0386eee9daca62
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: kgsl: reset GPU when GDSC is forced on

Sometimes for debug purposes the GPU regulators can be left
on, make sure we reset the gpu while waking up.

Change-Id: Ie18c9f45d9f5a5a7587a1bea2c7c9bb5ce000316
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>