ASoC: msm8974: Declare ocmem_audio wq as unbound.

ocmem_audio_client_driver_audio workqueue caused unncessary wakeups of
workqueue_trsutee thread during audio playback. Making the workqueue
unbound overcomes the issue.

Change-Id: I5b8abbe8937e368f66c751fa03d7c82fcd57d5e7
Signed-off-by: Badhri Jagan Sridharan <badhris@codeaurora.org>
msm: pm: Add API to enable/disable retention mode

On 8974 targets, retention mode voltage is controlled by the LDO
regulator, which in turn is powered through a ganged PMIC regulators. At
certain low voltage levels, the ganged PMIC will not be able to power
the LDO retention voltage. The regulator framework would invoke this
API to enable/disable retention mode in these scenarios.

When disabling retention modes, send a IPI to wakeup all online cores
out of idle, to ensure that no core is in a retention low power mode.
Also, disabled support for retention during suspend/hotplug operations
to ensure that a CPU isn't already in retention when the voltage is
lowered. This shouldn't have an effect on suspend, as the driver always
chooses the deepest sleep mode for suspend/hotplug.

Change-Id: I0af18168968c2aaf05ca99188d30762612c87de6
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
msm: kgsl: Avoid NULL pointer in adreno setstate functions

Make sure the specified context_id returns a valid context
in adreno_gpummu_setstate and adreno_iommu_setstate and
silently return if it doesn't.

CRs-Fixed: 439367
Change-Id: Ic0dedbad1a91b53f19782b50380bd36842614351
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
ASoC: wcd9xxx: Fix the ANC CnP

Add virtual ANC widgets which are used to enable ANC
before PA is turned on, and to disable ANC before TX is
turned off.

CRs-fixed: 387904
Change-Id: Id3eca8c09d1d1d3c3d89ebe3d58be9bf676eb9c0
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
power: pm8921-charger: change pr_err to pr_debug for usb trim

When reverse boost workaround is happening, the driver changes the
amount of current to be drawn from the USB. This results in printing
a lot of trim related messages. These messages should really be
debug messages and not error messages as they appear currently.

Fix them.

Change-Id: I2dccaedb559fc5e9865b137f980024e068bdafa3
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
msm: kgsl: Change GPU Fast Hang detection to 50ms

Fast hang detection algorithm is improved to use additional
performance counters to monitor shader processor activity.
Shader processor's active alu cycles, icl0 misses
and fs cflow instructions are added to list of activities
monitored for fast hang detection.

Change-Id: Ie74b2ca2d8eb587dbdae40f8fafd901e71f50ddb
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
USB: ehci-msm2: Add support for Host mode on HSUSB port

Add device tree support for ehci-msm2 driver for supporting
Host mode on HSUSB port. Also add required clock changes and
support for using second PHY for HSUSB operation.

Change-Id: I7bb47032afef011f90f5725347e12f29eb210ea9
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
defconfig: msm8974: Enable HSUSB host

Enable required config for supporting Host mode on 2nd instance
of USB core.

Change-Id: Ic8c0d8dcbb24610fd0ed1e2734c3c88ef1d042db
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
video: msm: Move no_notify_update from suspend to blank

Current location of no_update_notify completion does not wake up when
fb_blank is called. Since no_update_notify tracks panel power state (it
is assumed that screen updates are expected when the screen is off/blank),
no_update_notify should be completed in the blank helper functions rather
than suspend's.

CRs-Fixed: 434491
Change-Id: I3f74c6d31ba556352e248beb03ce724dbc0c1863
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: vidc: Fix bug in bus scaling

Fix index calculation for finding corresponding bus bandwidth.
Without this fix, higher resolutions will not be able to scale
bus accordingly resulting in poor performance/fps.

Change-Id: I0eb71336f9113c086bc51f7fd7669bb0adee2e1f
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
8974: i2c-qup: Correct the source clock-frequency

Source clock is incorrectly set to 24MHz on 8974. The driver
calculates the value to set in the QUP-clock-dividers from two
DT entries: bus-frequency and source-clock-frequency. The
correct source clock rate on 8974 is 19.2MHz and not 24MHz,
thus, the divider value is wrong, which results in a wrong
I2C bus frequency.
This patch corrects the source clock frequency in the DT to
19.2MHz.

