msm: display: Fix composition issues when framework rebooted in suspend.

Currently, if framework is rebooted while in suspend mode, borderfill
is not unset due to which MDP composition can not be enabled. This patch
fixes the issue.

Change-Id: I8b671eccedebf2bb08724cf2d284d4ab27a71360
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4.h
	drivers/video/msm/msm_fb.c
msm_fb: display: clean-up mdp4_dsi_cmd_show_event
msm: display: Limit dynamic fps feature only to MIPI video panels.

As dynamic fps feature is supported only for MIPI video panels,
return -EINVAL if sysfs node is written for panels other than
MIPI video. This change also removes world writable permissions
for sysfs node.

Change-Id: I72260e6032cb8a758b0457c36a808263a981260f
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm_fb: Handle vsync interrupt properly on MDP 3.03 targets

Handle enabling/disabling the vsync interrupt and mdp clock
enabling/disabling in a better way on MDP 3.03 targets. This
will avoid target crashes due to unclocked register access.

CRs-fixed: 388751
Change-Id: I5c4a409772464ce7d06869374dcba5ad7e335955
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp.c
msm_fb: Make Vsync IOCTL during disable sequence as NO WAIT

Change to make the vsync IOCTL no wait during the disable sequence.
This is to increase the performance. Handle the synchronization of
vsync interrupt using state variables in drivers from now.

Change-Id: Ia5ec14493f233a95f21d01ea627200a6c278239f
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Send vsync events using sysfs for MDP3 targets

Replace sending of vsync timestamp using uevents with sysfs entry
as uevent result in increase in power numbers due to broadcast in
nature.

Change-Id: I22cfbd68c8bcbe4a47e94074393f1cbf79920c58
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp_dma.c

Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp.c
	drivers/video/msm/mdp_dma_dsi_video.c
	drivers/video/msm/mdp_dma_lcdc.c
msm_fb: display: Create sysfs entries in mdp_probe for MDP3 targets

vsync sysfs entries should be created in mdp_probe instead of
creating in panel on. This avoids waiting for the first event
control in framework

Change-Id: I18b05b8d2a65d489afc6e3274ec8dc7a5b9a5f9a
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp.c
msm: display: maintain smmu for secure video

Currently video maps and unmaps the secure memory.
It could be too early to unmap it.
Rotator and MDP will maintain this, only unmap it when
no more needed. Memory managr has a refence count for it.

Change-Id: I5ca7cb09c0ad4b9e39808e937c2f50264727730c
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/clock-8960.c
	drivers/char/msm_rotator.c
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
msm_fb: display: add wfd suspend/resume to early suspend

wfd on/off was handled by fb_on/fb_close which are called from video
or userspace side. However, this is not the case for this branch. mdp
driver has to register wfd for suspend to make sure proper panel
on/off happen.

Change-Id: If1836598e5ae95e4b2b72e40dc85784a0d20c843
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp.c
	drivers/video/msm/mdp4_overlay_writeback.c
msm: display: Add DSI clock control for MDP GDHS power collapse

Enable DSI clock and regulator before enabling/disabling power collapse
for MDP GDHS.

(cherry picked from commit ad3200279e62eff01fd1bb9136cc9c0d11e10380)

(cherry picked from commit 58c5992c710df379e26bb210e00c74da501db9d2)

Change-Id: I76b91260c61abf214e688c0dea6989ed2cfa3801
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8064-regulator.c

Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8064-regulator.c
	arch/arm/mach-msm/board-8930-regulator-pm8038.c
	drivers/video/msm/mdp.c
	drivers/video/msm/mipi_dsi.h
msm: display: mdp.c cleanup
msm: display: Proper handling of prepare and unprepare clocks

This change handles prepare and unprepare clocks properly to
fix clock mismatches.

Change-Id: I09986aa1f0e1a5be2e07655a1db0d23760dd0725
Signed-off-by: Sangani Suryanarayana Raju <csuryan@codeaurora.org>

Conflicts:

	drivers/video/msm/mipi_dsi.c
defconfig: enable standalone power collapse
msm_fb: display: increase mdp_max_clk
ASoC: msm7x27A: Add mmap support for playback

Change-Id: I5a7eaa519b8146d2697b3c65ea1a08a3c8feacb3
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Phani Kumar Allada <pallad@codeaurora.org>
ASoc: msm: Add support for slimbus shared channel.

Previously, DSP used to setup the data path towards the
codec via slimbus. Now, the data path setup is broken into
two parts - one half of the path setup between apps to slimbus
and the other half from DSP. This configuration mode is
required to reduce overflow or underflow errors. Also this is
required to handle a configuration where mdm can talk
directly to codec.

Change-Id: Ic9f20b8a2f8a8eb355c07565ec80ec947a7a7337
Signed-off-by: Bharath Ramachandramurthy <bramacha@codeaurora.org>

Conflicts:

	sound/soc/codecs/wcd9310.c

Conflicts:

	sound/soc/msm/msm-dai-q6.c
slimbus: Support more than 1 clients to use a channel

There is a possibility that 2 or more clients can use the same
channel, one as producer and the other(s) as sink.
The slim_query_ch API gives the ability for a client to specify
channel number it needs to use.
Reference counting is used to make sure channel is not deallocated
until the last caller deallocates it.
Another counter (def) is used to keep track of channel definition and
removal. Channel definition is sent to hardware when the producer
and/or consumer(s) connects ports to the channel. Channel is only
removed when all clients indicate they want to remove channel.

Change-Id: Ic5084680419e16ee238d2e62c02e5430170b387d
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slimbus: Provide separate APIs to connect source and sink ports

Source and sink ports for a channel may be connected from different
clients.
Multiple sink ports and 1 source port can be connected to a channel.
Ports are freed/zeroed when channel is removed.

Change-Id: I165bb9db4fb43a9a884ea14ffed08f8d11b65c39
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim: msm: Support multiple satellites per MSM controller

Supporting multiple satellites per 1 controller enables communication
with more than 1 ADSP on target. There may be upto 2 ADSPs that MSM
controller driver needs to communicate with.

Change-Id: I9de96341ba0eee9da69bb48dc6d276374773633f
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim: msm: Enable satellite clients to request for specific channel

Since slimbus framework now supports clients to request a specific
channel number, channel number may be different than channel handle.
Channel numbers can range from 0-255 and channel handles returned by
slimbus framework may not be same as channel number. (e.g. if there
are 32 channel resources and the first channel number requested is
120, then it may get channel resource 24.)
This will enable 2 satellite clients (one as producer and one as
consumer) to connect to a specific channel.

Change-Id: I294c4d433daea15bc633dfea8a1e0648ccff3234
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>