ASoc: msm: qdsp6v2: Fix for NULL check

- Required check added for NULL pointer

CRs-fixed: 583939
Change-Id: I8b079c42ef06af9a817dc830c5f2d3c785232aa7
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ARM: dts: msm: changes for Liquid P3.1 APQ with HSIC QCA

Remove hsic_hub since it doesn't exist in P3.1, and also add some
settings needed for hsic host controller

Change-Id: I2666bf02a1035568622c94354f268f95ca297805
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
ARM: dts: msm: changes for Liquid P3.1 APQ with HSIC QCA

Disable wcnss modem use, since in liquid, there is no WCN, and
it might influence QCA6234

Change-Id: I45937252e5de8693eeebeff818a56beadc9ba224
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
ARM: dts: msm: changes for Liquid P3.1 APQ with HSIC QCA

Due to QCA6234 needs 3.3v/1.8v(L19/L10) output, overwrite the
default settings of L19 and L10.

Change-Id: Idfd84a17ba2b533e7aee14037ce3bb8d05779326
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
msm: cpufreq: Correct synchronous cpu logic

Fix an incorrect patch conflict resolution which results in failing to
initialize the cpufreq policy correctly when using an old acpuclock driver
version.

Change-Id: If8743a2608e720258ebc710718c3041144c00f10
CRs-fixed: 612226
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
msm: lpm_levels: Perform system_unprepare only system low power mode

system_unprepare() needs to execute operations related to system
unprepare only when the CPU subsystem was scheduled for a system low
power mode by the last core that went down. On the last core down, its
possible that residency conditions for system low power mode weren't met
and the system was never programmed to enter a low power mode. In these
scenarios, the system_unprepare() needn't execute any of the unprepare
functionalities.

CRs-fixed: 596831
Change-Id: I36b00f254354920775ba8e797bb08932e2495b24
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
msm: remote_spinlock: Add support for remote_spin_lock_rlock_id()

remote_spin_lock_rlock_id() and remote_spin_unlock_rlock() are
added to acquire/release a raw remote lock (without a local
spinlock). This is useful when ownership of a lock must transfer
between different execution environments, such as when a lock is
used to guarantee atomicity of a set of actions spread across
different execution environments.

Specifically, these APIs are added to support a new lock which
must be acquired in Linux but released by TrustZone software.

Because no local spinlock is acquired, each thread must use a
different ID so that only one thread can proceed through the
lock at a time.

Support for these new APIs is presently implemented only for
SFPB locks.

Change-Id: Ifc5b1f552090051d2e975107e56e21e22df08924
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
power: qpnp-charger: handle usb short to gnd OTG case

Over current protection (OCP) at USBIN depends on USB voltage to
function. Thus, a short at USBIN before OTG is enabled causes OCP to
fail.

The workaround uses the inductor current limit during boost to limit
the current drawn during a short and detect a short. If no short
was detected, the inductor limit is raised again. If a short happens
after the limit is raised the OCP circuitry will trigger and protect
the device.

CRs-Fixed: 600036
Change-Id: Ib8d46e9065b8b09100507a46718ed85336e12084
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
msm: rpm-regulator-smd: fix request suppression policy

The rpm-regulator-smd driver sends requests for a given regulator to
the RPM only if the regulator has been enabled by a Linux consumer.
If the regulator is disabled from Linux's point of view, then voltage
and current requests are buffered until the regulator is enabled again.
This buffering can lead to regulators being left at unnecessarily high
voltages when they are no longer needed.

Modify the request suppression policy so that current and voltage updates
are suppressed only before the first enable/disable request is sent for a
regulator or while the regulator is disabled if it has been marked as
apps-only. The first request sent for a given regulator must provide a
value for the enable/disable parameter otherwise the RPM will treat it as
an implicit disable request. This would break use-cases that require
certain regulators to be left on until sufficient software control is
initialized. Add a new device tree property, qcom,apps-only, which can be
used to specify that a given regulator supplies hardware that is fully
controlled by the applications processor.

CRs-Fixed: 533263
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Change-Id: I2a8820662e1471e5ff44f7d681d5d768da74980f
msm: reap unused audio files

Removing this file as it is not used in this branch.

Signed-off-by: anish kumar <kanish@codeaurora.org>
Change-Id: Ia7bd5c606c90a26f3180194d1a8d1810fcab6228
msm: vidc: Fix a race condition in masking interrupts

