msm: mdss: Use DT offsets for post-processing

Change post-processing code to use device tree offsets when reading from
and writing to post-processing registers. The device tree defines the bases
of hardware blocks, and previously these bases were hardcoded. Now they are
parsed dynamically from the DT so that the post-processing code is scalable
for different targets

Change-Id: Ic503889459f7793ea68af4128d2d0955e6f6bef2
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Make DSPP PP setup more modular

The previous DSPP PP setup function included config functions for each
of the different PP blocks except for dither. Now there is a dither setup
function, as well as an opmode setup function in order to clean up what is
done inside DSPP PP setup.

Change-Id: Ia347c35bb675e20531272566647a364f6e68468c
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Unlock correct mutex in AD setup

The incorrect mutex for the BL file descriptor was being unlocked
in AD setup. Removed the incorrect unlock and replaced it with an
unlock on the correct mutex.

Change-Id: I276823c34d1183b69d7af06bae8b02cb7e1b56b1
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Balance clock requests in histogram enable

Balance the clock requests in histogram enable to prevent clocks from being
left on.

Change-Id: I45fc029049b68cceb56d0dc40f7819aca0625a58
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Fix dither matrix configuration

Configure entry 0 to entry 15 in dither matrix.

Change-Id: I1259c121e84078325e54d952cbd2671031df2978
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Separate AD info from AD hardware base address

Splitting the AD info struct, which is used primarily to store state, from
the hardware blocks. Functionality is preserved by passing the structures
containing hardware information to the functions that execute the register
writes. This change is necessary for dual pipe operation where one AD state
machine controls more than one AD hardware block.

Change-Id: Ia0d8be6b70d121095df2bbaa102b7dedd26f2302
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: update kernel to support autogenerated dtsi files

Changes are to support autogenerated panel/mdss dtsi files
and their corresponding format

Signed-off-by: Arpita Banerjee <cabane@codeaurora.org>
Change-Id: Id7d33190f117f29ff5aca0021517020620a7afea
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ARM: dts: msm: fix several mdss device tree gpio properties

The third tuple of reset and enable named gpio represents a flag which
is not accessed on mdss driver side, so specify them to be zero to
avoid the assumption that it means something. These properties for
msm8974 and msm8226 got changed due to GCDB update and they are
changed back to the original values.

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

Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: add te gpio for command mode panel

Enable te gpio only for command mode panel and for other panel types
don't enable it to avoid excess current draw.

Change-Id: I7bbdd5984c719fbed8b24494666543a66de5a4d4
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mdss: display: remove the pwm gpio request from edp backlight

There is no use of the pwm gpio inside the driver so cleaning up the code
and removing it from devicetree.

Change-Id: I72c038f3082aa6ed18ea9142de75faecc1e1e0fd
Signed-off-by: Asaf Penso <apenso@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mdss:display: add regulator control to dsi-1

Regulators are shared by both dsi controller. For both
dual and split display application regulator should be
controlled individually to avoid reualtors are turned off
while dsi-1 still running which cause DLB0_ERR_CONTENTION_LP1
error.

CRs-fixed: 579900
Change-Id: Ia29bd3e49a405ccb1ad55f08f3897cee2ff6f4c6
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
arm/dts: hammerhead: Update panel config

Signed-off-by: Dan Trifan <jimsth@gmail.com>
mdss: dsi: Handle gpio configuration properly

Dsi related GPIOs are freed even when gpio request fails.
Fix this by removing the gpio_free() calls when the gpio request
fails. Add the gpio_request() and gpio_free()
calls to panel reset sequence so that gpio pins would
go to suspend state when not in use.
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>

msm: mdss: Avoid GPIO warnings during boot up

During continuous splash screen handoff, we see GPIO
warnings since we try to free the GPIOs without
requesting them before. This change takes care of avoiding
these warnings.

Change-Id: I574bcf0bd28e3c33dca618103cf0285675917189
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ARM: Don't dump vmalloc addresses with show_data()

Memory-mapped IO address spaces cannot be safely dumped at will.
Some addresses may not be available (clocked, powered) at all times,
and may result in hangs or bus decode errors if accessed. Other
registers that are accessible may have read side-effects, and dumping
them may have adverse affects on stability or the functionality of
the affected peripheral.

Be safe, and skip dumping such addresses altogether.

CRs-Fixed: 625442
Change-Id: I4cfa75f027ededf841a0240715af0db385857cbe
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit 23bbd49b56e4854067337c16ad2c2c95abbf7100)
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ARM: Improve vmalloc address checking in show_data()

There is an unhandled corner case with the current check
which has recently been hit. The nbytes argument may be
large enough for the range being dumped to cross a
boundary between page-table mappings, and dump addresses
which are vmalloc'd in the neighboring mapping.

Check every address being dumped to see if its vmalloc'd,
not just the address passed to show_data().

CRs-Fixed: 625442
Change-Id: I255b093808177321f5202dcacea337ee333bfc63
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit 2811c0946b2164cc3ede5350ce04dae32ce863e2)
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: compress: fix the target not going to TCXO shutdown

The error code propagated from the flush cmd in the trigger stop
is causing the error in the state of the soc compress framework.
This hinders in closing the BE connected to the FE.
If the AFE is not closed it prevents the target to go into TCXO
shutdown.
Fixed by removing the error handling of the flush command in the
trigger stop, since failure in flush doesn't signify the
failure in the stop command.

CRs-Fixed: 687111
Change-Id: I8f6e2bfbd0e59516ede2359dda4cedf027948a72
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: primary intf and panel config

Devicetree contains properties that specify the preferred
primary panel interface for MDP. Parse this information from
MDP and provide it to the individual controller.
Each controller driver reads devicetree property
to initialize the preferred panel.

Add bindings for property, under MDSS-MDP, to indicate
the panel interface such as dsi, hdmi, edp etc.
Panel interfaces are configured independently based on
msm board type. Add property that informs MDSS about
the panel interface to be used.

This facilitates the ability to use different panel
interfaces irrespective of the board or SoC.
Add bindings for property under DSI controller node to
indicate the preferred primary panel.
This allows to implement the ability to use different panel
irrespective of the board or SoC

Change-Id: Iaa95f0676ac427bd57bd29c9e12701b6f548b30a
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Fix export of mdss_is_ready()

Signed-off-by: Dan Trifan <jimsth@gmail.com>
arm/dts: hammerhead: Add JDI 1080p command mode panel config

Use a seperate config file. Move some stuff around an apply
a cleanup.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: primary panel config from boot param

Add ability to read kernel's boot parameters to
check for primary panel interface and panel
configuration. The parameter passes three
fields of information which are parsed by the MDP
driver as a part of the device probe.

Format for cmdline param expected is:
"mdss_mdp.panel=<lk_cfg>:<pan_intf>:<dt_node_name_panel>"
where <lk_cfg> is "1" - lk/gcdb config or "0" non-lk/non-gcdb
config;
<pan_intf> is one of "dsi:<ctrl_id>", "hdmi", "edp";
and <dt_node_name_panel> is the string identical to panel's
device node name from the DT.

Change-Id: Ib9e7e4b69c62537f551aaf9ccaf0dd69eddd6889
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>