Change-Id: I4cfc5fda3c0f5e403d8a5fa94d24cdc30f9efc0d
CRs-Fixed: 425744
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
video: msm: Reorganize post processing configuration

Reorganize post processing configuration functions to allow for easier code
reuse on other post processing features that are not located in the DSPP.

Change-Id: Ifd89afb3066ff0d6dba1d564ef09032cc981f65b
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Revert "power: pm8921-charger: change BOOT_DONE configuration"

This reverts commit b157ff75f967cc72c51f6eae3feaa6ba7a432c87.

Enabling BOOT_TIMER may cause an inadvertent shutdown in the subsequent
boot cycle for certain valid scenarios. Do not enable this bit.

CRs-Fixed: 434578
Change-Id: I0d657c2e0d47af32cc35cd66b902be72952e5438
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
USB: dwc3: Add support for host bus suspend

Add required support for host bus suspend for dwc3 driver. Also add
pm runtime callbacks for xhci platform device which will defer  putting
USB hardware in/out of low power mode to transciever driver. Whenever USB
core autosuspend timer expires, USB2 and USB3 roothubs are suspended, then
xhci platform device is runtime suspended. when xhci's runtime suspend
happens, it will call USB transciever's set_suspend callback which puts
USB hardware in low power mode.

When remote wakeup happens, dwc3 driver will bring USB hardware out of low
power mode. Then xhci stack will resume roothub port on which port change
is detected. Set skip resume flag to resume USB only on remote wakeup.

When micro A cable is disconnected during system suspend, xhci platform
device will be removed before PM resume of xhci device. Due to this,disable
depth counter mismatch happens and xhci device will not not be pm runtime
enabled on next cable connect. Fix this issue by calling pm_runtime_init
for xhci platform device.

CRs-Fixed: 422306
Change-Id: Ia06f792979d7bd3248ae40161978f9632ccd7808
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
defconfig: msm8974: Enable USB core auto suspend

Enable required config for allowing runtime suspend in
USB host mode.

Change-Id: I8acb586e8906d50e14dd9e9a3d0cb218f97d8ce7
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
media: video: Fix VCAP gpiomux configuration

VCAP gpiomux configuration were being overwritten by other
configurations. This problem was addressed by adding in machine
checks. There was also a problem with incorrectly selected gpio
functions in the gpiomux configurations for VCAP.

CRs-Fixed: 423595
Change-Id: Ie6f2d2ddc597ebbd53673e218ce07aca0e4e85f8
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
msm: smp2p: Add new SMSM Point-to-Point Driver

The Shared Memory Point to Point (SMP2P) driver facilitates
communication of multiple 32-bit values between two processors.  Each
value (called a state entry) has a single writer (the local side) and a
single reader (the remote side).  Entries are uniquely identified in the
system by the directed edge (local processor ID to remote processor ID)
and a string identifier.

This driver, which is layered on top of shared memory (SMEM), will
eventually replace the existing broadcast implementation of SMSM.  This
driver has several advantages over SMSM including:
 * Point-to-point communication which allows for XPU protection of SMEM
 * Multiple 32-bit state values for future expansion
 * GPIO and Virtual interrupt support for client-facing API
 * Version and feature negotiation to allow for phased upgrades of
   a system without requiring cross-processor dependencies.

Change-Id: Iefe2169ae686a3e5f400b3a7039f6b114a8b7e5a
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
defconfig: 9625: Enable CONFIG_NF_CT_NETLINK

Enable connection tracking in netfilter.

Change-Id: I4bf941bb18e07dfce1fcc40a075bb0640953b57d
Signed-off-by: Ekta Shah <eshah@codeaurora.org>
coresight: read tmc-etr reservation size from DT node

Remove using hardcoded value for the TMC ETR allocation size in
the TMC driver and instead get the size from the DT node. This
will ensure only one location (DT) controls the size of the
allocation.

Change-Id: I642d149e124c98470821ac4a37627747aecd2af7
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: return error if null or error is passed to coresight_register

Fail coresight_register if invalid (error or null) argument is
passed to avoid crashes.

Change-Id: I6c39ba2b81333f24480fdf5b348934651e095be5
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>