msm: mdss: Add support for ULPS mode for DSI

For smart panels that can refresh display from their internal
RAMs, it is possible to configure the DSI clock and data lanes
in Ultra Low Power State (ULPS) during idle static screen
usecase. Add support for this feature.

Change-Id: I4e94d6a0201262f0675322efc9e39dd93c86edda
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_dsi.c
	drivers/video/msm/mdss/mdss_mdp_intf_cmd.c
msm: mdss: dsi: remove unused memory mapped resource

There are more than one instances where the DSI registers
are memory mapped in the driver whereas only one instance is
being used. Remove the reference to the unused resource.

Change-Id: Ia213e94b43bf58446eead47b18cadeb36d6795a7
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
msm: mdss: Turn off MDP GDSC in idle screen for cmd mode panels

For command mode panels, the DSI lanes can be configured to an
Ultra Low Power State (ULPS) during idle screen use case. In such
cases, it is possible to turn off the MDP GDSC as MDP is completely
idle. This would result in reducing any leakage current. Add
support for this feature.

Change-Id: Ic4074f9e12a27fe0fbe95219ffaa2f466abee307
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
msm: mdss: add a separate register region for DSI PHY

The DSI PHY register offset from the controller base is
different for different targets. So, add a separate register
region for DSI PHY in the device tree. This register base and
offset will be used to access the DSI PHY registers. Also
change the register offsets which are dependent on the
controller base address.

Change-Id: Ie1d08950f3c8c8801908a1b3cf7db46a44b4e8c3
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
msm: mdss: cleanup dsi clock handling

Currently the DSI driver uses a two level reference counting for
the clocks used by the driver so as to ensure that the clocks are
correctly configured for dual-dsi use cases. However, this is not
necessary as the same can be achieved by using a single reference
count. Clean up the code to remove the sub-level ref counts and
add necessary error handling.

Change-Id: I6f1c1bfe83322dc0e1da3d757b6ca88cd629663e
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/msm_mdss_io_8974.c
msm: mdss: Add support to selectively control bus and link clocks

DSI driver needs two different types of clocks for normal
operation - bus clocks and link clocks. The clock control function
enables/disables both these set of clocks together. However,
under certain circumstances, it is required to control just the
link clocks or the bus clocks. To support this, add separate
ref counts for link and bus clocks and modify the clock control
function to selectively control these clocks.

Change-Id: I25312131fc737b56dc15f4edf5e55a5824dad855
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_dsi.h
msm: mdss: Turn on DSI link clocks after exiting ULPS

DSI branch clocks should only be enabled after removing the DSI clamps
when exiting the Ultra Low Power State (ULPS). If this is not enforced,
then the RCG for these clocks may not get turned on correctly which
may eventually lead to some display corruption. Fix this by
appropriately modifying ULPS exit sequence.

Change-Id: I5109dd140f8921256f95eb479dd33a73615d489f
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
msm: mdss: dsi: check ULPS state only for active lanes

It is possible that for certain panels, not all four data lanes are
active. After configuring the lanes to Ultra Low Power State (ULPS),
only check the status of the active lanes since the lanes that are not
used will never enter ULPS.

Change-Id: I0da358f2bd24d4472cfccb6cca9ca8b26ffa8226
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
Merge tag 'AU_LINUX_ANDROID_LNX.LA.3.5.2.2_RB1.04.04.04.087.040' into HEAD

AU_LINUX_ANDROID_LNX.LA.3.5.2.2_RB1.04.04.04.087.040 based on quic/aosp/LNX.LA.3.5.2.2_rb1

Conflicts:
	drivers/video/msm/mdss/mdss_dsi.c
	drivers/video/msm/mdss/mdss_dsi.h
	drivers/video/msm/mdss/mdss_mdp_intf_cmd.c
	drivers/video/msm/mdss/msm_mdss_io_8974.c

Change-Id: I1eba64c455700dcef6606b8d2589547ccef6f0df