Fix a race condition when interaction with firmware happens
in following sequence:

1. Firmware writes IDLE message into the message queue.
2. Driver writes a new command into command queue.
3. Firmware reads this command and starts processing it.
4. Driver checks if command queue is empty and finds it empty.
5. Firmware writes the response (of the command sent in 2) in
   message queue. Firmware also writes another IDLE message and
   sets the idle register.
6. Driver check if the IDLE register is set and finds it set.
7. Driver masks the interrupts. Since interrupts are masked,
   driver misses the response written by firmware in 5.

This race condition is fixed by checking if message queue is
empty or not between 6 and 7.

Change-Id: I4e11210deeef855bb67337b8958aea73ae77d16b
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
uio: provide vm access to UIO_MEM_PHYS maps

This makes it possible to let gdb access mappings of the process that is
being debugged.

uio_mmap_logical was moved and uio_vm_ops renamed to group related code
and differentiate to new stuff.

CRs-Fixed: 570735
Change-Id: I8a5ff343727cc58fedfeb73f3466cc9a7f153e84
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 7294151d0592e0ff48c61fca9fd7c93d613134da
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
msm: mdss: hdmi: parse for resolutions in EDID block 0

If EDID block 1 is not available or video data block is not
available, allow parsing of resolutions from block 0.

CRs-Fixed: 596518
Change-Id: I8574de3f80c817ac764d467e622ded7430c0df86
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Fix a few incorrectly checked [io_]remap_pfn_range() calls

Nico Golde reports a few straggling uses of [io_]remap_pfn_range() that
really should use the vm_iomap_memory() helper.  This trivially converts
two of them to the helper, and comments about why the third one really
needs to continue to use remap_pfn_range(), and adds the missing size
check.

CRs-Fixed: 570735
Change-Id: I927a67ea80fea5ed706749ead9defb1e72633952
Reported-by: Nico Golde <nico@ngolde.de>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org.
Git-commit: 7314e613d5ff9f0934f7a0f74ed7973b903315d1
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
[pratibha@codeaurora.org:resolve trivial merge conflicts]
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
msm: mdss: synchronize wfd driver iommu mmap/munmap with mdss

Add clocks reference during wfd driver iommu mdp_mmap/mdp_munmap
to ensure iommu is in proper state while wfd driver map/un-map
any buffers.

Change-Id: Id1a24285b81d5047e5e9f002ade9694ea49be59d
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: perform proper clock handoff during cont. splash screen

During continuous splash screen need to ensure clocks are properly ref
counted once and released once handoff has happened. Doing it in
different places can lead to improper order and cause clocks to be
disabled. Fix this by centralizing this into footswitch ctrl which is
called when continous splash screen is enabled.

Change-Id: I17f3d5517d9a0583221fdb5c354bf1992ddeddbd
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
ASoC: msm: qdsp6v2: fix slow_talk not disabled issue

If slow talk is disabled from the settings menu after voice
call is ended, the command is not sent to dsp since the voc state
is not in VOC_RUN and on next call CVS still has slow talk property
enabled. Fix by disabling slow talk when voice call is ended.

CRs-Fixed: 607911
Change-Id: I2c312e41b14fca021f8d41380c3b5c8493710255
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
msm: vidc: add support to set VP8 QP range

QP range differs from codec to codec. This change adds support
for VP8 QP min and max range.

Change-Id: Ia44cf885a8b6f71b7eef51076968021ae68d7a7e
CRs-Fixed: 578892
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
ASoC: msm: Condition change to feed buffer on resume

Feed data to the DSP on a CMD_RUN ack by looking at the number
of bytes sent to the DSP and not the number of bytes consumed

Change-Id: I45a670d244e20dd1f444a92b86737b7541a7ccf0
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
ASoC: msm: qdsp6v2: Wait for stream to be available in gapless playback

Compressed driver operates on two streams in gapless mode and switches
between the two streams. If compressed playback operates on larger
buffers and the clip being played is small enough to fit in one
buffer, the driver could run into a scenario where three streams
need to be handled. Three streams results in no audio because stream
switching logic is corrupted. Fix is to block the next track call if
stream one has not completed playback.

CRs-Fixed: 594977
Change-Id: I6c83e859fa38f177ec7f4fa4ea92937d34df933a
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>