iommu: msm: Lock the meta data against map/unmap races

Reference counting is not enough to prevent races with map/unmap.
If a client tries to take an additional reference to an already
existing sg_table, it may be possible for an unmap to destroy the
reference while the map is still in progress. Prevent this race by
(properly) taking the meta lock around all lookup and reference calls.

Change-Id: Ic5de556db0d902e8b8f81b83b7897ad77940b269
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: 9625: Lower A5 priority on 9625

As a workaround for a hardware issue with DDR access, A5 priority
should be lowered to 0.

Change-Id: I1cfa75ceb3813bc012cbc4936adcc37e4cad4914
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
diag: Add Support to switch between real time modes

Adding support to switch mode of Diag on peripherals between
real time and non real time modes while using DCI/Memory Device.
Also added changes to record debug information related to
DCI in debugfs.

Change-Id: I8aecf63681094b2cd47759702f6cbb225afda40d
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
ASoC: msm: Add routing mixer controls for MultiMedia9

Add new Frontend MultiMedia9 and corresponding
routing mixer controls in msm-pcm-routing.
MultiMedia9 is to be used for incall music delivery.

Change-Id: Ibb0d3ca9daea14280868e93e73c6ef6318a33221
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
ASoC: msm: Add MultiMedia9 Frontend to machine driver

Add the new MultiMedia9 Frontend to machine driver
which will be used by incall music delivery.

Change-Id: I355ab9aec4e7cd832299d9e6140e9be89b174fb2
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
ASoC: msm: Add new MultiMedia9 Frontend

Add a new frontend MultiMedia9 that can
be used by incall music delivery.

Change-Id: I58f32ab8e4fba684b820a570ddf20583867d06c6
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
arm/dt: msm8226: Add support for incall LCH tone playback

Add incall local call hold tone playback device
required for delivering LCH tone to the farside.
A seperate device is required in device tree for
each different voice session/subscription.

Change-Id: I7c39e8d6725fa7b04d669826ead0e1bbe98ac944
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
usb: msm_otg: add charger detection for floated D+ and D-

Floated charger means "D+/D- floated charger". According batt
charging spec 1.2, during primary detection, the DP voltage
is VDP_SRC, DM voltage may not exceed VDAT_REF, it's same to
standard downstream port(SDP). Introducing data contact
detection(DCD) here to distinguish between SDP and floated
charger. If DCD detected, it's SDP, otherwise floated charger
is detected.

Change-Id: Id7655f7209408092da84a09e3ab6f5c5a764ef78
Signed-off-by: zhenhuah <zhenhuah@codeaurora.org>
wcnss: Add SAW2 SPM register to register dump list

When a WDI timeout happens, WLAN driver will initiate SSR. Dumping these
registers before performing the reset helps to debug the root cause of
the timeout. Add SAW2 SPM register to the dump list.

Change-Id: Ic14fd49a2c7bb65a61eb74ea9ce82b8b51d13f20
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
arm/dt: msm8226: Specify MIN BUS voting till USB cable is connected

MSM8226 requires voting for NOC bandwidth (and PNOC clocks) when
enabling/disabling USB clocks. Hence, add BUS bandwidth vote for
the same.

CRs-Fixed: 494654
Change-Id: I08d1766428121030ea0c282dbfddda05e1f752d3
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
arm/dt: msm8974: Disable PM8941 MPP 1

This pin is not permissible to be modified from Linux.

Change-Id: I76d3ff8b901b77165f04d8ba2f129fba00ca63da
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
msm: kgsl: tracepoint cleanup

Use the same format for all trace points reporting the same
data, such as context ids (ctx=%u) and timestamps (ts=%u).
Make sure key=value format is used in a few places where it
was missing.

Change-Id: I4ec1c77c853c567c7a6ba69eff5023d8d71cdac4
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
gpu: ion: Attempt heaps in the order given

A previous change (47b9888cc80b224b3d341227224c44b3c884d28a
"gpu: ion: Switch heap rbtree to a prio list") changed the
priority of the heaps to attempt higher numbers first. The
current setup of heaps assumes that lower numbers will be tried
first. Rather than break the userspace ABI once again to match
what was done previously, change the heap priority back.

Change-Id: Ibb7664e11c0b9037f6968e0766486936b3d42e16
CRs-Fixed: 502722
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
iommu: msm: Only flush the exact list size

Before giving a list of memory chunks to trustzone, the list needs
to be flushed. The list is simply an array of physical addresses.
The current flush routine takes into account the size of the memory
chunk which is incorrect. The memory chunk size is not used in
calculating the list length since the list is a list of pointers.
Adjust the cache flushing routine to flush the actual size of the
list: size of each entry times the number of entries.

Change-Id: I3fbc7cb7e6c823823481b5fb205a1414e76150c9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ARM: dts: msm: add gcc mux to hardware event dt node for 8226

Add support for gcc mux registers to CoreSight Hardware event dt
node for MSM8226. These registers can be configured to generate
GCC Hardware events.

Change-Id: Ic4c5b0605b355845f5d942bc04dcc91589304f9e
Signed-off-by: Aparna Das <adas@codeaurora.org>
msm: mdss: Balance mdp and dsi clocks for command mode panels

MDP clocks are not balanced for command mode panels with continuous
splash screen turned on. Need to turn both mdp and dsi clk off when
splash screen is done.

CRs-fixed: 486155
Change-Id: I95d2efbc6c5d9a7b074f7e6c0abf66d062a090de
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
defconfig: msm8612: Enable light/proximity sensor driver STK3X1X

Add the config parameters to enable the sitronix light/proximity
sensor driver STK3X1X for msm8612

Change-Id: I4d92e95974bbdb1edd9683c83909c1458c62db03
Signed-off-by: Figo Wang <figow@codeaurora.org>
board: samarium: Add dummy clock support for USB2

Add dummy clock to fake clk_get/clk_put API's until full
support is available.

Change-Id: I6aba6a0b19d510863306fd11b447276994ab875a
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
mmc: msm_sdcc: Fix null pointer dereference in msmsdcc_pio_irq()

In a case where, the data transfer is scheduled in PIO mode, the write
data pend feature is enabled and the command corresponding to the data
transfer is timedout, it can happen that the failure recovery mechanism
clears the internal data transfer structure but not the PIO IRQ mask.
Since the msmsdcc_irq() and msmsdcc_pio_irq() are shared IRQ handlers,
the data structures free'd in command timeout interrupt routine might
be accessed in the msmsdcc_pio_irq() causing NULL pointer dereference.
Fix this by clearing PIO IRQ mask before stopping the data transfer.

CRs-Fixed: 498700
Change-Id: If597eed5da1707b8cbfb2c9c305719bf21d0eec5
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
msm: mdss: hdmi: Fix unclocked register access during power off

When mirroring is ongoing, if suspend or user specified hpd off is
processed then current implementation turns off hpd first and then cec.
When hpd is turned off, clocks and regulators to HDMI core are disabled.
So any access to HDMI register space leads to crash. Fix this by ensuring
CEC is disabled before HDMI core is powered off.

Change-Id: I171ca71aed27ce6721678920da0e89399201d76d
CRs-Fixed: 502121
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>