linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [DPU PATCH 00/11] Remove unused code and cleanup devicetree bindings for DPU driver
@ 2018-05-30 14:49 Rajesh Yadav
  2018-05-30 14:49 ` [DPU PATCH 05/11] drm/msm/dpu: remove writeback support Rajesh Yadav
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

This patch series aims at removing unused code from DPU driver and
also cleaning up its devicetree bindings.

Following functionality is removed in this series:
 - Removed display port driver, it will be posted back later after verification on SDM845
 - Removed HDCP 1.x support, it will be posted back with display port driver
 - Removed writeback support, it will be added at later stage based on DRM writeback connector series

Additionally, following cleanups are done:
 - Remove bus_scale config from devicetree and use static config in driver
 - Cleanup devicetree binding to model actual (tree like) HW hierarchy
 - Cleanup unused utility functions

This series is rebased on following:
 1. https://lists.freedesktop.org/archives/freedreno/2018-May/002502.html
 2. https://lists.freedesktop.org/archives/freedreno/2018-May/002565.html

Jordan Crouse (1):
  drm/msm/dpu: Remove unused code and move the header

Rajesh Yadav (10):
  dt-bindings: msm/disp: remove unused dsi & panel bindings
  dt-bindings: msm/disp: remove unused display port bindings
  Revert "drm/msm: Add DisplayPort support"
  dt-bindings: msm/disp: remove unused writeback bindings
  drm/msm/dpu: remove writeback support
  drm/msm/dpu: remove hdcp support
  drm/msm/dpu: remove dt parsing logic for bus_scale config
  dt-bindings: msm/disp: cleanup bindings for Snapdragon 845 DPU
  drm/msm/dpu: correct dpu_io_util.h include path
  drm/msm/dpu: move dpu_io_util to dpu folder

 .../devicetree/bindings/display/msm/dpu.txt        |  318 ++--
 .../devicetree/bindings/drm/msm/dpu-dp.txt         |  217 ---
 .../devicetree/bindings/drm/msm/dpu-dsi.txt        |  102 --
 .../devicetree/bindings/drm/msm/dpu-wb.txt         |   23 -
 .../devicetree/bindings/drm/msm/mdss-dsi-panel.txt |  772 ----------
 .../devicetree/bindings/fb/mdss-dsi-panel.txt      |  742 ---------
 Documentation/devicetree/bindings/fb/mdss-pll.txt  |  103 --
 drivers/gpu/drm/msm/Makefile                       |   21 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h           |    3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   94 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h        |    2 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h   |   63 -
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c    | 1349 -----------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c     |   41 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h     |   77 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c         |    3 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c         |   19 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h         |    6 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c         |   12 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h         |    4 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c          |  321 ----
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h          |  186 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c        |  186 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h        |   61 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c            |    5 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h            |    1 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |    2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c   |  253 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h   |    2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c             |   42 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.c             |  767 ----------
 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.h             |  232 ---
 drivers/gpu/drm/msm/dp/dp_audio.c                  |  806 ----------
 drivers/gpu/drm/msm/dp/dp_audio.h                  |   81 -
 drivers/gpu/drm/msm/dp/dp_aux.c                    |  570 -------
 drivers/gpu/drm/msm/dp/dp_aux.h                    |   44 -
 drivers/gpu/drm/msm/dp/dp_catalog.c                | 1320 ----------------
 drivers/gpu/drm/msm/dp/dp_catalog.h                |  163 --
 drivers/gpu/drm/msm/dp/dp_ctrl.c                   | 1474 ------------------
 drivers/gpu/drm/msm/dp/dp_ctrl.h                   |   50 -
 drivers/gpu/drm/msm/dp/dp_debug.c                  |  503 -------
 drivers/gpu/drm/msm/dp/dp_debug.h                  |   60 -
 drivers/gpu/drm/msm/dp/dp_display.c                | 1255 ----------------
 drivers/gpu/drm/msm/dp/dp_display.h                |   52 -
 drivers/gpu/drm/msm/dp/dp_drm.c                    |  538 -------
 drivers/gpu/drm/msm/dp/dp_drm.h                    |   96 --
 drivers/gpu/drm/msm/dp/dp_hdcp2p2.c                |  927 ------------
 drivers/gpu/drm/msm/dp/dp_link.c                   | 1548 -------------------
 drivers/gpu/drm/msm/dp/dp_link.h                   |  184 ---
 drivers/gpu/drm/msm/dp/dp_panel.c                  |  526 -------
 drivers/gpu/drm/msm/dp/dp_panel.h                  |  115 --
 drivers/gpu/drm/msm/dp/dp_parser.c                 |  645 --------
 drivers/gpu/drm/msm/dp/dp_parser.h                 |  200 ---
 drivers/gpu/drm/msm/dp/dp_power.c                  |  593 --------
 drivers/gpu/drm/msm/dp/dp_power.h                  |   56 -
 drivers/gpu/drm/msm/dp/dp_reg.h                    |  231 ---
 drivers/gpu/drm/msm/dp/dp_usbpd.c                  |  491 ------
 drivers/gpu/drm/msm/dp/dp_usbpd.h                  |  101 --
 drivers/gpu/drm/msm/dpu_hdcp.h                     |   74 -
 drivers/gpu/drm/msm/dpu_hdcp_1x.c                  | 1579 --------------------
 drivers/gpu/drm/msm/dpu_io_util.c                  |  556 -------
 drivers/gpu/drm/msm/msm_drv.h                      |    1 -
 include/drm/drm_dp_helper.h                        |   23 -
 include/linux/dpu_io_util.h                        |  115 --
 64 files changed, 556 insertions(+), 20450 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/dpu-dp.txt
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/dpu-dsi.txt
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/dpu-wb.txt
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt
 delete mode 100644 Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
 delete mode 100644 Documentation/devicetree/bindings/fb/mdss-pll.txt
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_audio.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_audio.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_debug.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_debug.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_display.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_display.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_hdcp2p2.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_link.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_link.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_power.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_power.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_usbpd.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_usbpd.h
 delete mode 100644 drivers/gpu/drm/msm/dpu_hdcp.h
 delete mode 100644 drivers/gpu/drm/msm/dpu_hdcp_1x.c
 delete mode 100644 drivers/gpu/drm/msm/dpu_io_util.c
 delete mode 100644 include/linux/dpu_io_util.h

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [DPU PATCH 01/11] dt-bindings: msm/disp: remove unused dsi & panel bindings
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2018-05-30 14:49   ` Rajesh Yadav
  2018-05-30 14:49   ` [DPU PATCH 02/11] dt-bindings: msm/disp: remove unused display port bindings Rajesh Yadav
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

DPU driver switched to existing upstream dsi driver
so removing the dsi-staging specific dsi and panel
bindings.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 .../devicetree/bindings/drm/msm/dpu-dsi.txt        | 102 ---
 .../devicetree/bindings/drm/msm/mdss-dsi-panel.txt | 772 ---------------------
 .../devicetree/bindings/fb/mdss-dsi-panel.txt      | 742 --------------------
 Documentation/devicetree/bindings/fb/mdss-pll.txt  | 103 ---
 4 files changed, 1719 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/dpu-dsi.txt
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt
 delete mode 100644 Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
 delete mode 100644 Documentation/devicetree/bindings/fb/mdss-pll.txt

diff --git a/Documentation/devicetree/bindings/drm/msm/dpu-dsi.txt b/Documentation/devicetree/bindings/drm/msm/dpu-dsi.txt
deleted file mode 100644
index 641cc26..0000000
--- a/Documentation/devicetree/bindings/drm/msm/dpu-dsi.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-Qualcomm Technologies, Inc.
-
-mdss-dsi is the master DSI device which supports multiple DSI host controllers
-that are compatible with MIPI display serial interface specification.
-
-DSI Controller:
-Required properties:
-- compatible:           Should be "qcom,dsi-ctrl-hw-v<version>". Supported
-			versions include 1.4, 2.0 and 2.2.
-			eg: qcom,dsi-ctrl-hw-v1.4, qcom,dsi-ctrl-hw-v2.0,
-			qcom,dsi-ctrl-hw-v2.2
-			And for dsi phy driver:
-			qcom,dsi-phy-v0.0-hpm, qcom,dsi-phy-v0.0-lpm,
-			qcom,dsi-phy-v1.0, qcom,dsi-phy-v2.0,
-			qcom,dsi-phy-v3.0
-- reg:                  Base address and length of DSI controller's memory
-			mapped regions.
-- reg-names:            A list of strings that name the list of regs.
-			"dsi_ctrl" - DSI controller memory region.
-			"mmss_misc" - MMSS misc memory region.
-- cell-index:           Specifies the controller instance.
-- clocks:               Clocks required for DSI controller operation.
-- clock-names:          Names of the clocks corresponding to handles. Following
-			clocks are required:
-			"mdp_core_clk"
-			"iface_clk"
-			"core_mmss_clk"
-			"bus_clk"
-			"byte_clk"
-			"pixel_clk"
-			"core_clk"
-			"byte_clk_rcg"
-			"pixel_clk_rcg"
-- gdsc-supply:		phandle to gdsc regulator node.
-- vdda-supply:		phandle to vdda regulator node.
-- vcca-supply:		phandle to vcca regulator node.
-- interrupt-parent	phandle to the interrupt parent device node.
-- interrupts:		The interrupt signal from the DSI block.
-
-Bus Scaling Data:
-- qcom,msm-bus,name:		String property describing MDSS client.
-- qcom,msm-bus,num-cases:	This is the number of bus scaling use cases
-				defined in the vectors property. This must be
-				set to <2> for MDSS DSI driver where use-case 0
-				is used to remove BW votes from the system. Use
-				case 1 is used to generate bandwidth requestes
-				when sending command packets.
-- qcom,msm-bus,num-paths:	This represents number of paths in each bus
-				scaling usecase. This value depends on number of
-				AXI master ports dedicated to MDSS for
-				particular chipset.
-- qcom,msm-bus,vectors-KBps:	A series of 4 cell properties, with a format
-				of (src, dst, ab, ib) which is defined at
-				Documentation/devicetree/bindings/arm/msm/msm_bus.txt.
-				DSI driver should always set average bandwidth
-				(ab) to 0 and always use instantaneous
-				bandwidth(ib) values.
-
-Optional properties:
-- label:                  String to describe controller.
-- qcom,platform-te-gpio:  Specifies the gpio used for TE.
-- qcom,dsi-display-active: Current active display
-- qcom,dsi-ctrl: handle to dsi controller device
-- qcom,dsi-phy: handle to dsi phy device
-- qcom,dsi-manager:       Specifies dsi manager is present
-- qcom,dsi-display:       Specifies dsi display is present
-- qcom,hdmi-display:      Specifies hdmi is present
-- qcom,dp-display:        Specified dp is present
-- qcom,<type>-supply-entries:		A node that lists the elements of the supply used by the
-					a particular "type" of DSI module. The module "types"
-					can be "core", "ctrl", and "phy". Within the same type,
-					there can be more than one instance of this binding,
-					in which case the entry would be appended with the
-					supply entry index.
-					e.g. qcom,ctrl-supply-entry@0
-					-- qcom,supply-name: name of the supply (vdd/vdda/vddio)
-					-- qcom,supply-min-voltage: minimum voltage level (uV)
-					-- qcom,supply-max-voltage: maximum voltage level (uV)
-					-- qcom,supply-enable-load: load drawn (uA) from enabled supply
-					-- qcom,supply-disable-load: load drawn (uA) from disabled supply
-					-- qcom,supply-pre-on-sleep: time to sleep (ms) before turning on
-					-- qcom,supply-post-on-sleep: time to sleep (ms) after turning on
-					-- qcom,supply-pre-off-sleep: time to sleep (ms) before turning off
-					-- qcom,supply-post-off-sleep: time to sleep (ms) after turning off
-- qcom,mdss-mdp-transfer-time-us:	Specifies the dsi transfer time for command mode
-					panels in microseconds. Driver uses this number to adjust
-					the clock rate according to the expected transfer time.
-					Increasing this value would slow down the mdp processing
-					and can result in slower performance.
-					Decreasing this value can speed up the mdp processing,
-					but this can also impact power consumption.
-					As a rule this time should not be higher than the time
-					that would be expected with the processing at the
-					dsi link rate since anyways this would be the maximum
-					transfer time that could be achieved.
-					If ping pong split enabled, this time should not be higher
-					than two times the dsi link rate time.
-					If the property is not specified, then the default value is 14000 us.
-- qcom,dsi-phy-isolation-enabled:	A boolean property enables the phy isolation from dsi
-					controller. This must be enabled for debugging purpose
-					only with simulator panel. It should not be enabled for
-					normal DSI panels.
diff --git a/Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt b/Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt
deleted file mode 100644
index 66a564d..0000000
--- a/Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt
+++ /dev/null
@@ -1,772 +0,0 @@
-QTI mdss-dsi-panel
-
-mdss-dsi-panel is a dsi panel device which supports panels that
-are compatible with MIPI display serial interface specification.
-
-Required properties:
-- compatible:				This property applies to DSI V2 panels only.
-					This property should not be added for panels
-					that work based on version "V6.0"
-					DSI panels that are of different versions
-					are initialized by the drivers for dsi controller.
-					This property specifies the version
-					for DSI HW that this panel will work with
-					"qcom,dsi-panel-v2" = DSI V2.0
-- status:        			This property applies to DSI V2 panels only.
-					This property should not be added for panels
-					that work based on version "V6.0"
-					DSI panels that are of different versions
-					are initialized by the drivers for dsi controller.
-					A string that has to be set to "okay/ok"
-					to enable the panel driver. By default this property
-					will be set to "disable". Will be set to "ok/okay"
-					status for specific platforms.
-- qcom,mdss-dsi-panel-controller:	Specifies the phandle for the DSI controller that
-					this panel will be mapped to.
-- qcom,mdss-dsi-panel-width:		Specifies panel width in pixels.
-- qcom,mdss-dsi-panel-height:		Specifies panel height in pixels.
-- qcom,mdss-dsi-bpp:			Specifies the panel bits per pixel.
-					3  = for rgb111
-					8  = for rgb332
-					12 = for rgb444
-					16 = for rgb565
-					18 = for rgb666
-					24 = for rgb888
-- qcom,mdss-dsi-panel-destination:	A string that specifies the destination display for the panel.
-					"display_1" = DISPLAY_1
-					"display_2" = DISPLAY_2
-- qcom,mdss-dsi-panel-timings:		An array of length 12 that specifies the PHY
-					timing settings for the panel.
-- qcom,mdss-dsi-panel-timings-8996:		An array of length 40 char that specifies the 8996 PHY lane
-					timing settings for the panel.
-- qcom,mdss-dsi-on-command:		A byte stream formed by multiple dcs packets base on
-					qcom dsi controller protocol.
-					byte 0: dcs data type
-					byte 1: set to indicate this is an individual packet
-						 (no chain)
-					byte 2: virtual channel number
-					byte 3: expect ack from client (dcs read command)
-					byte 4: wait number of specified ms after dcs command
-						 transmitted
-					byte 5, 6: 16 bits length in network byte order
-					byte 7 and beyond: number byte of payload
-- qcom,mdss-dsi-off-command:		A byte stream formed by multiple dcs packets base on
-					qcom dsi controller protocol.
-					byte 0: dcs data type
-					byte 1: set to indicate this is an individual packet
-						 (no chain)
-					byte 2: virtual channel number
-					byte 3: expect ack from client (dcs read command)
-					byte 4: wait number of specified ms after dcs command
-						 transmitted
-					byte 5, 6: 16 bits length in network byte order
-					byte 7 and beyond: number byte of payload
-- qcom,mdss-dsi-post-panel-on-command:	same as "qcom,mdss-dsi-on-command" except commands are
-					sent after displaying an image.
-
-Note, if a short DCS packet(i.e packet with Byte 0:dcs data type as 05) mentioned in
-qcom,mdss-dsi-on-command/qcom,mdss-dsi-off-command stream fails to transmit,
-then 3 options can be tried.
-	1. Send the packet as a long packet instead
-				Byte 0: dcs data type = 05 (DCS short Packet)
-				Byte 0: dcs data type = 29 (DCS long Packet)
-	2. Send the packet in one burst by prepending with the next packet in packet stream
-				Byte 1 = 01 (indicates this is an individual packet)
-				Byte 1 = 00 (indicates this will be appended to the next
-					     individual packet in the packet stream)
-	3. Prepend a NULL packet to the short packet and send both in one burst instead of
-	   combining multiple short packets and sending them in one burst.
-
-Optional properties:
-- qcom,mdss-dsi-panel-name:		A string used as a descriptive name of the panel
-- qcom,mdss-dsi-panel-phy-timings:	An array of length 'n' char that specifies the DSI PHY lane
-					timing settings for the panel. This is specific to DPU DRM driver.
-					The value of 'n' depends on the DSI PHY h/w revision and parsing this
-					property properly will be taken care in the DSI PHY DRM driver.
-- qcom,cmd-sync-wait-broadcast:		Boolean used to broadcast dcs command to panels.
-- qcom,mdss-dsi-fbc-enable:		Boolean used to enable frame buffer compression mode.
-- qcom,mdss-dsi-fbc-slice-height:	Slice height(in lines) of compressed block.
-					Expressed as power of 2. To set as 128 lines,
-					this should be set to 7.
-- qcom,mdss-dsi-fbc-2d-pred-mode:	Boolean to enable 2D map prediction.
-- qcom,mdss-dsi-fbc-ver2-mode:		Boolean to enable FBC 2.0 that supports 1/3
-					compression.
-- qcom,mdss-dsi-fbc-bpp:		Compressed bpp supported by the panel.
-					Specified color order is used as default value.
-- qcom,mdss-dsi-fbc-packing:		Component packing.
-					0 = default value.
-- qcom,mdss-dsi-fbc-quant-error:	Boolean used to enable quantization error calculation.
-- qcom,mdss-dsi-fbc-bias:		Bias for CD.
-					0 = default value.
-- qcom,mdss-dsi-fbc-pat-mode:		Boolean used to enable PAT mode.
-- qcom,mdss-dsi-fbc-vlc-mode:		Boolean used to enable VLC mode.
-- qcom,mdss-dsi-fbc-bflc-mode:		Boolean used to enable BFLC mode.
-- qcom,mdss-dsi-fbc-h-line-budget:	Per line extra budget.
-					0 = default value.
-- qcom,mdss-dsi-fbc-budget-ctrl:		Extra budget level.
-					0 = default value.
-- qcom,mdss-dsi-fbc-block-budget:		Per block budget.
-					0 = default value.
-- qcom,mdss-dsi-fbc-lossless-threshold: Lossless mode threshold.
-					0 = default value.
-- qcom,mdss-dsi-fbc-lossy-threshold:	Lossy mode threshold.
-					0 = default value.
-- qcom,mdss-dsi-fbc-rgb-threshold:	Lossy RGB threshold.
-					0 = default value.
-- qcom,mdss-dsi-fbc-lossy-mode-idx:	Lossy mode index value.
-					0 = default value.
-- qcom,mdss-dsi-fbc-max-pred-err:	Max quantization prediction error.
-					0 = default value
-- qcom,mdss-dsi-h-back-porch:		Horizontal back porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-h-front-porch:		Horizontal front porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-h-pulse-width:		Horizontal pulse width.
-					2 = default value.
-- qcom,mdss-dsi-h-sync-skew:		Horizontal sync skew value.
-					0 = default value.
-- qcom,mdss-dsi-v-back-porch:		Vertical back porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-v-front-porch:		Vertical front porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-v-pulse-width:		Vertical pulse width.
-					2 = default value.
-- qcom,mdss-dsi-h-left-border:		Horizontal left border in pixel.
-					0 = default value
-- qcom,mdss-dsi-h-right-border:		Horizontal right border in pixel.
-					0 = default value
-- qcom,mdss-dsi-v-top-border:		Vertical top border in pixel.
-					0 = default value
-- qcom,mdss-dsi-v-bottom-border:	Vertical bottom border in pixel.
-					0 = default value
-- qcom,mdss-dsi-underflow-color:	Specifies the controller settings for the
-					panel under flow color.
-					0xff = default value.
-- qcom,mdss-dsi-border-color:		Defines the border color value if border is present.
-					0 = default value.
-- qcom,mdss-dsi-panel-jitter:		Panel jitter value is expressed in terms of numerator
-					and denominator. It contains two u32 values - numerator
-					followed by denominator. The jitter configurition causes
-					the early wakeup if panel needs to adjust before vsync.
-					Default jitter value is 2.0%. Max allowed value is 10%.
-- qcom,mdss-dsi-panel-prefill-lines:	An integer value defines the panel prefill lines required to
-					calculate the backoff time of rsc.
-					Default value is 16 lines. Max allowed value is vtotal.
-- qcom,mdss-dsi-pan-enable-dynamic-fps:	Boolean used to enable change in frame rate dynamically.
-- qcom,mdss-dsi-pan-fps-update:		A string that specifies when to change the frame rate.
-					"dfps_suspend_resume_mode"= FPS change request is
-					implemented during suspend/resume.
-					"dfps_immediate_clk_mode" = FPS change request is
-					implemented immediately using DSI clocks.
-					"dfps_immediate_porch_mode_hfp" = FPS change request is
-					implemented immediately by changing panel horizontal
-					front porch values.
-					"dfps_immediate_porch_mode_vfp" = FPS change request is
-					implemented immediately by changing panel vertical
-					front porch values.
-- qcom,min-refresh-rate:		Minimum refresh rate supported by the panel.
-- qcom,max-refresh-rate:		Maximum refresh rate supported by the panel. If max refresh
-					rate is not specified, then the frame rate of the panel in
-					qcom,mdss-dsi-panel-framerate is used.
-- qcom,mdss-dsi-bl-pmic-control-type:	A string that specifies the implementation of backlight
-					control for this panel.
-					"bl_ctrl_pwm" = Backlight controlled by PWM gpio.
-					"bl_ctrl_wled" = Backlight controlled by WLED.
-					"bl_ctrl_dcs" = Backlight controlled by DCS commands.
-					other: Unknown backlight control. (default)
-- qcom,mdss-dsi-bl-pwm-pmi:		Boolean to indicate that PWM control is through second pmic chip.
-- qcom,mdss-dsi-bl-pmic-bank-select:	LPG channel for backlight.
-					Required if backlight pmic control type is PWM
-- qcom,mdss-dsi-bl-pmic-pwm-frequency:	PWM period in microseconds.
-					Required if backlight pmic control type is PWM
-- qcom,mdss-dsi-pwm-gpio:		PMIC gpio binding to backlight.
-					Required if backlight pmic control type is PWM
-- qcom,mdss-dsi-bl-min-level:		Specifies the min backlight level supported by the panel.
-					0 = default value.
-- qcom,mdss-dsi-bl-max-level:		Specifies the max backlight level supported by the panel.
-					255 = default value.
-- qcom,mdss-brightness-max-level:	Specifies the max brightness level supported.
-					255 = default value.
-- qcom,mdss-dsi-interleave-mode:	Specifies interleave mode.
-					0 = default value.
-- qcom,mdss-dsi-panel-type:		Specifies the panel operating mode.
-					"dsi_video_mode" = enable video mode (default).
-					"dsi_cmd_mode" = enable command mode.
-- qcom,5v-boost-gpio:			Specifies the panel gpio for display 5v boost.
-- qcom,mdss-dsi-te-check-enable:	Boolean to enable Tear Check configuration.
-- qcom,mdss-dsi-te-using-wd:		Boolean entry enables the watchdog timer support to generate the vsync signal
-					for command mode panel. By default, panel TE will be used to generate the vsync.
-- qcom,mdss-dsi-te-using-te-pin:	Boolean to specify whether using hardware vsync.
-- qcom,mdss-dsi-te-pin-select:		Specifies TE operating mode.
-					0 = TE through embedded dcs command
-					1 = TE through TE gpio pin. (default)
-- qcom,mdss-dsi-te-dcs-command:		Inserts the dcs command.
-					1 = default value.
-- qcom,mdss-dsi-wr-mem-start:		DCS command for write_memory_start.
-					0x2c = default value.
-- qcom,mdss-dsi-wr-mem-continue:	DCS command for write_memory_continue.
-					0x3c = default value.
-- qcom,mdss-dsi-h-sync-pulse:		Specifies the pulse mode option for the panel.
-					0 = Don't send hsa/he following vs/ve packet(default)
-					1 = Send hsa/he following vs/ve packet
-- qcom,mdss-dsi-hfp-power-mode:		Boolean to determine DSI lane state during
-					horizontal front porch (HFP) blanking period.
-- qcom,mdss-dsi-hbp-power-mode:		Boolean to determine DSI lane state during
-					horizontal back porch (HBP) blanking period.
-- qcom,mdss-dsi-hsa-power-mode:		Boolean to determine DSI lane state during
-					horizontal sync active (HSA) mode.
-- qcom,mdss-dsi-last-line-interleave	Boolean to determine if last line
-					interleave flag needs to be enabled.
-- qcom,mdss-dsi-bllp-eof-power-mode:	Boolean to determine DSI lane state during
-					blanking low power period (BLLP) EOF mode.
-- qcom,mdss-dsi-bllp-power-mode:	Boolean to determine DSI lane state during
-					blanking low power period (BLLP) mode.
-- qcom,mdss-dsi-traffic-mode:		Specifies the panel traffic mode.
-					"non_burst_sync_pulse" = non burst with sync pulses (default).
-					"non_burst_sync_event" = non burst with sync start event.
-					"burst_mode" = burst mode.
-- qcom,mdss-dsi-pixel-packing:		Specifies if pixel packing is used (in case of RGB666).
-					"tight" = Tight packing (default value).
-					"loose" = Loose packing.
-- qcom,mdss-dsi-virtual-channel-id:	Specifies the virtual channel identefier.
-					0 = default value.
-- qcom,mdss-dsi-color-order:		Specifies the R, G and B channel ordering.
-					"rgb_swap_rgb" = DSI_RGB_SWAP_RGB (default value)
-					"rgb_swap_rbg" = DSI_RGB_SWAP_RBG
-					"rgb_swap_brg" = DSI_RGB_SWAP_BRG
-					"rgb_swap_grb" = DSI_RGB_SWAP_GRB
-					"rgb_swap_gbr" = DSI_RGB_SWAP_GBR
-- qcom,mdss-dsi-lane-0-state:		Boolean that specifies whether data lane 0 is enabled.
-- qcom,mdss-dsi-lane-1-state:		Boolean that specifies whether data lane 1 is enabled.
-- qcom,mdss-dsi-lane-2-state:		Boolean that specifies whether data lane 2 is enabled.
-- qcom,mdss-dsi-lane-3-state:		Boolean that specifies whether data lane 3 is enabled.
-- qcom,mdss-dsi-t-clk-post:		Specifies the byte clock cycles after mode switch.
-					0x03 = default value.
-- qcom,mdss-dsi-t-clk-pre:		Specifies the byte clock cycles before mode switch.
-					0x24 = default value.
-- qcom,mdss-dsi-stream:			Specifies the packet stream to be used.
-					0 = stream 0 (default)
-					1 = stream 1
-- qcom,mdss-dsi-mdp-trigger:		Specifies the trigger mechanism to be used for MDP path.
-					"none" = no trigger
-					"trigger_te" = Tear check signal line used for trigger
-					"trigger_sw" = Triggered by software (default)
-					"trigger_sw_te" = Software trigger and TE
-- qcom,mdss-dsi-dma-trigger:		Specifies the trigger mechanism to be used for DMA path.
-					"none" = no trigger
-					"trigger_te" = Tear check signal line used for trigger
-					"trigger_sw" = Triggered by software (default)
-					"trigger_sw_seof" = Software trigger and start/end of frame trigger.
-					"trigger_sw_te" = Software trigger and TE
-- qcom,mdss-dsi-panel-framerate:	Specifies the frame rate for the panel.
-					60 = 60 frames per second (default)
-- qcom,mdss-dsi-panel-clockrate:	A 64 bit value specifies the panel clock speed in Hz.
-					0 = default value.
-- qcom,mdss-mdp-transfer-time-us:	Specifies the dsi transfer time for command mode
-					panels in microseconds. Driver uses this number to adjust
-					the clock rate according to the expected transfer time.
-					Increasing this value would slow down the mdp processing
-					and can result in slower performance.
-					Decreasing this value can speed up the mdp processing,
-					but this can also impact power consumption.
-					As a rule this time should not be higher than the time
-					that would be expected with the processing at the
-					dsi link rate since anyways this would be the maximum
-					transfer time that could be achieved.
-					If ping pong split enabled, this time should not be higher
-					than two times the dsi link rate time.
-					14000 = default value.
-- qcom,mdss-dsi-on-command-state:	String that specifies the ctrl state for sending ON commands.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-off-command-state:	String that specifies the ctrl state for sending OFF commands.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-post-mode-switch-on-command-state:	String that specifies the ctrl state for sending ON commands post mode switch.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-pan-physical-width-dimension:	Specifies panel physical width in mm which corresponds
-					to the physical width in the framebuffer information.
-- qcom,mdss-pan-physical-height-dimension:	Specifies panel physical height in mm which corresponds
-					to the physical height in the framebuffer information.
-- qcom,mdss-dsi-mode-sel-gpio-state:	String that specifies the lcd mode for panel
-					(such as single-port/dual-port), if qcom,panel-mode-gpio
-					binding is defined in dsi controller.
-					"dual_port" = Set GPIO to LOW
-					"single_port" = Set GPIO to HIGH
-					"high" = Set GPIO to HIGH
-					"low" = Set GPIO to LOW
-					The default value is "dual_port".
-- qcom,mdss-tear-check-disable:		Boolean to disable mdp tear check. Tear check is enabled by default to avoid
-					tearing. Other tear-check properties are ignored if this property is present.
-					The below tear check configuration properties can be individually tuned if
-					tear check is enabled.
-- qcom,mdss-tear-check-sync-cfg-height: Specifies the vertical total number of lines.
-					The default value is 0xfff0.
-- qcom,mdss-tear-check-sync-init-val:	Specifies the init value at which the read pointer gets loaded
-					at vsync edge. The reader pointer refers to the line number of
-					panel buffer that is currently being updated.
-					The default value is panel height.
-- qcom,mdss-tear-check-sync-threshold-start:
-					Allows the first ROI line write to an panel when read pointer is
-					between the range of ROI start line and ROI start line plus this
-					setting.
-					The default value is 4.
-- qcom,mdss-tear-check-sync-threshold-continue:
-					The minimum number of lines the write pointer needs to be
-					above the read pointer so that it is safe to write to the panel.
-					(This check is not done for the first ROI line write of an update)
-					The default value is 4.
-- qcom,mdss-tear-check-start-pos:	Specify the y position from which the start_threshold value is
-					added and write is kicked off if the read pointer falls within that
-					region.
-					The default value is panel height.
-- qcom,mdss-tear-check-rd-ptr-trigger-intr:
-					Specify the read pointer value at which an interrupt has to be
-					generated.
-					The default value is panel height + 1.
-- qcom,mdss-tear-check-frame-rate:	Specify the value to be a real frame rate(fps) x 100 factor to tune the
-					timing of TE simulation with more precision.
-					The default value is 6000 with 60 fps.
-- qcom,mdss-dsi-reset-sequence:		An array that lists the
-					sequence of reset gpio values and sleeps
-					Each command will have the format defined
-					as below:
-					--> Reset GPIO value
-					--> Sleep value (in ms)
-- qcom,partial-update-enabled:		String used to enable partial
-					panel update for command mode panels.
-					"none": partial update is disabled
-					"single_roi": default enable mode, only single roi is sent to panel
-					"dual_roi": two rois are merged into one big roi. Panel ddic should be able
-					to process two roi's along with the DCS command to send two rois.
-					disabled if property is not specified.
-- qcom,mdss-dsi-horizontal-line-idle:	List of width ranges (EC - SC) in pixels indicating
-					additional idle time in dsi clock cycles that is needed
-					to compensate for smaller line width.
-- qcom,partial-update-roi-merge:	Boolean indicates roi combination is need
-					and function has been provided for dcs
-					2A/2B command.
-- qcom,dcs-cmd-by-left:			Boolean to indicate that dcs command are sent
-					through the left DSI controller only in a dual-dsi configuration
-- qcom,mdss-dsi-panel-hdr-enabled:      Boolean to indicate HDR support in panel.
-- qcom,mdss-dsi-panel-hdr-color-primaries:
-                                        Array of 8 unsigned integers denoting chromaticity of panel.These
-                                        values are specified in nits units. The value range is 0 through 50000.
-                                        To obtain real chromacity, these values should be divided by factor of
-                                        50000. The structure of array is defined in below order
-                                        value 1: x value of white chromaticity of display panel
-                                        value 2: y value of white chromaticity of display panel
-                                        value 3: x value of red chromaticity of display panel
-                                        value 4: y value of red chromaticity of display panel
-                                        value 5: x value of green chromaticity of display panel
-                                        value 6: y value of green chromaticity of display panel
-                                        value 7: x value of blue chromaticity of display panel
-                                        value 8: y value of blue chromaticity of display panel
-- qcom,mdss-dsi-panel-peak-brightness:  Maximum brightness supported by panel.In absence of maximum value
-                                        typical value becomes peak brightness. Value is specified in nits units.
-                                        To obtain real peak brightness, this value should be divided by factor of
-                                        10000.
-- qcom,mdss-dsi-panel-blackness-level:  Blackness level supported by panel. Blackness level is defined as
-                                        ratio of peak brightness to contrast. Value is specified in nits units.
-                                        To obtain real blackness level, this value should be divided by factor of
-                                        10000.
-- qcom,mdss-dsi-lp11-init:		Boolean used to enable the DSI clocks and data lanes (low power 11)
-					before issuing hardware reset line.
-- qcom,mdss-dsi-init-delay-us:		Delay in microseconds(us) before performing any DSI activity in lp11
-					mode. This master delay (t_init_delay as per DSI spec) should be sum
-					of DSI internal delay to reach fuctional after power up and minimum
-					delay required by panel to reach functional.
-- qcom,mdss-dsi-rx-eot-ignore:		Boolean used to enable ignoring end of transmission packets.
-- qcom,mdss-dsi-tx-eot-append:		Boolean used to enable appending end of transmission packets.
-- qcom,ulps-enabled:			Boolean to enable support for Ultra Low Power State (ULPS) mode.
-- qcom,suspend-ulps-enabled:		Boolean to enable support for ULPS mode for panels during suspend state.
-- qcom,panel-roi-alignment:		Specifies the panel ROI alignment restrictions on its
-					left, top, width, height alignments and minimum width and
-					height values
-- qcom,esd-check-enabled:		Boolean used to enable ESD recovery feature.
-- qcom,mdss-dsi-panel-status-command:	A byte stream formed by multiple dcs packets based on
-					qcom dsi controller protocol, to read the panel status.
-					This value is used to kick in the ESD recovery.
-					byte 0: dcs data type
-					byte 1: set to indicate this is an individual packet
-						 (no chain)
-					byte 2: virtual channel number
-					byte 3: expect ack from client (dcs read command)
-					byte 4: wait number of specified ms after dcs command
-						 transmitted
-					byte 5, 6: 16 bits length in network byte order
-					byte 7 and beyond: number byte of payload
-- qcom,mdss-dsi-panel-status-command-mode:
-					String that specifies the ctrl state for reading the panel status.
-					"dsi_lp_mode" = DSI low power mode
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-lp1-command:		An optional byte stream to request low
-					power mode on a panel
-- qcom,mdss-dsi-lp1-command-mode:	String that specifies the ctrl state for
-					setting the panel power mode.
-					"dsi_lp_mode" = DSI low power mode
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-lp2-command:		An optional byte stream to request ultra
-					low power mode on a panel
-- qcom,mdss-dsi-lp2-command-mode:	String that specifies the ctrl state for
-					setting the panel power mode.
-					"dsi_lp_mode" = DSI low power mode
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-nolp-command:		An optional byte stream to disable low
-					power and ultra low power panel modes
-- qcom,mdss-dsi-nolp-command-mode:	String that specifies the ctrl state for
-					setting the panel power mode.
-					"dsi_lp_mode" = DSI low power mode
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-panel-status-check-mode:Specifies the panel status check method for ESD recovery.
-					"bta_check" = Uses BTA to check the panel status
-					"reg_read" = Reads panel status register to check the panel status
-					"reg_read_nt35596" = Reads panel status register to check the panel
-							     status for NT35596 panel.
-					"te_signal_check" = Uses TE signal behaviour to check the panel status
-- qcom,mdss-dsi-panel-status-read-length: Integer array that specify the expected read-back length of values
-					  for each of panel registers. Each length is corresponding to number of
-					  returned parameters of register introduced in specification.
-- qcom,mdss-dsi-panel-status-valid-params: Integer array that specify the valid returned values which need to check
-					   for each of register.
-					   Some panel need only check the first few values returned from panel.
-					   So: if this property is the same to qcom,mdss-dsi-panel-status-read-length,
-					   then just ignore this one.
-- qcom,mdss-dsi-panel-status-value:	Multiple integer arrays, each specifies the values of the panel status register
-					which is used to check the panel status. The size of each array is the sum of
-					length specified in qcom,mdss-dsi-panel-status-read-length, and must be equal.
-					This can cover that Some panel may return several alternative values.
-- qcom,mdss-dsi-panel-max-error-count:  Integer value that specifies the maximum number of errors from register
-					read that can be ignored before treating that the panel has gone bad.
-- qcom,dynamic-mode-switch-enabled:		Boolean used to mention whether panel supports
-					dynamic switching from video mode to command mode
-					and vice versa.
-- qcom,dynamic-mode-switch-type:		A string specifies how to perform dynamic mode switch.
-						If qcom,dynamic-mode-switch-enabled is set and no string specified, default value is
-						dynamic-switch-suspend-resume.
-					"dynamic-switch-suspend-resume"= Switch using suspend/resume. Panel will
-						go blank during transition.
-					"dynamic-switch-immediate"= Switch on next frame update. Panel will
-						not go blank for this transition.
-					"dynamic-resolution-switch-immediate"= Switch the panel resolution. Panel will
-						not go blank for this transition.
-- qcom,mdss-dsi-post-mode-switch-on-command:		Multiple dcs packets used for turning on DSI panel
-					after panel has switch modes.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,video-to-cmd-mode-switch-commands:	List of commands that need to be sent
-					to panel in order to switch from video mode to command mode dynamically.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,cmd-to-video-mode-switch-commands:	List of commands that need to be sent
-					to panel in order to switch from command mode to video mode dynamically.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,send-pps-before-switch:		Boolean propety to indicate when PPS commands should be sent,
-					either before or after switch commands during dynamic resolution
-					switch in DSC panels. If the property is not present, the default
-					behavior is to send PPS commands after the switch commands.
-- qcom,mdss-dsi-panel-orientation:	String used to indicate orientation of panel
-					"180" = panel is flipped in both horizontal and vertical directions
-					"hflip" = panel is flipped in horizontal direction
-					"vflip" = panel is flipped in vertical direction
-- qcom,panel-ack-disabled: A boolean property to indicate, whether we need to wait for any ACK from the panel
-			   for any commands that we send.
-- qcom,mdss-dsi-force-clock-lane-hs:	Boolean to force dsi clock lanes to HS mode always.
-
-- qcom,compression-mode:		Select compression mode for panel.
-					"fbc" - frame buffer compression
-					"dsc" - display stream compression.
-					If "dsc" compression is used then config subnodes needs to be defined.
-- qcom,panel-supply-entries:		A node that lists the elements of the supply used to
-					power the DSI panel. There can be more than one instance
-					of this binding, in which case the entry would be appended
-					with the supply entry index. For a detailed description of
-					fields in the supply entry, refer to the qcom,ctrl-supply-entries
-					binding above.
-- qcom,mdss-dsc-version:		An 8 bit value indicates the DSC version supported by panel. Bits[0.3]
-					provides information about minor version while Bits[4.7] provides
-					major version information. It supports only DSC rev 1(Major).1(Minor)
-					right now.
-- qcom,mdss-dsc-scr-version:		Each DSC version can have multiple SCR. This 8 bit value indicates
-					current SCR revision information supported by panel.
-- qcom,mdss-dsc-encoders:		An integer value indicating how many DSC encoders should be used
-					to drive data stream to DSI.
-					Default value is 1 and max value is 2.
-					2 encoder should be used only if qcom,mdss-lm-split or
-					qcom,split-mode with pingpong-split is used.
-- qcom,mdss-dsc-slice-height:		An integer value indicates the dsc slice height.
-- qcom,mdss-dsc-slice-width:		An integer value indicates the dsc slice width.
-					Multiple of slice width should be equal to panel-width.
-					Maximum 2 slices per DSC encoder can be used so if 2 DSC encoders
-					are used then minimum slice width is equal to panel-width/4.
-- qcom,mdss-dsc-slice-per-pkt:		An integer value indicates the slice per dsi packet.
-- qcom,mdss-dsc-bit-per-component: 	An integer value indicates the bits per component before compression.
-- qcom,mdss-dsc-bit-per-pixel:		An integer value indicates the bits per pixel after compression.
-- qcom,mdss-dsc-block-prediction-enable: A boolean value to enable/disable the block prediction at decoder.
-- qcom,mdss-dsc-config-by-manufacture-cmd: A boolean to indicates panel use manufacture command to setup pps
-					instead of standard dcs type 0x0A.
-- qcom,display-topology:  		Array of u32 values which specifies the	list of topologies available
-					for the display. A display topology is defined by a
-					set of 3 values in the order:
-					- number of mixers
-					- number of compression encoders
-					- number of interfaces
-					Therefore, the array should always contain a tuple of 3 elements.
-- qcom,default-topology-index:          An u32 value which indexes the topology set
-					specified by the node "qcom,display-topology"
-					to identify the default topology for the
-					display. The first set is indexed by the
-					value 0.
-
-Required properties for sub-nodes:	None
-Optional properties:
-- qcom,dba-panel:	Indicates whether the current panel is used as a display bridge
-					to a non-DSI interface.
-- qcom,bridge-name:			A string to indicate the name of the bridge chip connected to DSI. qcom,bridge-name
-					is required if qcom,dba-panel is defined for the panel.
-- qcom,adjust-timer-wakeup-ms:		An integer value to indicate the timer delay(in ms) to accommodate
-					s/w delay while configuring the event timer wakeup logic.
-
-- qcom,mdss-dsi-display-timings:	Parent node that lists the different resolutions that the panel supports.
-					Each child represents timings settings for a specific resolution.
-- qcom,mdss-dsi-post-init-delay:        Specifies required number of frames to wait so that panel can be functional
-					to show proper display.
-
-Additional properties added to the second level nodes that represent timings properties:
-- qcom,mdss-dsi-timing-default:		Property that specifies the current child as the default
-					timing configuration that will be used.
-- qcom,mdss-dsi-timing-switch-command:	List of commands that need to be sent
-					to panel when the resolution/timing switch happens dynamically.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,mdss-dsi-timing-switch-command-state:	String that specifies the ctrl state for sending resolution switch
-					commands.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-
-Note, if a given optional qcom,* binding is not present, then the driver will configure
-the default values specified.
-
-Example:
-&mdss_mdp {
-	dsi_sim_vid: qcom,mdss_dsi_sim_video {
-		qcom,mdss-dsi-panel-name = "simulator video mode dsi panel";
-		qcom,mdss-dsi-panel-controller = <&mdss_dsi0>;
-		qcom,mdss-dsi-panel-height = <1280>;
-		qcom,mdss-dsi-panel-width = <720>;
-		qcom,mdss-dsi-bpp = <24>;
-		qcom,mdss-dsi-pixel-packing = <0>;
-		qcom,mdss-dsi-panel-destination = "display_1";
-		qcom,cmd-sync-wait-broadcast;
-		qcom,mdss-dsi-fbc-enable;
-		qcom,mdss-dsi-fbc-slice-height = <5>;
-		qcom,mdss-dsi-fbc-2d-pred-mode;
-		qcom,mdss-dsi-fbc-ver2-mode;
-		qcom,mdss-dsi-fbc-bpp = <0>;
-		qcom,mdss-dsi-fbc-packing = <0>;
-		qcom,mdss-dsi-fbc-quant-error;
-		qcom,mdss-dsi-fbc-bias = <0>;
-		qcom,mdss-dsi-fbc-pat-mode;
-		qcom,mdss-dsi-fbc-vlc-mode;
-		qcom,mdss-dsi-fbc-bflc-mode;
-		qcom,mdss-dsi-fbc-h-line-budget = <0>;
-		qcom,mdss-dsi-fbc-budget-ctrl = <0>;
-		qcom,mdss-dsi-fbc-block-budget = <0>;
-		qcom,mdss-dsi-fbc-lossless-threshold = <0>;
-		qcom,mdss-dsi-fbc-lossy-threshold = <0>;
-		qcom,mdss-dsi-fbc-rgb-threshold = <0>;
-		qcom,mdss-dsi-fbc-lossy-mode-idx = <0>;
-		qcom,mdss-dsi-fbc-max-pred-err = <2>;
-		qcom,mdss-dsi-h-front-porch = <140>;
-		qcom,mdss-dsi-h-back-porch = <164>;
-		qcom,mdss-dsi-h-pulse-width = <8>;
-		qcom,mdss-dsi-h-sync-skew = <0>;
-		qcom,mdss-dsi-v-back-porch = <6>;
-		qcom,mdss-dsi-v-front-porch = <1>;
-		qcom,mdss-dsi-v-pulse-width = <1>;
-		qcom,mdss-dsi-h-left-border = <0>;
-		qcom,mdss-dsi-h-right-border = <0>;
-		qcom,mdss-dsi-v-top-border = <0>;
-		qcom,mdss-dsi-v-bottom-border = <0>;
-		qcom,mdss-dsi-border-color = <0>;
-		qcom,mdss-dsi-underflow-color = <0xff>;
-		qcom,mdss-dsi-bl-min-level = <1>;
-		qcom,mdss-dsi-bl-max-level = < 15>;
-		qcom,mdss-brightness-max-level = <255>;
-		qcom,mdss-dsi-interleave-mode = <0>;
-		qcom,mdss-dsi-panel-type = "dsi_video_mode";
-		qcom,mdss-dsi-te-check-enable;
-		qcom,mdss-dsi-te-using-wd;
-		qcom,mdss-dsi-te-using-te-pin;
-		qcom,mdss-dsi-te-dcs-command = <1>;
-		qcom,mdss-dsi-wr-mem-continue = <0x3c>;
-		qcom,mdss-dsi-wr-mem-start = <0x2c>;
-		qcom,mdss-dsi-te-pin-select = <1>;
-		qcom,mdss-dsi-h-sync-pulse = <1>;
-		qcom,mdss-dsi-hfp-power-mode;
-		qcom,mdss-dsi-hbp-power-mode;
-		qcom,mdss-dsi-hsa-power-mode;
-		qcom,mdss-dsi-bllp-eof-power-mode;
-		qcom,mdss-dsi-bllp-power-mode;
-		qcom,mdss-dsi-last-line-interleave;
-		qcom,mdss-dsi-traffic-mode = <0>;
-		qcom,mdss-dsi-virtual-channel-id = <0>;
-		qcom,mdss-dsi-color-order = <0>;
-		qcom,mdss-dsi-lane-0-state;
-		qcom,mdss-dsi-lane-1-state;
-		qcom,mdss-dsi-lane-2-state;
-		qcom,mdss-dsi-lane-3-state;
-		qcom,mdss-dsi-t-clk-post = <0x20>;
-		qcom,mdss-dsi-t-clk-pre = <0x2c>;
-		qcom,mdss-dsi-stream = <0>;
-		qcom,mdss-dsi-mdp-trigger = <0>;
-		qcom,mdss-dsi-dma-trigger = <0>;
-		qcom,mdss-dsi-panel-framerate = <60>;
-		qcom,mdss-dsi-panel-clockrate = <424000000>;
-		qcom,mdss-mdp-transfer-time-us = <12500>;
-		qcom,mdss-dsi-panel-timings = [7d 25 1d 00 37 33
-					22 27 1e 03 04 00];
-                qcom,mdss-dsi-panel-timings-8996 = [23 20 06 09 05 03 04 a0
-                                23 20 06 09 05 03 04 a0
-                                23 20 06 09 05 03 04 a0
-                                23 20 06 09 05 03 04 a0
-                                23 2e 06 08 05 03 04 a0];
-		qcom,mdss-dsi-on-command = [32 01 00 00 00 00 02 00 00
-					29 01 00 00 10 00 02 FF 99];
-		qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
-		qcom,mdss-dsi-off-command = [22 01 00 00 00 00 00];
-		qcom,mdss-dsi-off-command-state = "dsi_hs_mode";
-		qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_wled";
-		qcom,mdss-dsi-pan-enable-dynamic-fps;
-		qcom,mdss-dsi-pan-fps-update = "dfps_suspend_resume_mode";
-		qcom,min-refresh-rate = <30>;
-		qcom,max-refresh-rate = <60>;
-		qcom,mdss-dsi-bl-pmic-bank-select = <0>;
-		qcom,mdss-dsi-bl-pmic-pwm-frequency = <0>;
-		qcom,mdss-dsi-pwm-gpio = <&pm8941_mpps 5 0>;
-		qcom,5v-boost-gpio = <&pm8994_gpios 14 0>;
-		qcom,mdss-pan-physical-width-dimension = <60>;
-		qcom,mdss-pan-physical-height-dimension = <140>;
-		qcom,mdss-dsi-mode-sel-gpio-state = "dsc_mode";
-		qcom,mdss-tear-check-sync-cfg-height = <0xfff0>;
-		qcom,mdss-tear-check-sync-init-val = <1280>;
-		qcom,mdss-tear-check-sync-threshold-start = <4>;
-		qcom,mdss-tear-check-sync-threshold-continue = <4>;
-		qcom,mdss-tear-check-start-pos = <1280>;
-		qcom,mdss-tear-check-rd-ptr-trigger-intr = <1281>;
-		qcom,mdss-tear-check-frame-rate = <6000>;
-		qcom,mdss-dsi-reset-sequence = <1 2>, <0 10>, <1 10>;
-		qcom,partial-update-enabled = "single_roi";
-		qcom,dcs-cmd-by-left;
-		qcom,mdss-dsi-lp11-init;
-		qcom,mdss-dsi-init-delay-us = <100>;
-		mdss-dsi-rx-eot-ignore;
-		mdss-dsi-tx-eot-append;
-		qcom,ulps-enabled;
-		qcom,suspend-ulps-enabled;
-		qcom,panel-roi-alignment = <4 4 2 2 20 20>;
-		qcom,esd-check-enabled;
-		qcom,mdss-dsi-panel-status-command = [06 01 00 01 05 00 02 0A 08];
-		qcom,mdss-dsi-panel-status-command-state = "dsi_lp_mode";
-		qcom,mdss-dsi-panel-status-check-mode = "reg_read";
-		qcom,mdss-dsi-panel-status-read-length = <8>;
-		qcom,mdss-dsi-panel-max-error-count = <3>;
-		qcom,mdss-dsi-panel-status-value = <0x1c 0x00 0x05 0x02 0x40 0x84 0x06 0x01>;
-		qcom,dynamic-mode-switch-enabled;
-		qcom,dynamic-mode-switch-type = "dynamic-switch-immediate";
-		qcom,mdss-dsi-post-mode-switch-on-command = [32 01 00 00 00 00 02 00 00
-					29 01 00 00 10 00 02 B0 03];
-		qcom,video-to-cmd-mode-switch-commands = [15 01 00 00 00 00 02 C2 0B
-						15 01 00 00 00 00 02 C2 08];
-		qcom,cmd-to-video-mode-switch-commands = [15 01 00 00 00 00 02 C2 03];
-		qcom,send-pps-before-switch;
-		qcom,panel-ack-disabled;
-		qcom,mdss-dsi-horizontal-line-idle = <0 40 256>,
-						<40 120 128>,
-						<128 240 64>;
-		qcom,mdss-dsi-panel-orientation = "180"
-		qcom,mdss-dsi-panel-jitter = <0x8 0x10>;
-		qcom,mdss-dsi-panel-prefill-lines = <0x10>;
-		qcom,mdss-dsi-force-clock-lane-hs;
-		qcom,compression-mode = "dsc";
-		qcom,adjust-timer-wakeup-ms = <1>;
-		qcom,mdss-dsi-display-timings {
-			wqhd {
-				qcom,mdss-dsi-timing-default;
-				qcom,mdss-dsi-panel-width = <720>;
-				qcom,mdss-dsi-panel-height = <2560>;
-				qcom,mdss-dsi-h-front-porch = <20>;
-				qcom,mdss-dsi-h-back-porch = <8>;
-				qcom,mdss-dsi-h-pulse-width = <8>;
-				qcom,mdss-dsi-h-sync-skew = <0>;
-				qcom,mdss-dsi-v-back-porch = <4>;
-				qcom,mdss-dsi-v-front-porch = <728>;
-				qcom,mdss-dsi-v-pulse-width = <4>;
-				qcom,mdss-dsi-panel-framerate = <60>;
-				qcom,mdss-dsi-panel-timings = [E6 38 26 00 68 6E 2A 3C 2C 03 04 00];
-				qcom,mdss-dsi-t-clk-post = <0x02>;
-				qcom,mdss-dsi-t-clk-pre = <0x2a>;
-				qcom,mdss-dsi-on-command = [05 01 00 00 a0 00 02 11 00
-					05 01 00 00 02 00 02 29 00];
-				qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
-				qcom,mdss-dsi-timing-switch-command = [
-					29 00 00 00 00 00 02 B0 04
-					29 00 00 00 00 00 02 F1 00];
-				qcom,mdss-dsi-timing-switch-command-state = "dsi_lp_mode";
-
-				qcom,mdss-dsc-slice-height = <16>;
-				qcom,mdss-dsc-slice-width = <360>;
-				qcom,mdss-dsc-slice-per-pkt = <2>;
-				qcom,mdss-dsc-bit-per-component = <8>;
-				qcom,mdss-dsc-bit-per-pixel = <8>;
-				qcom,mdss-dsc-block-prediction-enable;
-				qcom,mdss-dsc-config-by-manufacture-cmd;
-				qcom,display-topology = <1 1 1>;
-				qcom,default-topology-index = <0>;
-			};
-		};
-		qcom,panel-supply-entries {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			qcom,panel-supply-entry@0 {
-				reg = <0>;
-				qcom,supply-name = "vdd";
-				qcom,supply-min-voltage = <2800000>;
-				qcom,supply-max-voltage = <2800000>;
-				qcom,supply-enable-load = <100000>;
-				qcom,supply-disable-load = <100>;
-				qcom,supply-pre-on-sleep = <0>;
-				qcom,supply-post-on-sleep = <0>;
-				qcom,supply-pre-off-sleep = <0>;
-				qcom,supply-post-off-sleep = <0>;
-			};
-
-			qcom,panel-supply-entry@1 {
-				reg = <1>;
-				qcom,supply-name = "vddio";
-				qcom,supply-min-voltage = <1800000>;
-				qcom,supply-max-voltage = <1800000>;
-				qcom,supply-enable-load = <100000>;
-				qcom,supply-disable-load = <100>;
-				qcom,supply-pre-on-sleep = <0>;
-				qcom,supply-post-on-sleep = <0>;
-				qcom,supply-pre-off-sleep = <0>;
-				qcom,supply-post-off-sleep = <0>;
-			};
-		};
-
-		qcom,dba-panel;
-		qcom,bridge-name = "adv7533";
-		qcom,mdss-dsc-version = <0x11>;
-		qcom,mdss-dsc-scr-version = <0x1>;
-		qcom,mdss-dsc-slice-height = <16>;
-		qcom,mdss-dsc-slice-width = <360>;
-		qcom,mdss-dsc-slice-per-pkt = <2>;
-		qcom,mdss-dsc-bit-per-component = <8>;
-		qcom,mdss-dsc-bit-per-pixel = <8>;
-		qcom,mdss-dsc-block-prediction-enable;
-		qcom,mdss-dsc-config-by-manufacture-cmd;
-		qcom,display-topology = <1 1 1>,
-			                <2 2 1>;
-		qcom,default-topology-index = <0>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
deleted file mode 100644
index 608b426..0000000
--- a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
+++ /dev/null
@@ -1,742 +0,0 @@
-Qualcomm mdss-dsi-panel
-
-mdss-dsi-panel is a dsi panel device which supports panels that
-are compatible with MIPI display serial interface specification.
-
-Required properties:
-- compatible:				This property applies to DSI V2 panels only.
-					This property should not be added for panels
-					that work based on version "V6.0"
-					DSI panels that are of different versions
-					are initialized by the drivers for dsi controller.
-					This property specifies the version
-					for DSI HW that this panel will work with
-					"qcom,dsi-panel-v2" = DSI V2.0
-- status:        			This property applies to DSI V2 panels only.
-					This property should not be added for panels
-					that work based on version "V6.0"
-					DSI panels that are of different versions
-					are initialized by the drivers for dsi controller.
-					A string that has to be set to "okay/ok"
-					to enable the panel driver. By default this property
-					will be set to "disable". Will be set to "ok/okay"
-					status for specific platforms.
-- qcom,mdss-dsi-panel-controller:	Specifies the phandle for the DSI controller that
-					this panel will be mapped to.
-- qcom,mdss-dsi-panel-width:		Specifies panel width in pixels.
-- qcom,mdss-dsi-panel-height:		Specifies panel height in pixels.
-- qcom,mdss-dsi-bpp:			Specifies the panel bits per pixel.
-					3  = for rgb111
-					8  = for rgb332
-					12 = for rgb444
-					16 = for rgb565
-					18 = for rgb666
-					24 = for rgb888
-- qcom,mdss-dsi-panel-destination:	A string that specifies the destination display for the panel.
-					"display_1" = DISPLAY_1
-					"display_2" = DISPLAY_2
-- qcom,mdss-dsi-panel-timings:		An array of length 12 that specifies the PHY
-					timing settings for the panel.
-- qcom,mdss-dsi-panel-timings-8996:		An array of length 40 char that specifies the 8996 PHY lane
-					timing settings for the panel.
-- qcom,mdss-dsi-on-command:		A byte stream formed by multiple dcs packets base on
-					qcom dsi controller protocol.
-					byte 0: dcs data type
-					byte 1: set to indicate this is an individual packet
-						 (no chain)
-					byte 2: virtual channel number
-					byte 3: expect ack from client (dcs read command)
-					byte 4: wait number of specified ms after dcs command
-						 transmitted
-					byte 5, 6: 16 bits length in network byte order
-					byte 7 and beyond: number byte of payload
-- qcom,mdss-dsi-off-command:		A byte stream formed by multiple dcs packets base on
-					qcom dsi controller protocol.
-					byte 0: dcs data type
-					byte 1: set to indicate this is an individual packet
-						 (no chain)
-					byte 2: virtual channel number
-					byte 3: expect ack from client (dcs read command)
-					byte 4: wait number of specified ms after dcs command
-						 transmitted
-					byte 5, 6: 16 bits length in network byte order
-					byte 7 and beyond: number byte of payload
-- qcom,mdss-dsi-post-panel-on-command:	same as "qcom,mdss-dsi-on-command" except commands are
-					sent after displaying an image.
-
-Note, if a short DCS packet(i.e packet with Byte 0:dcs data type as 05) mentioned in
-qcom,mdss-dsi-on-command/qcom,mdss-dsi-off-command stream fails to transmit,
-then 3 options can be tried.
-	1. Send the packet as a long packet instead
-				Byte 0: dcs data type = 05 (DCS short Packet)
-				Byte 0: dcs data type = 29 (DCS long Packet)
-	2. Send the packet in one burst by prepending with the next packet in packet stream
-				Byte 1 = 01 (indicates this is an individual packet)
-				Byte 1 = 00 (indicates this will be appended to the next
-					     individual packet in the packet stream)
-	3. Prepend a NULL packet to the short packet and send both in one burst instead of
-	   combining multiple short packets and sending them in one burst.
-
-Optional properties:
-- qcom,mdss-dsi-panel-name:		A string used as a descriptive name of the panel
-- qcom,cmd-sync-wait-broadcast:		Boolean used to broadcast dcs command to panels.
-- qcom,mdss-dsi-fbc-enable:		Boolean used to enable frame buffer compression mode.
-- qcom,mdss-dsi-fbc-slice-height:	Slice height(in lines) of compressed block.
-					Expressed as power of 2. To set as 128 lines,
-					this should be set to 7.
-- qcom,mdss-dsi-fbc-2d-pred-mode:	Boolean to enable 2D map prediction.
-- qcom,mdss-dsi-fbc-ver2-mode:		Boolean to enable FBC 2.0 that supports 1/3
-					compression.
-- qcom,mdss-dsi-fbc-bpp:		Compressed bpp supported by the panel.
-					Specified color order is used as default value.
-- qcom,mdss-dsi-fbc-packing:		Component packing.
-					0 = default value.
-- qcom,mdss-dsi-fbc-quant-error:	Boolean used to enable quantization error calculation.
-- qcom,mdss-dsi-fbc-bias:		Bias for CD.
-					0 = default value.
-- qcom,mdss-dsi-fbc-pat-mode:		Boolean used to enable PAT mode.
-- qcom,mdss-dsi-fbc-vlc-mode:		Boolean used to enable VLC mode.
-- qcom,mdss-dsi-fbc-bflc-mode:		Boolean used to enable BFLC mode.
-- qcom,mdss-dsi-fbc-h-line-budget:	Per line extra budget.
-					0 = default value.
-- qcom,mdss-dsi-fbc-budget-ctrl:		Extra budget level.
-					0 = default value.
-- qcom,mdss-dsi-fbc-block-budget:		Per block budget.
-					0 = default value.
-- qcom,mdss-dsi-fbc-lossless-threshold: Lossless mode threshold.
-					0 = default value.
-- qcom,mdss-dsi-fbc-lossy-threshold:	Lossy mode threshold.
-					0 = default value.
-- qcom,mdss-dsi-fbc-rgb-threshold:	Lossy RGB threshold.
-					0 = default value.
-- qcom,mdss-dsi-fbc-lossy-mode-idx:	Lossy mode index value.
-					0 = default value.
-- qcom,mdss-dsi-fbc-max-pred-err:	Max quantization prediction error.
-					0 = default value
-- qcom,mdss-dsi-h-back-porch:		Horizontal back porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-h-front-porch:		Horizontal front porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-h-pulse-width:		Horizontal pulse width.
-					2 = default value.
-- qcom,mdss-dsi-h-sync-skew:		Horizontal sync skew value.
-					0 = default value.
-- qcom,mdss-dsi-v-back-porch:		Vertical back porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-v-front-porch:		Vertical front porch value in pixel.
-					6 = default value.
-- qcom,mdss-dsi-v-pulse-width:		Vertical pulse width.
-					2 = default value.
-- qcom,mdss-dsi-h-left-border:		Horizontal left border in pixel.
-					0 = default value
-- qcom,mdss-dsi-h-right-border:		Horizontal right border in pixel.
-					0 = default value
-- qcom,mdss-dsi-v-top-border:		Vertical top border in pixel.
-					0 = default value
-- qcom,mdss-dsi-v-bottom-border:	Vertical bottom border in pixel.
-					0 = default value
-- qcom,mdss-dsi-underflow-color:	Specifies the controller settings for the
-					panel under flow color.
-					0xff = default value.
-- qcom,mdss-dsi-border-color:		Defines the border color value if border is present.
-					0 = default value.
-- qcom,mdss-dsi-pan-enable-dynamic-fps:	Boolean used to enable change in frame rate dynamically.
-- qcom,mdss-dsi-pan-fps-update:		A string that specifies when to change the frame rate.
-					"dfps_suspend_resume_mode"= FPS change request is
-					implemented during suspend/resume.
-					"dfps_immediate_clk_mode" = FPS change request is
-					implemented immediately using DSI clocks.
-					"dfps_immediate_porch_mode_hfp" = FPS change request is
-					implemented immediately by changing panel horizontal
-					front porch values.
-					"dfps_immediate_porch_mode_vfp" = FPS change request is
-					implemented immediately by changing panel vertical
-					front porch values.
-- qcom,min-refresh-rate:		Minimum refresh rate supported by the panel.
-- qcom,max-refresh-rate:		Maximum refresh rate supported by the panel. If max refresh
-					rate is not specified, then the frame rate of the panel in
-					qcom,mdss-dsi-panel-framerate is used.
-- qcom,mdss-dsi-bl-pmic-control-type:	A string that specifies the implementation of backlight
-					control for this panel.
-					"bl_ctrl_pwm" = Backlight controlled by PWM gpio.
-					"bl_ctrl_wled" = Backlight controlled by WLED.
-					"bl_ctrl_dcs" = Backlight controlled by DCS commands.
-					other: Unknown backlight control. (default)
-- qcom,mdss-dsi-bl-pwm-pmi:		Boolean to indicate that PWM control is through second pmic chip.
-- qcom,mdss-dsi-bl-pmic-bank-select:	LPG channel for backlight.
-					Required if blpmiccontroltype is PWM
-- qcom,mdss-dsi-bl-pmic-pwm-frequency:	PWM period in microseconds.
-					Required if blpmiccontroltype is PWM
-- qcom,mdss-dsi-pwm-gpio:		PMIC gpio binding to backlight.
-					Required if blpmiccontroltype is PWM
-- qcom,mdss-dsi-bl-min-level:		Specifies the min backlight level supported by the panel.
-					0 = default value.
-- qcom,mdss-dsi-bl-max-level:		Specifies the max backlight level supported by the panel.
-					255 = default value.
-- qcom,mdss-brightness-max-level:	Specifies the max brightness level supported.
-					255 = default value.
-- qcom,mdss-dsi-interleave-mode:	Specifies interleave mode.
-					0 = default value.
-- qcom,mdss-dsi-panel-type:		Specifies the panel operating mode.
-					"dsi_video_mode" = enable video mode (default).
-					"dsi_cmd_mode" = enable command mode.
-- qcom,5v-boost-gpio:			Specifies the panel gpio for display 5v boost.
-- qcom,mdss-dsi-te-check-enable:	Boolean to enable Tear Check configuration.
-- qcom,mdss-dsi-te-using-te-pin:	Boolean to specify whether using hardware vsync.
-- qcom,mdss-dsi-te-pin-select:		Specifies TE operating mode.
-					0 = TE through embedded dcs command
-					1 = TE through TE gpio pin. (default)
-- qcom,mdss-dsi-te-dcs-command:		Inserts the dcs command.
-					1 = default value.
-- qcom,mdss-dsi-wr-mem-start:		DCS command for write_memory_start.
-					0x2c = default value.
-- qcom,mdss-dsi-wr-mem-continue:	DCS command for write_memory_continue.
-					0x3c = default value.
-- qcom,mdss-dsi-h-sync-pulse:		Specifies the pulse mode option for the panel.
-					0 = Don't send hsa/he following vs/ve packet(default)
-					1 = Send hsa/he following vs/ve packet
-- qcom,mdss-dsi-hfp-power-mode:		Boolean to determine DSI lane state during
-					horizontal front porch (HFP) blanking period.
-- qcom,mdss-dsi-hbp-power-mode:		Boolean to determine DSI lane state during
-					horizontal back porch (HBP) blanking period.
-- qcom,mdss-dsi-hsa-power-mode:		Boolean to determine DSI lane state during
-					horizontal sync active (HSA) mode.
-- qcom,mdss-dsi-last-line-interleave	Boolean to determine if last line
-					interleave flag needs to be enabled.
-- qcom,mdss-dsi-bllp-eof-power-mode:	Boolean to determine DSI lane state during
-					blanking low power period (BLLP) EOF mode.
-- qcom,mdss-dsi-bllp-power-mode:	Boolean to determine DSI lane state during
-					blanking low power period (BLLP) mode.
-- qcom,mdss-dsi-traffic-mode:		Specifies the panel traffic mode.
-					"non_burst_sync_pulse" = non burst with sync pulses (default).
-					"non_burst_sync_event" = non burst with sync start event.
-					"burst_mode" = burst mode.
-- qcom,mdss-dsi-pixel-packing:		Specifies if pixel packing is used (in case of RGB666).
-					"tight" = Tight packing (default value).
-					"loose" = Loose packing.
-- qcom,mdss-dsi-virtual-channel-id:	Specifies the virtual channel identefier.
-					0 = default value.
-- qcom,mdss-dsi-color-order:		Specifies the R, G and B channel ordering.
-					"rgb_swap_rgb" = DSI_RGB_SWAP_RGB (default value)
-					"rgb_swap_rbg" = DSI_RGB_SWAP_RBG
-					"rgb_swap_brg" = DSI_RGB_SWAP_BRG
-					"rgb_swap_grb" = DSI_RGB_SWAP_GRB
-					"rgb_swap_gbr" = DSI_RGB_SWAP_GBR
-- qcom,mdss-dsi-lane-0-state:		Boolean that specifies whether data lane 0 is enabled.
-- qcom,mdss-dsi-lane-1-state:		Boolean that specifies whether data lane 1 is enabled.
-- qcom,mdss-dsi-lane-2-state:		Boolean that specifies whether data lane 2 is enabled.
-- qcom,mdss-dsi-lane-3-state:		Boolean that specifies whether data lane 3 is enabled.
-- qcom,mdss-dsi-t-clk-post:		Specifies the byte clock cycles after mode switch.
-					0x03 = default value.
-- qcom,mdss-dsi-t-clk-pre:		Specifies the byte clock cycles before mode switch.
-					0x24 = default value.
-- qcom,mdss-dsi-stream:			Specifies the packet stream to be used.
-					0 = stream 0 (default)
-					1 = stream 1
-- qcom,mdss-dsi-mdp-trigger:		Specifies the trigger mechanism to be used for MDP path.
-					"none" = no trigger
-					"trigger_te" = Tear check signal line used for trigger
-					"trigger_sw" = Triggered by software (default)
-					"trigger_sw_te" = Software trigger and TE
-- qcom,mdss-dsi-dma-trigger:		Specifies the trigger mechanism to be used for DMA path.
-					"none" = no trigger
-					"trigger_te" = Tear check signal line used for trigger
-					"trigger_sw" = Triggered by software (default)
-					"trigger_sw_seof" = Software trigger and start/end of frame trigger.
-					"trigger_sw_te" = Software trigger and TE
-- qcom,mdss-dsi-panel-framerate:	Specifies the frame rate for the panel.
-					60 = 60 frames per second (default)
-- qcom,mdss-dsi-panel-clockrate:	A 64 bit value specifies the panel clock speed in Hz.
-					0 = default value.
-- qcom,mdss-mdp-transfer-time-us:	Specifies the dsi transfer time for command mode
-					panels in microseconds. Driver uses this number to adjust
-					the clock rate according to the expected transfer time.
-					Increasing this value would slow down the mdp processing
-					and can result in slower performance.
-					Decreasing this value can speed up the mdp processing,
-					but this can also impact power consumption.
-					As a rule this time should not be higher than the time
-					that would be expected with the processing at the
-					dsi link rate since anyways this would be the maximum
-					transfer time that could be achieved.
-					If ping pong split enabled, this time should not be higher
-					than two times the dsi link rate time.
-					14000 = default value.
-- qcom,mdss-dsi-on-command-state:	String that specifies the ctrl state for sending ON commands.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-off-command-state:	String that specifies the ctrl state for sending OFF commands.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-post-mode-switch-on-command-state:	String that specifies the ctrl state for sending ON commands post mode switch.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-pan-physical-width-dimension:	Specifies panel physical width in mm which corresponds
-					to the physical width in the framebuffer information.
-- qcom,mdss-pan-physical-height-dimension:	Specifies panel physical height in mm which corresponds
-					to the physical height in the framebuffer information.
-- qcom,mdss-dsi-mode-sel-gpio-state:	String that specifies the lcd mode for panel
-					(such as single-port/dual-port), if qcom,panel-mode-gpio
-					binding is defined in dsi controller.
-					"dual_port" = Set GPIO to LOW
-					"single_port" = Set GPIO to HIGH
-					"high" = Set GPIO to HIGH
-					"low" = Set GPIO to LOW
-					The default value is "dual_port".
-- qcom,mdss-tear-check-disable:		Boolean to disable mdp tear check. Tear check is enabled by default to avoid
-					tearing. Other tear-check properties are ignored if this property is present.
-					The below tear check configuration properties can be individually tuned if
-					tear check is enabled.
-- qcom,mdss-tear-check-sync-cfg-height: Specifies the vertical total number of lines.
-					The default value is 0xfff0.
-- qcom,mdss-tear-check-sync-init-val:	Specifies the init value at which the read pointer gets loaded
-					at vsync edge. The reader pointer refers to the line number of
-					panel buffer that is currently being updated.
-					The default value is panel height.
-- qcom,mdss-tear-check-sync-threshold-start:
-					Allows the first ROI line write to an panel when read pointer is
-					between the range of ROI start line and ROI start line plus this
-					setting.
-					The default value is 4.
-- qcom,mdss-tear-check-sync-threshold-continue:
-					The minimum number of lines the write pointer needs to be
-					above the read pointer so that it is safe to write to the panel.
-					(This check is not done for the first ROI line write of an update)
-					The default value is 4.
-- qcom,mdss-tear-check-start-pos:	Specify the y position from which the start_threshold value is
-					added and write is kicked off if the read pointer falls within that
-					region.
-					The default value is panel height.
-- qcom,mdss-tear-check-rd-ptr-trigger-intr:
-					Specify the read pointer value at which an interrupt has to be
-					generated.
-					The default value is panel height + 1.
-- qcom,mdss-tear-check-frame-rate:	Specify the value to be a real frame rate(fps) x 100 factor to tune the
-					timing of TE simulation with more precision.
-					The default value is 6000 with 60 fps.
-- qcom,mdss-dsi-reset-sequence:		An array that lists the
-					sequence of reset gpio values and sleeps
-					Each command will have the format defined
-					as below:
-					--> Reset GPIO value
-					--> Sleep value (in ms)
-- qcom,partial-update-enabled:		Boolean used to enable partial
-					panel update for command mode panels.
-- qcom,mdss-dsi-horizontal-line-idle:	List of width ranges (EC - SC) in pixels indicating
-					additional idle time in dsi clock cycles that is needed
-					to compensate for smaller line width.
-- qcom,partial-update-roi-merge:	Boolean indicates roi combination is need
-					and function has been provided for dcs
-					2A/2B command.
-- qcom,dcs-cmd-by-left:			Boolean to indicate that dcs command are sent
-					through the left DSI controller only in a dual-dsi configuration
-- qcom,mdss-dsi-lp11-init:		Boolean used to enable the DSI clocks and data lanes (low power 11)
-					before issuing hardware reset line.
-- qcom,mdss-dsi-init-delay-us:		Delay in microseconds(us) before performing any DSI activity in lp11
-					mode. This master delay (t_init_delay as per DSI spec) should be sum
-					of DSI internal delay to reach fuctional after power up and minimum
-					delay required by panel to reach functional.
-- qcom,mdss-dsi-rx-eot-ignore:		Boolean used to enable ignoring end of transmission packets.
-- qcom,mdss-dsi-tx-eot-append:		Boolean used to enable appending end of transmission packets.
-- qcom,ulps-enabled:			Boolean to enable support for Ultra Low Power State (ULPS) mode.
-- qcom,suspend-ulps-enabled:		Boolean to enable support for ULPS mode for panels during suspend state.
-- qcom,panel-roi-alignment:		Specifies the panel ROI alignment restrictions on its
-					left, top, width, height alignments and minimum width and
-					height values
-- qcom,esd-check-enabled:		Boolean used to enable ESD recovery feature.
-- qcom,mdss-dsi-panel-status-command:	A byte stream formed by multiple dcs packets based on
-					qcom dsi controller protocol, to read the panel status.
-					This value is used to kick in the ESD recovery.
-					byte 0: dcs data type
-					byte 1: set to indicate this is an individual packet
-						 (no chain)
-					byte 2: virtual channel number
-					byte 3: expect ack from client (dcs read command)
-					byte 4: wait number of specified ms after dcs command
-						 transmitted
-					byte 5, 6: 16 bits length in network byte order
-					byte 7 and beyond: number byte of payload
-- qcom,mdss-dsi-panel-status-command-mode:
-					String that specifies the ctrl state for reading the panel status.
-					"dsi_lp_mode" = DSI low power mode
-					"dsi_hs_mode" = DSI high speed mode
-- qcom,mdss-dsi-panel-status-check-mode:Specifies the panel status check method for ESD recovery.
-					"bta_check" = Uses BTA to check the panel status
-					"reg_read" = Reads panel status register to check the panel status
-					"reg_read_nt35596" = Reads panel status register to check the panel
-							     status for NT35596 panel.
-					"te_signal_check" = Uses TE signal behaviour to check the panel status
-- qcom,mdss-dsi-panel-status-read-length: Integer array that specify the expected read-back length of values
-					  for each of panel registers. Each length is corresponding to number of
-					  returned parameters of register introduced in specification.
-- qcom,mdss-dsi-panel-status-valid-params: Integer array that specify the valid returned values which need to check
-					   for each of register.
-					   Some panel need only check the first few values returned from panel.
-					   So: if this property is the same to qcom,mdss-dsi-panel-status-read-length,
-					   then just ignore this one.
-- qcom,mdss-dsi-panel-status-value:	Multiple integer arrays, each specifies the values of the panel status register
-					which is used to check the panel status. The size of each array is the sum of
-					length specified in qcom,mdss-dsi-panel-status-read-length, and must be equal.
-					This can cover that Some panel may return several alternative values.
-- qcom,mdss-dsi-panel-max-error-count:  Integer value that specifies the maximum number of errors from register
-					read that can be ignored before treating that the panel has gone bad.
-- qcom,dynamic-mode-switch-enabled:		Boolean used to mention whether panel supports
-					dynamic switching from video mode to command mode
-					and vice versa.
-- qcom,dynamic-mode-switch-type:		A string specifies how to perform dynamic mode switch.
-						If qcom,dynamic-mode-switch-enabled is set and no string specified, default value is
-						dynamic-switch-suspend-resume.
-					"dynamic-switch-suspend-resume"= Switch using suspend/resume. Panel will
-						go blank during transition.
-					"dynamic-switch-immediate"= Switch on next frame update. Panel will
-						not go blank for this transition.
-					"dynamic-resolution-switch-immediate"= Switch the panel resolution. Panel will
-						not go blank for this transition.
-- qcom,mdss-dsi-post-mode-switch-on-command:		Multiple dcs packets used for turning on DSI panel
-					after panel has switch modes.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,video-to-cmd-mode-switch-commands:	List of commands that need to be sent
-					to panel in order to switch from video mode to command mode dynamically.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,cmd-to-video-mode-switch-commands:	List of commands that need to be sent
-					to panel in order to switch from command mode to video mode dynamically.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,send-pps-before-switch:		Boolean propety to indicate when PPS commands should be sent,
-					either before or after switch commands during dynamic resolution
-					switch in DSC panels. If the property is not present, the default
-					behavior is to send PPS commands after the switch commands.
-- qcom,mdss-dsi-panel-orientation:	String used to indicate orientation of panel
-					"180" = panel is flipped in both horizontal and vertical directions
-					"hflip" = panel is flipped in horizontal direction
-					"vflip" = panel is flipped in vertical direction
-- qcom,panel-ack-disabled: A boolean property to indicate, whether we need to wait for any ACK from the panel
-			   for any commands that we send.
-- qcom,mdss-dsi-force-clock-lane-hs:	Boolean to force dsi clock lanes to HS mode always.
-
-- qcom,compression-mode:		Select compression mode for panel.
-					"fbc" - frame buffer compression
-					"dsc" - display stream compression.
-					If "dsc" compression is used then config subnodes needs to be defined.
-- qcom,panel-supply-entries:		A node that lists the elements of the supply used to
-					power the DSI panel. There can be more than one instance
-					of this binding, in which case the entry would be appended
-					with the supply entry index. For a detailed description of
-					fields in the supply entry, refer to the qcom,ctrl-supply-entries
-					binding above.
-- qcom,config-select:			Optional property to select default configuration.
-
-[[Optional config sub-nodes]]		These subnodes provide different configurations for a given same panel.
-					Default configuration can be chosen by specifying phandle of the
-					selected subnode in the qcom,config-select.
-Required properties for sub-nodes:	None
-Optional properites:
-- qcom,lm-split:			An array of two values indicating MDP should use two layer
-					mixers to reduce power.
-					Ex: Normally 1080x1920 display uses single DSI and thus one layer
-					    mixer. But if we use two layer mixers then mux the output of
-					    those two mixers into single stream and route it to single DSI
-					    then we can lower the clock requirements of MDP. To use this
-					    configuration we need two fill this array with <540 540>.
-					Both values doesn't have to be same, but recommended, however sum of
-					both values has to be equal to the panel-width.
-					By default two mixer streams are merged using 2D mux, however if
-					2 DSC encoders are used then merge is performed within compression
-					engine.
-- qcom,split-mode:			String property indicating which split mode MDP should use. Valid
-					entries are "pingpong-split" and "dualctl-split".
-					This property is mutually exclusive with qcom,lm-split.
-- qcom,mdss-dsc-version:		An 8 bit value indicates the DSC version supported by panel. Bits[0.3]
-					provides information about minor version while Bits[4.7] provides
-					major version information. It supports only DSC rev 1(Major).1(Minor)
-					right now.
-- qcom,mdss-dsc-scr-version:		Each DSC version can have multiple SCR. This 8 bit value indicates
-					current SCR revision information supported by panel.
-- qcom,mdss-dsc-encoders:		An integer value indicating how many DSC encoders should be used
-					to drive data stream to DSI.
-					Default value is 1 and max value is 2.
-					2 encoder should be used only if qcom,mdss-lm-split or
-					qcom,split-mode with pingpong-split is used.
-- qcom,mdss-dsc-slice-height:		An integer value indicates the dsc slice height.
-- qcom,mdss-dsc-slice-width:		An integer value indicates the dsc slice width.
-					Multiple of slice width should be equal to panel-width.
-					Maximum 2 slices per DSC encoder can be used so if 2 DSC encoders
-					are used then minimum slice width is equal to panel-width/4.
-- qcom,mdss-dsc-slice-per-pkt:		An integer value indicates the slice per dsi packet.
-- qcom,mdss-dsc-bit-per-component: 	An integer value indicates the bits per component before compression.
-- qcom,mdss-dsc-bit-per-pixel:		An integer value indicates the bits per pixel after compression.
-- qcom,mdss-dsc-block-prediction-enable: A boolean value to enable/disable the block prediction at decoder.
-- qcom,mdss-dsc-config-by-manufacture-cmd: A boolean to indicates panel use manufacture command to setup pps
-					instead of standard dcs type 0x0A.
-- qcom,dba-panel:	Indicates whether the current panel is used as a display bridge
-					to a non-DSI interface.
-- qcom,bridge-name:			A string to indicate the name of the bridge chip connected to DSI. qcom,bridge-name
-					is required if qcom,dba-panel is defined for the panel.
-- qcom,adjust-timer-wakeup-ms:		An integer value to indicate the timer delay(in ms) to accommodate
-					s/w delay while configuring the event timer wakeup logic.
-
-- qcom,mdss-dsi-display-timings:	Parent node that lists the different resolutions that the panel supports.
-					Each child represents timings settings for a specific resolution.
-- qcom,mdss-dsi-post-init-delay:        Specifies required number of frames to wait so that panel can be functional
-					to show proper display.
-
-Additional properties added to the second level nodes that represent timings properties:
-- qcom,mdss-dsi-timing-default:		Property that specifies the current child as the default
-					timing configuration that will be used.
-- qcom,mdss-dsi-timing-switch-command:	List of commands that need to be sent
-					to panel when the resolution/timing switch happens dynamically.
-					Refer to "qcom,mdss-dsi-on-command" section for adding commands.
-- qcom,mdss-dsi-timing-switch-command-state:	String that specifies the ctrl state for sending resolution switch
-					commands.
-					"dsi_lp_mode" = DSI low power mode (default)
-					"dsi_hs_mode" = DSI high speed mode
-
-Note, if a given optional qcom,* binding is not present, then the driver will configure
-the default values specified.
-
-Example:
-&mdss_mdp {
-	dsi_sim_vid: qcom,mdss_dsi_sim_video {
-		qcom,mdss-dsi-panel-name = "simulator video mode dsi panel";
-		qcom,mdss-dsi-panel-controller = <&mdss_dsi0>;
-		qcom,mdss-dsi-panel-height = <1280>;
-		qcom,mdss-dsi-panel-width = <720>;
-		qcom,mdss-dsi-bpp = <24>;
-		qcom,mdss-dsi-pixel-packing = <0>;
-		qcom,mdss-dsi-panel-destination = "display_1";
-		qcom,cmd-sync-wait-broadcast;
-		qcom,mdss-dsi-fbc-enable;
-		qcom,mdss-dsi-fbc-slice-height = <5>;
-		qcom,mdss-dsi-fbc-2d-pred-mode;
-		qcom,mdss-dsi-fbc-ver2-mode;
-		qcom,mdss-dsi-fbc-bpp = <0>;
-		qcom,mdss-dsi-fbc-packing = <0>;
-		qcom,mdss-dsi-fbc-quant-error;
-		qcom,mdss-dsi-fbc-bias = <0>;
-		qcom,mdss-dsi-fbc-pat-mode;
-		qcom,mdss-dsi-fbc-vlc-mode;
-		qcom,mdss-dsi-fbc-bflc-mode;
-		qcom,mdss-dsi-fbc-h-line-budget = <0>;
-		qcom,mdss-dsi-fbc-budget-ctrl = <0>;
-		qcom,mdss-dsi-fbc-block-budget = <0>;
-		qcom,mdss-dsi-fbc-lossless-threshold = <0>;
-		qcom,mdss-dsi-fbc-lossy-threshold = <0>;
-		qcom,mdss-dsi-fbc-rgb-threshold = <0>;
-		qcom,mdss-dsi-fbc-lossy-mode-idx = <0>;
-		qcom,mdss-dsi-fbc-max-pred-err = <2>;
-		qcom,mdss-dsi-h-front-porch = <140>;
-		qcom,mdss-dsi-h-back-porch = <164>;
-		qcom,mdss-dsi-h-pulse-width = <8>;
-		qcom,mdss-dsi-h-sync-skew = <0>;
-		qcom,mdss-dsi-v-back-porch = <6>;
-		qcom,mdss-dsi-v-front-porch = <1>;
-		qcom,mdss-dsi-v-pulse-width = <1>;
-		qcom,mdss-dsi-h-left-border = <0>;
-		qcom,mdss-dsi-h-right-border = <0>;
-		qcom,mdss-dsi-v-top-border = <0>;
-		qcom,mdss-dsi-v-bottom-border = <0>;
-		qcom,mdss-dsi-border-color = <0>;
-		qcom,mdss-dsi-underflow-color = <0xff>;
-		qcom,mdss-dsi-bl-min-level = <1>;
-		qcom,mdss-dsi-bl-max-level = < 15>;
-		qcom,mdss-brightness-max-level = <255>;
-		qcom,mdss-dsi-interleave-mode = <0>;
-		qcom,mdss-dsi-panel-type = "dsi_video_mode";
-		qcom,mdss-dsi-te-check-enable;
-		qcom,mdss-dsi-te-using-te-pin;
-		qcom,mdss-dsi-te-dcs-command = <1>;
-		qcom,mdss-dsi-wr-mem-continue = <0x3c>;
-		qcom,mdss-dsi-wr-mem-start = <0x2c>;
-		qcom,mdss-dsi-te-pin-select = <1>;
-		qcom,mdss-dsi-h-sync-pulse = <1>;
-		qcom,mdss-dsi-hfp-power-mode;
-		qcom,mdss-dsi-hbp-power-mode;
-		qcom,mdss-dsi-hsa-power-mode;
-		qcom,mdss-dsi-bllp-eof-power-mode;
-		qcom,mdss-dsi-bllp-power-mode;
-		qcom,mdss-dsi-last-line-interleave;
-		qcom,mdss-dsi-traffic-mode = <0>;
-		qcom,mdss-dsi-virtual-channel-id = <0>;
-		qcom,mdss-dsi-color-order = <0>;
-		qcom,mdss-dsi-lane-0-state;
-		qcom,mdss-dsi-lane-1-state;
-		qcom,mdss-dsi-lane-2-state;
-		qcom,mdss-dsi-lane-3-state;
-		qcom,mdss-dsi-t-clk-post = <0x20>;
-		qcom,mdss-dsi-t-clk-pre = <0x2c>;
-		qcom,mdss-dsi-stream = <0>;
-		qcom,mdss-dsi-mdp-trigger = <0>;
-		qcom,mdss-dsi-dma-trigger = <0>;
-		qcom,mdss-dsi-panel-framerate = <60>;
-		qcom,mdss-dsi-panel-clockrate = <424000000>;
-		qcom,mdss-mdp-transfer-time-us = <12500>;
-		qcom,mdss-dsi-panel-timings = [7d 25 1d 00 37 33
-					22 27 1e 03 04 00];
-                qcom,mdss-dsi-panel-timings-8996 = [23 20 06 09 05 03 04 a0
-                                23 20 06 09 05 03 04 a0
-                                23 20 06 09 05 03 04 a0
-                                23 20 06 09 05 03 04 a0
-                                23 2e 06 08 05 03 04 a0];
-		qcom,mdss-dsi-on-command = [32 01 00 00 00 00 02 00 00
-					29 01 00 00 10 00 02 FF 99];
-		qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
-		qcom,mdss-dsi-off-command = [22 01 00 00 00 00 00];
-		qcom,mdss-dsi-off-command-state = "dsi_hs_mode";
-		qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_wled";
-		qcom,mdss-dsi-pan-enable-dynamic-fps;
-		qcom,mdss-dsi-pan-fps-update = "dfps_suspend_resume_mode";
-		qcom,min-refresh-rate = <30>;
-		qcom,max-refresh-rate = <60>;
-		qcom,mdss-dsi-bl-pmic-bank-select = <0>;
-		qcom,mdss-dsi-bl-pmic-pwm-frequency = <0>;
-		qcom,mdss-dsi-pwm-gpio = <&pm8941_mpps 5 0>;
-		qcom,5v-boost-gpio = <&pm8994_gpios 14 0>;
-		qcom,mdss-pan-physical-width-dimension = <60>;
-		qcom,mdss-pan-physical-height-dimension = <140>;
-		qcom,mdss-dsi-mode-sel-gpio-state = "dsc_mode";
-		qcom,mdss-tear-check-sync-cfg-height = <0xfff0>;
-		qcom,mdss-tear-check-sync-init-val = <1280>;
-		qcom,mdss-tear-check-sync-threshold-start = <4>;
-		qcom,mdss-tear-check-sync-threshold-continue = <4>;
-		qcom,mdss-tear-check-start-pos = <1280>;
-		qcom,mdss-tear-check-rd-ptr-trigger-intr = <1281>;
-		qcom,mdss-tear-check-frame-rate = <6000>;
-		qcom,mdss-dsi-reset-sequence = <1 2>, <0 10>, <1 10>;
-		qcom,partial-update-enabled;
-		qcom,dcs-cmd-by-left;
-		qcom,mdss-dsi-lp11-init;
-		qcom,mdss-dsi-init-delay-us = <100>;
-		mdss-dsi-rx-eot-ignore;
-		mdss-dsi-tx-eot-append;
-		qcom,ulps-enabled;
-		qcom,suspend-ulps-enabled;
-		qcom,panel-roi-alignment = <4 4 2 2 20 20>;
-		qcom,esd-check-enabled;
-		qcom,mdss-dsi-panel-status-command = [06 01 00 01 05 00 02 0A 08];
-		qcom,mdss-dsi-panel-status-command-state = "dsi_lp_mode";
-		qcom,mdss-dsi-panel-status-check-mode = "reg_read";
-		qcom,mdss-dsi-panel-status-read-length = <8>;
-		qcom,mdss-dsi-panel-max-error-count = <3>;
-		qcom,mdss-dsi-panel-status-value = <0x1c 0x00 0x05 0x02 0x40 0x84 0x06 0x01>;
-		qcom,dynamic-mode-switch-enabled;
-		qcom,dynamic-mode-switch-type = "dynamic-switch-immediate";
-		qcom,mdss-dsi-post-mode-switch-on-command = [32 01 00 00 00 00 02 00 00
-					29 01 00 00 10 00 02 B0 03];
-		qcom,video-to-cmd-mode-switch-commands = [15 01 00 00 00 00 02 C2 0B
-						15 01 00 00 00 00 02 C2 08];
-		qcom,cmd-to-video-mode-switch-commands = [15 01 00 00 00 00 02 C2 03];
-		qcom,send-pps-before-switch;
-		qcom,panel-ack-disabled;
-		qcom,mdss-dsi-horizontal-line-idle = <0 40 256>,
-						<40 120 128>,
-						<128 240 64>;
-		qcom,mdss-dsi-panel-orientation = "180"
-		qcom,mdss-dsi-force-clock-lane-hs;
-		qcom,compression-mode = "dsc";
-		qcom,adjust-timer-wakeup-ms = <1>;
-		qcom,mdss-dsi-display-timings {
-			wqhd {
-				qcom,mdss-dsi-timing-default;
-				qcom,mdss-dsi-panel-width = <720>;
-				qcom,mdss-dsi-panel-height = <2560>;
-				qcom,mdss-dsi-h-front-porch = <20>;
-				qcom,mdss-dsi-h-back-porch = <8>;
-				qcom,mdss-dsi-h-pulse-width = <8>;
-				qcom,mdss-dsi-h-sync-skew = <0>;
-				qcom,mdss-dsi-v-back-porch = <4>;
-				qcom,mdss-dsi-v-front-porch = <728>;
-				qcom,mdss-dsi-v-pulse-width = <4>;
-				qcom,mdss-dsi-panel-framerate = <60>;
-				qcom,mdss-dsi-panel-timings = [E6 38 26 00 68 6E 2A 3C 2C 03 04 00];
-				qcom,mdss-dsi-t-clk-post = <0x02>;
-				qcom,mdss-dsi-t-clk-pre = <0x2a>;
-				qcom,mdss-dsi-on-command = [05 01 00 00 a0 00 02 11 00
-					05 01 00 00 02 00 02 29 00];
-				qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
-				qcom,mdss-dsi-timing-switch-command = [
-					29 00 00 00 00 00 02 B0 04
-					29 00 00 00 00 00 02 F1 00];
-				qcom,mdss-dsi-timing-switch-command-state = "dsi_lp_mode";
-
-				qcom,config-select = <&dsi_sim_vid_config0>;
-				dsi_sim_vid_config0: config0 {
-					qcom,lm-split = <360 360>;
-					qcom,mdss-dsc-encoders = <2>;
-					qcom,mdss-dsc-slice-height = <16>;
-					qcom,mdss-dsc-slice-width = <360>;
-					qcom,mdss-dsc-slice-per-pkt = <2>;
-					qcom,mdss-dsc-bit-per-component = <8>;
-					qcom,mdss-dsc-bit-per-pixel = <8>;
-					qcom,mdss-dsc-block-prediction-enable;
-					qcom,mdss-dsc-config-by-manufacture-cmd;
-				};
-			};
-		};
-		qcom,panel-supply-entries {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			qcom,panel-supply-entry@0 {
-				reg = <0>;
-				qcom,supply-name = "vdd";
-				qcom,supply-min-voltage = <2800000>;
-				qcom,supply-max-voltage = <2800000>;
-				qcom,supply-enable-load = <100000>;
-				qcom,supply-disable-load = <100>;
-				qcom,supply-pre-on-sleep = <0>;
-				qcom,supply-post-on-sleep = <0>;
-				qcom,supply-pre-off-sleep = <0>;
-				qcom,supply-post-off-sleep = <0>;
-			};
-
-			qcom,panel-supply-entry@1 {
-				reg = <1>;
-				qcom,supply-name = "vddio";
-				qcom,supply-min-voltage = <1800000>;
-				qcom,supply-max-voltage = <1800000>;
-				qcom,supply-enable-load = <100000>;
-				qcom,supply-disable-load = <100>;
-				qcom,supply-pre-on-sleep = <0>;
-				qcom,supply-post-on-sleep = <0>;
-				qcom,supply-pre-off-sleep = <0>;
-				qcom,supply-post-off-sleep = <0>;
-			};
-		};
-
-		qcom,config-select = <&dsi_sim_vid_config0>;
-		qcom,dba-panel;
-		qcom,bridge-name = "adv7533";
-		qcom,mdss-dsc-version = <0x11>;
-		qcom,mdss-dsc-scr-version = <0x1>;
-
-		dsi_sim_vid_config0: config0 {
-			qcom,lm-split = <360 360>;
-			qcom,mdss-dsc-encoders = <2>;
-			qcom,mdss-dsc-slice-height = <16>;
-			qcom,mdss-dsc-slice-width = <360>;
-			qcom,mdss-dsc-slice-per-pkt = <2>;
-			qcom,mdss-dsc-bit-per-component = <8>;
-			qcom,mdss-dsc-bit-per-pixel = <8>;
-			qcom,mdss-dsc-block-prediction-enable;
-			qcom,mdss-dsc-config-by-manufacture-cmd;
-		};
-
-		dsi_sim_vid_config1: config1 {
-			qcom,mdss-dsc-encoders = <1>;
-			qcom,mdss-dsc-slice-height = <16>;
-			qcom,mdss-dsc-slice-width = <360>;
-			qcom,mdss-dsc-slice-per-pkt = <2>;
-			qcom,mdss-dsc-bit-per-component = <8>;
-			qcom,mdss-dsc-bit-per-pixel = <8>;
-			qcom,mdss-dsc-block-prediction-enable;
-			qcom,mdss-dsc-config-by-manufacture-cmd;
-		};
-
-		dsi_sim_vid_config2: config2 {
-			qcom,split-mode = "dualctl-split";
-		};
-
-		dsi_sim_vid_config3: config3 {
-			qcom,split-mode = "pingpong-split";
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/fb/mdss-pll.txt b/Documentation/devicetree/bindings/fb/mdss-pll.txt
deleted file mode 100644
index 59fa6a0..0000000
--- a/Documentation/devicetree/bindings/fb/mdss-pll.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-Qualcomm Technologies MDSS pll for DSI/EDP/HDMI
-
-mdss-pll is a pll controller device which supports pll devices that
-are compatible with MIPI display serial interface specification,
-HDMI and edp.
-
-Required properties:
-- compatible:		Compatible name used in the driver
-                        "qcom,mdss_dsi_pll_8916", "qcom,mdss_dsi_pll_8939",
-                        "qcom,mdss_dsi_pll_8974", "qcom,mdss_dsi_pll_8994",
-                        "qcom,mdss_dsi_pll_8994", "qcom,mdss_dsi_pll_8909",
-                        "qcom,mdss_hdmi_pll", "qcom,mdss_hdmi_pll_8994",
-                        "qcom,mdss_dsi_pll_8992", "qcom,mdss_hdmi_pll_8992",
-                        "qcom,mdss_dsi_pll_8996", "qcom,mdss_hdmi_pll_8996",
-                        "qcom,mdss_hdmi_pll_8996_v2", "qcom,mdss_dsi_pll_8996_v2",
-                        "qcom,mdss_hdmi_pll_8996_v3", "qcom,mdss_hdmi_pll_8996_v3_1p8",
-                        "qcom,mdss_edp_pll_8996_v3", "qcom,mdss_edp_pll_8996_v3_1p8",
-                        "qcom,mdss_dsi_pll_10nm", "qcom,mdss_dp_pll_8998",
-                        "qcom,mdss_hdmi_pll_8998", "qcom,mdss_dp_pll_10nm".
-- cell-index:		Specifies the controller used
-- reg:			offset and length of the register set for the device.
-- reg-names :		names to refer to register sets related to this device
-- gdsc-supply:		Phandle for gdsc regulator device node.
-- vddio-supply:		Phandle for vddio regulator device node.
-- clocks:		List of Phandles for clock device nodes
-			needed by the device.
-- clock-names:		List of clock names needed by the device.
-- clock-rate:		List of clock rates in Hz.
-
-Optional properties:
-- label:	       	A string used to describe the driver used.
-- vcca-supply:		Phandle for vcca regulator device node.
-
-
-- qcom,dsi-pll-ssc-en:	Boolean property to indicate that ssc is enabled.
-- qcom,dsi-pll-ssc-mode: Spread-spectrum clocking. It can be either "down-spread"
-			or "center-spread". Default is "down-spread" if it is not specified.
-- qcom,ssc-frequency-hz:	Integer property to specify the spread frequency
-			to be programmed for the SSC.
-- qcom,ssc-ppm:		Integer property to specify the Parts per Million
-			value of SSC.
-
-- qcom,platform-supply-entries:	A node that lists the elements of the supply. There
-				can be more than one instance of this binding,
-				in which case the entry would be appended with
-				the supply entry index.
-				e.g. qcom,platform-supply-entry@0
-				- reg: offset and length of the register set for the device.
-				-- qcom,supply-name: name of the supply (vdd/vdda/vddio)
-				-- qcom,supply-min-voltage: minimum voltage level (uV)
-				-- qcom,supply-max-voltage: maximum voltage level (uV)
-				-- qcom,supply-enable-load: load drawn (uA) from enabled supply
-				-- qcom,supply-disable-load: load drawn (uA) from disabled supply
-				-- qcom,supply-pre-on-sleep: time to sleep (ms) before turning on
-				-- qcom,supply-post-on-sleep: time to sleep (ms) after turning on
-				-- qcom,supply-pre-off-sleep: time to sleep (ms) before turning off
-				-- qcom,supply-post-off-sleep: time to sleep (ms) after turning off
-
-Example:
-	mdss_dsi0_pll: qcom,mdss_dsi_pll@fd922A00 {
-		compatible = "qcom,mdss_dsi_pll_8974";
-		label = "MDSS DSI 0 PLL";
-		cell-index = <0>;
-
-		reg = <0xfd922A00 0xD4>,
-		      <0xfd922900 0x64>,
-		      <0xfd8c2300 0x8>;
-		reg-names = "pll_base", "dynamic_pll_base", "gdsc_base";
-		gdsc-supply = <&gdsc_mdss>;
-		vddio-supply = <&pm8941_l12>;
-		vcca-supply = <&pm8941_l28>;
-
-		clocks = <&clock_gcc clk_gcc_mdss_mdp_clk>,
-			 <&clock_gcc clk_gcc_mdss_ahb_clk>,
-			 <&clock_gcc clk_gcc_mdss_axi_clk>;
-		clock-names = "mdp_core_clk", "iface_clk", "bus_clk";
-		clock-rate = <0>, <0>, <0>;
-
-		qcom,dsi-pll-slave;
-		qcom,dsi-pll-ssc-en;
-		qcom,dsi-pll-ssc-mode = "down-spread";
-		qcom,ssc-frequency-hz = <30000>;
-		qcom,ssc-ppm = <5000>;
-
-		qcom,platform-supply-entries {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			qcom,platform-supply-entry@0 {
-				reg = <0>;
-				qcom,supply-name = "vddio";
-				qcom,supply-min-voltage = <1800000>;
-				qcom,supply-max-voltage = <1800000>;
-				qcom,supply-enable-load = <100000>;
-				qcom,supply-disable-load = <100>;
-				qcom,supply-pre-on-sleep = <0>;
-				qcom,supply-post-on-sleep = <20>;
-				qcom,supply-pre-off-sleep = <0>;
-				qcom,supply-post-off-sleep = <0>;
-			};
-		};
-	};
-
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 02/11] dt-bindings: msm/disp: remove unused display port bindings
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  2018-05-30 14:49   ` [DPU PATCH 01/11] dt-bindings: msm/disp: remove unused dsi & panel bindings Rajesh Yadav
@ 2018-05-30 14:49   ` Rajesh Yadav
  2018-05-30 14:49   ` [DPU PATCH 03/11] Revert "drm/msm: Add DisplayPort support" Rajesh Yadav
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

DPU display port driver is not enabled yet so
removing the bindings. The driver code is also
reverted. The bindings will be added back when
display port driver is reworked and enabled for
sdm845.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 .../devicetree/bindings/drm/msm/dpu-dp.txt         | 217 ---------------------
 1 file changed, 217 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/dpu-dp.txt

diff --git a/Documentation/devicetree/bindings/drm/msm/dpu-dp.txt b/Documentation/devicetree/bindings/drm/msm/dpu-dp.txt
deleted file mode 100644
index 1ed2715..0000000
--- a/Documentation/devicetree/bindings/drm/msm/dpu-dp.txt
+++ /dev/null
@@ -1,217 +0,0 @@
-Qualcomm Technologies, Inc.
-dpu-dp is the master Display Port device which supports DP host controllers that are compatible with VESA Display Port interface specification.
-DP Controller: Required properties:
-- compatible:           Should be "qcom,dp-display".
-- reg:                  Base address and length of DP hardware's memory mapped regions.
-- reg-names:            A list of strings that name the list of regs. "dp_ctrl" - DP controller memory region.
-			"dp_phy" - DP PHY memory region.
-			"dp_ln_tx0" - USB3 DP PHY combo TX-0 lane memory region.
-			"dp_ln_tx1" - USB3 DP PHY combo TX-1 lane memory region.
-			"dp_mmss_cc" - Display Clock Control memory region.
-			"qfprom_physical" - QFPROM Phys memory region.
-			"dp_pll" - USB3 DP combo PLL memory region.
-			"usb3_dp_com" - USB3 DP PHY combo memory region.
-			"hdcp_physical" - DP HDCP memory region.
-- cell-index:           Specifies the controller instance.
-- clocks:               Clocks required for Display Port operation.
-- clock-names:          Names of the clocks corresponding to handles. Following clocks are required:
-			"core_aux_clk", "core_usb_ref_clk_src","core_usb_ref_clk", "core_usb_cfg_ahb_clk",
-			"core_usb_pipe_clk", "ctrl_link_clk", "ctrl_link_iface_clk", "ctrl_crypto_clk",
-			"ctrl_pixel_clk", "pixel_clk_rcg", "pixel_parent".
-- gdsc-supply:		phandle to gdsc regulator node.
-- vdda-1p2-supply:		phandle to vdda 1.2V regulator node.
-- vdda-0p9-supply:		phandle to vdda 0.9V regulator node.
-- interrupt-parent	phandle to the interrupt parent device node.
-- interrupts:		The interrupt signal from the DSI block.
-- qcom,aux-en-gpio:			Specifies the aux-channel enable gpio.
-- qcom,aux-sel-gpio:		Specifies the aux-channel select gpio.
-- qcom,usbplug-cc-gpio:		Specifies the usbplug orientation gpio.
-- qcom,aux-cfg0-settings:		Specifies the DP AUX configuration 0 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg1-settings:		Specifies the DP AUX configuration 1 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg2-settings:		Specifies the DP AUX configuration 2 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg3-settings:		Specifies the DP AUX configuration 3 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg4-settings:		Specifies the DP AUX configuration 4 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg5-settings:		Specifies the DP AUX configuration 5 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg6-settings:		Specifies the DP AUX configuration 6 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg7-settings:		Specifies the DP AUX configuration 7 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg8-settings:		Specifies the DP AUX configuration 8 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,aux-cfg9-settings:		Specifies the DP AUX configuration 9 settings. The first
-					entry in this array corresponds to the register offset
-					within DP AUX, while the remaining entries indicate the
-					programmable values.
-- qcom,max-pclk-frequency-khz:	An integer specifying the max. pixel clock in KHz supported by Display Port.
-- qcom,dp-usbpd-detection:	Phandle for the PMI regulator node for USB PHY PD detection.
-- qcom,<type>-supply-entries:		A node that lists the elements of the supply used by the a particular "type" of DSI module. The module "types"
-					can be "core", "ctrl", and "phy". Within the same type,
-					there can be more than one instance of this binding,
-					in which case the entry would be appended with the
-					supply entry index.
-					e.g. qcom,ctrl-supply-entry@0
-					-- qcom,supply-name: name of the supply (vdd/vdda/vddio)
-					-- qcom,supply-min-voltage: minimum voltage level (uV)
-					-- qcom,supply-max-voltage: maximum voltage level (uV)
-					-- qcom,supply-enable-load: load drawn (uA) from enabled supply
-					-- qcom,supply-disable-load: load drawn (uA) from disabled supply
-					-- qcom,supply-pre-on-sleep: time to sleep (ms) before turning on
-					-- qcom,supply-post-on-sleep: time to sleep (ms) after turning on
-					-- qcom,supply-pre-off-sleep: time to sleep (ms) before turning off
-					-- qcom,supply-post-off-sleep: time to sleep (ms) after turning off
-- pinctrl-names:	List of names to assign mdss pin states defined in pinctrl device node
-					Refer to pinctrl-bindings.txt
-- pinctrl-<0..n>:	Lists phandles each pointing to the pin configuration node within a pin
-					controller. These pin configurations are installed in the pinctrl
-					device node. Refer to pinctrl-bindings.txt
-
-msm_ext_disp is a device which manages the interaction between external
-display interfaces, e.g. Display Port, and the audio subsystem.
-
-Optional properties:
-- qcom,ext-disp:		phandle for msm-ext-display module
-- compatible:			Must be "qcom,msm-ext-disp"
-
-[Optional child nodes]: These nodes are for devices which are
-dependent on msm_ext_disp. If msm_ext_disp is disabled then
-these devices will be disabled as well. Ex. Audio Codec device.
-
-- ext_disp_audio_codec: Node for Audio Codec.
-- compatible : "qcom,msm-ext-disp-audio-codec-rx";
-
-Example:
-	ext_disp: qcom,msm-ext-disp {
-		compatible = "qcom,msm-ext-disp";
-		ext_disp_audio_codec: qcom,msm-ext-disp-audio-codec-rx {
-			compatible = "qcom,msm-ext-disp-audio-codec-rx";
-		};
-	};
-
-	dpu_dp: qcom,dp_display@0{
-		cell-index = <0>;
-		compatible = "qcom,dp-display";
-
-		gdsc-supply = <&mdss_core_gdsc>;
-		vdda-1p2-supply = <&pm8998_l26>;
-		vdda-0p9-supply = <&pm8998_l1>;
-
-		reg =	<0xae90000 0xa84>,
-			<0x88eaa00 0x200>,
-			<0x88ea200 0x200>,
-			<0x88ea600 0x200>,
-			<0xaf02000 0x1a0>,
-			<0x780000 0x621c>,
-			<0x88ea030 0x10>,
-			<0x88e8000 0x621c>,
-			<0x0aee1000 0x034>;
-		reg-names = "dp_ctrl", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
-			"dp_mmss_cc", "qfprom_physical", "dp_pll",
-			"usb3_dp_com", "hdcp_physical";
-
-		interrupt-parent = <&mdss_mdp>;
-		interrupts = <12 0>;
-
-		clocks =  <&clock_dispcc DISP_CC_MDSS_DP_AUX_CLK>,
-			 <&clock_rpmh RPMH_CXO_CLK>,
-			 <&clock_gcc GCC_USB3_PRIM_CLKREF_CLK>,
-			 <&clock_gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
-			 <&clock_gcc GCC_USB3_PRIM_PHY_PIPE_CLK>,
-			 <&clock_dispcc DISP_CC_MDSS_DP_LINK_CLK>,
-			 <&clock_dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
-			 <&clock_dispcc DISP_CC_MDSS_DP_CRYPTO_CLK>,
-			 <&clock_dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
-			 <&clock_dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>,
-			 <&mdss_dp_pll DP_VCO_DIVIDED_CLK_SRC_MUX>;
-		clock-names = "core_aux_clk", "core_usb_ref_clk_src",
-			"core_usb_ref_clk", "core_usb_cfg_ahb_clk",
-			"core_usb_pipe_clk", "ctrl_link_clk",
-			"ctrl_link_iface_clk", "ctrl_crypto_clk",
-			"ctrl_pixel_clk", "pixel_clk_rcg", "pixel_parent";
-
-		qcom,dp-usbpd-detection = <&pmi8998_pdphy>;
-		qcom,ext-disp = <&ext_disp>;
-
-		qcom,aux-cfg0-settings = [1c 00];
-		qcom,aux-cfg1-settings = [20 13 23 1d];
-		qcom,aux-cfg2-settings = [24 00];
-		qcom,aux-cfg3-settings = [28 00];
-		qcom,aux-cfg4-settings = [2c 0a];
-		qcom,aux-cfg5-settings = [30 26];
-		qcom,aux-cfg6-settings = [34 0a];
-		qcom,aux-cfg7-settings = [38 03];
-		qcom,aux-cfg8-settings = [3c bb];
-		qcom,aux-cfg9-settings = [40 03];
-		qcom,max-pclk-frequency-khz = <593470>;
-		pinctrl-names = "mdss_dp_active", "mdss_dp_sleep";
-		pinctrl-0 = <&dpu_dp_aux_active &dpu_dp_usbplug_cc_active>;
-		pinctrl-1 = <&dpu_dp_aux_suspend &dpu_dp_usbplug_cc_suspend>;
-		qcom,aux-en-gpio = <&tlmm 43 0>;
-		qcom,aux-sel-gpio = <&tlmm 51 0>;
-		qcom,usbplug-cc-gpio = <&tlmm 38 0>;
-		qcom,core-supply-entries {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			qcom,core-supply-entry@0 {
-				reg = <0>;
-				qcom,supply-name = "gdsc";
-				qcom,supply-min-voltage = <0>;
-				qcom,supply-max-voltage = <0>;
-				qcom,supply-enable-load = <0>;
-				qcom,supply-disable-load = <0>;
-			};
-		};
-
-		qcom,ctrl-supply-entries {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			qcom,ctrl-supply-entry@0 {
-				reg = <0>;
-				qcom,supply-name = "vdda-1p2";
-				qcom,supply-min-voltage = <1200000>;
-				qcom,supply-max-voltage = <1200000>;
-				qcom,supply-enable-load = <21800>;
-				qcom,supply-disable-load = <4>;
-			};
-		};
-
-		qcom,phy-supply-entries {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			qcom,phy-supply-entry@0 {
-				reg = <0>;
-				qcom,supply-name = "vdda-0p9";
-				qcom,supply-min-voltage = <880000>;
-				qcom,supply-max-voltage = <880000>;
-				qcom,supply-enable-load = <36000>;
-				qcom,supply-disable-load = <32>;
-			};
-		};
-	};
-};
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 03/11] Revert "drm/msm: Add DisplayPort support"
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  2018-05-30 14:49   ` [DPU PATCH 01/11] dt-bindings: msm/disp: remove unused dsi & panel bindings Rajesh Yadav
  2018-05-30 14:49   ` [DPU PATCH 02/11] dt-bindings: msm/disp: remove unused display port bindings Rajesh Yadav
@ 2018-05-30 14:49   ` Rajesh Yadav
  2018-05-30 14:49   ` [DPU PATCH 04/11] dt-bindings: msm/disp: remove unused writeback bindings Rajesh Yadav
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

DPU display port driver is not enabled yet so
reverting the driver patch.
It will be added back when the driver is reworked
and enabled for sdm845 SoC.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 drivers/gpu/drm/msm/Makefile        |   14 -
 drivers/gpu/drm/msm/dp/dp_audio.c   |  806 ------------------
 drivers/gpu/drm/msm/dp/dp_audio.h   |   81 --
 drivers/gpu/drm/msm/dp/dp_aux.c     |  570 -------------
 drivers/gpu/drm/msm/dp/dp_aux.h     |   44 -
 drivers/gpu/drm/msm/dp/dp_catalog.c | 1320 -----------------------------
 drivers/gpu/drm/msm/dp/dp_catalog.h |  163 ----
 drivers/gpu/drm/msm/dp/dp_ctrl.c    | 1474 ---------------------------------
 drivers/gpu/drm/msm/dp/dp_ctrl.h    |   50 --
 drivers/gpu/drm/msm/dp/dp_debug.c   |  503 ------------
 drivers/gpu/drm/msm/dp/dp_debug.h   |   60 --
 drivers/gpu/drm/msm/dp/dp_display.c | 1255 ----------------------------
 drivers/gpu/drm/msm/dp/dp_display.h |   52 --
 drivers/gpu/drm/msm/dp/dp_drm.c     |  538 ------------
 drivers/gpu/drm/msm/dp/dp_drm.h     |   96 ---
 drivers/gpu/drm/msm/dp/dp_hdcp2p2.c |  927 ---------------------
 drivers/gpu/drm/msm/dp/dp_link.c    | 1548 -----------------------------------
 drivers/gpu/drm/msm/dp/dp_link.h    |  184 -----
 drivers/gpu/drm/msm/dp/dp_panel.c   |  526 ------------
 drivers/gpu/drm/msm/dp/dp_panel.h   |  115 ---
 drivers/gpu/drm/msm/dp/dp_parser.c  |  645 ---------------
 drivers/gpu/drm/msm/dp/dp_parser.h  |  200 -----
 drivers/gpu/drm/msm/dp/dp_power.c   |  593 --------------
 drivers/gpu/drm/msm/dp/dp_power.h   |   56 --
 drivers/gpu/drm/msm/dp/dp_reg.h     |  231 ------
 drivers/gpu/drm/msm/dp/dp_usbpd.c   |  491 -----------
 drivers/gpu/drm/msm/dp/dp_usbpd.h   |  101 ---
 include/drm/drm_dp_helper.h         |   23 -
 28 files changed, 12666 deletions(-)
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_audio.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_audio.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_debug.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_debug.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_display.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_display.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_hdcp2p2.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_link.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_link.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_power.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_power.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_usbpd.c
 delete mode 100644 drivers/gpu/drm/msm/dp/dp_usbpd.h

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 93a0de5..7fc3974 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -99,20 +99,6 @@ msm-y := \
 
 msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o
 
-msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_usbpd.o \
-	dp/dp_parser.o \
-	dp/dp_power.o \
-	dp/dp_catalog.o \
-	dp/dp_aux.o \
-	dp/dp_panel.o \
-	dp/dp_link.o \
-	dp/dp_ctrl.o \
-	dp/dp_audio.o \
-	dp/dp_debug.o \
-	dp/dp_display.o \
-	dp/dp_drm.o \
-	dp/dp_hdcp2p2.o
-
 msm_wb-$(CONFIG_DRM_MSM_WRITEBACK) += disp/dpu1/dpu_wb.o \
 				      disp/dpu1/dpu_encoder_phys_wb.o
 
diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c
deleted file mode 100644
index ce00b8b..0000000
--- a/drivers/gpu/drm/msm/dp/dp_audio.c
+++ /dev/null
@@ -1,806 +0,0 @@
-/*
- * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/of_platform.h>
-#include <linux/msm_ext_display.h>
-
-#include <drm/drm_dp_helper.h>
-#include <drm/drm_edid.h>
-
-#include "dp_catalog.h"
-#include "dp_audio.h"
-#include "dp_panel.h"
-
-#define HEADER_BYTE_2_BIT	 0
-#define PARITY_BYTE_2_BIT	 8
-#define HEADER_BYTE_1_BIT	16
-#define PARITY_BYTE_1_BIT	24
-#define HEADER_BYTE_3_BIT	16
-#define PARITY_BYTE_3_BIT	24
-
-struct dp_audio_private {
-	struct platform_device *ext_pdev;
-	struct platform_device *pdev;
-	struct dp_catalog_audio *catalog;
-	struct msm_ext_disp_init_data ext_audio_data;
-	struct dp_panel *panel;
-
-	bool ack_enabled;
-	bool session_on;
-	bool engine_on;
-
-	u32 channels;
-
-	struct completion hpd_comp;
-
-	struct dp_audio dp_audio;
-};
-
-static u8 dp_audio_get_g0_value(u8 data)
-{
-	u8 c[4];
-	u8 g[4];
-	u8 ret_data = 0;
-	u8 i;
-
-	for (i = 0; i < 4; i++)
-		c[i] = (data >> i) & 0x01;
-
-	g[0] = c[3];
-	g[1] = c[0] ^ c[3];
-	g[2] = c[1];
-	g[3] = c[2];
-
-	for (i = 0; i < 4; i++)
-		ret_data = ((g[i] & 0x01) << i) | ret_data;
-
-	return ret_data;
-}
-
-static u8 dp_audio_get_g1_value(u8 data)
-{
-	u8 c[4];
-	u8 g[4];
-	u8 ret_data = 0;
-	u8 i;
-
-	for (i = 0; i < 4; i++)
-		c[i] = (data >> i) & 0x01;
-
-	g[0] = c[0] ^ c[3];
-	g[1] = c[0] ^ c[1] ^ c[3];
-	g[2] = c[1] ^ c[2];
-	g[3] = c[2] ^ c[3];
-
-	for (i = 0; i < 4; i++)
-		ret_data = ((g[i] & 0x01) << i) | ret_data;
-
-	return ret_data;
-}
-
-static u8 dp_audio_calculate_parity(u32 data)
-{
-	u8 x0 = 0;
-	u8 x1 = 0;
-	u8 ci = 0;
-	u8 iData = 0;
-	u8 i = 0;
-	u8 parity_byte;
-	u8 num_byte = (data & 0xFF00) > 0 ? 8 : 2;
-
-	for (i = 0; i < num_byte; i++) {
-		iData = (data >> i*4) & 0xF;
-
-		ci = iData ^ x1;
-		x1 = x0 ^ dp_audio_get_g1_value(ci);
-		x0 = dp_audio_get_g0_value(ci);
-	}
-
-	parity_byte = x1 | (x0 << 4);
-
-	return parity_byte;
-}
-
-static u32 dp_audio_get_header(struct dp_catalog_audio *catalog,
-		enum dp_catalog_audio_sdp_type sdp,
-		enum dp_catalog_audio_header_type header)
-{
-	catalog->sdp_type = sdp;
-	catalog->sdp_header = header;
-	catalog->get_header(catalog);
-
-	return catalog->data;
-}
-
-static void dp_audio_set_header(struct dp_catalog_audio *catalog,
-		u32 data,
-		enum dp_catalog_audio_sdp_type sdp,
-		enum dp_catalog_audio_header_type header)
-{
-	catalog->sdp_type = sdp;
-	catalog->sdp_header = header;
-	catalog->data = data;
-	catalog->set_header(catalog);
-}
-
-static void dp_audio_stream_sdp(struct dp_audio_private *audio)
-{
-	struct dp_catalog_audio *catalog = audio->catalog;
-	u32 value, new_value;
-	u8 parity_byte;
-
-	/* Config header and parity byte 1 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_STREAM, DP_AUDIO_SDP_HEADER_1);
-
-	new_value = 0x02;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_1_BIT)
-			| (parity_byte << PARITY_BYTE_1_BIT));
-	pr_debug("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_STREAM, DP_AUDIO_SDP_HEADER_1);
-
-	/* Config header and parity byte 2 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_STREAM, DP_AUDIO_SDP_HEADER_2);
-	new_value = value;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_2_BIT)
-			| (parity_byte << PARITY_BYTE_2_BIT));
-	pr_debug("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_STREAM, DP_AUDIO_SDP_HEADER_2);
-
-	/* Config header and parity byte 3 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_STREAM, DP_AUDIO_SDP_HEADER_3);
-
-	new_value = audio->channels - 1;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_3_BIT)
-			| (parity_byte << PARITY_BYTE_3_BIT));
-	pr_debug("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n",
-		value, parity_byte);
-
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_STREAM, DP_AUDIO_SDP_HEADER_3);
-}
-
-static void dp_audio_timestamp_sdp(struct dp_audio_private *audio)
-{
-	struct dp_catalog_audio *catalog = audio->catalog;
-	u32 value, new_value;
-	u8 parity_byte;
-
-	/* Config header and parity byte 1 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_TIMESTAMP, DP_AUDIO_SDP_HEADER_1);
-
-	new_value = 0x1;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_1_BIT)
-			| (parity_byte << PARITY_BYTE_1_BIT));
-	pr_debug("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n",
-		value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_TIMESTAMP, DP_AUDIO_SDP_HEADER_1);
-
-	/* Config header and parity byte 2 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_TIMESTAMP, DP_AUDIO_SDP_HEADER_2);
-
-	new_value = 0x17;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_2_BIT)
-			| (parity_byte << PARITY_BYTE_2_BIT));
-	pr_debug("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_TIMESTAMP, DP_AUDIO_SDP_HEADER_2);
-
-	/* Config header and parity byte 3 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_TIMESTAMP, DP_AUDIO_SDP_HEADER_3);
-
-	new_value = (0x0 | (0x11 << 2));
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_3_BIT)
-			| (parity_byte << PARITY_BYTE_3_BIT));
-	pr_debug("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_TIMESTAMP, DP_AUDIO_SDP_HEADER_3);
-}
-
-static void dp_audio_infoframe_sdp(struct dp_audio_private *audio)
-{
-	struct dp_catalog_audio *catalog = audio->catalog;
-	u32 value, new_value;
-	u8 parity_byte;
-
-	/* Config header and parity byte 1 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_INFOFRAME, DP_AUDIO_SDP_HEADER_1);
-
-	new_value = 0x84;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_1_BIT)
-			| (parity_byte << PARITY_BYTE_1_BIT));
-	pr_debug("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_INFOFRAME, DP_AUDIO_SDP_HEADER_1);
-
-	/* Config header and parity byte 2 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_INFOFRAME, DP_AUDIO_SDP_HEADER_2);
-
-	new_value = 0x1b;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_2_BIT)
-			| (parity_byte << PARITY_BYTE_2_BIT));
-	pr_debug("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_INFOFRAME, DP_AUDIO_SDP_HEADER_2);
-
-	/* Config header and parity byte 3 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_INFOFRAME, DP_AUDIO_SDP_HEADER_3);
-
-	new_value = (0x0 | (0x11 << 2));
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_3_BIT)
-			| (parity_byte << PARITY_BYTE_3_BIT));
-	pr_debug("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n",
-			new_value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_INFOFRAME, DP_AUDIO_SDP_HEADER_3);
-}
-
-static void dp_audio_copy_management_sdp(struct dp_audio_private *audio)
-{
-	struct dp_catalog_audio *catalog = audio->catalog;
-	u32 value, new_value;
-	u8 parity_byte;
-
-	/* Config header and parity byte 1 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_COPYMANAGEMENT, DP_AUDIO_SDP_HEADER_1);
-
-	new_value = 0x05;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_1_BIT)
-			| (parity_byte << PARITY_BYTE_1_BIT));
-	pr_debug("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_COPYMANAGEMENT, DP_AUDIO_SDP_HEADER_1);
-
-	/* Config header and parity byte 2 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_COPYMANAGEMENT, DP_AUDIO_SDP_HEADER_2);
-
-	new_value = 0x0F;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_2_BIT)
-			| (parity_byte << PARITY_BYTE_2_BIT));
-	pr_debug("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_COPYMANAGEMENT, DP_AUDIO_SDP_HEADER_2);
-
-	/* Config header and parity byte 3 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_COPYMANAGEMENT, DP_AUDIO_SDP_HEADER_3);
-
-	new_value = 0x0;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_3_BIT)
-			| (parity_byte << PARITY_BYTE_3_BIT));
-	pr_debug("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_COPYMANAGEMENT, DP_AUDIO_SDP_HEADER_3);
-}
-
-static void dp_audio_isrc_sdp(struct dp_audio_private *audio)
-{
-	struct dp_catalog_audio *catalog = audio->catalog;
-	u32 value, new_value;
-	u8 parity_byte;
-
-	/* Config header and parity byte 1 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_ISRC, DP_AUDIO_SDP_HEADER_1);
-
-	new_value = 0x06;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_1_BIT)
-			| (parity_byte << PARITY_BYTE_1_BIT));
-	pr_debug("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_ISRC, DP_AUDIO_SDP_HEADER_1);
-
-	/* Config header and parity byte 2 */
-	value = dp_audio_get_header(catalog,
-			DP_AUDIO_SDP_ISRC, DP_AUDIO_SDP_HEADER_2);
-
-	new_value = 0x0F;
-	parity_byte = dp_audio_calculate_parity(new_value);
-	value |= ((new_value << HEADER_BYTE_2_BIT)
-			| (parity_byte << PARITY_BYTE_2_BIT));
-	pr_debug("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n",
-			value, parity_byte);
-	dp_audio_set_header(catalog, value,
-		DP_AUDIO_SDP_ISRC, DP_AUDIO_SDP_HEADER_2);
-}
-
-static void dp_audio_setup_sdp(struct dp_audio_private *audio)
-{
-	audio->catalog->config_sdp(audio->catalog);
-
-	dp_audio_stream_sdp(audio);
-	dp_audio_timestamp_sdp(audio);
-	dp_audio_infoframe_sdp(audio);
-	dp_audio_copy_management_sdp(audio);
-	dp_audio_isrc_sdp(audio);
-}
-
-static void dp_audio_setup_acr(struct dp_audio_private *audio)
-{
-	u32 select = 0;
-	struct dp_catalog_audio *catalog = audio->catalog;
-
-	switch (audio->dp_audio.bw_code) {
-	case DP_LINK_BW_1_62:
-		select = 0;
-		break;
-	case DP_LINK_BW_2_7:
-		select = 1;
-		break;
-	case DP_LINK_BW_5_4:
-		select = 2;
-		break;
-	case DP_LINK_BW_8_1:
-		select = 3;
-		break;
-	default:
-		pr_debug("Unknown link rate\n");
-		select = 0;
-		break;
-	}
-
-	catalog->data = select;
-	catalog->config_acr(catalog);
-}
-
-static void dp_audio_safe_to_exit_level(struct dp_audio_private *audio)
-{
-	struct dp_catalog_audio *catalog = audio->catalog;
-	u32 safe_to_exit_level = 0;
-
-	switch (audio->dp_audio.lane_count) {
-	case 1:
-		safe_to_exit_level = 14;
-		break;
-	case 2:
-		safe_to_exit_level = 8;
-		break;
-	case 4:
-		safe_to_exit_level = 5;
-		break;
-	default:
-		pr_debug("setting the default safe_to_exit_level = %u\n",
-				safe_to_exit_level);
-		safe_to_exit_level = 14;
-		break;
-	}
-
-	catalog->data = safe_to_exit_level;
-	catalog->safe_to_exit_level(catalog);
-}
-
-static void dp_audio_enable(struct dp_audio_private *audio, bool enable)
-{
-	struct dp_catalog_audio *catalog = audio->catalog;
-
-	catalog->data = enable;
-	catalog->enable(catalog);
-
-	audio->engine_on = enable;
-}
-
-static struct dp_audio_private *get_audio_get_data(struct platform_device *pdev)
-{
-	struct msm_ext_disp_data *ext_data;
-	struct dp_audio *dp_audio;
-
-	if (!pdev) {
-		pr_err("invalid input\n");
-		return ERR_PTR(-ENODEV);
-	}
-
-	ext_data = platform_get_drvdata(pdev);
-	if (!ext_data) {
-		pr_err("invalid ext disp data\n");
-		return ERR_PTR(-EINVAL);
-	}
-
-	dp_audio = ext_data->intf_data;
-	if (!ext_data) {
-		pr_err("invalid intf data\n");
-		return ERR_PTR(-EINVAL);
-	}
-
-	return container_of(dp_audio, struct dp_audio_private, dp_audio);
-}
-
-static int dp_audio_info_setup(struct platform_device *pdev,
-	struct msm_ext_disp_audio_setup_params *params)
-{
-	int rc = 0;
-	struct dp_audio_private *audio;
-
-	audio = get_audio_get_data(pdev);
-	if (IS_ERR(audio)) {
-		rc = PTR_ERR(audio);
-		goto end;
-	}
-
-	audio->channels = params->num_of_channels;
-
-	dp_audio_setup_sdp(audio);
-	dp_audio_setup_acr(audio);
-	dp_audio_safe_to_exit_level(audio);
-	dp_audio_enable(audio, true);
-end:
-	return rc;
-}
-
-static int dp_audio_get_edid_blk(struct platform_device *pdev,
-		struct msm_ext_disp_audio_edid_blk *blk)
-{
-	int rc = 0;
-	struct dp_audio_private *audio;
-
-	audio = get_audio_get_data(pdev);
-	if (IS_ERR(audio)) {
-		rc = PTR_ERR(audio);
-		goto end;
-	}
-
-	if (!audio->panel || !audio->panel->edid) {
-		pr_err("invalid panel data\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-/*
- * TODO:
- *	audio_data_blk should be changed to be a cea_sad array
- *	audio_data_blk_size should be changed to contain a count of sads
- *
- *	Once this is done, use drm_edid_to_sad() to extract this from
- *	audio->panel->edid. I'd change this, but I don't have that code :/
- */
-#if 0
-	blk->audio_data_blk = edid->audio_data_block;
-	blk->audio_data_blk_size = edid->adb_size;
-#endif
-
-	blk->spk_alloc_data_blk_size = drm_edid_to_speaker_allocation(
-						audio->panel->edid,
-						blk->spkr_alloc_data_block);
-
-end:
-	return rc;
-}
-
-static int dp_audio_get_cable_status(struct platform_device *pdev, u32 vote)
-{
-	int rc = 0;
-	struct dp_audio_private *audio;
-
-	audio = get_audio_get_data(pdev);
-	if (IS_ERR(audio)) {
-		rc = PTR_ERR(audio);
-		goto end;
-	}
-
-	if (!audio->panel) {
-		pr_err("invalid panel data\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	return audio->session_on;
-end:
-	return rc;
-}
-
-static int dp_audio_get_intf_id(struct platform_device *pdev)
-{
-	int rc = 0;
-	struct dp_audio_private *audio;
-
-	audio = get_audio_get_data(pdev);
-	if (IS_ERR(audio)) {
-		rc = PTR_ERR(audio);
-		goto end;
-	}
-
-	return EXT_DISPLAY_TYPE_DP;
-end:
-	return rc;
-}
-
-static void dp_audio_teardown_done(struct platform_device *pdev)
-{
-	struct dp_audio_private *audio;
-
-	audio = get_audio_get_data(pdev);
-	if (IS_ERR(audio))
-		return;
-
-	if (!audio->panel) {
-		pr_err("invalid panel data\n");
-		return;
-	}
-
-	dp_audio_enable(audio, false);
-
-	complete_all(&audio->hpd_comp);
-
-	pr_debug("audio engine disabled\n");
-}
-
-static int dp_audio_ack_done(struct platform_device *pdev, u32 ack)
-{
-	int rc = 0, ack_hpd;
-	struct dp_audio_private *audio;
-
-	audio = get_audio_get_data(pdev);
-	if (IS_ERR(audio)) {
-		rc = PTR_ERR(audio);
-		goto end;
-	}
-
-	if (ack & AUDIO_ACK_SET_ENABLE) {
-		audio->ack_enabled = ack & AUDIO_ACK_ENABLE ?
-			true : false;
-
-		pr_debug("audio ack feature %s\n",
-			audio->ack_enabled ? "enabled" : "disabled");
-		goto end;
-	}
-
-	if (!audio->ack_enabled)
-		goto end;
-
-	ack_hpd = ack & AUDIO_ACK_CONNECT;
-
-	pr_debug("acknowledging audio (%d)\n", ack_hpd);
-
-	if (!audio->engine_on)
-		complete_all(&audio->hpd_comp);
-end:
-	return rc;
-}
-
-static int dp_audio_init_ext_disp(struct dp_audio_private *audio)
-{
-	int rc = 0;
-	struct device_node *pd = NULL;
-	const char *phandle = "qcom,ext-disp";
-	struct msm_ext_disp_init_data *ext;
-	struct msm_ext_disp_audio_codec_ops *ops;
-
-	ext = &audio->ext_audio_data;
-	ops = &ext->codec_ops;
-
-	ext->type = EXT_DISPLAY_TYPE_DP;
-	ext->pdev = audio->pdev;
-	ext->intf_data = &audio->dp_audio;
-
-	ops->audio_info_setup   = dp_audio_info_setup;
-	ops->get_audio_edid_blk = dp_audio_get_edid_blk;
-	ops->cable_status       = dp_audio_get_cable_status;
-	ops->get_intf_id        = dp_audio_get_intf_id;
-	ops->teardown_done      = dp_audio_teardown_done;
-	ops->acknowledge        = dp_audio_ack_done;
-
-	if (!audio->pdev->dev.of_node) {
-		pr_err("cannot find audio dev.of_node\n");
-		rc = -ENODEV;
-		goto end;
-	}
-
-	pd = of_parse_phandle(audio->pdev->dev.of_node, phandle, 0);
-	if (!pd) {
-		pr_err("cannot parse %s handle\n", phandle);
-		rc = -ENODEV;
-		goto end;
-	}
-
-	audio->ext_pdev = of_find_device_by_node(pd);
-	if (!audio->ext_pdev) {
-		pr_err("cannot find %s pdev\n", phandle);
-		rc = -ENODEV;
-		goto end;
-	}
-
-	rc = msm_ext_disp_register_intf(audio->ext_pdev, ext);
-	if (rc)
-		pr_err("failed to register disp\n");
-end:
-	if (pd)
-		of_node_put(pd);
-
-	return rc;
-}
-
-static int dp_audio_on(struct dp_audio *dp_audio)
-{
-	int rc = 0;
-	struct dp_audio_private *audio;
-	struct msm_ext_disp_init_data *ext;
-
-	if (!dp_audio) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	audio = container_of(dp_audio, struct dp_audio_private, dp_audio);
-
-	ext = &audio->ext_audio_data;
-
-	audio->session_on = true;
-
-	rc = ext->intf_ops.audio_config(audio->ext_pdev,
-			EXT_DISPLAY_TYPE_DP,
-			EXT_DISPLAY_CABLE_CONNECT);
-	if (rc) {
-		pr_err("failed to config audio, err=%d\n", rc);
-		goto end;
-	}
-
-	rc = ext->intf_ops.audio_notify(audio->ext_pdev,
-			EXT_DISPLAY_TYPE_DP,
-			EXT_DISPLAY_CABLE_CONNECT);
-	if (rc) {
-		pr_err("failed to notify audio, err=%d\n", rc);
-		goto end;
-	}
-
-	reinit_completion(&audio->hpd_comp);
-	rc = wait_for_completion_timeout(&audio->hpd_comp, HZ * 5);
-	if (!rc) {
-		pr_err("timeout\n");
-		rc = -ETIMEDOUT;
-		goto end;
-	}
-
-	pr_debug("success\n");
-end:
-	return rc;
-}
-
-static int dp_audio_off(struct dp_audio *dp_audio)
-{
-	int rc = 0;
-	struct dp_audio_private *audio;
-	struct msm_ext_disp_init_data *ext;
-
-	if (!dp_audio) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	audio = container_of(dp_audio, struct dp_audio_private, dp_audio);
-	ext = &audio->ext_audio_data;
-
-	rc = ext->intf_ops.audio_notify(audio->ext_pdev,
-			EXT_DISPLAY_TYPE_DP,
-			EXT_DISPLAY_CABLE_DISCONNECT);
-	if (rc) {
-		pr_err("failed to notify audio, err=%d\n", rc);
-		goto end;
-	}
-
-	reinit_completion(&audio->hpd_comp);
-	rc = wait_for_completion_timeout(&audio->hpd_comp, HZ * 5);
-	if (!rc) {
-		pr_err("timeout\n");
-		rc = -ETIMEDOUT;
-		goto end;
-	}
-
-	pr_debug("success\n");
-end:
-	rc = ext->intf_ops.audio_config(audio->ext_pdev,
-			EXT_DISPLAY_TYPE_DP,
-			EXT_DISPLAY_CABLE_DISCONNECT);
-	if (rc)
-		pr_err("failed to config audio, err=%d\n", rc);
-
-	audio->session_on = false;
-	audio->engine_on  = false;
-
-	return rc;
-}
-
-struct dp_audio *dp_audio_get(struct platform_device *pdev,
-			struct dp_panel *panel,
-			struct dp_catalog_audio *catalog)
-{
-	int rc = 0;
-	struct dp_audio_private *audio;
-	struct dp_audio *dp_audio;
-
-	if (!pdev || !panel || !catalog) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	audio = devm_kzalloc(&pdev->dev, sizeof(*audio), GFP_KERNEL);
-	if (!audio) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	init_completion(&audio->hpd_comp);
-
-	audio->pdev = pdev;
-	audio->panel = panel;
-	audio->catalog = catalog;
-
-	dp_audio = &audio->dp_audio;
-
-	dp_audio->on  = dp_audio_on;
-	dp_audio->off = dp_audio_off;
-
-	rc = dp_audio_init_ext_disp(audio);
-	if (rc) {
-		devm_kfree(&pdev->dev, audio);
-		goto error;
-	}
-
-	catalog->init(catalog);
-
-	return dp_audio;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_audio_put(struct dp_audio *dp_audio)
-{
-	struct dp_audio_private *audio;
-
-	if (!dp_audio)
-		return;
-
-	audio = container_of(dp_audio, struct dp_audio_private, dp_audio);
-
-	devm_kfree(&audio->pdev->dev, audio);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_audio.h b/drivers/gpu/drm/msm/dp/dp_audio.h
deleted file mode 100644
index 9e7fa16..0000000
--- a/drivers/gpu/drm/msm/dp/dp_audio.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_AUDIO_H_
-#define _DP_AUDIO_H_
-
-#include <linux/platform_device.h>
-
-#include "dp_panel.h"
-#include "dp_catalog.h"
-
-/**
- * struct dp_audio
- * @lane_count: number of lanes configured in current session
- * @bw_code: link rate's bandwidth code for current session
- */
-struct dp_audio {
-	u32 lane_count;
-	u32 bw_code;
-
-	/**
-	 * on()
-	 *
-	 * Enables the audio by notifying the user module.
-	 *
-	 * @dp_audio: an instance of struct dp_audio.
-	 *
-	 * Returns the error code in case of failure, 0 in success case.
-	 */
-	int (*on)(struct dp_audio *dp_audio);
-
-	/**
-	 * off()
-	 *
-	 * Disables the audio by notifying the user module.
-	 *
-	 * @dp_audio: an instance of struct dp_audio.
-	 *
-	 * Returns the error code in case of failure, 0 in success case.
-	 */
-	int (*off)(struct dp_audio *dp_audio);
-};
-
-/**
- * dp_audio_get()
- *
- * Creates and instance of dp audio.
- *
- * @pdev: caller's platform device instance.
- * @panel: an instance of dp_panel module.
- * @catalog: an instance of dp_catalog_audio module.
- *
- * Returns the error code in case of failure, otherwize
- * an instance of newly created dp_module.
- */
-struct dp_audio *dp_audio_get(struct platform_device *pdev,
-			struct dp_panel *panel,
-			struct dp_catalog_audio *catalog);
-
-/**
- * dp_audio_put()
- *
- * Cleans the dp_audio instance.
- *
- * @dp_audio: an instance of dp_audio.
- */
-void dp_audio_put(struct dp_audio *dp_audio);
-#endif /* _DP_AUDIO_H_ */
-
-
diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c
deleted file mode 100644
index 75ac98b..0000000
--- a/drivers/gpu/drm/msm/dp/dp_aux.c
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/delay.h>
-
-#include "dp_aux.h"
-
-#define DP_AUX_ENUM_STR(x)		#x
-
-enum {
-	DP_AUX_DATA_INDEX_WRITE = BIT(31),
-};
-
-struct dp_aux_private {
-	struct device *dev;
-	struct dp_aux dp_aux;
-	struct dp_catalog_aux *catalog;
-	struct dp_aux_cfg *cfg;
-
-	struct mutex mutex;
-	struct completion comp;
-
-	u32 aux_error_num;
-	u32 retry_cnt;
-	bool cmd_busy;
-	bool native;
-	bool read;
-	bool no_send_addr;
-	bool no_send_stop;
-	u32 offset;
-	u32 segment;
-
-	struct drm_dp_aux drm_aux;
-};
-
-static char *dp_aux_get_error(u32 aux_error)
-{
-	switch (aux_error) {
-	case DP_AUX_ERR_NONE:
-		return DP_AUX_ENUM_STR(DP_AUX_ERR_NONE);
-	case DP_AUX_ERR_ADDR:
-		return DP_AUX_ENUM_STR(DP_AUX_ERR_ADDR);
-	case DP_AUX_ERR_TOUT:
-		return DP_AUX_ENUM_STR(DP_AUX_ERR_TOUT);
-	case DP_AUX_ERR_NACK:
-		return DP_AUX_ENUM_STR(DP_AUX_ERR_NACK);
-	case DP_AUX_ERR_DEFER:
-		return DP_AUX_ENUM_STR(DP_AUX_ERR_DEFER);
-	case DP_AUX_ERR_NACK_DEFER:
-		return DP_AUX_ENUM_STR(DP_AUX_ERR_NACK_DEFER);
-	default:
-		return "unknown";
-	}
-}
-
-static u32 dp_aux_write(struct dp_aux_private *aux,
-		struct drm_dp_aux_msg *msg)
-{
-	u32 data[4], reg, len;
-	u8 *msgdata = msg->buffer;
-	int const aux_cmd_fifo_len = 128;
-	int i = 0;
-
-	if (aux->read)
-		len = 4;
-	else
-		len = msg->size + 4;
-
-	/*
-	 * cmd fifo only has depth of 144 bytes
-	 * limit buf length to 128 bytes here
-	 */
-	if (len > aux_cmd_fifo_len) {
-		pr_err("buf len error\n");
-		return 0;
-	}
-
-	/* Pack cmd and write to HW */
-	data[0] = (msg->address >> 16) & 0xf; /* addr[19:16] */
-	if (aux->read)
-		data[0] |=  BIT(4); /* R/W */
-
-	data[1] = (msg->address >> 8) & 0xff;	/* addr[15:8] */
-	data[2] = msg->address & 0xff;		/* addr[7:0] */
-	data[3] = (msg->size - 1) & 0xff;	/* len[7:0] */
-
-	for (i = 0; i < len; i++) {
-		reg = (i < 4) ? data[i] : msgdata[i - 4];
-		reg = ((reg) << 8) & 0x0000ff00; /* index = 0, write */
-		if (i == 0)
-			reg |= DP_AUX_DATA_INDEX_WRITE;
-		aux->catalog->data = reg;
-		aux->catalog->write_data(aux->catalog);
-	}
-
-	aux->catalog->clear_trans(aux->catalog, false);
-
-	reg = 0; /* Transaction number == 1 */
-	if (!aux->native) { /* i2c */
-		reg |= BIT(8);
-
-		if (aux->no_send_addr)
-			reg |= BIT(10);
-
-		if (aux->no_send_stop)
-			reg |= BIT(11);
-	}
-
-	reg |= BIT(9);
-	aux->catalog->data = reg;
-	aux->catalog->write_trans(aux->catalog);
-
-	return len;
-}
-
-static int dp_aux_cmd_fifo_tx(struct dp_aux_private *aux,
-		struct drm_dp_aux_msg *msg)
-{
-	u32 ret = 0, len = 0, timeout;
-	int const aux_timeout_ms = HZ/4;
-
-	reinit_completion(&aux->comp);
-
-	len = dp_aux_write(aux, msg);
-	if (len == 0) {
-		pr_err("DP AUX write failed\n");
-		return -EINVAL;
-	}
-
-	timeout = wait_for_completion_timeout(&aux->comp, aux_timeout_ms);
-	if (!timeout) {
-		pr_err("aux %s timeout\n", (aux->read ? "read" : "write"));
-		return -ETIMEDOUT;
-	}
-
-	if (aux->aux_error_num == DP_AUX_ERR_NONE) {
-		ret = len;
-	} else {
-		pr_err_ratelimited("aux err: %s\n",
-			dp_aux_get_error(aux->aux_error_num));
-
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-static void dp_aux_cmd_fifo_rx(struct dp_aux_private *aux,
-		struct drm_dp_aux_msg *msg)
-{
-	u32 data;
-	u8 *dp;
-	u32 i, actual_i;
-	u32 len = msg->size;
-
-	aux->catalog->clear_trans(aux->catalog, true);
-
-	data = 0;
-	data |= DP_AUX_DATA_INDEX_WRITE; /* INDEX_WRITE */
-	data |= BIT(0);  /* read */
-
-	aux->catalog->data = data;
-	aux->catalog->write_data(aux->catalog);
-
-	dp = msg->buffer;
-
-	/* discard first byte */
-	data = aux->catalog->read_data(aux->catalog);
-
-	for (i = 0; i < len; i++) {
-		data = aux->catalog->read_data(aux->catalog);
-		*dp++ = (u8)((data >> 8) & 0xff);
-
-		actual_i = (data >> 16) & 0xFF;
-		if (i != actual_i)
-			pr_warn("Index mismatch: expected %d, found %d\n",
-				i, actual_i);
-	}
-}
-
-static void dp_aux_native_handler(struct dp_aux_private *aux)
-{
-	u32 isr = aux->catalog->isr;
-
-	if (isr & DP_INTR_AUX_I2C_DONE)
-		aux->aux_error_num = DP_AUX_ERR_NONE;
-	else if (isr & DP_INTR_WRONG_ADDR)
-		aux->aux_error_num = DP_AUX_ERR_ADDR;
-	else if (isr & DP_INTR_TIMEOUT)
-		aux->aux_error_num = DP_AUX_ERR_TOUT;
-	if (isr & DP_INTR_NACK_DEFER)
-		aux->aux_error_num = DP_AUX_ERR_NACK;
-
-	complete(&aux->comp);
-}
-
-static void dp_aux_i2c_handler(struct dp_aux_private *aux)
-{
-	u32 isr = aux->catalog->isr;
-
-	if (isr & DP_INTR_AUX_I2C_DONE) {
-		if (isr & (DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER))
-			aux->aux_error_num = DP_AUX_ERR_NACK;
-		else
-			aux->aux_error_num = DP_AUX_ERR_NONE;
-	} else {
-		if (isr & DP_INTR_WRONG_ADDR)
-			aux->aux_error_num = DP_AUX_ERR_ADDR;
-		else if (isr & DP_INTR_TIMEOUT)
-			aux->aux_error_num = DP_AUX_ERR_TOUT;
-		if (isr & DP_INTR_NACK_DEFER)
-			aux->aux_error_num = DP_AUX_ERR_NACK_DEFER;
-		if (isr & DP_INTR_I2C_NACK)
-			aux->aux_error_num = DP_AUX_ERR_NACK;
-		if (isr & DP_INTR_I2C_DEFER)
-			aux->aux_error_num = DP_AUX_ERR_DEFER;
-	}
-
-	complete(&aux->comp);
-}
-
-static void dp_aux_isr(struct dp_aux *dp_aux)
-{
-	struct dp_aux_private *aux;
-
-	if (!dp_aux) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
-
-	aux->catalog->get_irq(aux->catalog, aux->cmd_busy);
-
-	if (!aux->cmd_busy)
-		return;
-
-	if (aux->native)
-		dp_aux_native_handler(aux);
-	else
-		dp_aux_i2c_handler(aux);
-}
-
-static void dp_aux_reconfig(struct dp_aux *dp_aux)
-{
-	struct dp_aux_private *aux;
-
-	if (!dp_aux) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
-
-	aux->catalog->update_aux_cfg(aux->catalog,
-			aux->cfg, PHY_AUX_CFG1);
-	aux->catalog->reset(aux->catalog);
-}
-
-static void dp_aux_update_offset_and_segment(struct dp_aux_private *aux,
-		struct drm_dp_aux_msg *input_msg)
-{
-	u32 const edid_address = 0x50;
-	u32 const segment_address = 0x30;
-	bool i2c_read = input_msg->request &
-		(DP_AUX_I2C_READ & DP_AUX_NATIVE_READ);
-	u8 *data = NULL;
-
-	if (aux->native || i2c_read || ((input_msg->address != edid_address) &&
-		(input_msg->address != segment_address)))
-		return;
-
-
-	data = input_msg->buffer;
-	if (input_msg->address == segment_address)
-		aux->segment = *data;
-	else
-		aux->offset = *data;
-}
-
-/**
- * dp_aux_transfer_helper() - helper function for EDID read transactions
- *
- * @aux: DP AUX private structure
- * @input_msg: input message from DRM upstream APIs
- *
- * return: void
- *
- * This helper function is used to fix EDID reads for non-compliant
- * sinks that do not handle the i2c middle-of-transaction flag correctly.
- */
-static void dp_aux_transfer_helper(struct dp_aux_private *aux,
-		struct drm_dp_aux_msg *input_msg)
-{
-	struct drm_dp_aux_msg helper_msg;
-	u32 const message_size = 0x10;
-	u32 const segment_address = 0x30;
-	bool i2c_mot = input_msg->request & DP_AUX_I2C_MOT;
-	bool i2c_read = input_msg->request &
-		(DP_AUX_I2C_READ & DP_AUX_NATIVE_READ);
-
-	if (!i2c_mot || !i2c_read || (input_msg->size == 0))
-		return;
-
-	aux->read = false;
-	aux->cmd_busy = true;
-	aux->no_send_addr = true;
-	aux->no_send_stop = true;
-
-	/*
-	 * Send the segment address for every i2c read in which the
-	 * middle-of-tranaction flag is set. This is required to support EDID
-	 * reads of more than 2 blocks as the segment address is reset to 0
-	 * since we are overriding the middle-of-transaction flag for read
-	 * transactions.
-	 */
-	memset(&helper_msg, 0, sizeof(helper_msg));
-	helper_msg.address = segment_address;
-	helper_msg.buffer = &aux->segment;
-	helper_msg.size = 1;
-	dp_aux_cmd_fifo_tx(aux, &helper_msg);
-
-	/*
-	 * Send the offset address for every i2c read in which the
-	 * middle-of-transaction flag is set. This will ensure that the sink
-	 * will update its read pointer and return the correct portion of the
-	 * EDID buffer in the subsequent i2c read trasntion triggered in the
-	 * native AUX transfer function.
-	 */
-	memset(&helper_msg, 0, sizeof(helper_msg));
-	helper_msg.address = input_msg->address;
-	helper_msg.buffer = &aux->offset;
-	helper_msg.size = 1;
-	dp_aux_cmd_fifo_tx(aux, &helper_msg);
-	aux->offset += message_size;
-
-	if (aux->offset == 0x80 || aux->offset == 0x100)
-		aux->segment = 0x0; /* reset segment at end of block */
-}
-
-/*
- * This function does the real job to process an AUX transaction.
- * It will call aux_reset() function to reset the AUX channel,
- * if the waiting is timeout.
- */
-static ssize_t dp_aux_transfer(struct drm_dp_aux *drm_aux,
-		struct drm_dp_aux_msg *msg)
-{
-	ssize_t ret;
-	int const aux_cmd_native_max = 16;
-	int const aux_cmd_i2c_max = 128;
-	int const retry_count = 5;
-	struct dp_aux_private *aux = container_of(drm_aux,
-		struct dp_aux_private, drm_aux);
-
-	mutex_lock(&aux->mutex);
-
-	aux->native = msg->request & (DP_AUX_NATIVE_WRITE & DP_AUX_NATIVE_READ);
-
-	/* Ignore address only message */
-	if ((msg->size == 0) || (msg->buffer == NULL)) {
-		msg->reply = aux->native ?
-			DP_AUX_NATIVE_REPLY_ACK : DP_AUX_I2C_REPLY_ACK;
-		ret = msg->size;
-		goto unlock_exit;
-	}
-
-	/* msg sanity check */
-	if ((aux->native && (msg->size > aux_cmd_native_max)) ||
-		(msg->size > aux_cmd_i2c_max)) {
-		pr_err("%s: invalid msg: size(%zu), request(%x)\n",
-			__func__, msg->size, msg->request);
-		ret = -EINVAL;
-		goto unlock_exit;
-	}
-
-	dp_aux_update_offset_and_segment(aux, msg);
-	dp_aux_transfer_helper(aux, msg);
-
-	aux->read = msg->request & (DP_AUX_I2C_READ & DP_AUX_NATIVE_READ);
-	aux->cmd_busy = true;
-
-	if (aux->read) {
-		aux->no_send_addr = true;
-		aux->no_send_stop = false;
-	} else {
-		aux->no_send_addr = true;
-		aux->no_send_stop = true;
-	}
-
-	ret = dp_aux_cmd_fifo_tx(aux, msg);
-	if ((ret < 0) && aux->native) {
-		aux->retry_cnt++;
-		if (!(aux->retry_cnt % retry_count))
-			aux->catalog->update_aux_cfg(aux->catalog,
-				aux->cfg, PHY_AUX_CFG1);
-		aux->catalog->reset(aux->catalog);
-		goto unlock_exit;
-	} else if (ret < 0) {
-		goto unlock_exit;
-	}
-
-	if (aux->aux_error_num == DP_AUX_ERR_NONE) {
-		if (aux->read)
-			dp_aux_cmd_fifo_rx(aux, msg);
-
-		msg->reply = aux->native ?
-			DP_AUX_NATIVE_REPLY_ACK : DP_AUX_I2C_REPLY_ACK;
-	} else {
-		/* Reply defer to retry */
-		msg->reply = aux->native ?
-			DP_AUX_NATIVE_REPLY_DEFER : DP_AUX_I2C_REPLY_DEFER;
-	}
-
-	/* Return requested size for success or retry */
-	ret = msg->size;
-	aux->retry_cnt = 0;
-
-unlock_exit:
-	aux->cmd_busy = false;
-	mutex_unlock(&aux->mutex);
-	return ret;
-}
-
-static void dp_aux_reset_phy_config_indices(struct dp_aux_cfg *aux_cfg)
-{
-	int i = 0;
-
-	for (i = 0; i < PHY_AUX_CFG_MAX; i++)
-		aux_cfg[i].current_index = 0;
-}
-
-static void dp_aux_init(struct dp_aux *dp_aux, struct dp_aux_cfg *aux_cfg)
-{
-	struct dp_aux_private *aux;
-
-	if (!dp_aux || !aux_cfg) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
-
-	aux->catalog->reset(aux->catalog);
-	aux->catalog->enable(aux->catalog, true);
-	aux->retry_cnt = 0;
-	dp_aux_reset_phy_config_indices(aux_cfg);
-	aux->catalog->setup(aux->catalog, aux_cfg);
-}
-
-static void dp_aux_deinit(struct dp_aux *dp_aux)
-{
-	struct dp_aux_private *aux;
-
-	if (!dp_aux) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
-
-	aux->catalog->enable(aux->catalog, false);
-}
-
-static int dp_aux_register(struct dp_aux *dp_aux)
-{
-	struct dp_aux_private *aux;
-	int ret = 0;
-
-	if (!dp_aux) {
-		pr_err("invalid input\n");
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
-
-	aux->drm_aux.name = "dpu_dp_aux";
-	aux->drm_aux.dev = aux->dev;
-	aux->drm_aux.transfer = dp_aux_transfer;
-	ret = drm_dp_aux_register(&aux->drm_aux);
-	if (ret) {
-		pr_err("%s: failed to register drm aux: %d\n", __func__, ret);
-		goto exit;
-	}
-	dp_aux->drm_aux = &aux->drm_aux;
-exit:
-	return ret;
-}
-
-static void dp_aux_deregister(struct dp_aux *dp_aux)
-{
-	struct dp_aux_private *aux;
-
-	if (!dp_aux) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
-	drm_dp_aux_unregister(&aux->drm_aux);
-}
-
-struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
-		struct dp_aux_cfg *aux_cfg)
-{
-	int rc = 0;
-	struct dp_aux_private *aux;
-	struct dp_aux *dp_aux;
-
-	if (!catalog || !aux_cfg) {
-		pr_err("invalid input\n");
-		rc = -ENODEV;
-		goto error;
-	}
-
-	aux = devm_kzalloc(dev, sizeof(*aux), GFP_KERNEL);
-	if (!aux) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	init_completion(&aux->comp);
-	aux->cmd_busy = false;
-	mutex_init(&aux->mutex);
-
-	aux->dev = dev;
-	aux->catalog = catalog;
-	aux->cfg = aux_cfg;
-	dp_aux = &aux->dp_aux;
-	aux->retry_cnt = 0;
-
-	dp_aux->isr     = dp_aux_isr;
-	dp_aux->init    = dp_aux_init;
-	dp_aux->deinit  = dp_aux_deinit;
-	dp_aux->drm_aux_register = dp_aux_register;
-	dp_aux->drm_aux_deregister = dp_aux_deregister;
-	dp_aux->reconfig = dp_aux_reconfig;
-
-	return dp_aux;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_aux_put(struct dp_aux *dp_aux)
-{
-	struct dp_aux_private *aux;
-
-	if (!dp_aux)
-		return;
-
-	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
-
-	mutex_destroy(&aux->mutex);
-
-	devm_kfree(aux->dev, aux);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_aux.h b/drivers/gpu/drm/msm/dp/dp_aux.h
deleted file mode 100644
index f5277c5..0000000
--- a/drivers/gpu/drm/msm/dp/dp_aux.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_AUX_H_
-#define _DP_AUX_H_
-
-#include "dp_catalog.h"
-#include <drm/drm_dp_helper.h>
-
-enum dp_aux_error {
-	DP_AUX_ERR_NONE	= 0,
-	DP_AUX_ERR_ADDR	= -1,
-	DP_AUX_ERR_TOUT	= -2,
-	DP_AUX_ERR_NACK	= -3,
-	DP_AUX_ERR_DEFER	= -4,
-	DP_AUX_ERR_NACK_DEFER	= -5,
-};
-
-struct dp_aux {
-	struct drm_dp_aux *drm_aux;
-	int (*drm_aux_register)(struct dp_aux *aux);
-	void (*drm_aux_deregister)(struct dp_aux *aux);
-	void (*isr)(struct dp_aux *aux);
-	void (*init)(struct dp_aux *aux, struct dp_aux_cfg *aux_cfg);
-	void (*deinit)(struct dp_aux *aux);
-	void (*reconfig)(struct dp_aux *aux);
-};
-
-struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
-		struct dp_aux_cfg *aux_cfg);
-void dp_aux_put(struct dp_aux *aux);
-
-#endif /*__DP_AUX_H_*/
diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c
deleted file mode 100644
index 8421a12..0000000
--- a/drivers/gpu/drm/msm/dp/dp_catalog.c
+++ /dev/null
@@ -1,1320 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/delay.h>
-#include <drm/drm_dp_helper.h>
-
-#include "dp_catalog.h"
-#include "dp_reg.h"
-
-#define DP_GET_MSB(x)	(x >> 8)
-#define DP_GET_LSB(x)	(x & 0xff)
-
-#define dp_read(offset) readl_relaxed((offset))
-#define dp_write(offset, data) writel_relaxed((data), (offset))
-
-#define dp_catalog_get_priv(x) { \
-	struct dp_catalog *dp_catalog; \
-	dp_catalog = container_of(x, struct dp_catalog, x); \
-	catalog = container_of(dp_catalog, struct dp_catalog_private, \
-				dp_catalog); \
-}
-
-#define DP_INTERRUPT_STATUS1 \
-	(DP_INTR_AUX_I2C_DONE| \
-	DP_INTR_WRONG_ADDR | DP_INTR_TIMEOUT | \
-	DP_INTR_NACK_DEFER | DP_INTR_WRONG_DATA_CNT | \
-	DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER | \
-	DP_INTR_PLL_UNLOCKED | DP_INTR_AUX_ERROR)
-
-#define DP_INTR_MASK1		(DP_INTERRUPT_STATUS1 << 2)
-
-#define DP_INTERRUPT_STATUS2 \
-	(DP_INTR_READY_FOR_VIDEO | DP_INTR_IDLE_PATTERN_SENT | \
-	DP_INTR_FRAME_END | DP_INTR_CRC_UPDATED)
-
-#define DP_INTR_MASK2		(DP_INTERRUPT_STATUS2 << 2)
-
-static u8 const vm_pre_emphasis[4][4] = {
-	{0x00, 0x0B, 0x12, 0xFF},       /* pe0, 0 db */
-	{0x00, 0x0A, 0x12, 0xFF},       /* pe1, 3.5 db */
-	{0x00, 0x0C, 0xFF, 0xFF},       /* pe2, 6.0 db */
-	{0xFF, 0xFF, 0xFF, 0xFF}        /* pe3, 9.5 db */
-};
-
-/* voltage swing, 0.2v and 1.0v are not support */
-static u8 const vm_voltage_swing[4][4] = {
-	{0x07, 0x0F, 0x14, 0xFF}, /* sw0, 0.4v  */
-	{0x11, 0x1D, 0x1F, 0xFF}, /* sw1, 0.6 v */
-	{0x18, 0x1F, 0xFF, 0xFF}, /* sw1, 0.8 v */
-	{0xFF, 0xFF, 0xFF, 0xFF}  /* sw1, 1.2 v, optional */
-};
-
-/* audio related catalog functions */
-struct dp_catalog_private {
-	struct device *dev;
-	struct dp_io *io;
-
-	u32 (*audio_map)[DP_AUDIO_SDP_HEADER_MAX];
-	struct dp_catalog dp_catalog;
-};
-
-/* aux related catalog functions */
-static u32 dp_catalog_aux_read_data(struct dp_catalog_aux *aux)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!aux) {
-		pr_err("invalid input\n");
-		goto end;
-	}
-
-	dp_catalog_get_priv(aux);
-	base = catalog->io->ctrl_io.base;
-
-	return dp_read(base + DP_AUX_DATA);
-end:
-	return 0;
-}
-
-static int dp_catalog_aux_write_data(struct dp_catalog_aux *aux)
-{
-	int rc = 0;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!aux) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dp_catalog_get_priv(aux);
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_AUX_DATA, aux->data);
-end:
-	return rc;
-}
-
-static int dp_catalog_aux_write_trans(struct dp_catalog_aux *aux)
-{
-	int rc = 0;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!aux) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dp_catalog_get_priv(aux);
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_AUX_TRANS_CTRL, aux->data);
-end:
-	return rc;
-}
-
-static int dp_catalog_aux_clear_trans(struct dp_catalog_aux *aux, bool read)
-{
-	int rc = 0;
-	u32 data = 0;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!aux) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dp_catalog_get_priv(aux);
-	base = catalog->io->ctrl_io.base;
-
-	if (read) {
-		data = dp_read(base + DP_AUX_TRANS_CTRL);
-		data &= ~BIT(9);
-		dp_write(base + DP_AUX_TRANS_CTRL, data);
-	} else {
-		dp_write(base + DP_AUX_TRANS_CTRL, 0);
-	}
-end:
-	return rc;
-}
-
-static void dp_catalog_aux_reset(struct dp_catalog_aux *aux)
-{
-	u32 aux_ctrl;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!aux) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(aux);
-	base = catalog->io->ctrl_io.base;
-
-	aux_ctrl = dp_read(base + DP_AUX_CTRL);
-
-	aux_ctrl |= BIT(1);
-	dp_write(base + DP_AUX_CTRL, aux_ctrl);
-	usleep_range(1000, 1010); /* h/w recommended delay */
-
-	aux_ctrl &= ~BIT(1);
-	dp_write(base + DP_AUX_CTRL, aux_ctrl);
-}
-
-static void dp_catalog_aux_enable(struct dp_catalog_aux *aux, bool enable)
-{
-	u32 aux_ctrl;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!aux) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(aux);
-	base = catalog->io->ctrl_io.base;
-
-	aux_ctrl = dp_read(base + DP_AUX_CTRL);
-
-	if (enable) {
-		dp_write(base + DP_TIMEOUT_COUNT, 0xffff);
-		dp_write(base + DP_AUX_LIMITS, 0xffff);
-		aux_ctrl |= BIT(0);
-	} else {
-		aux_ctrl &= ~BIT(0);
-	}
-
-	dp_write(base + DP_AUX_CTRL, aux_ctrl);
-}
-
-static void dp_catalog_aux_update_cfg(struct dp_catalog_aux *aux,
-		struct dp_aux_cfg *cfg, enum dp_phy_aux_config_type type)
-{
-	struct dp_catalog_private *catalog;
-	u32 new_index = 0, current_index = 0;
-
-	if (!aux || !cfg || (type >= PHY_AUX_CFG_MAX)) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(aux);
-
-	current_index = cfg[type].current_index;
-	new_index = (current_index + 1) % cfg[type].cfg_cnt;
-	pr_debug("Updating %s from 0x%08x to 0x%08x\n",
-		dp_phy_aux_config_type_to_string(type),
-	cfg[type].lut[current_index], cfg[type].lut[new_index]);
-
-	dp_write(catalog->io->phy_io.base + cfg[type].offset,
-			cfg[type].lut[new_index]);
-	cfg[type].current_index = new_index;
-}
-
-static void dp_catalog_aux_setup(struct dp_catalog_aux *aux,
-		struct dp_aux_cfg *cfg)
-{
-	struct dp_catalog_private *catalog;
-	int i = 0;
-
-	if (!aux || !cfg) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(aux);
-
-	dp_write(catalog->io->phy_io.base + DP_PHY_PD_CTL, 0x65);
-	wmb(); /* make sure PD programming happened */
-
-	/* Turn on BIAS current for PHY/PLL */
-	dp_write(catalog->io->dp_pll_io.base +
-		QSERDES_COM_BIAS_EN_CLKBUFLR_EN, 0x1b);
-
-	/* DP AUX CFG register programming */
-	for (i = 0; i < PHY_AUX_CFG_MAX; i++) {
-		pr_debug("%s: offset=0x%08x, value=0x%08x\n",
-			dp_phy_aux_config_type_to_string(i),
-			cfg[i].offset, cfg[i].lut[cfg[i].current_index]);
-		dp_write(catalog->io->phy_io.base + cfg[i].offset,
-			cfg[i].lut[cfg[i].current_index]);
-	}
-
-	dp_write(catalog->io->phy_io.base + DP_PHY_AUX_INTERRUPT_MASK, 0x1F);
-}
-
-static void dp_catalog_aux_get_irq(struct dp_catalog_aux *aux, bool cmd_busy)
-{
-	u32 ack;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!aux) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(aux);
-	base = catalog->io->ctrl_io.base;
-
-	aux->isr = dp_read(base + DP_INTR_STATUS);
-	aux->isr &= ~DP_INTR_MASK1;
-	ack = aux->isr & DP_INTERRUPT_STATUS1;
-	ack <<= 1;
-	ack |= DP_INTR_MASK1;
-	dp_write(base + DP_INTR_STATUS, ack);
-}
-
-/* controller related catalog functions */
-static u32 dp_catalog_ctrl_read_hdcp_status(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	return dp_read(base + DP_HDCP_STATUS);
-}
-
-static void dp_catalog_ctrl_setup_infoframe_sdp(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-	u32 header, data;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	header = dp_read(base + MMSS_DP_VSCEXT_0);
-	header |= ctrl->hdr_data.vsc_hdr_byte1;
-	dp_write(base + MMSS_DP_VSCEXT_0, header);
-
-	header = dp_read(base + MMSS_DP_VSCEXT_1);
-	header |= ctrl->hdr_data.vsc_hdr_byte1;
-	dp_write(base + MMSS_DP_VSCEXT_1, header);
-
-	header = dp_read(base + MMSS_DP_VSCEXT_1);
-	header |= ctrl->hdr_data.vsc_hdr_byte1;
-	dp_write(base + MMSS_DP_VSCEXT_1, header);
-
-	header =  ctrl->hdr_data.version;
-	header |=  ctrl->hdr_data.length << 8;
-	header |= ctrl->hdr_data.eotf << 16;
-	header |= (ctrl->hdr_data.descriptor_id << 24);
-	dp_write(base + MMSS_DP_VSCEXT_2, header);
-
-	data = (DP_GET_LSB(ctrl->hdr_data.display_primaries_x[0]) |
-		(DP_GET_MSB(ctrl->hdr_data.display_primaries_x[0]) << 8) |
-		(DP_GET_LSB(ctrl->hdr_data.display_primaries_y[0]) << 16) |
-		(DP_GET_MSB(ctrl->hdr_data.display_primaries_y[0]) << 24));
-	dp_write(base + MMSS_DP_VSCEXT_3, data);
-
-	data = (DP_GET_LSB(ctrl->hdr_data.display_primaries_x[1]) |
-		(DP_GET_MSB(ctrl->hdr_data.display_primaries_x[1]) << 8) |
-		(DP_GET_LSB(ctrl->hdr_data.display_primaries_y[1]) << 16) |
-		(DP_GET_MSB(ctrl->hdr_data.display_primaries_y[1]) << 24));
-	dp_write(base + MMSS_DP_VSCEXT_4, data);
-
-	data = (DP_GET_LSB(ctrl->hdr_data.display_primaries_x[2]) |
-		(DP_GET_MSB(ctrl->hdr_data.display_primaries_x[2]) << 8) |
-		(DP_GET_LSB(ctrl->hdr_data.display_primaries_y[2]) << 16) |
-		(DP_GET_MSB(ctrl->hdr_data.display_primaries_y[2]) << 24));
-	dp_write(base + MMSS_DP_VSCEXT_5, data);
-
-	data = (DP_GET_LSB(ctrl->hdr_data.white_point_x) |
-		(DP_GET_MSB(ctrl->hdr_data.white_point_x) << 8) |
-		(DP_GET_LSB(ctrl->hdr_data.white_point_y) << 16) |
-		(DP_GET_MSB(ctrl->hdr_data.white_point_y) << 24));
-	dp_write(base + MMSS_DP_VSCEXT_6, data);
-
-	data = (DP_GET_LSB(ctrl->hdr_data.max_luminance) |
-		(DP_GET_MSB(ctrl->hdr_data.max_luminance) << 8) |
-		(DP_GET_LSB(ctrl->hdr_data.min_luminance) << 16) |
-		(DP_GET_MSB(ctrl->hdr_data.min_luminance) << 24));
-	dp_write(base + MMSS_DP_VSCEXT_7, data);
-
-	data = (DP_GET_LSB(ctrl->hdr_data.max_content_light_level) |
-		(DP_GET_MSB(ctrl->hdr_data.max_content_light_level) << 8) |
-		(DP_GET_LSB(ctrl->hdr_data.max_average_light_level) << 16) |
-		(DP_GET_MSB(ctrl->hdr_data.max_average_light_level) << 24));
-	dp_write(base + MMSS_DP_VSCEXT_8, data);
-
-	dp_write(base + MMSS_DP_VSCEXT_9, 0x00);
-}
-
-static void dp_catalog_ctrl_setup_vsc_sdp(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-	u32 value;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	value = dp_read(base + MMSS_DP_GENERIC0_0);
-	value |= ctrl->hdr_data.vsc_hdr_byte1;
-	dp_write(base + MMSS_DP_GENERIC0_0, value);
-
-	value = dp_read(base + MMSS_DP_GENERIC0_1);
-	value |= ctrl->hdr_data.vsc_hdr_byte2;
-	dp_write(base + MMSS_DP_GENERIC0_1, value);
-
-	value = dp_read(base + MMSS_DP_GENERIC0_1);
-	value |= ctrl->hdr_data.vsc_hdr_byte3;
-	dp_write(base + MMSS_DP_GENERIC0_1, value);
-
-	dp_write(base + MMSS_DP_GENERIC0_2, 0x00);
-	dp_write(base + MMSS_DP_GENERIC0_3, 0x00);
-	dp_write(base + MMSS_DP_GENERIC0_4, 0x00);
-	dp_write(base + MMSS_DP_GENERIC0_5, 0x00);
-
-	dp_write(base + MMSS_DP_GENERIC0_6, ctrl->hdr_data.pkt_payload);
-	dp_write(base + MMSS_DP_GENERIC0_7, 0x00);
-	dp_write(base + MMSS_DP_GENERIC0_8, 0x00);
-	dp_write(base + MMSS_DP_GENERIC0_9, 0x00);
-}
-
-static void dp_catalog_ctrl_config_hdr(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-	u32 cfg, cfg2;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	cfg = dp_read(base + MMSS_DP_SDP_CFG);
-	/* VSCEXT_SDP_EN */
-	cfg |= BIT(16);
-
-	/* GEN0_SDP_EN */
-	cfg |= BIT(17);
-
-	dp_write(base + MMSS_DP_SDP_CFG, cfg);
-
-	cfg2 = dp_read(base + MMSS_DP_SDP_CFG2);
-	/* Generic0 SDP Payload is 19 bytes which is > 16, so Bit16 is 1 */
-	cfg2 |= BIT(16);
-	dp_write(base + MMSS_DP_SDP_CFG2, cfg2);
-
-	dp_catalog_ctrl_setup_vsc_sdp(ctrl);
-	dp_catalog_ctrl_setup_infoframe_sdp(ctrl);
-
-	cfg = dp_read(base + DP_MISC1_MISC0);
-	/* Indicates presence of VSC */
-	cfg |= BIT(6) << 8;
-
-	dp_write(base + DP_MISC1_MISC0, cfg);
-
-	cfg = dp_read(base + DP_CONFIGURATION_CTRL);
-	/* Send VSC */
-	cfg |= BIT(7);
-
-	switch (ctrl->hdr_data.bpc) {
-	default:
-	case 10:
-		cfg |= BIT(9);
-		break;
-	case 8:
-		cfg |= BIT(8);
-		break;
-	}
-
-	dp_write(base + DP_CONFIGURATION_CTRL, cfg);
-
-	cfg = dp_read(base + DP_COMPRESSION_MODE_CTRL);
-
-	/* Trigger SDP values in registers */
-	cfg |= BIT(8);
-	dp_write(base + DP_COMPRESSION_MODE_CTRL, cfg);
-}
-
-static void dp_catalog_ctrl_update_transfer_unit(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_VALID_BOUNDARY, ctrl->valid_boundary);
-	dp_write(base + DP_TU, ctrl->dp_tu);
-	dp_write(base + DP_VALID_BOUNDARY_2, ctrl->valid_boundary2);
-}
-
-static void dp_catalog_ctrl_state_ctrl(struct dp_catalog_ctrl *ctrl, u32 state)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_STATE_CTRL, state);
-}
-
-static void dp_catalog_ctrl_config_ctrl(struct dp_catalog_ctrl *ctrl, u32 cfg)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	pr_debug("DP_CONFIGURATION_CTRL=0x%x\n", cfg);
-
-	dp_write(base + DP_CONFIGURATION_CTRL, cfg);
-	dp_write(base + DP_MAINLINK_LEVELS, 0xa08);
-	dp_write(base + MMSS_DP_ASYNC_FIFO_CONFIG, 0x1);
-}
-
-static void dp_catalog_ctrl_lane_mapping(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_LOGICAL2PHYSCIAL_LANE_MAPPING, 0xe4);
-}
-
-static void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog_ctrl *ctrl,
-						bool enable)
-{
-	u32 mainlink_ctrl;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	if (enable) {
-		dp_write(base + DP_MAINLINK_CTRL, 0x02000000);
-		wmb(); /* make sure mainlink is turned off before reset */
-		dp_write(base + DP_MAINLINK_CTRL, 0x02000002);
-		wmb(); /* make sure mainlink entered reset */
-		dp_write(base + DP_MAINLINK_CTRL, 0x02000000);
-		wmb(); /* make sure mainlink reset done */
-		dp_write(base + DP_MAINLINK_CTRL, 0x02000001);
-		wmb(); /* make sure mainlink turned on */
-	} else {
-		mainlink_ctrl = dp_read(base + DP_MAINLINK_CTRL);
-		mainlink_ctrl &= ~BIT(0);
-		dp_write(base + DP_MAINLINK_CTRL, mainlink_ctrl);
-	}
-}
-
-static void dp_catalog_ctrl_config_misc(struct dp_catalog_ctrl *ctrl,
-					u32 cc, u32 tb)
-{
-	u32 misc_val;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	misc_val = dp_read(base + DP_MISC1_MISC0);
-	misc_val |= cc;
-	misc_val |= (tb << 5);
-	misc_val |= BIT(0); /* Configure clock to synchronous mode */
-
-	pr_debug("misc settings = 0x%x\n", misc_val);
-	dp_write(base + DP_MISC1_MISC0, misc_val);
-}
-
-static void dp_catalog_ctrl_config_msa(struct dp_catalog_ctrl *ctrl,
-					u32 rate, u32 stream_rate_khz,
-					bool fixed_nvid)
-{
-	u32 pixel_m, pixel_n;
-	u32 mvid, nvid;
-	u64 mvid_calc;
-	u32 const nvid_fixed = 0x8000;
-	u32 const link_rate_hbr2 = 540000;
-	u32 const link_rate_hbr3 = 810000;
-	struct dp_catalog_private *catalog;
-	void __iomem *base_cc, *base_ctrl;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	if (fixed_nvid) {
-		pr_debug("use fixed NVID=0x%x\n", nvid_fixed);
-		nvid = nvid_fixed;
-
-		pr_debug("link rate=%dkbps, stream_rate_khz=%uKhz",
-			rate, stream_rate_khz);
-
-		/*
-		 * For intermediate results, use 64 bit arithmetic to avoid
-		 * loss of precision.
-		 */
-		mvid_calc = (u64) stream_rate_khz * nvid;
-		mvid_calc = div_u64(mvid_calc, rate);
-
-		/*
-		 * truncate back to 32 bits as this final divided value will
-		 * always be within the range of a 32 bit unsigned int.
-		 */
-		mvid = (u32) mvid_calc;
-	} else {
-		base_cc = catalog->io->dp_cc_io.base;
-
-		pixel_m = dp_read(base_cc + MMSS_DP_PIXEL_M);
-		pixel_n = dp_read(base_cc + MMSS_DP_PIXEL_N);
-		pr_debug("pixel_m=0x%x, pixel_n=0x%x\n", pixel_m, pixel_n);
-
-		mvid = (pixel_m & 0xFFFF) * 5;
-		nvid = (0xFFFF & (~pixel_n)) + (pixel_m & 0xFFFF);
-
-		pr_debug("rate = %d\n", rate);
-
-		if (link_rate_hbr2 == rate)
-			nvid *= 2;
-
-		if (link_rate_hbr3 == rate)
-			nvid *= 3;
-	}
-
-	base_ctrl = catalog->io->ctrl_io.base;
-	pr_debug("mvid=0x%x, nvid=0x%x\n", mvid, nvid);
-	dp_write(base_ctrl + DP_SOFTWARE_MVID, mvid);
-	dp_write(base_ctrl + DP_SOFTWARE_NVID, nvid);
-}
-
-static void dp_catalog_ctrl_set_pattern(struct dp_catalog_ctrl *ctrl,
-					u32 pattern)
-{
-	int bit, cnt = 10;
-	u32 data;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	bit = 1;
-	bit <<= (pattern - 1);
-	pr_debug("hw: bit=%d train=%d\n", bit, pattern);
-	dp_write(base + DP_STATE_CTRL, bit);
-
-	bit = 8;
-	bit <<= (pattern - 1);
-
-	while (cnt--) {
-		data = dp_read(base + DP_MAINLINK_READY);
-		if (data & bit)
-			break;
-	}
-
-	if (cnt == 0)
-		pr_err("set link_train=%d failed\n", pattern);
-}
-
-static void dp_catalog_ctrl_usb_reset(struct dp_catalog_ctrl *ctrl, bool flip)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-
-	base = catalog->io->usb3_dp_com.base;
-
-	dp_write(base + USB3_DP_COM_RESET_OVRD_CTRL, 0x0a);
-	dp_write(base + USB3_DP_COM_PHY_MODE_CTRL, 0x02);
-	dp_write(base + USB3_DP_COM_SW_RESET, 0x01);
-	/* make sure usb3 com phy software reset is done */
-	wmb();
-
-	if (!flip) /* CC1 */
-		dp_write(base + USB3_DP_COM_TYPEC_CTRL, 0x02);
-	else /* CC2 */
-		dp_write(base + USB3_DP_COM_TYPEC_CTRL, 0x03);
-
-	dp_write(base + USB3_DP_COM_SWI_CTRL, 0x00);
-	dp_write(base + USB3_DP_COM_SW_RESET, 0x00);
-	/* make sure the software reset is done */
-	wmb();
-
-	dp_write(base + USB3_DP_COM_POWER_DOWN_CTRL, 0x01);
-	dp_write(base + USB3_DP_COM_RESET_OVRD_CTRL, 0x00);
-	/* make sure phy is brought out of reset */
-	wmb();
-
-}
-
-static void dp_catalog_ctrl_reset(struct dp_catalog_ctrl *ctrl)
-{
-	u32 sw_reset;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	sw_reset = dp_read(base + DP_SW_RESET);
-
-	sw_reset |= BIT(0);
-	dp_write(base + DP_SW_RESET, sw_reset);
-	usleep_range(1000, 1010); /* h/w recommended delay */
-
-	sw_reset &= ~BIT(0);
-	dp_write(base + DP_SW_RESET, sw_reset);
-}
-
-static bool dp_catalog_ctrl_mainlink_ready(struct dp_catalog_ctrl *ctrl)
-{
-	u32 data;
-	int cnt = 10;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		goto end;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	while (--cnt) {
-		/* DP_MAINLINK_READY */
-		data = dp_read(base + DP_MAINLINK_READY);
-		if (data & BIT(0))
-			return true;
-
-		usleep_range(1000, 1010); /* 1ms wait before next reg read */
-	}
-	pr_err("mainlink not ready\n");
-end:
-	return false;
-}
-
-static void dp_catalog_ctrl_enable_irq(struct dp_catalog_ctrl *ctrl,
-						bool enable)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	if (enable) {
-		dp_write(base + DP_INTR_STATUS, DP_INTR_MASK1);
-		dp_write(base + DP_INTR_STATUS2, DP_INTR_MASK2);
-	} else {
-		dp_write(base + DP_INTR_STATUS, 0x00);
-		dp_write(base + DP_INTR_STATUS2, 0x00);
-	}
-}
-
-static void dp_catalog_ctrl_hpd_config(struct dp_catalog_ctrl *ctrl, bool en)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	if (en) {
-		u32 reftimer = dp_read(base + DP_DP_HPD_REFTIMER);
-
-		dp_write(base + DP_DP_HPD_INT_ACK, 0xF);
-		dp_write(base + DP_DP_HPD_INT_MASK, 0xF);
-
-		/* Enabling REFTIMER */
-		reftimer |= BIT(16);
-		dp_write(base + DP_DP_HPD_REFTIMER, 0xF);
-		/* Enable HPD */
-		dp_write(base + DP_DP_HPD_CTRL, 0x1);
-	} else {
-		/*Disable HPD */
-		dp_write(base + DP_DP_HPD_CTRL, 0x0);
-	}
-}
-
-static void dp_catalog_ctrl_get_interrupt(struct dp_catalog_ctrl *ctrl)
-{
-	u32 ack = 0;
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	ctrl->isr = dp_read(base + DP_INTR_STATUS2);
-	ctrl->isr &= ~DP_INTR_MASK2;
-	ack = ctrl->isr & DP_INTERRUPT_STATUS2;
-	ack <<= 1;
-	ack |= DP_INTR_MASK2;
-	dp_write(base + DP_INTR_STATUS2, ack);
-}
-
-static void dp_catalog_ctrl_phy_reset(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_PHY_CTRL, 0x5); /* bit 0 & 2 */
-	usleep_range(1000, 1010); /* h/w recommended delay */
-	dp_write(base + DP_PHY_CTRL, 0x0);
-	wmb(); /* make sure PHY reset done */
-}
-
-static void dp_catalog_ctrl_phy_lane_cfg(struct dp_catalog_ctrl *ctrl,
-		bool flipped, u8 ln_cnt)
-{
-	u32 info = 0x0;
-	struct dp_catalog_private *catalog;
-	u8 orientation = BIT(!!flipped);
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-
-	info |= (ln_cnt & 0x0F);
-	info |= ((orientation & 0x0F) << 4);
-	pr_debug("Shared Info = 0x%x\n", info);
-
-	dp_write(catalog->io->phy_io.base + DP_PHY_SPARE0, info);
-}
-
-static void dp_catalog_ctrl_update_vx_px(struct dp_catalog_ctrl *ctrl,
-		u8 v_level, u8 p_level)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base0, *base1;
-	u8 value0, value1;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-	base0 = catalog->io->ln_tx0_io.base;
-	base1 = catalog->io->ln_tx1_io.base;
-
-	pr_debug("hw: v=%d p=%d\n", v_level, p_level);
-
-	value0 = vm_voltage_swing[v_level][p_level];
-	value1 = vm_pre_emphasis[v_level][p_level];
-
-	/* program default setting first */
-	dp_write(base0 + TXn_TX_DRV_LVL, 0x2A);
-	dp_write(base1 + TXn_TX_DRV_LVL, 0x2A);
-	dp_write(base0 + TXn_TX_EMP_POST1_LVL, 0x20);
-	dp_write(base1 + TXn_TX_EMP_POST1_LVL, 0x20);
-
-	/* Enable MUX to use Cursor values from these registers */
-	value0 |= BIT(5);
-	value1 |= BIT(5);
-
-	/* Configure host and panel only if both values are allowed */
-	if (value0 != 0xFF && value1 != 0xFF) {
-		dp_write(base0 + TXn_TX_DRV_LVL, value0);
-		dp_write(base1 + TXn_TX_DRV_LVL, value0);
-		dp_write(base0 + TXn_TX_EMP_POST1_LVL, value1);
-		dp_write(base1 + TXn_TX_EMP_POST1_LVL, value1);
-
-		pr_debug("hw: vx_value=0x%x px_value=0x%x\n",
-			value0, value1);
-	} else {
-		pr_err("invalid vx (0x%x=0x%x), px (0x%x=0x%x\n",
-			v_level, value0, p_level, value1);
-	}
-}
-
-static void dp_catalog_ctrl_send_phy_pattern(struct dp_catalog_ctrl *ctrl,
-			u32 pattern)
-{
-	struct dp_catalog_private *catalog;
-	u32 value = 0x0;
-	void __iomem *base = NULL;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_catalog_get_priv(ctrl);
-
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_STATE_CTRL, 0x0);
-
-	switch (pattern) {
-	case DP_TEST_PHY_PATTERN_D10_2_NO_SCRAMBLING:
-		dp_write(base + DP_STATE_CTRL, 0x1);
-		break;
-	case DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT:
-		value &= ~(1 << 16);
-		dp_write(base + DP_HBR2_COMPLIANCE_SCRAMBLER_RESET, value);
-		value |= 0xFC;
-		dp_write(base + DP_HBR2_COMPLIANCE_SCRAMBLER_RESET, value);
-		dp_write(base + DP_MAINLINK_LEVELS, 0x2);
-		dp_write(base + DP_STATE_CTRL, 0x10);
-		break;
-	case DP_TEST_PHY_PATTERN_PRBS7:
-		dp_write(base + DP_STATE_CTRL, 0x20);
-		break;
-	case DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN:
-		dp_write(base + DP_STATE_CTRL, 0x40);
-		/* 00111110000011111000001111100000 */
-		dp_write(base + DP_TEST_80BIT_CUSTOM_PATTERN_REG0, 0x3E0F83E0);
-		/* 00001111100000111110000011111000 */
-		dp_write(base + DP_TEST_80BIT_CUSTOM_PATTERN_REG1, 0x0F83E0F8);
-		/* 1111100000111110 */
-		dp_write(base + DP_TEST_80BIT_CUSTOM_PATTERN_REG2, 0x0000F83E);
-		break;
-	case DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN:
-		value = BIT(16);
-		dp_write(base + DP_HBR2_COMPLIANCE_SCRAMBLER_RESET, value);
-		value |= 0xFC;
-		dp_write(base + DP_HBR2_COMPLIANCE_SCRAMBLER_RESET, value);
-		dp_write(base + DP_MAINLINK_LEVELS, 0x2);
-		dp_write(base + DP_STATE_CTRL, 0x10);
-		break;
-	default:
-		pr_debug("No valid test pattern requested: 0x%x\n", pattern);
-		return;
-	}
-
-	/* Make sure the test pattern is programmed in the hardware */
-	wmb();
-}
-
-static u32 dp_catalog_ctrl_read_phy_pattern(struct dp_catalog_ctrl *ctrl)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base = NULL;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return 0;
-	}
-
-	dp_catalog_get_priv(ctrl);
-
-	base = catalog->io->ctrl_io.base;
-
-	return dp_read(base + DP_MAINLINK_READY);
-}
-
-/* panel related catalog functions */
-static int dp_catalog_panel_timing_cfg(struct dp_catalog_panel *panel)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-
-	if (!panel) {
-		pr_err("invalid input\n");
-		goto end;
-	}
-
-	dp_catalog_get_priv(panel);
-	base = catalog->io->ctrl_io.base;
-
-	dp_write(base + DP_TOTAL_HOR_VER, panel->total);
-	dp_write(base + DP_START_HOR_VER_FROM_SYNC, panel->sync_start);
-	dp_write(base + DP_HSYNC_VSYNC_WIDTH_POLARITY, panel->width_blanking);
-	dp_write(base + DP_ACTIVE_HOR_VER, panel->dp_active);
-end:
-	return 0;
-}
-
-static void dp_catalog_audio_init(struct dp_catalog_audio *audio)
-{
-	struct dp_catalog_private *catalog;
-	static u32 sdp_map[][DP_AUDIO_SDP_HEADER_MAX] = {
-		{
-			MMSS_DP_AUDIO_STREAM_0,
-			MMSS_DP_AUDIO_STREAM_1,
-			MMSS_DP_AUDIO_STREAM_1,
-		},
-		{
-			MMSS_DP_AUDIO_TIMESTAMP_0,
-			MMSS_DP_AUDIO_TIMESTAMP_1,
-			MMSS_DP_AUDIO_TIMESTAMP_1,
-		},
-		{
-			MMSS_DP_AUDIO_INFOFRAME_0,
-			MMSS_DP_AUDIO_INFOFRAME_1,
-			MMSS_DP_AUDIO_INFOFRAME_1,
-		},
-		{
-			MMSS_DP_AUDIO_COPYMANAGEMENT_0,
-			MMSS_DP_AUDIO_COPYMANAGEMENT_1,
-			MMSS_DP_AUDIO_COPYMANAGEMENT_1,
-		},
-		{
-			MMSS_DP_AUDIO_ISRC_0,
-			MMSS_DP_AUDIO_ISRC_1,
-			MMSS_DP_AUDIO_ISRC_1,
-		},
-	};
-
-	if (!audio)
-		return;
-
-	dp_catalog_get_priv(audio);
-
-	catalog->audio_map = sdp_map;
-}
-
-static void dp_catalog_audio_config_sdp(struct dp_catalog_audio *audio)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-	u32 sdp_cfg = 0;
-	u32 sdp_cfg2 = 0;
-
-	if (!audio)
-		return;
-
-	dp_catalog_get_priv(audio);
-	base = catalog->io->ctrl_io.base;
-
-	/* AUDIO_TIMESTAMP_SDP_EN */
-	sdp_cfg |= BIT(1);
-	/* AUDIO_STREAM_SDP_EN */
-	sdp_cfg |= BIT(2);
-	/* AUDIO_COPY_MANAGEMENT_SDP_EN */
-	sdp_cfg |= BIT(5);
-	/* AUDIO_ISRC_SDP_EN  */
-	sdp_cfg |= BIT(6);
-	/* AUDIO_INFOFRAME_SDP_EN  */
-	sdp_cfg |= BIT(20);
-
-	pr_debug("sdp_cfg = 0x%x\n", sdp_cfg);
-	dp_write(base + MMSS_DP_SDP_CFG, sdp_cfg);
-
-	sdp_cfg2 = dp_read(base + MMSS_DP_SDP_CFG2);
-	/* IFRM_REGSRC -> Do not use reg values */
-	sdp_cfg2 &= ~BIT(0);
-	/* AUDIO_STREAM_HB3_REGSRC-> Do not use reg values */
-	sdp_cfg2 &= ~BIT(1);
-
-	pr_debug("sdp_cfg2 = 0x%x\n", sdp_cfg2);
-	dp_write(base + MMSS_DP_SDP_CFG2, sdp_cfg2);
-}
-
-static void dp_catalog_audio_get_header(struct dp_catalog_audio *audio)
-{
-	struct dp_catalog_private *catalog;
-	u32 (*sdp_map)[DP_AUDIO_SDP_HEADER_MAX];
-	void __iomem *base;
-	enum dp_catalog_audio_sdp_type sdp;
-	enum dp_catalog_audio_header_type header;
-
-	if (!audio)
-		return;
-
-	dp_catalog_get_priv(audio);
-
-	base    = catalog->io->ctrl_io.base;
-	sdp_map = catalog->audio_map;
-	sdp     = audio->sdp_type;
-	header  = audio->sdp_header;
-
-	audio->data = dp_read(base + sdp_map[sdp][header]);
-}
-
-static void dp_catalog_audio_set_header(struct dp_catalog_audio *audio)
-{
-	struct dp_catalog_private *catalog;
-	u32 (*sdp_map)[DP_AUDIO_SDP_HEADER_MAX];
-	void __iomem *base;
-	enum dp_catalog_audio_sdp_type sdp;
-	enum dp_catalog_audio_header_type header;
-	u32 data;
-
-	if (!audio)
-		return;
-
-	dp_catalog_get_priv(audio);
-
-	base    = catalog->io->ctrl_io.base;
-	sdp_map = catalog->audio_map;
-	sdp     = audio->sdp_type;
-	header  = audio->sdp_header;
-	data    = audio->data;
-
-	dp_write(base + sdp_map[sdp][header], data);
-}
-
-static void dp_catalog_audio_config_acr(struct dp_catalog_audio *audio)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-	u32 acr_ctrl, select;
-
-	dp_catalog_get_priv(audio);
-
-	select = audio->data;
-	base   = catalog->io->ctrl_io.base;
-
-	acr_ctrl = select << 4 | BIT(31) | BIT(8) | BIT(14);
-
-	pr_debug("select = 0x%x, acr_ctrl = 0x%x\n", select, acr_ctrl);
-
-	dp_write(base + MMSS_DP_AUDIO_ACR_CTRL, acr_ctrl);
-}
-
-static void dp_catalog_audio_safe_to_exit_level(struct dp_catalog_audio *audio)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-	u32 mainlink_levels, safe_to_exit_level;
-
-	dp_catalog_get_priv(audio);
-
-	base   = catalog->io->ctrl_io.base;
-	safe_to_exit_level = audio->data;
-
-	mainlink_levels = dp_read(base + DP_MAINLINK_LEVELS);
-	mainlink_levels &= 0xFE0;
-	mainlink_levels |= safe_to_exit_level;
-
-	pr_debug("mainlink_level = 0x%x, safe_to_exit_level = 0x%x\n",
-			mainlink_levels, safe_to_exit_level);
-
-	dp_write(base + DP_MAINLINK_LEVELS, mainlink_levels);
-}
-
-static void dp_catalog_audio_enable(struct dp_catalog_audio *audio)
-{
-	struct dp_catalog_private *catalog;
-	void __iomem *base;
-	bool enable;
-	u32 audio_ctrl;
-
-	dp_catalog_get_priv(audio);
-
-	base   = catalog->io->ctrl_io.base;
-	enable = !!audio->data;
-
-	audio_ctrl = dp_read(base + MMSS_DP_AUDIO_CFG);
-
-	if (enable)
-		audio_ctrl |= BIT(0);
-	else
-		audio_ctrl &= ~BIT(0);
-
-	pr_debug("dp_audio_cfg = 0x%x\n", audio_ctrl);
-	dp_write(base + MMSS_DP_AUDIO_CFG, audio_ctrl);
-
-	/* make sure audio engine is disabled */
-	wmb();
-}
-
-struct dp_catalog *dp_catalog_get(struct device *dev, struct dp_io *io)
-{
-	int rc = 0;
-	struct dp_catalog *dp_catalog;
-	struct dp_catalog_private *catalog;
-	struct dp_catalog_aux aux = {
-		.read_data     = dp_catalog_aux_read_data,
-		.write_data    = dp_catalog_aux_write_data,
-		.write_trans   = dp_catalog_aux_write_trans,
-		.clear_trans   = dp_catalog_aux_clear_trans,
-		.reset         = dp_catalog_aux_reset,
-		.update_aux_cfg = dp_catalog_aux_update_cfg,
-		.enable        = dp_catalog_aux_enable,
-		.setup         = dp_catalog_aux_setup,
-		.get_irq       = dp_catalog_aux_get_irq,
-	};
-	struct dp_catalog_ctrl ctrl = {
-		.state_ctrl     = dp_catalog_ctrl_state_ctrl,
-		.config_ctrl    = dp_catalog_ctrl_config_ctrl,
-		.lane_mapping   = dp_catalog_ctrl_lane_mapping,
-		.mainlink_ctrl  = dp_catalog_ctrl_mainlink_ctrl,
-		.config_misc    = dp_catalog_ctrl_config_misc,
-		.config_msa     = dp_catalog_ctrl_config_msa,
-		.set_pattern    = dp_catalog_ctrl_set_pattern,
-		.reset          = dp_catalog_ctrl_reset,
-		.usb_reset      = dp_catalog_ctrl_usb_reset,
-		.mainlink_ready = dp_catalog_ctrl_mainlink_ready,
-		.enable_irq     = dp_catalog_ctrl_enable_irq,
-		.hpd_config     = dp_catalog_ctrl_hpd_config,
-		.phy_reset      = dp_catalog_ctrl_phy_reset,
-		.phy_lane_cfg   = dp_catalog_ctrl_phy_lane_cfg,
-		.update_vx_px   = dp_catalog_ctrl_update_vx_px,
-		.get_interrupt  = dp_catalog_ctrl_get_interrupt,
-		.config_hdr     = dp_catalog_ctrl_config_hdr,
-		.update_transfer_unit = dp_catalog_ctrl_update_transfer_unit,
-		.read_hdcp_status     = dp_catalog_ctrl_read_hdcp_status,
-		.send_phy_pattern    = dp_catalog_ctrl_send_phy_pattern,
-		.read_phy_pattern = dp_catalog_ctrl_read_phy_pattern,
-	};
-	struct dp_catalog_audio audio = {
-		.init       = dp_catalog_audio_init,
-		.config_acr = dp_catalog_audio_config_acr,
-		.enable     = dp_catalog_audio_enable,
-		.config_sdp = dp_catalog_audio_config_sdp,
-		.set_header = dp_catalog_audio_set_header,
-		.get_header = dp_catalog_audio_get_header,
-		.safe_to_exit_level = dp_catalog_audio_safe_to_exit_level,
-	};
-	struct dp_catalog_panel panel = {
-		.timing_cfg = dp_catalog_panel_timing_cfg,
-	};
-
-	if (!io) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	catalog  = devm_kzalloc(dev, sizeof(*catalog), GFP_KERNEL);
-	if (!catalog) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	catalog->dev = dev;
-	catalog->io = io;
-
-	dp_catalog = &catalog->dp_catalog;
-
-	dp_catalog->aux   = aux;
-	dp_catalog->ctrl  = ctrl;
-	dp_catalog->audio = audio;
-	dp_catalog->panel = panel;
-
-	return dp_catalog;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_catalog_put(struct dp_catalog *dp_catalog)
-{
-	struct dp_catalog_private *catalog;
-
-	if (!dp_catalog)
-		return;
-
-	catalog = container_of(dp_catalog, struct dp_catalog_private,
-				dp_catalog);
-
-	devm_kfree(catalog->dev, catalog);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.h b/drivers/gpu/drm/msm/dp/dp_catalog.h
deleted file mode 100644
index 12b5ad9..0000000
--- a/drivers/gpu/drm/msm/dp/dp_catalog.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_CATALOG_H_
-#define _DP_CATALOG_H_
-
-#include "dp_parser.h"
-
-/* interrupts */
-#define DP_INTR_HPD		BIT(0)
-#define DP_INTR_AUX_I2C_DONE	BIT(3)
-#define DP_INTR_WRONG_ADDR	BIT(6)
-#define DP_INTR_TIMEOUT		BIT(9)
-#define DP_INTR_NACK_DEFER	BIT(12)
-#define DP_INTR_WRONG_DATA_CNT	BIT(15)
-#define DP_INTR_I2C_NACK	BIT(18)
-#define DP_INTR_I2C_DEFER	BIT(21)
-#define DP_INTR_PLL_UNLOCKED	BIT(24)
-#define DP_INTR_AUX_ERROR	BIT(27)
-
-#define DP_INTR_READY_FOR_VIDEO		BIT(0)
-#define DP_INTR_IDLE_PATTERN_SENT	BIT(3)
-#define DP_INTR_FRAME_END		BIT(6)
-#define DP_INTR_CRC_UPDATED		BIT(9)
-
-#define HDR_PRIMARIES_COUNT   3
-
-struct dp_catalog_hdr_data {
-	u32 vsc_hdr_byte0;
-	u32 vsc_hdr_byte1;
-	u32 vsc_hdr_byte2;
-	u32 vsc_hdr_byte3;
-	u32 pkt_payload;
-
-	u32 bpc;
-
-	u32 version;
-	u32 length;
-	u32 eotf;
-	u32 descriptor_id;
-
-	u32 display_primaries_x[HDR_PRIMARIES_COUNT];
-	u32 display_primaries_y[HDR_PRIMARIES_COUNT];
-	u32 white_point_x;
-	u32 white_point_y;
-	u32 max_luminance;
-	u32 min_luminance;
-	u32 max_content_light_level;
-	u32 max_average_light_level;
-};
-
-struct dp_catalog_aux {
-	u32 data;
-	u32 isr;
-
-	u32 (*read_data)(struct dp_catalog_aux *aux);
-	int (*write_data)(struct dp_catalog_aux *aux);
-	int (*write_trans)(struct dp_catalog_aux *aux);
-	int (*clear_trans)(struct dp_catalog_aux *aux, bool read);
-	void (*reset)(struct dp_catalog_aux *aux);
-	void (*enable)(struct dp_catalog_aux *aux, bool enable);
-	void (*update_aux_cfg)(struct dp_catalog_aux *aux,
-		struct dp_aux_cfg *cfg, enum dp_phy_aux_config_type type);
-	void (*setup)(struct dp_catalog_aux *aux,
-			struct dp_aux_cfg *aux_cfg);
-	void (*get_irq)(struct dp_catalog_aux *aux, bool cmd_busy);
-};
-
-struct dp_catalog_ctrl {
-	u32 dp_tu;
-	u32 valid_boundary;
-	u32 valid_boundary2;
-	u32 isr;
-	struct dp_catalog_hdr_data hdr_data;
-
-	void (*state_ctrl)(struct dp_catalog_ctrl *ctrl, u32 state);
-	void (*config_ctrl)(struct dp_catalog_ctrl *ctrl, u32 config);
-	void (*lane_mapping)(struct dp_catalog_ctrl *ctrl);
-	void (*mainlink_ctrl)(struct dp_catalog_ctrl *ctrl, bool enable);
-	void (*config_misc)(struct dp_catalog_ctrl *ctrl, u32 cc, u32 tb);
-	void (*config_msa)(struct dp_catalog_ctrl *ctrl, u32 rate,
-				u32 stream_rate_khz, bool fixed_nvid);
-	void (*set_pattern)(struct dp_catalog_ctrl *ctrl, u32 pattern);
-	void (*reset)(struct dp_catalog_ctrl *ctrl);
-	void (*usb_reset)(struct dp_catalog_ctrl *ctrl, bool flip);
-	bool (*mainlink_ready)(struct dp_catalog_ctrl *ctrl);
-	void (*enable_irq)(struct dp_catalog_ctrl *ctrl, bool enable);
-	void (*hpd_config)(struct dp_catalog_ctrl *ctrl, bool enable);
-	void (*phy_reset)(struct dp_catalog_ctrl *ctrl);
-	void (*phy_lane_cfg)(struct dp_catalog_ctrl *ctrl, bool flipped,
-				u8 lane_cnt);
-	void (*update_vx_px)(struct dp_catalog_ctrl *ctrl, u8 v_level,
-				u8 p_level);
-	void (*get_interrupt)(struct dp_catalog_ctrl *ctrl);
-	void (*config_hdr)(struct dp_catalog_ctrl *ctrl);
-	void (*update_transfer_unit)(struct dp_catalog_ctrl *ctrl);
-	u32 (*read_hdcp_status)(struct dp_catalog_ctrl *ctrl);
-	void (*send_phy_pattern)(struct dp_catalog_ctrl *ctrl,
-			u32 pattern);
-	u32 (*read_phy_pattern)(struct dp_catalog_ctrl *ctrl);
-};
-
-enum dp_catalog_audio_sdp_type {
-	DP_AUDIO_SDP_STREAM,
-	DP_AUDIO_SDP_TIMESTAMP,
-	DP_AUDIO_SDP_INFOFRAME,
-	DP_AUDIO_SDP_COPYMANAGEMENT,
-	DP_AUDIO_SDP_ISRC,
-	DP_AUDIO_SDP_MAX,
-};
-
-enum dp_catalog_audio_header_type {
-	DP_AUDIO_SDP_HEADER_1,
-	DP_AUDIO_SDP_HEADER_2,
-	DP_AUDIO_SDP_HEADER_3,
-	DP_AUDIO_SDP_HEADER_MAX,
-};
-
-struct dp_catalog_audio {
-	enum dp_catalog_audio_sdp_type sdp_type;
-	enum dp_catalog_audio_header_type sdp_header;
-	u32 data;
-
-	void (*init)(struct dp_catalog_audio *audio);
-	void (*enable)(struct dp_catalog_audio *audio);
-	void (*config_acr)(struct dp_catalog_audio *audio);
-	void (*config_sdp)(struct dp_catalog_audio *audio);
-	void (*set_header)(struct dp_catalog_audio *audio);
-	void (*get_header)(struct dp_catalog_audio *audio);
-	void (*safe_to_exit_level)(struct dp_catalog_audio *audio);
-};
-
-struct dp_catalog_panel {
-	u32 total;
-	u32 sync_start;
-	u32 width_blanking;
-	u32 dp_active;
-
-	int (*timing_cfg)(struct dp_catalog_panel *panel);
-};
-
-struct dp_catalog {
-	struct dp_catalog_aux aux;
-	struct dp_catalog_ctrl ctrl;
-	struct dp_catalog_audio audio;
-	struct dp_catalog_panel panel;
-};
-
-struct dp_catalog *dp_catalog_get(struct device *dev, struct dp_io *io);
-void dp_catalog_put(struct dp_catalog *catalog);
-
-#endif /* _DP_CATALOG_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
deleted file mode 100644
index c8039fe..0000000
--- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
+++ /dev/null
@@ -1,1474 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/types.h>
-#include <linux/completion.h>
-#include <linux/delay.h>
-
-#include "dp_ctrl.h"
-
-#define DP_KHZ_TO_HZ 1000
-
-#define DP_CTRL_INTR_READY_FOR_VIDEO     BIT(0)
-#define DP_CTRL_INTR_IDLE_PATTERN_SENT  BIT(3)
-
-/* dp state ctrl */
-#define ST_TRAIN_PATTERN_1		BIT(0)
-#define ST_TRAIN_PATTERN_2		BIT(1)
-#define ST_TRAIN_PATTERN_3		BIT(2)
-#define ST_TRAIN_PATTERN_4		BIT(3)
-#define ST_SYMBOL_ERR_RATE_MEASUREMENT	BIT(4)
-#define ST_PRBS7			BIT(5)
-#define ST_CUSTOM_80_BIT_PATTERN	BIT(6)
-#define ST_SEND_VIDEO			BIT(7)
-#define ST_PUSH_IDLE			BIT(8)
-
-#define MR_LINK_TRAINING1  0x8
-#define MR_LINK_SYMBOL_ERM 0x80
-#define MR_LINK_PRBS7 0x100
-#define MR_LINK_CUSTOM80 0x200
-
-struct dp_vc_tu_mapping_table {
-	u32 vic;
-	u8 lanes;
-	u8 lrate; /* DP_LINK_RATE -> 162(6), 270(10), 540(20), 810 (30) */
-	u8 bpp;
-	u8 valid_boundary_link;
-	u16 delay_start_link;
-	bool boundary_moderation_en;
-	u8 valid_lower_boundary_link;
-	u8 upper_boundary_count;
-	u8 lower_boundary_count;
-	u8 tu_size_minus1;
-};
-
-struct dp_ctrl_private {
-	struct dp_ctrl dp_ctrl;
-
-	struct device *dev;
-	struct dp_aux *aux;
-	struct dp_panel *panel;
-	struct dp_link *link;
-	struct dp_power *power;
-	struct dp_parser *parser;
-	struct dp_catalog_ctrl *catalog;
-
-	struct completion idle_comp;
-	struct completion video_comp;
-
-	bool orientation;
-	atomic_t aborted;
-
-	u32 pixel_rate;
-	u32 vic;
-};
-
-enum notification_status {
-	NOTIFY_UNKNOWN,
-	NOTIFY_CONNECT,
-	NOTIFY_DISCONNECT,
-	NOTIFY_CONNECT_IRQ_HPD,
-	NOTIFY_DISCONNECT_IRQ_HPD,
-};
-
-static void dp_ctrl_idle_patterns_sent(struct dp_ctrl_private *ctrl)
-{
-	pr_debug("idle_patterns_sent\n");
-	complete(&ctrl->idle_comp);
-}
-
-static void dp_ctrl_video_ready(struct dp_ctrl_private *ctrl)
-{
-	pr_debug("dp_video_ready\n");
-	complete(&ctrl->video_comp);
-}
-
-static void dp_ctrl_abort(struct dp_ctrl *dp_ctrl)
-{
-	struct dp_ctrl_private *ctrl;
-
-	if (!dp_ctrl) {
-		pr_err("Invalid input data\n");
-		return;
-	}
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	atomic_set(&ctrl->aborted, 1);
-}
-
-static void dp_ctrl_state_ctrl(struct dp_ctrl_private *ctrl, u32 state)
-{
-	ctrl->catalog->state_ctrl(ctrl->catalog, state);
-}
-
-static void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl)
-{
-	int const idle_pattern_completion_timeout_ms = 3 * HZ / 100;
-	struct dp_ctrl_private *ctrl;
-
-	if (!dp_ctrl) {
-		pr_err("Invalid input data\n");
-		return;
-	}
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	reinit_completion(&ctrl->idle_comp);
-	dp_ctrl_state_ctrl(ctrl, ST_PUSH_IDLE);
-
-	if (!wait_for_completion_timeout(&ctrl->idle_comp,
-			idle_pattern_completion_timeout_ms))
-		pr_warn("PUSH_IDLE pattern timedout\n");
-
-	pr_debug("mainlink off done\n");
-}
-
-static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl)
-{
-	u32 config = 0, tbd;
-	u8 *dpcd = ctrl->panel->dpcd;
-
-	config |= (2 << 13); /* Default-> LSCLK DIV: 1/4 LCLK  */
-	config |= (0 << 11); /* RGB */
-
-	/* Scrambler reset enable */
-	if (dpcd[DP_EDP_CONFIGURATION_CAP] & DP_ALTERNATE_SCRAMBLER_RESET_CAP)
-		config |= (1 << 10);
-
-	tbd = ctrl->link->get_test_bits_depth(ctrl->link,
-			ctrl->panel->pinfo.bpp);
-
-	if (tbd == DP_TEST_BIT_DEPTH_UNKNOWN)
-		tbd = DP_TEST_BIT_DEPTH_8;
-
-	config |= tbd << 8;
-
-	/* Num of Lanes */
-	config |= ((ctrl->link->link_params.lane_count - 1) << 4);
-
-	if (drm_dp_enhanced_frame_cap(dpcd))
-		config |= 0x40;
-
-	config |= 0x04; /* progressive video */
-
-	config |= 0x03;	/* sycn clock & static Mvid */
-
-	ctrl->catalog->config_ctrl(ctrl->catalog, config);
-}
-
-/**
- * dp_ctrl_configure_source_params() - configures DP transmitter source params
- * @ctrl: Display Port Driver data
- *
- * Configures the DP transmitter source params including details such as lane
- * configuration, output format and sink/panel timing information.
- */
-static void dp_ctrl_configure_source_params(struct dp_ctrl_private *ctrl)
-{
-	u32 cc, tb;
-
-	ctrl->catalog->lane_mapping(ctrl->catalog);
-	ctrl->catalog->mainlink_ctrl(ctrl->catalog, true);
-
-	dp_ctrl_config_ctrl(ctrl);
-
-	tb = ctrl->link->get_test_bits_depth(ctrl->link,
-		ctrl->panel->pinfo.bpp);
-	cc = ctrl->link->get_colorimetry_config(ctrl->link);
-	ctrl->catalog->config_misc(ctrl->catalog, cc, tb);
-	ctrl->panel->timing_cfg(ctrl->panel);
-}
-
-static void dp_ctrl_get_extra_req_bytes(u64 result_valid,
-					int valid_bdary_link,
-					u64 value1, u64 value2,
-					bool *negative, u64 *result,
-					u64 compare)
-{
-	*negative = false;
-	if (result_valid >= compare) {
-		if (valid_bdary_link
-				>= compare)
-			*result = value1 + value2;
-		else {
-			if (value1 < value2)
-				*negative = true;
-			*result = (value1 >= value2) ?
-				(value1 - value2) : (value2 - value1);
-		}
-	} else {
-		if (valid_bdary_link
-				>= compare) {
-			if (value1 >= value2)
-				*negative = true;
-			*result = (value1 >= value2) ?
-				(value1 - value2) : (value2 - value1);
-		} else {
-			*result = value1 + value2;
-			*negative = true;
-		}
-	}
-}
-
-static u64 roundup_u64(u64 x, u64 y)
-{
-	x += (y - 1);
-	return (div64_ul(x, y) * y);
-}
-
-static u64 rounddown_u64(u64 x, u64 y)
-{
-	u64 rem;
-
-	div64_u64_rem(x, y, &rem);
-	return (x - rem);
-}
-
-static void dp_ctrl_calc_tu_parameters(struct dp_ctrl_private *ctrl,
-		struct dp_vc_tu_mapping_table *tu_table)
-{
-	u32 multiplier = 1000000;
-	u64 pclk, lclk;
-	u8 bpp, ln_cnt;
-	int run_idx = 0;
-	u32 lwidth, h_blank;
-	u32 fifo_empty = 0;
-	u32 ratio_scale = 1001;
-	u64 temp, ratio, original_ratio;
-	u64 temp2, reminder;
-	u64 temp3, temp4, result = 0;
-
-	u64 err = multiplier;
-	u64 n_err = 0, n_n_err = 0;
-	bool n_err_neg, nn_err_neg;
-	u8 hblank_margin = 16;
-
-	u8 tu_size, tu_size_desired = 0, tu_size_minus1;
-	int valid_boundary_link;
-	u64 resulting_valid;
-	u64 total_valid;
-	u64 effective_valid;
-	u64 effective_valid_recorded;
-	int n_tus;
-	int n_tus_per_lane;
-	int paired_tus;
-	int remainder_tus;
-	int remainder_tus_upper, remainder_tus_lower;
-	int extra_bytes;
-	int filler_size;
-	int delay_start_link;
-	int boundary_moderation_en = 0;
-	int upper_bdry_cnt = 0;
-	int lower_bdry_cnt = 0;
-	int i_upper_bdry_cnt = 0;
-	int i_lower_bdry_cnt = 0;
-	int valid_lower_boundary_link = 0;
-	int even_distribution_bf = 0;
-	int even_distribution_legacy = 0;
-	int even_distribution = 0;
-	int min_hblank = 0;
-	int extra_pclk_cycles;
-	u8 extra_pclk_cycle_delay = 4;
-	int extra_pclk_cycles_in_link_clk;
-	u64 ratio_by_tu;
-	u64 average_valid2;
-	u64 extra_buffer_margin;
-	int new_valid_boundary_link;
-
-	u64 resulting_valid_tmp;
-	u64 ratio_by_tu_tmp;
-	int n_tus_tmp;
-	int extra_pclk_cycles_tmp;
-	int extra_pclk_cycles_in_lclk_tmp;
-	int extra_req_bytes_new_tmp;
-	int filler_size_tmp;
-	int lower_filler_size_tmp;
-	int delay_start_link_tmp;
-	int min_hblank_tmp = 0;
-	bool extra_req_bytes_is_neg = false;
-	struct dp_panel_info *pinfo = &ctrl->panel->pinfo;
-
-	u8 dp_brute_force = 1;
-	u64 brute_force_threshold = 10;
-	u64 diff_abs;
-
-	ln_cnt =  ctrl->link->link_params.lane_count;
-
-	bpp = pinfo->bpp;
-	lwidth = pinfo->h_active;
-	h_blank = pinfo->h_back_porch + pinfo->h_front_porch +
-				pinfo->h_sync_width;
-	pclk = pinfo->pixel_clk_khz * 1000;
-
-	boundary_moderation_en = 0;
-	upper_bdry_cnt = 0;
-	lower_bdry_cnt = 0;
-	i_upper_bdry_cnt = 0;
-	i_lower_bdry_cnt = 0;
-	valid_lower_boundary_link = 0;
-	even_distribution_bf = 0;
-	even_distribution_legacy = 0;
-	even_distribution = 0;
-	min_hblank = 0;
-
-	lclk = drm_dp_bw_code_to_link_rate(
-		ctrl->link->link_params.bw_code) * DP_KHZ_TO_HZ;
-
-	pr_debug("pclk=%lld, active_width=%d, h_blank=%d\n",
-						pclk, lwidth, h_blank);
-	pr_debug("lclk = %lld, ln_cnt = %d\n", lclk, ln_cnt);
-	ratio = div64_u64_rem(pclk * bpp * multiplier,
-				8 * ln_cnt * lclk, &reminder);
-	ratio = div64_u64((pclk * bpp * multiplier), (8 * ln_cnt * lclk));
-	original_ratio = ratio;
-
-	extra_buffer_margin = roundup_u64(div64_u64(extra_pclk_cycle_delay
-				* lclk * multiplier, pclk), multiplier);
-	extra_buffer_margin = div64_u64(extra_buffer_margin, multiplier);
-
-	/* To deal with cases where lines are not distributable */
-	if (((lwidth % ln_cnt) != 0) && ratio < multiplier) {
-		ratio = ratio * ratio_scale;
-		ratio = ratio < (1000 * multiplier)
-				? ratio : (1000 * multiplier);
-	}
-	pr_debug("ratio = %lld\n", ratio);
-
-	for (tu_size = 32; tu_size <= 64; tu_size++) {
-		temp = ratio * tu_size;
-		temp2 = (div_u64(temp / multiplier) + 1) * multiplier;
-		n_err = roundup_u64(temp, multiplier) - temp;
-
-		if (n_err < err) {
-			err = n_err;
-			tu_size_desired = tu_size;
-		}
-	}
-	pr_debug("Info: tu_size_desired = %d\n", tu_size_desired);
-
-	tu_size_minus1 = tu_size_desired - 1;
-
-	valid_boundary_link = roundup_u64(ratio * tu_size_desired, multiplier);
-	valid_boundary_link /= multiplier;
-	n_tus = rounddown((lwidth * bpp * multiplier)
-			/ (8 * valid_boundary_link), multiplier) / multiplier;
-	even_distribution_legacy = n_tus % ln_cnt == 0 ? 1 : 0;
-	pr_debug("Info: n_symbol_per_tu=%d, number_of_tus=%d\n",
-					valid_boundary_link, n_tus);
-
-	extra_bytes = roundup_u64((n_tus + 1)
-			* ((valid_boundary_link * multiplier)
-			- (original_ratio * tu_size_desired)), multiplier);
-	extra_bytes /= multiplier;
-	extra_pclk_cycles = roundup(extra_bytes * 8 * multiplier / bpp,
-			multiplier);
-	extra_pclk_cycles /= multiplier;
-	extra_pclk_cycles_in_link_clk = roundup_u64(div64_u64(extra_pclk_cycles
-				* lclk * multiplier, pclk), multiplier);
-	extra_pclk_cycles_in_link_clk /= multiplier;
-	filler_size = roundup_u64((tu_size_desired - valid_boundary_link)
-						* multiplier, multiplier);
-	filler_size /= multiplier;
-	ratio_by_tu = div64_u64(ratio * tu_size_desired, multiplier);
-
-	pr_debug("extra_pclk_cycles_in_link_clk=%d, extra_bytes=%d\n",
-				extra_pclk_cycles_in_link_clk, extra_bytes);
-	pr_debug("extra_pclk_cycles_in_link_clk=%d\n",
-				extra_pclk_cycles_in_link_clk);
-	pr_debug("filler_size=%d, extra_buffer_margin=%lld\n",
-				filler_size, extra_buffer_margin);
-
-	delay_start_link = ((extra_bytes > extra_pclk_cycles_in_link_clk)
-			? extra_bytes
-			: extra_pclk_cycles_in_link_clk)
-				+ filler_size + extra_buffer_margin;
-	resulting_valid = valid_boundary_link;
-	pr_debug("Info: delay_start_link=%d, filler_size=%d\n",
-				delay_start_link, filler_size);
-	pr_debug("valid_boundary_link=%d ratio_by_tu=%lld\n",
-				valid_boundary_link, ratio_by_tu);
-
-	diff_abs = (resulting_valid >= ratio_by_tu)
-				? (resulting_valid - ratio_by_tu)
-				: (ratio_by_tu - resulting_valid);
-
-	if (err != 0 && ((diff_abs > brute_force_threshold)
-			|| (even_distribution_legacy == 0)
-			|| (dp_brute_force == 1))) {
-		err = multiplier;
-		for (tu_size = 32; tu_size <= 64; tu_size++) {
-			for (i_upper_bdry_cnt = 1; i_upper_bdry_cnt <= 15;
-						i_upper_bdry_cnt++) {
-				for (i_lower_bdry_cnt = 1;
-					i_lower_bdry_cnt <= 15;
-					i_lower_bdry_cnt++) {
-					new_valid_boundary_link =
-						roundup_u64(ratio
-						* tu_size, multiplier);
-					average_valid2 = (i_upper_bdry_cnt
-						* new_valid_boundary_link
-						+ i_lower_bdry_cnt
-						* (new_valid_boundary_link
-							- multiplier))
-						/ (i_upper_bdry_cnt
-							+ i_lower_bdry_cnt);
-					n_tus = rounddown_u64(div64_u64(lwidth
-						* multiplier * multiplier
-						* (bpp / 8), average_valid2),
-							multiplier);
-					n_tus /= multiplier;
-					n_tus_per_lane
-						= rounddown(n_tus
-							* multiplier
-							/ ln_cnt, multiplier);
-					n_tus_per_lane /= multiplier;
-					paired_tus =
-						rounddown((n_tus_per_lane)
-							* multiplier
-							/ (i_upper_bdry_cnt
-							+ i_lower_bdry_cnt),
-							multiplier);
-					paired_tus /= multiplier;
-					remainder_tus = n_tus_per_lane
-							- paired_tus
-						* (i_upper_bdry_cnt
-							+ i_lower_bdry_cnt);
-					if ((remainder_tus
-						- i_upper_bdry_cnt) > 0) {
-						remainder_tus_upper
-							= i_upper_bdry_cnt;
-						remainder_tus_lower =
-							remainder_tus
-							- i_upper_bdry_cnt;
-					} else {
-						remainder_tus_upper
-							= remainder_tus;
-						remainder_tus_lower = 0;
-					}
-					total_valid = paired_tus
-						* (i_upper_bdry_cnt
-						* new_valid_boundary_link
-							+ i_lower_bdry_cnt
-						* (new_valid_boundary_link
-							- multiplier))
-						+ (remainder_tus_upper
-						* new_valid_boundary_link)
-						+ (remainder_tus_lower
-						* (new_valid_boundary_link
-							- multiplier));
-					n_err_neg = nn_err_neg = false;
-					effective_valid
-						= div_u64(total_valid,
-							n_tus_per_lane);
-					n_n_err = (effective_valid
-							>= (ratio * tu_size))
-						? (effective_valid
-							- (ratio * tu_size))
-						: ((ratio * tu_size)
-							- effective_valid);
-					if (effective_valid < (ratio * tu_size))
-						nn_err_neg = true;
-					n_err = (average_valid2
-						>= (ratio * tu_size))
-						? (average_valid2
-							- (ratio * tu_size))
-						: ((ratio * tu_size)
-							- average_valid2);
-					if (average_valid2 < (ratio * tu_size))
-						n_err_neg = true;
-					even_distribution =
-						n_tus % ln_cnt == 0 ? 1 : 0;
-					diff_abs =
-						resulting_valid >= ratio_by_tu
-						? (resulting_valid
-							- ratio_by_tu)
-						: (ratio_by_tu
-							- resulting_valid);
-
-					resulting_valid_tmp = div64_u64(
-						(i_upper_bdry_cnt
-						* new_valid_boundary_link
-						+ i_lower_bdry_cnt
-						* (new_valid_boundary_link
-							- multiplier)),
-						(i_upper_bdry_cnt
-							+ i_lower_bdry_cnt));
-					ratio_by_tu_tmp =
-						original_ratio * tu_size;
-					ratio_by_tu_tmp /= multiplier;
-					n_tus_tmp = rounddown_u64(
-						div64_u64(lwidth
-						* multiplier * multiplier
-						* bpp / 8,
-						resulting_valid_tmp),
-						multiplier);
-					n_tus_tmp /= multiplier;
-
-					temp3 = (resulting_valid_tmp
-						>= (original_ratio * tu_size))
-						? (resulting_valid_tmp
-						- original_ratio * tu_size)
-						: (original_ratio * tu_size)
-						- resulting_valid_tmp;
-					temp3 = (n_tus_tmp + 1) * temp3;
-					temp4 = (new_valid_boundary_link
-						>= (original_ratio * tu_size))
-						? (new_valid_boundary_link
-							- original_ratio
-							* tu_size)
-						: (original_ratio * tu_size)
-						- new_valid_boundary_link;
-					temp4 = (i_upper_bdry_cnt
-							* ln_cnt * temp4);
-
-					temp3 = roundup_u64(temp3, multiplier);
-					temp4 = roundup_u64(temp4, multiplier);
-					dp_ctrl_get_extra_req_bytes
-						(resulting_valid_tmp,
-						new_valid_boundary_link,
-						temp3, temp4,
-						&extra_req_bytes_is_neg,
-						&result,
-						(original_ratio * tu_size));
-					extra_req_bytes_new_tmp
-						= div64_ul(result, multiplier);
-					if ((extra_req_bytes_is_neg)
-						&& (extra_req_bytes_new_tmp
-							> 1))
-						extra_req_bytes_new_tmp
-						= extra_req_bytes_new_tmp - 1;
-					if (extra_req_bytes_new_tmp == 0)
-						extra_req_bytes_new_tmp = 1;
-					extra_pclk_cycles_tmp =
-						(u64)(extra_req_bytes_new_tmp
-						      * 8 * multiplier) / bpp;
-					extra_pclk_cycles_tmp /= multiplier;
-
-					if (extra_pclk_cycles_tmp <= 0)
-						extra_pclk_cycles_tmp = 1;
-					extra_pclk_cycles_in_lclk_tmp =
-						roundup_u64(div64_u64(
-							extra_pclk_cycles_tmp
-							* lclk * multiplier,
-							pclk), multiplier);
-					extra_pclk_cycles_in_lclk_tmp
-						/= multiplier;
-					filler_size_tmp = roundup_u64(
-						(tu_size * multiplier *
-						new_valid_boundary_link),
-						multiplier);
-					filler_size_tmp /= multiplier;
-					lower_filler_size_tmp =
-						filler_size_tmp + 1;
-					if (extra_req_bytes_is_neg)
-						temp3 = (extra_req_bytes_new_tmp
-						> extra_pclk_cycles_in_lclk_tmp
-						? extra_pclk_cycles_in_lclk_tmp
-						: extra_req_bytes_new_tmp);
-					else
-						temp3 = (extra_req_bytes_new_tmp
-						> extra_pclk_cycles_in_lclk_tmp
-						? extra_req_bytes_new_tmp :
-						extra_pclk_cycles_in_lclk_tmp);
-
-					temp4 = lower_filler_size_tmp
-						+ extra_buffer_margin;
-					if (extra_req_bytes_is_neg)
-						delay_start_link_tmp
-							= (temp3 >= temp4)
-							? (temp3 - temp4)
-							: (temp4 - temp3);
-					else
-						delay_start_link_tmp
-							= temp3 + temp4;
-
-					min_hblank_tmp = (int)div64_u64(
-						roundup_u64(
-						div64_u64(delay_start_link_tmp
-						* pclk * multiplier, lclk),
-						multiplier), multiplier)
-						+ hblank_margin;
-
-					if (((even_distribution == 1)
-						|| ((even_distribution_bf == 0)
-						&& (even_distribution_legacy
-								== 0)))
-						&& !n_err_neg && !nn_err_neg
-						&& n_n_err < err
-						&& (n_n_err < diff_abs
-						|| (dp_brute_force == 1))
-						&& (new_valid_boundary_link
-									- 1) > 0
-						&& (h_blank >=
-							(u32)min_hblank_tmp)) {
-						upper_bdry_cnt =
-							i_upper_bdry_cnt;
-						lower_bdry_cnt =
-							i_lower_bdry_cnt;
-						err = n_n_err;
-						boundary_moderation_en = 1;
-						tu_size_desired = tu_size;
-						valid_boundary_link =
-							new_valid_boundary_link;
-						effective_valid_recorded
-							= effective_valid;
-						delay_start_link
-							= delay_start_link_tmp;
-						filler_size = filler_size_tmp;
-						min_hblank = min_hblank_tmp;
-						n_tus = n_tus_tmp;
-						even_distribution_bf = 1;
-
-						pr_debug("upper_bdry_cnt=%d, lower_boundary_cnt=%d, err=%lld, tu_size_desired=%d, valid_boundary_link=%d, effective_valid=%lld\n",
-							upper_bdry_cnt,
-							lower_bdry_cnt, err,
-							tu_size_desired,
-							valid_boundary_link,
-							effective_valid);
-					}
-				}
-			}
-		}
-
-		if (boundary_moderation_en == 1) {
-			resulting_valid = (u64)(upper_bdry_cnt
-					*valid_boundary_link + lower_bdry_cnt
-					* (valid_boundary_link - 1))
-					/ (upper_bdry_cnt + lower_bdry_cnt);
-			ratio_by_tu = original_ratio * tu_size_desired;
-			valid_lower_boundary_link =
-				(valid_boundary_link / multiplier) - 1;
-
-			tu_size_minus1 = tu_size_desired - 1;
-			even_distribution_bf = 1;
-			valid_boundary_link /= multiplier;
-			pr_debug("Info: Boundary_moderation enabled\n");
-		}
-	}
-
-	min_hblank = ((int) roundup_u64(div64_u64(delay_start_link * pclk
-			* multiplier, lclk), multiplier))
-			/ multiplier + hblank_margin;
-	if (h_blank < (u32)min_hblank) {
-		pr_debug(" WARNING: run_idx=%d Programmed h_blank %d is smaller than the min_hblank %d supported.\n",
-					run_idx, h_blank, min_hblank);
-	}
-
-	if (fifo_empty)	{
-		tu_size_minus1 = 31;
-		valid_boundary_link = 32;
-		delay_start_link = 0;
-		boundary_moderation_en = 0;
-	}
-
-	pr_debug("tu_size_minus1=%d valid_boundary_link=%d delay_start_link=%d boundary_moderation_en=%d\n upper_boundary_cnt=%d lower_boundary_cnt=%d valid_lower_boundary_link=%d min_hblank=%d\n",
-		tu_size_minus1, valid_boundary_link, delay_start_link,
-		boundary_moderation_en, upper_bdry_cnt, lower_bdry_cnt,
-		valid_lower_boundary_link, min_hblank);
-
-	tu_table->valid_boundary_link = valid_boundary_link;
-	tu_table->delay_start_link = delay_start_link;
-	tu_table->boundary_moderation_en = boundary_moderation_en;
-	tu_table->valid_lower_boundary_link = valid_lower_boundary_link;
-	tu_table->upper_boundary_count = upper_bdry_cnt;
-	tu_table->lower_boundary_count = lower_bdry_cnt;
-	tu_table->tu_size_minus1 = tu_size_minus1;
-}
-
-static void dp_ctrl_setup_tr_unit(struct dp_ctrl_private *ctrl)
-{
-	u32 dp_tu = 0x0;
-	u32 valid_boundary = 0x0;
-	u32 valid_boundary2 = 0x0;
-	struct dp_vc_tu_mapping_table tu_calc_table;
-
-	dp_ctrl_calc_tu_parameters(ctrl, &tu_calc_table);
-
-	dp_tu |= tu_calc_table.tu_size_minus1;
-	valid_boundary |= tu_calc_table.valid_boundary_link;
-	valid_boundary |= (tu_calc_table.delay_start_link << 16);
-
-	valid_boundary2 |= (tu_calc_table.valid_lower_boundary_link << 1);
-	valid_boundary2 |= (tu_calc_table.upper_boundary_count << 16);
-	valid_boundary2 |= (tu_calc_table.lower_boundary_count << 20);
-
-	if (tu_calc_table.boundary_moderation_en)
-		valid_boundary2 |= BIT(0);
-
-	pr_debug("dp_tu=0x%x, valid_boundary=0x%x, valid_boundary2=0x%x\n",
-			dp_tu, valid_boundary, valid_boundary2);
-
-	ctrl->catalog->dp_tu = dp_tu;
-	ctrl->catalog->valid_boundary = valid_boundary;
-	ctrl->catalog->valid_boundary2 = valid_boundary2;
-
-	ctrl->catalog->update_transfer_unit(ctrl->catalog);
-}
-
-static int dp_ctrl_wait4video_ready(struct dp_ctrl_private *ctrl)
-{
-	int ret = 0;
-
-	ret = wait_for_completion_timeout(&ctrl->video_comp, HZ / 2);
-	if (ret <= 0) {
-		pr_err("Link Train timedout\n");
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-static int dp_ctrl_update_sink_vx_px(struct dp_ctrl_private *ctrl,
-		u32 voltage_level, u32 pre_emphasis_level)
-{
-	int i;
-	u8 buf[4];
-	u32 max_level_reached = 0;
-
-	if (voltage_level == DP_LINK_VOLTAGE_MAX) {
-		pr_debug("max. voltage swing level reached %d\n",
-				voltage_level);
-		max_level_reached |= BIT(2);
-	}
-
-	if (pre_emphasis_level == DP_LINK_PRE_EMPHASIS_MAX) {
-		pr_debug("max. pre-emphasis level reached %d\n",
-				pre_emphasis_level);
-		max_level_reached  |= BIT(5);
-	}
-
-	pre_emphasis_level <<= 3;
-
-	for (i = 0; i < 4; i++)
-		buf[i] = voltage_level | pre_emphasis_level | max_level_reached;
-
-	pr_debug("sink: p|v=0x%x\n", voltage_level | pre_emphasis_level);
-	return drm_dp_dpcd_write(ctrl->aux->drm_aux, 0x103, buf, 4);
-}
-
-static void dp_ctrl_update_vx_px(struct dp_ctrl_private *ctrl)
-{
-	struct dp_link *link = ctrl->link;
-
-	ctrl->catalog->update_vx_px(ctrl->catalog,
-		link->phy_params.v_level, link->phy_params.p_level);
-
-	dp_ctrl_update_sink_vx_px(ctrl, link->phy_params.v_level,
-		link->phy_params.p_level);
-}
-
-static void dp_ctrl_train_pattern_set(struct dp_ctrl_private *ctrl,
-		u8 pattern)
-{
-	u8 buf[4];
-
-	pr_debug("sink: pattern=%x\n", pattern);
-
-	buf[0] = pattern;
-	drm_dp_dpcd_write(ctrl->aux->drm_aux, DP_TRAINING_PATTERN_SET, buf, 1);
-}
-
-static int dp_ctrl_read_link_status(struct dp_ctrl_private *ctrl,
-					u8 *link_status)
-{
-	int ret = 0, len;
-	u32 const offset = DP_LANE_ALIGN_STATUS_UPDATED - DP_LANE0_1_STATUS;
-	u32 link_status_read_max_retries = 100;
-
-	while (--link_status_read_max_retries) {
-		len = drm_dp_dpcd_read_link_status(ctrl->aux->drm_aux,
-			link_status);
-		if (len != DP_LINK_STATUS_SIZE) {
-			pr_err("DP link status read failed, err: %d\n", len);
-			ret = len;
-			break;
-		}
-
-		if (!(link_status[offset] & DP_LINK_STATUS_UPDATED))
-			break;
-	}
-
-	return ret;
-}
-
-static int dp_ctrl_link_train_1(struct dp_ctrl_private *ctrl)
-{
-	int tries, old_v_level, ret = 0;
-	u8 link_status[DP_LINK_STATUS_SIZE];
-	int const maximum_retries = 5;
-
-	dp_ctrl_state_ctrl(ctrl, 0);
-	/* Make sure to clear the current pattern before starting a new one */
-	wmb();
-
-	ctrl->catalog->set_pattern(ctrl->catalog, 0x01);
-	dp_ctrl_train_pattern_set(ctrl, DP_TRAINING_PATTERN_1 |
-		DP_LINK_SCRAMBLING_DISABLE); /* train_1 */
-	dp_ctrl_update_vx_px(ctrl);
-
-	tries = 0;
-	old_v_level = ctrl->link->phy_params.v_level;
-	while (1) {
-		drm_dp_link_train_clock_recovery_delay(ctrl->panel->dpcd);
-
-		ret = dp_ctrl_read_link_status(ctrl, link_status);
-		if (ret)
-			break;
-
-		if (drm_dp_clock_recovery_ok(link_status,
-			ctrl->link->link_params.lane_count)) {
-			break;
-		}
-
-		if (ctrl->link->phy_params.v_level == DP_LINK_VOLTAGE_MAX) {
-			pr_err_ratelimited("max v_level reached\n");
-			ret = -EAGAIN;
-			break;
-		}
-
-		if (old_v_level == ctrl->link->phy_params.v_level) {
-			tries++;
-			if (tries >= maximum_retries) {
-				pr_err("max tries reached\n");
-				ret = -ETIMEDOUT;
-				break;
-			}
-		} else {
-			tries = 0;
-			old_v_level = ctrl->link->phy_params.v_level;
-		}
-
-		pr_debug("clock recovery not done, adjusting vx px\n");
-
-		ctrl->link->adjust_levels(ctrl->link, link_status);
-		dp_ctrl_update_vx_px(ctrl);
-	}
-
-	return ret;
-}
-
-static int dp_ctrl_link_rate_down_shift(struct dp_ctrl_private *ctrl)
-{
-	int ret = 0;
-
-	if (!ctrl)
-		return -EINVAL;
-
-	switch (ctrl->link->link_params.bw_code) {
-	case DP_LINK_BW_8_1:
-		ctrl->link->link_params.bw_code = DP_LINK_BW_5_4;
-		break;
-	case DP_LINK_BW_5_4:
-		ctrl->link->link_params.bw_code = DP_LINK_BW_2_7;
-		break;
-	case DP_LINK_BW_2_7:
-	case DP_LINK_BW_1_62:
-	default:
-		ctrl->link->link_params.bw_code = DP_LINK_BW_1_62;
-		break;
-	};
-
-	pr_debug("new bw code=0x%x\n", ctrl->link->link_params.bw_code);
-
-	return ret;
-}
-
-static void dp_ctrl_clear_training_pattern(struct dp_ctrl_private *ctrl)
-{
-	dp_ctrl_train_pattern_set(ctrl, 0);
-	drm_dp_link_train_channel_eq_delay(ctrl->panel->dpcd);
-}
-
-static int dp_ctrl_link_training_2(struct dp_ctrl_private *ctrl)
-{
-	int tries = 0, ret = 0;
-	char pattern;
-	int const maximum_retries = 5;
-	u8 link_status[DP_LINK_STATUS_SIZE];
-
-	dp_ctrl_state_ctrl(ctrl, 0);
-	/* Make sure to clear the current pattern before starting a new one */
-	wmb();
-
-	if (drm_dp_tps3_supported(ctrl->panel->dpcd))
-		pattern = DP_TRAINING_PATTERN_3;
-	else
-		pattern = DP_TRAINING_PATTERN_2;
-
-	dp_ctrl_update_vx_px(ctrl);
-	ctrl->catalog->set_pattern(ctrl->catalog, pattern);
-	dp_ctrl_train_pattern_set(ctrl, pattern | DP_RECOVERED_CLOCK_OUT_EN);
-
-	do  {
-		drm_dp_link_train_channel_eq_delay(ctrl->panel->dpcd);
-
-		ret = dp_ctrl_read_link_status(ctrl, link_status);
-		if (ret)
-			break;
-
-		if (drm_dp_channel_eq_ok(link_status,
-			ctrl->link->link_params.lane_count))
-			break;
-
-		if (tries > maximum_retries) {
-			ret = -ETIMEDOUT;
-			break;
-		}
-		tries++;
-
-		ctrl->link->adjust_levels(ctrl->link, link_status);
-		dp_ctrl_update_vx_px(ctrl);
-	} while (1);
-
-	return ret;
-}
-
-static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl)
-{
-	int ret = 0;
-	u8 encoding = 0x1;
-	struct drm_dp_link link_info = {0};
-
-	ctrl->link->phy_params.p_level = 0;
-	ctrl->link->phy_params.v_level = 0;
-
-	dp_ctrl_config_ctrl(ctrl);
-
-	link_info.num_lanes = ctrl->link->link_params.lane_count;
-	link_info.rate = drm_dp_bw_code_to_link_rate(
-		ctrl->link->link_params.bw_code);
-	link_info.capabilities = ctrl->panel->link_info.capabilities;
-
-	drm_dp_link_configure(ctrl->aux->drm_aux, &link_info);
-	drm_dp_dpcd_write(ctrl->aux->drm_aux, DP_MAIN_LINK_CHANNEL_CODING_SET,
-				&encoding, 1);
-
-	ret = dp_ctrl_link_train_1(ctrl);
-	if (ret) {
-		pr_err("link training #1 failed\n");
-		goto end;
-	}
-
-	/* print success info as this is a result of user initiated action */
-	pr_info("link training #1 successful\n");
-
-	ret = dp_ctrl_link_training_2(ctrl);
-	if (ret) {
-		pr_err("link training #2 failed\n");
-		goto end;
-	}
-
-	/* print success info as this is a result of user initiated action */
-	pr_debug("link training #2 successful\n");
-
-end:
-	dp_ctrl_state_ctrl(ctrl, 0);
-	/* Make sure to clear the current pattern before starting a new one */
-	wmb();
-
-	dp_ctrl_clear_training_pattern(ctrl);
-	return ret;
-}
-
-static int dp_ctrl_setup_main_link(struct dp_ctrl_private *ctrl, bool train)
-{
-	bool mainlink_ready = false;
-	int ret = 0;
-
-	ctrl->catalog->mainlink_ctrl(ctrl->catalog, true);
-
-	ret = ctrl->link->psm_config(ctrl->link,
-		&ctrl->panel->link_info, false);
-	if (ret)
-		goto end;
-
-	if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN)
-		goto end;
-
-	if (!train)
-		goto send_video;
-
-	/*
-	 * As part of previous calls, DP controller state might have
-	 * transitioned to PUSH_IDLE. In order to start transmitting a link
-	 * training pattern, we have to first to a DP software reset.
-	 */
-	ctrl->catalog->reset(ctrl->catalog);
-
-	ret = dp_ctrl_link_train(ctrl);
-	if (ret)
-		goto end;
-
-send_video:
-	/*
-	 * Set up transfer unit values and set controller state to send
-	 * video.
-	 */
-	dp_ctrl_setup_tr_unit(ctrl);
-	ctrl->catalog->state_ctrl(ctrl->catalog, ST_SEND_VIDEO);
-
-	dp_ctrl_wait4video_ready(ctrl);
-	mainlink_ready = ctrl->catalog->mainlink_ready(ctrl->catalog);
-	pr_debug("mainlink %s\n", mainlink_ready ? "READY" : "NOT READY");
-end:
-	return ret;
-}
-
-static void dp_ctrl_set_clock_rate(struct dp_ctrl_private *ctrl,
-		char *name, u32 rate)
-{
-	u32 num = ctrl->parser->mp[DP_CTRL_PM].num_clk;
-	struct dss_clk *cfg = ctrl->parser->mp[DP_CTRL_PM].clk_config;
-
-	while (num && strcmp(cfg->clk_name, name)) {
-		num--;
-		cfg++;
-	}
-
-	pr_debug("setting rate=%d on clk=%s\n", rate, name);
-
-	if (num)
-		cfg->rate = rate;
-	else
-		pr_err("%s clock could not be set with rate %d\n", name, rate);
-}
-
-static int dp_ctrl_enable_mainlink_clocks(struct dp_ctrl_private *ctrl)
-{
-	int ret = 0;
-
-	ctrl->power->set_pixel_clk_parent(ctrl->power);
-
-	dp_ctrl_set_clock_rate(ctrl, "ctrl_link_clk",
-		drm_dp_bw_code_to_link_rate(ctrl->link->link_params.bw_code));
-
-	dp_ctrl_set_clock_rate(ctrl, "ctrl_pixel_clk", ctrl->pixel_rate);
-
-	ret = ctrl->power->clk_enable(ctrl->power, DP_CTRL_PM, true);
-	if (ret) {
-		pr_err("Unabled to start link clocks\n");
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-static int dp_ctrl_disable_mainlink_clocks(struct dp_ctrl_private *ctrl)
-{
-	return ctrl->power->clk_enable(ctrl->power, DP_CTRL_PM, false);
-}
-
-static int dp_ctrl_host_init(struct dp_ctrl *dp_ctrl, bool flip)
-{
-	struct dp_ctrl_private *ctrl;
-	struct dp_catalog_ctrl *catalog;
-
-	if (!dp_ctrl) {
-		pr_err("Invalid input data\n");
-		return -EINVAL;
-	}
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	ctrl->orientation = flip;
-	catalog = ctrl->catalog;
-
-	catalog->usb_reset(ctrl->catalog, flip);
-	catalog->phy_reset(ctrl->catalog);
-	catalog->enable_irq(ctrl->catalog, true);
-
-	return 0;
-}
-
-/**
- * dp_ctrl_host_deinit() - Uninitialize DP controller
- * @ctrl: Display Port Driver data
- *
- * Perform required steps to uninitialize DP controller
- * and its resources.
- */
-static void dp_ctrl_host_deinit(struct dp_ctrl *dp_ctrl)
-{
-	struct dp_ctrl_private *ctrl;
-
-	if (!dp_ctrl) {
-		pr_err("Invalid input data\n");
-		return;
-	}
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	ctrl->catalog->enable_irq(ctrl->catalog, false);
-
-	pr_debug("Host deinitialized successfully\n");
-}
-
-static bool dp_ctrl_use_fixed_nvid(struct dp_ctrl_private *ctrl)
-{
-	u8 *dpcd = ctrl->panel->dpcd;
-
-	/*
-	 * For better interop experience, used a fixed NVID=0x8000
-	 * whenever connected to a VGA dongle downstream.
-	 */
-	if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT) {
-		u8 type = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
-			DP_DWN_STRM_PORT_TYPE_MASK;
-		if (type == DP_DWN_STRM_PORT_TYPE_ANALOG)
-			return true;
-	}
-
-	return false;
-}
-
-static int dp_ctrl_link_maintenance(struct dp_ctrl_private *ctrl)
-{
-	int ret = 0;
-
-	ctrl->dp_ctrl.push_idle(&ctrl->dp_ctrl);
-	ctrl->dp_ctrl.reset(&ctrl->dp_ctrl);
-
-	ctrl->pixel_rate = ctrl->panel->pinfo.pixel_clk_khz;
-
-	do {
-		if (ret == -EAGAIN) {
-			/* try with lower link rate */
-			dp_ctrl_link_rate_down_shift(ctrl);
-
-			ctrl->catalog->mainlink_ctrl(ctrl->catalog, false);
-		}
-
-		ctrl->catalog->phy_lane_cfg(ctrl->catalog,
-			ctrl->orientation, ctrl->link->link_params.lane_count);
-
-		/*
-		 * Disable and re-enable the mainlink clock since the
-		 * link clock might have been adjusted as part of the
-		 * link maintenance.
-		 */
-		dp_ctrl_disable_mainlink_clocks(ctrl);
-
-		ret = dp_ctrl_enable_mainlink_clocks(ctrl);
-		if (ret)
-			continue;
-
-		dp_ctrl_configure_source_params(ctrl);
-
-		ctrl->catalog->config_msa(ctrl->catalog,
-			drm_dp_bw_code_to_link_rate(
-			ctrl->link->link_params.bw_code),
-			ctrl->pixel_rate, dp_ctrl_use_fixed_nvid(ctrl));
-
-		reinit_completion(&ctrl->idle_comp);
-
-		ret = dp_ctrl_setup_main_link(ctrl, true);
-	} while (ret == -EAGAIN);
-
-	return ret;
-}
-
-static void dp_ctrl_process_phy_test_request(struct dp_ctrl_private *ctrl)
-{
-	int ret = 0;
-
-	if (!ctrl->link->phy_params.phy_test_pattern_sel) {
-		pr_debug("no test pattern selected by sink\n");
-		return;
-	}
-
-	pr_debug("start\n");
-
-	ctrl->dp_ctrl.push_idle(&ctrl->dp_ctrl);
-	/*
-	 * The global reset will need DP link ralated clocks to be
-	 * running. Add the global reset just before disabling the
-	 * link clocks and core clocks.
-	 */
-	ctrl->dp_ctrl.reset(&ctrl->dp_ctrl);
-	ctrl->dp_ctrl.off(&ctrl->dp_ctrl);
-
-	ret = ctrl->dp_ctrl.on(&ctrl->dp_ctrl);
-	if (ret)
-		pr_err("failed to enable DP controller\n");
-
-	pr_debug("end\n");
-}
-
-static void dp_ctrl_send_phy_test_pattern(struct dp_ctrl_private *ctrl)
-{
-	bool success = false;
-	u32 pattern_sent = 0x0;
-	u32 pattern_requested = ctrl->link->phy_params.phy_test_pattern_sel;
-
-	pr_debug("request: %s\n",
-			dp_link_get_phy_test_pattern(pattern_requested));
-
-	ctrl->catalog->update_vx_px(ctrl->catalog,
-			ctrl->link->phy_params.v_level,
-			ctrl->link->phy_params.p_level);
-	ctrl->catalog->send_phy_pattern(ctrl->catalog, pattern_requested);
-	ctrl->link->send_test_response(ctrl->link);
-
-	pattern_sent = ctrl->catalog->read_phy_pattern(ctrl->catalog);
-
-	switch (pattern_sent) {
-	case MR_LINK_TRAINING1:
-		if (pattern_requested ==
-				DP_TEST_PHY_PATTERN_D10_2_NO_SCRAMBLING)
-			success = true;
-		break;
-	case MR_LINK_SYMBOL_ERM:
-		if ((pattern_requested ==
-				DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT)
-			|| (pattern_requested ==
-				DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN))
-			success = true;
-		break;
-	case MR_LINK_PRBS7:
-		if (pattern_requested == DP_TEST_PHY_PATTERN_PRBS7)
-			success = true;
-		break;
-	case MR_LINK_CUSTOM80:
-		if (pattern_requested ==
-				DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN)
-			success = true;
-		break;
-	default:
-		success = false;
-		return;
-	}
-
-	pr_debug("%s: %s\n", success ? "success" : "failed",
-			dp_link_get_phy_test_pattern(pattern_requested));
-}
-
-static void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl)
-{
-	struct dp_ctrl_private *ctrl;
-	u32 sink_request = 0x0;
-
-	if (!dp_ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-	sink_request = ctrl->link->sink_request;
-
-	if (sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) {
-		pr_info("PHY_TEST_PATTERN request\n");
-		dp_ctrl_process_phy_test_request(ctrl);
-	}
-
-	if (sink_request & DP_LINK_STATUS_UPDATED)
-		dp_ctrl_link_maintenance(ctrl);
-
-	if (sink_request & DP_TEST_LINK_TRAINING) {
-		ctrl->link->send_test_response(ctrl->link);
-		dp_ctrl_link_maintenance(ctrl);
-	}
-}
-
-static void dp_ctrl_reset(struct dp_ctrl *dp_ctrl)
-{
-	struct dp_ctrl_private *ctrl;
-
-	if (!dp_ctrl) {
-		pr_err("invalid params\n");
-		return;
-	}
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-	ctrl->catalog->reset(ctrl->catalog);
-}
-
-static int dp_ctrl_on(struct dp_ctrl *dp_ctrl)
-{
-	int rc = 0;
-	struct dp_ctrl_private *ctrl;
-	u32 rate = 0;
-	u32 link_train_max_retries = 100;
-	u32 const phy_cts_pixel_clk_khz = 148500;
-
-	if (!dp_ctrl) {
-		rc = -EINVAL;
-		goto end;
-	}
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	atomic_set(&ctrl->aborted, 0);
-	rate = ctrl->panel->link_info.rate;
-
-	ctrl->power->clk_enable(ctrl->power, DP_CORE_PM, true);
-	ctrl->catalog->hpd_config(ctrl->catalog, true);
-
-	if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) {
-		pr_debug("using phy test link parameters\n");
-		if (!ctrl->panel->pinfo.pixel_clk_khz)
-			ctrl->pixel_rate = phy_cts_pixel_clk_khz;
-	} else {
-		ctrl->link->link_params.bw_code =
-			drm_dp_link_rate_to_bw_code(rate);
-		ctrl->link->link_params.lane_count =
-			ctrl->panel->link_info.num_lanes;
-		ctrl->pixel_rate = ctrl->panel->pinfo.pixel_clk_khz;
-	}
-
-	pr_debug("bw_code=%d, lane_count=%d, pixel_rate=%d\n",
-		ctrl->link->link_params.bw_code,
-		ctrl->link->link_params.lane_count, ctrl->pixel_rate);
-
-	ctrl->catalog->phy_lane_cfg(ctrl->catalog,
-			ctrl->orientation, ctrl->link->link_params.lane_count);
-
-	rc = dp_ctrl_enable_mainlink_clocks(ctrl);
-	if (rc)
-		goto end;
-
-	reinit_completion(&ctrl->idle_comp);
-
-	dp_ctrl_configure_source_params(ctrl);
-
-	while (--link_train_max_retries && !atomic_read(&ctrl->aborted)) {
-		ctrl->catalog->config_msa(ctrl->catalog,
-			drm_dp_bw_code_to_link_rate(
-			ctrl->link->link_params.bw_code),
-			ctrl->pixel_rate, dp_ctrl_use_fixed_nvid(ctrl));
-
-		rc = dp_ctrl_setup_main_link(ctrl, true);
-		if (!rc)
-			break;
-
-		/* try with lower link rate */
-		dp_ctrl_link_rate_down_shift(ctrl);
-
-		ctrl->catalog->mainlink_ctrl(ctrl->catalog, false);
-
-		dp_ctrl_disable_mainlink_clocks(ctrl);
-		/* hw recommended delay before re-enabling clocks */
-		msleep(20);
-
-		dp_ctrl_enable_mainlink_clocks(ctrl);
-	}
-
-	if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN)
-		dp_ctrl_send_phy_test_pattern(ctrl);
-
-	pr_debug("End-\n");
-
-end:
-	return rc;
-}
-
-static void dp_ctrl_off(struct dp_ctrl *dp_ctrl)
-{
-	struct dp_ctrl_private *ctrl;
-
-	if (!dp_ctrl)
-		return;
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	ctrl->catalog->mainlink_ctrl(ctrl->catalog, false);
-	ctrl->catalog->reset(ctrl->catalog);
-
-	/* Make sure DP is disabled before clk disable */
-	wmb();
-
-	dp_ctrl_disable_mainlink_clocks(ctrl);
-
-	pr_debug("DP off done\n");
-}
-
-static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl)
-{
-	struct dp_ctrl_private *ctrl;
-
-	if (!dp_ctrl)
-		return;
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	ctrl->catalog->get_interrupt(ctrl->catalog);
-
-	if (ctrl->catalog->isr & DP_CTRL_INTR_READY_FOR_VIDEO)
-		dp_ctrl_video_ready(ctrl);
-
-	if (ctrl->catalog->isr & DP_CTRL_INTR_IDLE_PATTERN_SENT)
-		dp_ctrl_idle_patterns_sent(ctrl);
-}
-
-struct dp_ctrl *dp_ctrl_get(struct dp_ctrl_in *in)
-{
-	int rc = 0;
-	struct dp_ctrl_private *ctrl;
-	struct dp_ctrl *dp_ctrl;
-
-	if (!in->dev || !in->panel || !in->aux ||
-	    !in->link || !in->catalog) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	ctrl = devm_kzalloc(in->dev, sizeof(*ctrl), GFP_KERNEL);
-	if (!ctrl) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	init_completion(&ctrl->idle_comp);
-	init_completion(&ctrl->video_comp);
-
-	/* in parameters */
-	ctrl->parser   = in->parser;
-	ctrl->panel    = in->panel;
-	ctrl->power    = in->power;
-	ctrl->aux      = in->aux;
-	ctrl->link     = in->link;
-	ctrl->catalog  = in->catalog;
-
-	dp_ctrl = &ctrl->dp_ctrl;
-
-	/* out parameters */
-	dp_ctrl->init      = dp_ctrl_host_init;
-	dp_ctrl->deinit    = dp_ctrl_host_deinit;
-	dp_ctrl->on        = dp_ctrl_on;
-	dp_ctrl->off       = dp_ctrl_off;
-	dp_ctrl->push_idle = dp_ctrl_push_idle;
-	dp_ctrl->abort     = dp_ctrl_abort;
-	dp_ctrl->isr       = dp_ctrl_isr;
-	dp_ctrl->reset	   = dp_ctrl_reset;
-	dp_ctrl->handle_sink_request = dp_ctrl_handle_sink_request;
-
-	return dp_ctrl;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_ctrl_put(struct dp_ctrl *dp_ctrl)
-{
-	struct dp_ctrl_private *ctrl;
-
-	if (!dp_ctrl)
-		return;
-
-	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
-
-	devm_kfree(ctrl->dev, ctrl);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.h b/drivers/gpu/drm/msm/dp/dp_ctrl.h
deleted file mode 100644
index 6ab221a..0000000
--- a/drivers/gpu/drm/msm/dp/dp_ctrl.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_CTRL_H_
-#define _DP_CTRL_H_
-
-#include "dp_aux.h"
-#include "dp_panel.h"
-#include "dp_link.h"
-#include "dp_parser.h"
-#include "dp_power.h"
-#include "dp_catalog.h"
-
-struct dp_ctrl {
-	int (*init)(struct dp_ctrl *dp_ctrl, bool flip);
-	void (*deinit)(struct dp_ctrl *dp_ctrl);
-	int (*on)(struct dp_ctrl *dp_ctrl);
-	void (*off)(struct dp_ctrl *dp_ctrl);
-	void (*reset)(struct dp_ctrl *dp_ctrl);
-	void (*push_idle)(struct dp_ctrl *dp_ctrl);
-	void (*abort)(struct dp_ctrl *dp_ctrl);
-	void (*isr)(struct dp_ctrl *dp_ctrl);
-	void (*handle_sink_request)(struct dp_ctrl *dp_ctrl);
-};
-
-struct dp_ctrl_in {
-	struct device *dev;
-	struct dp_panel *panel;
-	struct dp_aux *aux;
-	struct dp_link *link;
-	struct dp_parser *parser;
-	struct dp_power *power;
-	struct dp_catalog_ctrl *catalog;
-};
-
-struct dp_ctrl *dp_ctrl_get(struct dp_ctrl_in *in);
-void dp_ctrl_put(struct dp_ctrl *dp_ctrl);
-
-#endif /* _DP_CTRL_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c
deleted file mode 100644
index a48f82e..0000000
--- a/drivers/gpu/drm/msm/dp/dp_debug.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/debugfs.h>
-
-#include "dp_parser.h"
-#include "dp_power.h"
-#include "dp_catalog.h"
-#include "dp_aux.h"
-#include "dp_ctrl.h"
-#include "dp_debug.h"
-#include "drm_connector.h"
-#include "dp_display.h"
-
-#define DEBUG_NAME "drm_dp"
-
-struct dp_debug_private {
-	struct dentry *root;
-
-	struct dp_usbpd *usbpd;
-	struct dp_link *link;
-	struct dp_panel *panel;
-	struct drm_connector **connector;
-	struct device *dev;
-
-	struct dp_debug dp_debug;
-};
-
-static ssize_t dp_debug_write_hpd(struct file *file,
-		const char __user *user_buff, size_t count, loff_t *ppos)
-{
-	struct dp_debug_private *debug = file->private_data;
-	char buf[SZ_8];
-	size_t len = 0;
-	int hpd;
-
-	if (!debug)
-		return -ENODEV;
-
-	if (*ppos)
-		return 0;
-
-	/* Leave room for termination char */
-	len = min_t(size_t, count, SZ_8 - 1);
-	if (copy_from_user(buf, user_buff, len))
-		goto end;
-
-	buf[len] = '\0';
-
-	if (kstrtoint(buf, 10, &hpd) != 0)
-		goto end;
-
-	debug->usbpd->connect(debug->usbpd, hpd);
-end:
-	return -len;
-}
-
-static ssize_t dp_debug_write_edid_modes(struct file *file,
-		const char __user *user_buff, size_t count, loff_t *ppos)
-{
-	struct dp_debug_private *debug = file->private_data;
-	char buf[SZ_32];
-	size_t len = 0;
-	int hdisplay = 0, vdisplay = 0, vrefresh = 0;
-
-	if (!debug)
-		return -ENODEV;
-
-	if (*ppos)
-		goto end;
-
-	/* Leave room for termination char */
-	len = min_t(size_t, count, SZ_32 - 1);
-	if (copy_from_user(buf, user_buff, len))
-		goto clear;
-
-	buf[len] = '\0';
-
-	if (sscanf(buf, "%d %d %d", &hdisplay, &vdisplay, &vrefresh) != 3)
-		goto clear;
-
-	if (!hdisplay || !vdisplay || !vrefresh)
-		goto clear;
-
-	debug->dp_debug.debug_en = true;
-	debug->dp_debug.hdisplay = hdisplay;
-	debug->dp_debug.vdisplay = vdisplay;
-	debug->dp_debug.vrefresh = vrefresh;
-	goto end;
-clear:
-	pr_debug("clearing debug modes\n");
-	debug->dp_debug.debug_en = false;
-end:
-	return len;
-}
-
-static ssize_t dp_debug_read_connected(struct file *file,
-		char __user *user_buff, size_t count, loff_t *ppos)
-{
-	struct dp_debug_private *debug = file->private_data;
-	char buf[SZ_8];
-	u32 len = 0;
-
-	if (!debug)
-		return -ENODEV;
-
-	if (*ppos)
-		return 0;
-
-	len += snprintf(buf, SZ_8, "%d\n", debug->usbpd->hpd_high);
-
-	if (copy_to_user(user_buff, buf, len))
-		return -EFAULT;
-
-	*ppos += len;
-	return len;
-}
-
-static ssize_t dp_debug_read_edid_modes(struct file *file,
-		char __user *user_buff, size_t count, loff_t *ppos)
-{
-	struct dp_debug_private *debug = file->private_data;
-	char *buf;
-	u32 len = 0;
-	int rc = 0;
-	struct drm_connector *connector;
-	struct drm_display_mode *mode;
-
-	if (!debug) {
-		pr_err("invalid data\n");
-		rc = -ENODEV;
-		goto error;
-	}
-
-	connector = *debug->connector;
-
-	if (!connector) {
-		pr_err("connector is NULL\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	if (*ppos)
-		goto error;
-
-	buf = kzalloc(SZ_4K, GFP_KERNEL);
-	if (!buf) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	list_for_each_entry(mode, &connector->modes, head) {
-		len += snprintf(buf + len, SZ_4K - len,
-		"%s %d %d %d %d %d %d %d %d %d 0x%x\n",
-		mode->name, mode->vrefresh, mode->hdisplay,
-		mode->hsync_start, mode->hsync_end, mode->htotal,
-		mode->vdisplay, mode->vsync_start, mode->vsync_end,
-		mode->vtotal, mode->flags);
-	}
-
-	if (copy_to_user(user_buff, buf, len)) {
-		kfree(buf);
-		rc = -EFAULT;
-		goto error;
-	}
-
-	*ppos += len;
-	kfree(buf);
-
-	return len;
-error:
-	return rc;
-}
-
-static int dp_debug_check_buffer_overflow(int rc, int *max_size, int *len)
-{
-	if (rc >= *max_size) {
-		pr_err("buffer overflow\n");
-		return -EINVAL;
-	}
-	*len += rc;
-	*max_size = SZ_4K - *len;
-
-	return 0;
-}
-
-static ssize_t dp_debug_read_info(struct file *file, char __user *user_buff,
-		size_t count, loff_t *ppos)
-{
-	struct dp_debug_private *debug = file->private_data;
-	char *buf;
-	u32 len = 0, rc = 0;
-	u64 lclk = 0;
-	u32 max_size = SZ_4K;
-
-	if (!debug)
-		return -ENODEV;
-
-	if (*ppos)
-		return 0;
-
-	buf = kzalloc(SZ_4K, GFP_KERNEL);
-	if (!buf)
-		return -ENOMEM;
-
-	rc = snprintf(buf + len, max_size, "\tname = %s\n", DEBUG_NAME);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\tdp_panel\n\t\tmax_pclk_khz = %d\n",
-		debug->panel->max_pclk_khz);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\tdrm_dp_link\n\t\trate = %u\n",
-		debug->panel->link_info.rate);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tnum_lanes = %u\n",
-		debug->panel->link_info.num_lanes);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tcapabilities = %lu\n",
-		debug->panel->link_info.capabilities);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\tdp_panel_info:\n\t\tactive = %dx%d\n",
-		debug->panel->pinfo.h_active,
-		debug->panel->pinfo.v_active);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tback_porch = %dx%d\n",
-		debug->panel->pinfo.h_back_porch,
-		debug->panel->pinfo.v_back_porch);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tfront_porch = %dx%d\n",
-		debug->panel->pinfo.h_front_porch,
-		debug->panel->pinfo.v_front_porch);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tsync_width = %dx%d\n",
-		debug->panel->pinfo.h_sync_width,
-		debug->panel->pinfo.v_sync_width);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tactive_low = %dx%d\n",
-		debug->panel->pinfo.h_active_low,
-		debug->panel->pinfo.v_active_low);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\th_skew = %d\n",
-		debug->panel->pinfo.h_skew);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\trefresh rate = %d\n",
-		debug->panel->pinfo.refresh_rate);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tpixel clock khz = %d\n",
-		debug->panel->pinfo.pixel_clk_khz);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tbpp = %d\n",
-		debug->panel->pinfo.bpp);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	/* Link Information */
-	rc = snprintf(buf + len, max_size,
-		"\tdp_link:\n\t\ttest_requested = %d\n",
-		debug->link->sink_request);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tlane_count = %d\n", debug->link->link_params.lane_count);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tbw_code = %d\n", debug->link->link_params.bw_code);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	lclk = drm_dp_bw_code_to_link_rate(
-			debug->link->link_params.bw_code) * 1000;
-	rc = snprintf(buf + len, max_size,
-		"\t\tlclk = %lld\n", lclk);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tv_level = %d\n", debug->link->phy_params.v_level);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	rc = snprintf(buf + len, max_size,
-		"\t\tp_level = %d\n", debug->link->phy_params.p_level);
-	if (dp_debug_check_buffer_overflow(rc, &max_size, &len))
-		goto error;
-
-	if (copy_to_user(user_buff, buf, len))
-		goto error;
-
-	*ppos += len;
-
-	kfree(buf);
-	return len;
-error:
-	kfree(buf);
-	return -EINVAL;
-}
-
-static const struct file_operations dp_debug_fops = {
-	.open = simple_open,
-	.read = dp_debug_read_info,
-};
-
-static const struct file_operations edid_modes_fops = {
-	.open = simple_open,
-	.read = dp_debug_read_edid_modes,
-	.write = dp_debug_write_edid_modes,
-};
-
-static const struct file_operations hpd_fops = {
-	.open = simple_open,
-	.write = dp_debug_write_hpd,
-};
-
-static const struct file_operations connected_fops = {
-	.open = simple_open,
-	.read = dp_debug_read_connected,
-};
-
-static int dp_debug_init(struct dp_debug *dp_debug)
-{
-	int rc = 0;
-	struct dp_debug_private *debug = container_of(dp_debug,
-		struct dp_debug_private, dp_debug);
-	struct dentry *dir, *file, *edid_modes;
-	struct dentry *hpd, *connected;
-	struct dentry *root = debug->root;
-
-	dir = debugfs_create_dir(DEBUG_NAME, NULL);
-	if (IS_ERR_OR_NULL(dir)) {
-		rc = PTR_ERR(dir);
-		pr_err("[%s] debugfs create dir failed, rc = %d\n",
-		       DEBUG_NAME, rc);
-		goto error;
-	}
-
-	file = debugfs_create_file("dp_debug", 0444, dir,
-				debug, &dp_debug_fops);
-	if (IS_ERR_OR_NULL(file)) {
-		rc = PTR_ERR(file);
-		pr_err("[%s] debugfs create file failed, rc=%d\n",
-		       DEBUG_NAME, rc);
-		goto error_remove_dir;
-	}
-
-	edid_modes = debugfs_create_file("edid_modes", 0644, dir,
-					debug, &edid_modes_fops);
-	if (IS_ERR_OR_NULL(edid_modes)) {
-		rc = PTR_ERR(edid_modes);
-		pr_err("[%s] debugfs create edid_modes failed, rc=%d\n",
-		       DEBUG_NAME, rc);
-		goto error_remove_dir;
-	}
-
-	hpd = debugfs_create_file("hpd", 0644, dir,
-					debug, &hpd_fops);
-	if (IS_ERR_OR_NULL(hpd)) {
-		rc = PTR_ERR(hpd);
-		pr_err("[%s] debugfs hpd failed, rc=%d\n",
-			DEBUG_NAME, rc);
-		goto error_remove_dir;
-	}
-
-	connected = debugfs_create_file("connected", 0444, dir,
-					debug, &connected_fops);
-	if (IS_ERR_OR_NULL(connected)) {
-		rc = PTR_ERR(connected);
-		pr_err("[%s] debugfs connected failed, rc=%d\n",
-			DEBUG_NAME, rc);
-		goto error_remove_dir;
-	}
-
-	root = dir;
-	return rc;
-error_remove_dir:
-	debugfs_remove(dir);
-error:
-	return rc;
-}
-
-struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
-			struct dp_usbpd *usbpd, struct dp_link *link,
-			struct drm_connector **connector)
-{
-	int rc = 0;
-	struct dp_debug_private *debug;
-	struct dp_debug *dp_debug;
-
-	if (!dev || !panel || !usbpd || !link) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	debug = devm_kzalloc(dev, sizeof(*debug), GFP_KERNEL);
-	if (!debug) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	debug->dp_debug.debug_en = false;
-	debug->usbpd = usbpd;
-	debug->link = link;
-	debug->panel = panel;
-	debug->dev = dev;
-	debug->connector = connector;
-
-	dp_debug = &debug->dp_debug;
-	dp_debug->vdisplay = 0;
-	dp_debug->hdisplay = 0;
-	dp_debug->vrefresh = 0;
-
-	rc = dp_debug_init(dp_debug);
-	if (rc) {
-		devm_kfree(dev, debug);
-		goto error;
-	}
-
-	return dp_debug;
-error:
-	return ERR_PTR(rc);
-}
-
-static int dp_debug_deinit(struct dp_debug *dp_debug)
-{
-	struct dp_debug_private *debug;
-
-	if (!dp_debug)
-		return -EINVAL;
-
-	debug = container_of(dp_debug, struct dp_debug_private, dp_debug);
-
-	debugfs_remove(debug->root);
-
-	return 0;
-}
-
-void dp_debug_put(struct dp_debug *dp_debug)
-{
-	struct dp_debug_private *debug;
-
-	if (!dp_debug)
-		return;
-
-	debug = container_of(dp_debug, struct dp_debug_private, dp_debug);
-
-	dp_debug_deinit(dp_debug);
-
-	devm_kfree(debug->dev, debug);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_debug.h b/drivers/gpu/drm/msm/dp/dp_debug.h
deleted file mode 100644
index 06b7acb..0000000
--- a/drivers/gpu/drm/msm/dp/dp_debug.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_DEBUG_H_
-#define _DP_DEBUG_H_
-
-#include "dp_panel.h"
-#include "dp_link.h"
-#include "dp_usbpd.h"
-
-/**
- * struct dp_debug
- * @debug_en: specifies whether debug mode enabled
- * @vdisplay: used to filter out vdisplay value
- * @hdisplay: used to filter out hdisplay value
- * @vrefresh: used to filter out vrefresh value
- */
-struct dp_debug {
-	bool debug_en;
-	int vdisplay;
-	int hdisplay;
-	int vrefresh;
-};
-
-/**
- * dp_debug_get() - configure and get the DisplayPlot debug module data
- *
- * @dev: device instance of the caller
- * @panel: instance of panel module
- * @usbpd: instance of usbpd module
- * @link: instance of link module
- * @connector: double pointer to display connector
- * return: pointer to allocated debug module data
- *
- * This function sets up the debug module and provides a way
- * for debugfs input to be communicated with existing modules
- */
-struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
-			struct dp_usbpd *usbpd, struct dp_link *link,
-			struct drm_connector **connector);
-/**
- * dp_debug_put()
- *
- * Cleans up dp_debug instance
- *
- * @dp_debug: instance of dp_debug
- */
-void dp_debug_put(struct dp_debug *dp_debug);
-#endif /* _DP_DEBUG_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
deleted file mode 100644
index 846ef33..0000000
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ /dev/null
@@ -1,1255 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/uaccess.h>
-#include <linux/debugfs.h>
-#include <linux/component.h>
-#include <linux/of_irq.h>
-#include <linux/hdcp_qseecom.h>
-
-#include "msm_drv.h"
-#include "dp_usbpd.h"
-#include "dp_parser.h"
-#include "dp_power.h"
-#include "dp_catalog.h"
-#include "dp_aux.h"
-#include "dp_link.h"
-#include "dp_panel.h"
-#include "dp_ctrl.h"
-#include "dp_audio.h"
-#include "dp_display.h"
-#include "dpu_hdcp.h"
-#include "dp_debug.h"
-
-static struct dp_display *g_dp_display;
-#define HPD_STRING_SIZE 30
-
-struct dp_hdcp {
-	void *data;
-	struct dpu_hdcp_ops *ops;
-
-	void *hdcp1;
-	void *hdcp2;
-
-	int enc_lvl;
-
-	bool auth_state;
-	bool hdcp1_present;
-	bool hdcp2_present;
-	bool feature_enabled;
-};
-
-struct dp_display_private {
-	char *name;
-	int irq;
-
-	/* state variables */
-	bool core_initialized;
-	bool power_on;
-	bool hpd_irq_on;
-	bool audio_supported;
-
-	struct platform_device *pdev;
-	struct dentry *root;
-	struct completion notification_comp;
-
-	struct dp_usbpd   *usbpd;
-	struct dp_parser  *parser;
-	struct dp_power   *power;
-	struct dp_catalog *catalog;
-	struct dp_aux     *aux;
-	struct dp_link    *link;
-	struct dp_panel   *panel;
-	struct dp_ctrl    *ctrl;
-	struct dp_audio   *audio;
-	struct dp_debug   *debug;
-
-	struct dp_hdcp hdcp;
-
-	struct dp_usbpd_cb usbpd_cb;
-	struct dp_display_mode mode;
-	struct dp_display dp_display;
-
-	struct workqueue_struct *hdcp_workqueue;
-	struct delayed_work hdcp_cb_work;
-	struct mutex hdcp_mutex;
-	int hdcp_status;
-};
-
-static const struct of_device_id dp_dt_match[] = {
-	{.compatible = "qcom,dp-display"},
-	{}
-};
-
-static inline bool dp_display_is_hdcp_enabled(struct dp_display_private *dp)
-{
-	return dp->hdcp.feature_enabled &&
-		(dp->hdcp.hdcp1_present || dp->hdcp.hdcp2_present) &&
-		dp->hdcp.ops;
-}
-
-static irqreturn_t dp_display_irq(int irq, void *dev_id)
-{
-	struct dp_display_private *dp = dev_id;
-
-	if (!dp) {
-		pr_err("invalid data\n");
-		return IRQ_NONE;
-	}
-
-	/* DP controller isr */
-	dp->ctrl->isr(dp->ctrl);
-
-	/* DP aux isr */
-	dp->aux->isr(dp->aux);
-
-	/* HDCP isr */
-	if (dp_display_is_hdcp_enabled(dp) && dp->hdcp.ops->isr) {
-		if (dp->hdcp.ops->isr(dp->hdcp.data))
-			pr_err("dp_hdcp_isr failed\n");
-	}
-
-	return IRQ_HANDLED;
-}
-
-static void dp_display_hdcp_cb_work(struct work_struct *work)
-{
-	struct dp_display_private *dp;
-	struct delayed_work *dw = to_delayed_work(work);
-	struct dpu_hdcp_ops *ops;
-	int rc = 0;
-	u32 hdcp_auth_state;
-
-	dp = container_of(dw, struct dp_display_private, hdcp_cb_work);
-
-	rc = dp->catalog->ctrl.read_hdcp_status(&dp->catalog->ctrl);
-	if (rc >= 0) {
-		hdcp_auth_state = (rc >> 20) & 0x3;
-		pr_debug("hdcp auth state %d\n", hdcp_auth_state);
-	}
-
-	ops = dp->hdcp.ops;
-
-	switch (dp->hdcp_status) {
-	case HDCP_STATE_AUTHENTICATING:
-		pr_debug("start authenticaton\n");
-
-		if (dp->hdcp.ops && dp->hdcp.ops->authenticate)
-			rc = dp->hdcp.ops->authenticate(dp->hdcp.data);
-
-		break;
-	case HDCP_STATE_AUTHENTICATED:
-		pr_debug("hdcp authenticated\n");
-		dp->hdcp.auth_state = true;
-		break;
-	case HDCP_STATE_AUTH_FAIL:
-		dp->hdcp.auth_state = false;
-
-		if (dp->power_on) {
-			pr_debug("Reauthenticating\n");
-			if (ops && ops->reauthenticate) {
-				rc = ops->reauthenticate(dp->hdcp.data);
-				if (rc)
-					pr_err("reauth failed rc=%d\n", rc);
-			}
-		} else {
-			pr_debug("not reauthenticating, cable disconnected\n");
-		}
-
-		break;
-	default:
-		break;
-	}
-}
-
-static void dp_display_notify_hdcp_status_cb(void *ptr,
-		enum dpu_hdcp_states status)
-{
-	struct dp_display_private *dp = ptr;
-
-	if (!dp) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp->hdcp_status = status;
-
-	if (dp->dp_display.is_connected)
-		queue_delayed_work(dp->hdcp_workqueue, &dp->hdcp_cb_work, HZ/4);
-}
-
-static int dp_display_create_hdcp_workqueue(struct dp_display_private *dp)
-{
-	dp->hdcp_workqueue = create_workqueue("sdm_dp_hdcp");
-	if (IS_ERR_OR_NULL(dp->hdcp_workqueue)) {
-		pr_err("Error creating hdcp_workqueue\n");
-		return -EPERM;
-	}
-
-	INIT_DELAYED_WORK(&dp->hdcp_cb_work, dp_display_hdcp_cb_work);
-
-	return 0;
-}
-
-static void dp_display_destroy_hdcp_workqueue(struct dp_display_private *dp)
-{
-	if (dp->hdcp_workqueue)
-		destroy_workqueue(dp->hdcp_workqueue);
-}
-
-static void dp_display_update_hdcp_info(struct dp_display_private *dp)
-{
-	void *fd = NULL;
-	struct dpu_hdcp_ops *ops = NULL;
-
-	if (!dp) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	if (!dp->hdcp.feature_enabled) {
-		pr_debug("feature not enabled\n");
-		return;
-	}
-
-	fd = dp->hdcp.hdcp2;
-	if (fd)
-		ops = dpu_dp_hdcp2p2_start(fd);
-
-	if (ops && ops->feature_supported)
-		dp->hdcp.hdcp2_present = ops->feature_supported(fd);
-	else
-		dp->hdcp.hdcp2_present = false;
-
-	pr_debug("hdcp2p2: %s\n",
-			dp->hdcp.hdcp2_present ? "supported" : "not supported");
-
-	if (!dp->hdcp.hdcp2_present) {
-		dp->hdcp.hdcp1_present = hdcp1_check_if_supported_load_app();
-
-		if (dp->hdcp.hdcp1_present) {
-			fd = dp->hdcp.hdcp1;
-			ops = dpu_hdcp_1x_start(fd);
-		}
-	}
-
-	pr_debug("hdcp1x: %s\n",
-			dp->hdcp.hdcp1_present ? "supported" : "not supported");
-
-	if (dp->hdcp.hdcp2_present || dp->hdcp.hdcp1_present) {
-		dp->hdcp.data = fd;
-		dp->hdcp.ops = ops;
-	} else {
-		dp->hdcp.data = NULL;
-		dp->hdcp.ops = NULL;
-	}
-}
-
-static void dp_display_deinitialize_hdcp(struct dp_display_private *dp)
-{
-	if (!dp) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dpu_dp_hdcp2p2_deinit(dp->hdcp.data);
-	dp_display_destroy_hdcp_workqueue(dp);
-	mutex_destroy(&dp->hdcp_mutex);
-}
-
-static int dp_display_initialize_hdcp(struct dp_display_private *dp)
-{
-	struct dpu_hdcp_init_data hdcp_init_data;
-	struct resource *res;
-	int rc = 0;
-
-	if (!dp) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	mutex_init(&dp->hdcp_mutex);
-
-	rc = dp_display_create_hdcp_workqueue(dp);
-	if (rc) {
-		pr_err("Failed to create HDCP workqueue\n");
-		goto error;
-	}
-
-	res = platform_get_resource_byname(dp->pdev,
-		IORESOURCE_MEM, "dp_ctrl");
-	if (!res) {
-		pr_err("Error getting dp ctrl resource\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	hdcp_init_data.phy_addr      = res->start;
-	hdcp_init_data.client_id     = HDCP_CLIENT_DP;
-	hdcp_init_data.drm_aux       = dp->aux->drm_aux;
-	hdcp_init_data.cb_data       = (void *)dp;
-	hdcp_init_data.workq         = dp->hdcp_workqueue;
-	hdcp_init_data.mutex         = &dp->hdcp_mutex;
-	hdcp_init_data.sec_access    = true;
-	hdcp_init_data.notify_status = dp_display_notify_hdcp_status_cb;
-	hdcp_init_data.core_io       = &dp->parser->io.ctrl_io;
-	hdcp_init_data.qfprom_io     = &dp->parser->io.qfprom_io;
-	hdcp_init_data.hdcp_io       = &dp->parser->io.hdcp_io;
-	hdcp_init_data.revision      = &dp->panel->link_info.revision;
-
-	dp->hdcp.hdcp1 = dpu_hdcp_1x_init(&hdcp_init_data);
-	if (IS_ERR_OR_NULL(dp->hdcp.hdcp1)) {
-		pr_err("Error initializing HDCP 1.x\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	pr_debug("HDCP 1.3 initialized\n");
-
-	dp->hdcp.hdcp2 = dpu_dp_hdcp2p2_init(&hdcp_init_data);
-	if (!IS_ERR_OR_NULL(dp->hdcp.hdcp2))
-		pr_debug("HDCP 2.2 initialized\n");
-
-	dp->hdcp.feature_enabled = true;
-
-	return 0;
-error:
-	dp_display_deinitialize_hdcp(dp);
-	return rc;
-}
-
-static int dp_display_bind(struct device *dev, struct device *master,
-		void *data)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-	struct drm_device *drm;
-	struct msm_drm_private *priv;
-	struct platform_device *pdev = to_platform_device(dev);
-
-	if (!dev || !pdev || !master) {
-		pr_err("invalid param(s), dev %pK, pdev %pK, master %pK\n",
-				dev, pdev, master);
-		rc = -EINVAL;
-		goto end;
-	}
-
-	drm = dev_get_drvdata(master);
-	dp = platform_get_drvdata(pdev);
-	if (!drm || !dp) {
-		pr_err("invalid param(s), drm %pK, dp %pK\n",
-				drm, dp);
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dp->dp_display.drm_dev = drm;
-	priv = drm->dev_private;
-
-	rc = dp->parser->parse(dp->parser);
-	if (rc) {
-		pr_err("device tree parsing failed\n");
-		goto end;
-	}
-
-	rc = dp->aux->drm_aux_register(dp->aux);
-	if (rc) {
-		pr_err("DRM DP AUX register failed\n");
-		goto end;
-	}
-
-	rc = dp->power->power_client_init(dp->power, &priv->phandle);
-	if (rc) {
-		pr_err("Power client create failed\n");
-		goto end;
-	}
-
-	rc = dp_display_initialize_hdcp(dp);
-	if (rc) {
-		pr_err("HDCP initialization failed\n");
-		goto end;
-	}
-end:
-	return rc;
-}
-
-static void dp_display_unbind(struct device *dev, struct device *master,
-		void *data)
-{
-	struct dp_display_private *dp;
-	struct platform_device *pdev = to_platform_device(dev);
-
-	if (!dev || !pdev) {
-		pr_err("invalid param(s)\n");
-		return;
-	}
-
-	dp = platform_get_drvdata(pdev);
-	if (!dp) {
-		pr_err("Invalid params\n");
-		return;
-	}
-
-	(void)dp->power->power_client_deinit(dp->power);
-	(void)dp->aux->drm_aux_deregister(dp->aux);
-	dp_display_deinitialize_hdcp(dp);
-}
-
-static const struct component_ops dp_display_comp_ops = {
-	.bind = dp_display_bind,
-	.unbind = dp_display_unbind,
-};
-
-static bool dp_display_is_ds_bridge(struct dp_panel *panel)
-{
-	return (panel->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
-		DP_DWN_STRM_PORT_PRESENT);
-}
-
-static bool dp_display_is_sink_count_zero(struct dp_display_private *dp)
-{
-	return dp_display_is_ds_bridge(dp->panel) &&
-		(dp->link->sink_count.count == 0);
-}
-
-static void dp_display_send_hpd_event(struct dp_display *dp_display)
-{
-	struct drm_device *dev = NULL;
-	struct dp_display_private *dp;
-	struct drm_connector *connector;
-	char name[HPD_STRING_SIZE], status[HPD_STRING_SIZE],
-		bpp[HPD_STRING_SIZE], pattern[HPD_STRING_SIZE];
-	char *envp[5];
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-	if (!dp) {
-		pr_err("invalid params\n");
-		return;
-	}
-	connector = dp->dp_display.connector;
-	dev = dp_display->connector->dev;
-
-	connector->status = connector->funcs->detect(connector, false);
-	pr_debug("[%s] status updated to %s\n",
-			      connector->name,
-			      drm_get_connector_status_name(connector->status));
-	snprintf(name, HPD_STRING_SIZE, "name=%s", connector->name);
-	snprintf(status, HPD_STRING_SIZE, "status=%s",
-		drm_get_connector_status_name(connector->status));
-	snprintf(bpp, HPD_STRING_SIZE, "bpp=%d",
-		dp_link_bit_depth_to_bpp(
-		dp->link->test_video.test_bit_depth));
-	snprintf(pattern, HPD_STRING_SIZE, "pattern=%d",
-		dp->link->test_video.test_video_pattern);
-
-	pr_debug("generating hotplug event [%s]:[%s] [%s] [%s]\n",
-		name, status, bpp, pattern);
-	envp[0] = name;
-	envp[1] = status;
-	envp[2] = bpp;
-	envp[3] = pattern;
-	envp[4] = NULL;
-	kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE,
-			envp);
-}
-
-static int dp_display_send_hpd_notification(struct dp_display_private *dp,
-		bool hpd)
-{
-	if ((hpd && dp->dp_display.is_connected) ||
-			(!hpd && !dp->dp_display.is_connected)) {
-		pr_info("HPD already %s\n", (hpd ? "on" : "off"));
-		return 0;
-	}
-
-	/* reset video pattern flag on disconnect */
-	if (!hpd)
-		dp->panel->video_test = false;
-
-	dp->dp_display.is_connected = hpd;
-	reinit_completion(&dp->notification_comp);
-	dp_display_send_hpd_event(&dp->dp_display);
-
-	if (!wait_for_completion_timeout(&dp->notification_comp, HZ * 2)) {
-		pr_warn("%s timeout\n", hpd ? "connect" : "disconnect");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static int dp_display_process_hpd_high(struct dp_display_private *dp)
-{
-	int rc = 0;
-	u32 max_pclk_from_edid = 0;
-	struct edid *edid;
-
-	dp->aux->init(dp->aux, dp->parser->aux_cfg);
-
-	if (dp->link->psm_enabled)
-		goto notify;
-
-	rc = dp->panel->read_sink_caps(dp->panel, dp->dp_display.connector);
-	if (rc)
-		goto notify;
-
-	dp->link->process_request(dp->link);
-
-	if (dp_display_is_sink_count_zero(dp)) {
-		pr_debug("no downstream devices connected\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	edid = dp->panel->edid_ctrl->edid;
-
-	dp->audio_supported = drm_detect_monitor_audio(edid);
-
-	dp->panel->handle_sink_request(dp->panel);
-
-	max_pclk_from_edid = dp->panel->get_max_pclk(dp->panel);
-
-	dp->dp_display.max_pclk_khz = min(max_pclk_from_edid,
-		dp->parser->max_pclk_khz);
-
-notify:
-	dp_display_send_hpd_notification(dp, true);
-
-end:
-	return rc;
-}
-
-static void dp_display_host_init(struct dp_display_private *dp)
-{
-	bool flip = false;
-
-	if (dp->core_initialized) {
-		pr_debug("DP core already initialized\n");
-		return;
-	}
-
-	if (dp->usbpd->orientation == ORIENTATION_CC2)
-		flip = true;
-
-	dp->power->init(dp->power, flip);
-	dp->ctrl->init(dp->ctrl, flip);
-	enable_irq(dp->irq);
-	dp->core_initialized = true;
-}
-
-static void dp_display_host_deinit(struct dp_display_private *dp)
-{
-	if (!dp->core_initialized) {
-		pr_debug("DP core already off\n");
-		return;
-	}
-
-	dp->ctrl->deinit(dp->ctrl);
-	dp->power->deinit(dp->power);
-	disable_irq(dp->irq);
-	dp->core_initialized = false;
-}
-
-static void dp_display_process_hpd_low(struct dp_display_private *dp)
-{
-	/* cancel any pending request */
-	dp->ctrl->abort(dp->ctrl);
-
-	if (dp_display_is_hdcp_enabled(dp) && dp->hdcp.ops->off) {
-		cancel_delayed_work_sync(&dp->hdcp_cb_work);
-		dp->hdcp.ops->off(dp->hdcp.data);
-	}
-
-	if (dp->audio_supported)
-		dp->audio->off(dp->audio);
-
-	dp_display_send_hpd_notification(dp, false);
-
-	dp->aux->deinit(dp->aux);
-}
-
-static int dp_display_usbpd_configure_cb(struct device *dev)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dev) {
-		pr_err("invalid dev\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dp = dev_get_drvdata(dev);
-	if (!dp) {
-		pr_err("no driver data found\n");
-		rc = -ENODEV;
-		goto end;
-	}
-
-	dp_display_host_init(dp);
-
-	if (dp->usbpd->hpd_high)
-		dp_display_process_hpd_high(dp);
-end:
-	return rc;
-}
-
-static void dp_display_clean(struct dp_display_private *dp)
-{
-	if (dp_display_is_hdcp_enabled(dp)) {
-		dp->hdcp_status = HDCP_STATE_INACTIVE;
-
-		cancel_delayed_work_sync(&dp->hdcp_cb_work);
-		if (dp->hdcp.ops->off)
-			dp->hdcp.ops->off(dp->hdcp.data);
-	}
-
-	dp->ctrl->push_idle(dp->ctrl);
-	dp->ctrl->off(dp->ctrl);
-}
-
-static int dp_display_usbpd_disconnect_cb(struct device *dev)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dev) {
-		pr_err("invalid dev\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dp = dev_get_drvdata(dev);
-	if (!dp) {
-		pr_err("no driver data found\n");
-		rc = -ENODEV;
-		goto end;
-	}
-
-	/* cancel any pending request */
-	dp->ctrl->abort(dp->ctrl);
-
-	if (dp->audio_supported)
-		dp->audio->off(dp->audio);
-
-	rc = dp_display_send_hpd_notification(dp, false);
-
-	/* if cable is disconnected, reset psm_enabled flag */
-	if (!dp->usbpd->alt_mode_cfg_done)
-		dp->link->psm_enabled = false;
-
-	if ((rc < 0) && dp->power_on)
-		dp_display_clean(dp);
-
-	dp_display_host_deinit(dp);
-end:
-	return rc;
-}
-
-static void dp_display_handle_video_request(struct dp_display_private *dp)
-{
-	if (dp->link->sink_request & DP_TEST_LINK_VIDEO_PATTERN) {
-		/* force disconnect followed by connect */
-		dp->usbpd->connect(dp->usbpd, false);
-		dp->panel->video_test = true;
-		dp->usbpd->connect(dp->usbpd, true);
-		dp->link->send_test_response(dp->link);
-	}
-}
-
-static int dp_display_handle_hpd_irq(struct dp_display_private *dp)
-{
-	if (dp->link->sink_request & DS_PORT_STATUS_CHANGED) {
-		dp_display_send_hpd_notification(dp, false);
-
-		if (dp_display_is_sink_count_zero(dp)) {
-			pr_debug("sink count is zero, nothing to do\n");
-			return 0;
-		}
-
-		return dp_display_process_hpd_high(dp);
-	}
-
-	dp->ctrl->handle_sink_request(dp->ctrl);
-
-	dp_display_handle_video_request(dp);
-
-	return 0;
-}
-
-static int dp_display_usbpd_attention_cb(struct device *dev)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dev) {
-		pr_err("invalid dev\n");
-		return -EINVAL;
-	}
-
-	dp = dev_get_drvdata(dev);
-	if (!dp) {
-		pr_err("no driver data found\n");
-		return -ENODEV;
-	}
-
-	if (dp->usbpd->hpd_irq) {
-		dp->hpd_irq_on = true;
-
-		if (dp_display_is_hdcp_enabled(dp) && dp->hdcp.ops->cp_irq) {
-			if (!dp->hdcp.ops->cp_irq(dp->hdcp.data))
-				goto end;
-		}
-
-		rc = dp->link->process_request(dp->link);
-		/* check for any test request issued by sink */
-		if (!rc)
-			dp_display_handle_hpd_irq(dp);
-
-		dp->hpd_irq_on = false;
-		goto end;
-	}
-
-	if (!dp->usbpd->hpd_high) {
-		dp_display_process_hpd_low(dp);
-		goto end;
-	}
-
-	if (dp->usbpd->alt_mode_cfg_done)
-		dp_display_process_hpd_high(dp);
-end:
-	return rc;
-}
-
-static void dp_display_deinit_sub_modules(struct dp_display_private *dp)
-{
-	dp_audio_put(dp->audio);
-	dp_ctrl_put(dp->ctrl);
-	dp_link_put(dp->link);
-	dp_panel_put(dp->panel);
-	dp_aux_put(dp->aux);
-	dp_power_put(dp->power);
-	dp_catalog_put(dp->catalog);
-	dp_parser_put(dp->parser);
-	dp_usbpd_put(dp->usbpd);
-	dp_debug_put(dp->debug);
-}
-
-static int dp_init_sub_modules(struct dp_display_private *dp)
-{
-	int rc = 0;
-	struct device *dev = &dp->pdev->dev;
-	struct dp_usbpd_cb *cb = &dp->usbpd_cb;
-	struct dp_ctrl_in ctrl_in = {
-		.dev = dev,
-	};
-	struct dp_panel_in panel_in = {
-		.dev = dev,
-	};
-
-	cb->configure  = dp_display_usbpd_configure_cb;
-	cb->disconnect = dp_display_usbpd_disconnect_cb;
-	cb->attention  = dp_display_usbpd_attention_cb;
-
-	dp->usbpd = dp_usbpd_get(dev, cb);
-	if (IS_ERR(dp->usbpd)) {
-		rc = PTR_ERR(dp->usbpd);
-		pr_err("failed to initialize usbpd, rc = %d\n", rc);
-		dp->usbpd = NULL;
-		goto error;
-	}
-
-	dp->parser = dp_parser_get(dp->pdev);
-	if (IS_ERR(dp->parser)) {
-		rc = PTR_ERR(dp->parser);
-		pr_err("failed to initialize parser, rc = %d\n", rc);
-		dp->parser = NULL;
-		goto error_parser;
-	}
-
-	dp->catalog = dp_catalog_get(dev, &dp->parser->io);
-	if (IS_ERR(dp->catalog)) {
-		rc = PTR_ERR(dp->catalog);
-		pr_err("failed to initialize catalog, rc = %d\n", rc);
-		dp->catalog = NULL;
-		goto error_catalog;
-	}
-
-	dp->power = dp_power_get(dp->parser);
-	if (IS_ERR(dp->power)) {
-		rc = PTR_ERR(dp->power);
-		pr_err("failed to initialize power, rc = %d\n", rc);
-		dp->power = NULL;
-		goto error_power;
-	}
-
-	dp->aux = dp_aux_get(dev, &dp->catalog->aux, dp->parser->aux_cfg);
-	if (IS_ERR(dp->aux)) {
-		rc = PTR_ERR(dp->aux);
-		pr_err("failed to initialize aux, rc = %d\n", rc);
-		dp->aux = NULL;
-		goto error_aux;
-	}
-
-	dp->link = dp_link_get(dev, dp->aux);
-	if (IS_ERR(dp->link)) {
-		rc = PTR_ERR(dp->link);
-		pr_err("failed to initialize link, rc = %d\n", rc);
-		dp->link = NULL;
-		goto error_link;
-	}
-
-	panel_in.aux = dp->aux;
-	panel_in.catalog = &dp->catalog->panel;
-	panel_in.link = dp->link;
-
-	dp->panel = dp_panel_get(&panel_in);
-	if (IS_ERR(dp->panel)) {
-		rc = PTR_ERR(dp->panel);
-		pr_err("failed to initialize panel, rc = %d\n", rc);
-		dp->panel = NULL;
-		goto error_panel;
-	}
-
-	ctrl_in.link = dp->link;
-	ctrl_in.panel = dp->panel;
-	ctrl_in.aux = dp->aux;
-	ctrl_in.power = dp->power;
-	ctrl_in.catalog = &dp->catalog->ctrl;
-	ctrl_in.parser = dp->parser;
-
-	dp->ctrl = dp_ctrl_get(&ctrl_in);
-	if (IS_ERR(dp->ctrl)) {
-		rc = PTR_ERR(dp->ctrl);
-		pr_err("failed to initialize ctrl, rc = %d\n", rc);
-		dp->ctrl = NULL;
-		goto error_ctrl;
-	}
-
-	dp->audio = dp_audio_get(dp->pdev, dp->panel, &dp->catalog->audio);
-	if (IS_ERR(dp->audio)) {
-		rc = PTR_ERR(dp->audio);
-		pr_err("failed to initialize audio, rc = %d\n", rc);
-		dp->audio = NULL;
-		goto error_audio;
-	}
-
-	dp->debug = dp_debug_get(dev, dp->panel, dp->usbpd,
-				dp->link, &dp->dp_display.connector);
-	if (IS_ERR(dp->debug)) {
-		rc = PTR_ERR(dp->debug);
-		pr_err("failed to initialize debug, rc = %d\n", rc);
-		dp->debug = NULL;
-		goto error_debug;
-	}
-
-	return rc;
-error_debug:
-	dp_audio_put(dp->audio);
-error_audio:
-	dp_ctrl_put(dp->ctrl);
-error_ctrl:
-	dp_panel_put(dp->panel);
-error_panel:
-	dp_link_put(dp->link);
-error_link:
-	dp_aux_put(dp->aux);
-error_aux:
-	dp_power_put(dp->power);
-error_power:
-	dp_catalog_put(dp->catalog);
-error_catalog:
-	dp_parser_put(dp->parser);
-error_parser:
-	dp_usbpd_put(dp->usbpd);
-error:
-	return rc;
-}
-
-static int dp_display_set_mode(struct dp_display *dp_display,
-		struct dp_display_mode *mode)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-
-	dp->panel->pinfo = mode->timing;
-	dp->panel->init_info(dp->panel);
-error:
-	return rc;
-}
-
-static int dp_display_prepare(struct dp_display *dp)
-{
-	return 0;
-}
-
-static int dp_display_enable(struct dp_display *dp_display)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-
-	if (dp->power_on) {
-		pr_debug("Link already setup, return\n");
-		return 0;
-	}
-
-	rc = dp->ctrl->on(dp->ctrl);
-	if (!rc)
-		dp->power_on = true;
-error:
-	return rc;
-}
-
-static int dp_display_post_enable(struct dp_display *dp_display)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-
-	if (dp->audio_supported) {
-		dp->audio->bw_code = dp->link->link_params.bw_code;
-		dp->audio->lane_count = dp->link->link_params.lane_count;
-		dp->audio->on(dp->audio);
-	}
-
-	complete_all(&dp->notification_comp);
-
-	dp_display_update_hdcp_info(dp);
-
-	if (dp_display_is_hdcp_enabled(dp)) {
-		cancel_delayed_work_sync(&dp->hdcp_cb_work);
-
-		dp->hdcp_status = HDCP_STATE_AUTHENTICATING;
-		queue_delayed_work(dp->hdcp_workqueue,
-				&dp->hdcp_cb_work, HZ / 2);
-	}
-end:
-	return rc;
-}
-
-static int dp_display_pre_disable(struct dp_display *dp_display)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-
-	if (dp_display_is_hdcp_enabled(dp)) {
-		dp->hdcp_status = HDCP_STATE_INACTIVE;
-
-		cancel_delayed_work_sync(&dp->hdcp_cb_work);
-		if (dp->hdcp.ops->off)
-			dp->hdcp.ops->off(dp->hdcp.data);
-	}
-
-	if (dp->usbpd->alt_mode_cfg_done && (dp->usbpd->hpd_high ||
-		dp->usbpd->forced_disconnect))
-		dp->link->psm_config(dp->link, &dp->panel->link_info, true);
-
-	dp->ctrl->push_idle(dp->ctrl);
-error:
-	return rc;
-}
-
-static int dp_display_disable(struct dp_display *dp_display)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-
-	if (!dp->power_on || !dp->core_initialized)
-		goto error;
-
-	dp->ctrl->off(dp->ctrl);
-
-	dp->power_on = false;
-
-	complete_all(&dp->notification_comp);
-error:
-	return rc;
-}
-
-static int dp_request_irq(struct dp_display *dp_display)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-
-	dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
-	if (dp->irq < 0) {
-		rc = dp->irq;
-		pr_err("failed to get irq: %d\n", rc);
-		return rc;
-	}
-
-	rc = devm_request_irq(&dp->pdev->dev, dp->irq, dp_display_irq,
-		IRQF_TRIGGER_HIGH, "dp_display_isr", dp);
-	if (rc < 0) {
-		pr_err("failed to request IRQ%u: %d\n",
-				dp->irq, rc);
-		return rc;
-	}
-	disable_irq(dp->irq);
-
-	return 0;
-}
-
-static struct dp_debug *dp_get_debug(struct dp_display *dp_display)
-{
-	struct dp_display_private *dp;
-
-	if (!dp_display) {
-		pr_err("invalid input\n");
-		return ERR_PTR(-EINVAL);
-	}
-
-	dp = container_of(dp_display, struct dp_display_private, dp_display);
-
-	return dp->debug;
-}
-
-static int dp_display_unprepare(struct dp_display *dp)
-{
-	return 0;
-}
-
-static int dp_display_validate_mode(struct dp_display *dp,
-	struct dp_display_mode *mode)
-{
-	return 0;
-}
-
-static int dp_display_get_modes(struct dp_display *dp,
-	struct dp_display_mode *dp_mode)
-{
-	struct dp_display_private *dp_display;
-	int ret = 0;
-
-	if (!dp) {
-		pr_err("invalid params\n");
-		return 0;
-	}
-
-	dp_display = container_of(dp, struct dp_display_private, dp_display);
-
-	ret = dp_display->panel->get_modes(dp_display->panel,
-		dp->connector, dp_mode);
-	if (dp_mode->timing.pixel_clk_khz)
-		dp->max_pclk_khz = dp_mode->timing.pixel_clk_khz;
-	return ret;
-}
-
-static bool dp_display_check_video_test(struct dp_display *dp)
-{
-	struct dp_display_private *dp_display;
-
-	if (!dp) {
-		pr_err("invalid params\n");
-		return false;
-	}
-
-	dp_display = container_of(dp, struct dp_display_private, dp_display);
-
-	if (dp_display->panel->video_test)
-		return true;
-
-	return false;
-}
-
-static int dp_display_get_test_bpp(struct dp_display *dp)
-{
-	struct dp_display_private *dp_display;
-
-	if (!dp) {
-		pr_err("invalid params\n");
-		return 0;
-	}
-
-	dp_display = container_of(dp, struct dp_display_private, dp_display);
-
-	return dp_link_bit_depth_to_bpp(
-		dp_display->link->test_video.test_bit_depth);
-}
-
-static int dp_display_probe(struct platform_device *pdev)
-{
-	int rc = 0;
-	struct dp_display_private *dp;
-
-	if (!pdev || !pdev->dev.of_node) {
-		pr_err("pdev not found\n");
-		return -ENODEV;
-	}
-
-	dp = devm_kzalloc(&pdev->dev, sizeof(*dp), GFP_KERNEL);
-	if (!dp)
-		return -ENOMEM;
-
-	init_completion(&dp->notification_comp);
-
-	dp->pdev = pdev;
-	dp->name = "drm_dp";
-
-	rc = dp_init_sub_modules(dp);
-	if (rc) {
-		devm_kfree(&pdev->dev, dp);
-		return -EPROBE_DEFER;
-	}
-
-	platform_set_drvdata(pdev, dp);
-
-	g_dp_display = &dp->dp_display;
-
-	g_dp_display->enable        = dp_display_enable;
-	g_dp_display->post_enable   = dp_display_post_enable;
-	g_dp_display->pre_disable   = dp_display_pre_disable;
-	g_dp_display->disable       = dp_display_disable;
-	g_dp_display->set_mode      = dp_display_set_mode;
-	g_dp_display->validate_mode = dp_display_validate_mode;
-	g_dp_display->get_modes     = dp_display_get_modes;
-	g_dp_display->prepare       = dp_display_prepare;
-	g_dp_display->unprepare     = dp_display_unprepare;
-	g_dp_display->request_irq   = dp_request_irq;
-	g_dp_display->get_debug     = dp_get_debug;
-	g_dp_display->send_hpd_event    = dp_display_send_hpd_event;
-	g_dp_display->is_video_test = dp_display_check_video_test;
-	g_dp_display->get_test_bpp = dp_display_get_test_bpp;
-
-	rc = component_add(&pdev->dev, &dp_display_comp_ops);
-	if (rc) {
-		pr_err("component add failed, rc=%d\n", rc);
-		dp_display_deinit_sub_modules(dp);
-		devm_kfree(&pdev->dev, dp);
-	}
-
-	return rc;
-}
-
-int dp_display_get_displays(void **displays, int count)
-{
-	if (!displays) {
-		pr_err("invalid data\n");
-		return -EINVAL;
-	}
-
-	if (count != 1) {
-		pr_err("invalid number of displays\n");
-		return -EINVAL;
-	}
-
-	displays[0] = g_dp_display;
-	return count;
-}
-
-int dp_display_get_num_of_displays(void)
-{
-	return 1;
-}
-
-static int dp_display_remove(struct platform_device *pdev)
-{
-	struct dp_display_private *dp;
-
-	if (!pdev)
-		return -EINVAL;
-
-	dp = platform_get_drvdata(pdev);
-
-	dp_display_deinit_sub_modules(dp);
-
-	platform_set_drvdata(pdev, NULL);
-	devm_kfree(&pdev->dev, dp);
-
-	return 0;
-}
-
-static struct platform_driver dp_display_driver = {
-	.probe  = dp_display_probe,
-	.remove = dp_display_remove,
-	.driver = {
-		.name = "msm-dp-display",
-		.of_match_table = dp_dt_match,
-	},
-};
-
-static int __init dp_display_init(void)
-{
-	int ret;
-
-	ret = platform_driver_register(&dp_display_driver);
-	if (ret) {
-		pr_err("driver register failed");
-		return ret;
-	}
-
-	return ret;
-}
-module_init(dp_display_init);
-
-static void __exit dp_display_cleanup(void)
-{
-	platform_driver_unregister(&dp_display_driver);
-}
-module_exit(dp_display_cleanup);
-
diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h
deleted file mode 100644
index 092a0eb..0000000
--- a/drivers/gpu/drm/msm/dp/dp_display.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_DISPLAY_H_
-#define _DP_DISPLAY_H_
-
-#include <drm/drmP.h>
-
-#include "dp_panel.h"
-
-struct dp_display {
-	struct drm_device *drm_dev;
-	struct dp_bridge *bridge;
-	struct drm_connector *connector;
-	bool is_connected;
-	u32 max_pclk_khz;
-
-	int (*enable)(struct dp_display *dp_display);
-	int (*post_enable)(struct dp_display *dp_display);
-
-	int (*pre_disable)(struct dp_display *dp_display);
-	int (*disable)(struct dp_display *dp_display);
-
-	int (*set_mode)(struct dp_display *dp_display,
-			struct dp_display_mode *mode);
-	int (*validate_mode)(struct dp_display *dp_display,
-			struct dp_display_mode *mode);
-	int (*get_modes)(struct dp_display *dp_display,
-		struct dp_display_mode *dp_mode);
-	int (*prepare)(struct dp_display *dp_display);
-	int (*unprepare)(struct dp_display *dp_display);
-	int (*request_irq)(struct dp_display *dp_display);
-	struct dp_debug *(*get_debug)(struct dp_display *dp_display);
-	void (*send_hpd_event)(struct dp_display *dp_display);
-	bool (*is_video_test)(struct dp_display *dp_display);
-	int (*get_test_bpp)(struct dp_display *dp_display);
-};
-
-int dp_display_get_num_of_displays(void);
-int dp_display_get_displays(void **displays, int count);
-#endif /* _DP_DISPLAY_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c
deleted file mode 100644
index a35452f..0000000
--- a/drivers/gpu/drm/msm/dp/dp_drm.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp]: %s: " fmt, __func__
-
-#include <drm/drm_atomic_helper.h>
-#include <drm/drm_atomic.h>
-#include <drm/drm_crtc.h>
-
-#include "msm_drv.h"
-#include "msm_kms.h"
-#include "dpu_connector.h"
-#include "dp_drm.h"
-#include "dp_debug.h"
-
-#define to_dp_bridge(x)     container_of((x), struct dp_bridge, base)
-
-static void convert_to_dp_mode(const struct drm_display_mode *drm_mode,
-			struct dp_display_mode *dp_mode, struct dp_display *dp)
-{
-	const u32 num_components = 3;
-
-	memset(dp_mode, 0, sizeof(*dp_mode));
-
-	dp_mode->timing.h_active = drm_mode->hdisplay;
-	dp_mode->timing.h_back_porch = drm_mode->htotal - drm_mode->hsync_end;
-	dp_mode->timing.h_sync_width = drm_mode->htotal -
-			(drm_mode->hsync_start + dp_mode->timing.h_back_porch);
-	dp_mode->timing.h_front_porch = drm_mode->hsync_start -
-					 drm_mode->hdisplay;
-	dp_mode->timing.h_skew = drm_mode->hskew;
-
-	dp_mode->timing.v_active = drm_mode->vdisplay;
-	dp_mode->timing.v_back_porch = drm_mode->vtotal - drm_mode->vsync_end;
-	dp_mode->timing.v_sync_width = drm_mode->vtotal -
-		(drm_mode->vsync_start + dp_mode->timing.v_back_porch);
-
-	dp_mode->timing.v_front_porch = drm_mode->vsync_start -
-					 drm_mode->vdisplay;
-
-	if (dp->is_video_test(dp))
-		dp_mode->timing.bpp = dp->get_test_bpp(dp);
-	else
-		dp_mode->timing.bpp = dp->connector->display_info.bpc *
-		num_components;
-
-	if (!dp_mode->timing.bpp)
-		dp_mode->timing.bpp = 24;
-
-	dp_mode->timing.refresh_rate = drm_mode->vrefresh;
-
-	dp_mode->timing.pixel_clk_khz = drm_mode->clock;
-
-	dp_mode->timing.v_active_low =
-		!!(drm_mode->flags & DRM_MODE_FLAG_NVSYNC);
-
-	dp_mode->timing.h_active_low =
-		!!(drm_mode->flags & DRM_MODE_FLAG_NHSYNC);
-}
-
-static void convert_to_drm_mode(const struct dp_display_mode *dp_mode,
-				struct drm_display_mode *drm_mode)
-{
-	u32 flags = 0;
-
-	memset(drm_mode, 0, sizeof(*drm_mode));
-
-	drm_mode->hdisplay = dp_mode->timing.h_active;
-	drm_mode->hsync_start = drm_mode->hdisplay +
-				dp_mode->timing.h_front_porch;
-	drm_mode->hsync_end = drm_mode->hsync_start +
-			      dp_mode->timing.h_sync_width;
-	drm_mode->htotal = drm_mode->hsync_end + dp_mode->timing.h_back_porch;
-	drm_mode->hskew = dp_mode->timing.h_skew;
-
-	drm_mode->vdisplay = dp_mode->timing.v_active;
-	drm_mode->vsync_start = drm_mode->vdisplay +
-				dp_mode->timing.v_front_porch;
-	drm_mode->vsync_end = drm_mode->vsync_start +
-			      dp_mode->timing.v_sync_width;
-	drm_mode->vtotal = drm_mode->vsync_end + dp_mode->timing.v_back_porch;
-
-	drm_mode->vrefresh = dp_mode->timing.refresh_rate;
-	drm_mode->clock = dp_mode->timing.pixel_clk_khz;
-
-	if (dp_mode->timing.h_active_low)
-		flags |= DRM_MODE_FLAG_NHSYNC;
-	else
-		flags |= DRM_MODE_FLAG_PHSYNC;
-
-	if (dp_mode->timing.v_active_low)
-		flags |= DRM_MODE_FLAG_NVSYNC;
-	else
-		flags |= DRM_MODE_FLAG_PVSYNC;
-
-	drm_mode->flags = flags;
-
-	drm_mode->type = 0x48;
-	drm_mode_set_name(drm_mode);
-}
-
-static int dp_bridge_attach(struct drm_bridge *dp_bridge)
-{
-	struct dp_bridge *bridge = to_dp_bridge(dp_bridge);
-
-	if (!dp_bridge) {
-		pr_err("Invalid params\n");
-		return -EINVAL;
-	}
-
-	pr_debug("[%d] attached\n", bridge->id);
-
-	return 0;
-}
-
-static void dp_bridge_pre_enable(struct drm_bridge *drm_bridge)
-{
-	int rc = 0;
-	struct dp_bridge *bridge;
-	struct dp_display *dp;
-
-	if (!drm_bridge) {
-		pr_err("Invalid params\n");
-		return;
-	}
-
-	bridge = to_dp_bridge(drm_bridge);
-	dp = bridge->display;
-
-	/* By this point mode should have been validated through mode_fixup */
-	rc = dp->set_mode(dp, &bridge->dp_mode);
-	if (rc) {
-		pr_err("[%d] failed to perform a mode set, rc=%d\n",
-		       bridge->id, rc);
-		return;
-	}
-
-	rc = dp->prepare(dp);
-	if (rc) {
-		pr_err("[%d] DP display prepare failed, rc=%d\n",
-		       bridge->id, rc);
-		return;
-	}
-
-	rc = dp->enable(dp);
-	if (rc) {
-		pr_err("[%d] DP display enable failed, rc=%d\n",
-		       bridge->id, rc);
-		dp->unprepare(dp);
-	}
-}
-
-static void dp_bridge_enable(struct drm_bridge *drm_bridge)
-{
-	int rc = 0;
-	struct dp_bridge *bridge;
-	struct dp_display *dp;
-
-	if (!drm_bridge) {
-		pr_err("Invalid params\n");
-		return;
-	}
-
-	bridge = to_dp_bridge(drm_bridge);
-	dp = bridge->display;
-
-	rc = dp->post_enable(dp);
-	if (rc)
-		pr_err("[%d] DP display post enable failed, rc=%d\n",
-		       bridge->id, rc);
-}
-
-static void dp_bridge_disable(struct drm_bridge *drm_bridge)
-{
-	int rc = 0;
-	struct dp_bridge *bridge;
-	struct dp_display *dp;
-
-	if (!drm_bridge) {
-		pr_err("Invalid params\n");
-		return;
-	}
-
-	bridge = to_dp_bridge(drm_bridge);
-	dp = bridge->display;
-
-	rc = dp->pre_disable(dp);
-	if (rc) {
-		pr_err("[%d] DP display pre disable failed, rc=%d\n",
-		       bridge->id, rc);
-	}
-}
-
-static void dp_bridge_post_disable(struct drm_bridge *drm_bridge)
-{
-	int rc = 0;
-	struct dp_bridge *bridge;
-	struct dp_display *dp;
-
-	if (!drm_bridge) {
-		pr_err("Invalid params\n");
-		return;
-	}
-
-	bridge = to_dp_bridge(drm_bridge);
-	dp = bridge->display;
-
-	rc = dp->disable(dp);
-	if (rc) {
-		pr_err("[%d] DP display disable failed, rc=%d\n",
-		       bridge->id, rc);
-		return;
-	}
-
-	rc = dp->unprepare(dp);
-	if (rc) {
-		pr_err("[%d] DP display unprepare failed, rc=%d\n",
-		       bridge->id, rc);
-		return;
-	}
-}
-
-static void dp_bridge_mode_set(struct drm_bridge *drm_bridge,
-				struct drm_display_mode *mode,
-				struct drm_display_mode *adjusted_mode)
-{
-	struct dp_bridge *bridge;
-	struct dp_display *dp;
-
-	if (!drm_bridge || !mode || !adjusted_mode) {
-		pr_err("Invalid params\n");
-		return;
-	}
-
-	bridge = to_dp_bridge(drm_bridge);
-	dp = bridge->display;
-
-	memset(&bridge->dp_mode, 0x0, sizeof(struct dp_display_mode));
-	convert_to_dp_mode(adjusted_mode, &bridge->dp_mode, dp);
-}
-
-static bool dp_bridge_mode_fixup(struct drm_bridge *drm_bridge,
-				  const struct drm_display_mode *mode,
-				  struct drm_display_mode *adjusted_mode)
-{
-	int rc = 0;
-	bool ret = true;
-	struct dp_display_mode dp_mode;
-	struct dp_bridge *bridge;
-	struct dp_display *dp;
-
-	if (!drm_bridge || !mode || !adjusted_mode) {
-		pr_err("Invalid params\n");
-		ret = false;
-		goto end;
-	}
-
-	bridge = to_dp_bridge(drm_bridge);
-	dp = bridge->display;
-
-	convert_to_dp_mode(mode, &dp_mode, dp);
-
-	rc = dp->validate_mode(dp, &dp_mode);
-	if (rc) {
-		pr_err("[%d] mode is not valid, rc=%d\n", bridge->id, rc);
-		ret = false;
-	} else {
-		convert_to_drm_mode(&dp_mode, adjusted_mode);
-	}
-end:
-	return ret;
-}
-
-static const struct drm_bridge_funcs dp_bridge_ops = {
-	.attach       = dp_bridge_attach,
-	.mode_fixup   = dp_bridge_mode_fixup,
-	.pre_enable   = dp_bridge_pre_enable,
-	.enable       = dp_bridge_enable,
-	.disable      = dp_bridge_disable,
-	.post_disable = dp_bridge_post_disable,
-	.mode_set     = dp_bridge_mode_set,
-};
-
-int dp_connector_post_init(struct drm_connector *connector,
-		void *info,
-		void *display)
-{
-	struct dp_display *dp_display = display;
-
-	if (!info || !dp_display)
-		return -EINVAL;
-
-	dp_display->connector = connector;
-	return 0;
-}
-
-int dp_connector_get_mode_info(const struct drm_display_mode *drm_mode,
-	struct msm_mode_info *mode_info, u32 max_mixer_width)
-{
-	const u32 dual_lm = 2;
-	const u32 single_lm = 1;
-	const u32 single_intf = 1;
-	const u32 no_enc = 0;
-	struct msm_display_topology *topology;
-
-	if (!drm_mode || !mode_info || !max_mixer_width) {
-		pr_err("invalid params\n");
-		return -EINVAL;
-	}
-
-	topology = &mode_info->topology;
-	topology->num_lm = (max_mixer_width <= drm_mode->hdisplay) ?
-							dual_lm : single_lm;
-	topology->num_enc = no_enc;
-	topology->num_intf = single_intf;
-
-	mode_info->frame_rate = drm_mode->vrefresh;
-	mode_info->vtotal = drm_mode->vtotal;
-	mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_NONE;
-
-	return 0;
-}
-
-int dp_connector_get_info(struct msm_display_info *info, void *data)
-{
-	struct dp_display *display = data;
-
-	if (!info || !display) {
-		pr_err("invalid params\n");
-		return -EINVAL;
-	}
-
-	info->intf_type = DRM_MODE_CONNECTOR_DisplayPort;
-
-	info->num_of_h_tiles = 1;
-	info->h_tile_instance[0] = 0;
-	info->is_connected = display->is_connected;
-	info->capabilities = MSM_DISPLAY_CAP_VID_MODE | MSM_DISPLAY_CAP_EDID |
-		MSM_DISPLAY_CAP_HOT_PLUG;
-
-	return 0;
-}
-
-enum drm_connector_status dp_connector_detect(struct drm_connector *conn,
-		bool force,
-		void *display)
-{
-	enum drm_connector_status status = connector_status_unknown;
-	struct msm_display_info info;
-	int rc;
-
-	if (!conn || !display)
-		return status;
-
-	/* get display dp_info */
-	memset(&info, 0x0, sizeof(info));
-	rc = dp_connector_get_info(&info, display);
-	if (rc) {
-		pr_err("failed to get display info, rc=%d\n", rc);
-		return connector_status_disconnected;
-	}
-
-	if (info.capabilities & MSM_DISPLAY_CAP_HOT_PLUG)
-		status = (info.is_connected ? connector_status_connected :
-					      connector_status_disconnected);
-	else
-		status = connector_status_connected;
-
-	conn->display_info.width_mm = info.width_mm;
-	conn->display_info.height_mm = info.height_mm;
-
-	return status;
-}
-
-void dp_connector_send_hpd_event(void *display)
-{
-	struct dp_display *dp;
-
-	if (!display) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp = display;
-
-	if (dp->send_hpd_event)
-		dp->send_hpd_event(dp);
-}
-
-int dp_connector_get_modes(struct drm_connector *connector,
-		void *display)
-{
-	int rc = 0;
-	struct dp_display *dp;
-	struct dp_display_mode *dp_mode = NULL;
-	struct drm_display_mode *m, drm_mode;
-
-	if (!connector || !display)
-		return 0;
-
-	dp = display;
-
-	dp_mode = kzalloc(sizeof(*dp_mode),  GFP_KERNEL);
-	if (!dp_mode)
-		return 0;
-
-	/* pluggable case assumes EDID is read when HPD */
-	if (dp->is_connected) {
-		rc = dp->get_modes(dp, dp_mode);
-		if (!rc)
-			pr_err("failed to get DP sink modes, rc=%d\n", rc);
-
-		if (dp_mode->timing.pixel_clk_khz) { /* valid DP mode */
-			memset(&drm_mode, 0x0, sizeof(drm_mode));
-			convert_to_drm_mode(dp_mode, &drm_mode);
-			m = drm_mode_duplicate(connector->dev, &drm_mode);
-			if (!m) {
-				pr_err("failed to add mode %ux%u\n",
-				       drm_mode.hdisplay,
-				       drm_mode.vdisplay);
-				kfree(dp_mode);
-				return 0;
-			}
-			m->width_mm = connector->display_info.width_mm;
-			m->height_mm = connector->display_info.height_mm;
-			drm_mode_probed_add(connector, m);
-		}
-	} else {
-		pr_err("No sink connected\n");
-	}
-	kfree(dp_mode);
-
-	return rc;
-}
-
-int dp_drm_bridge_init(void *data, struct drm_encoder *encoder)
-{
-	int rc = 0;
-	struct dp_bridge *bridge;
-	struct drm_device *dev;
-	struct dp_display *display = data;
-	struct msm_drm_private *priv = NULL;
-
-	bridge = kzalloc(sizeof(*bridge), GFP_KERNEL);
-	if (!bridge) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	dev = display->drm_dev;
-	bridge->display = display;
-	bridge->base.funcs = &dp_bridge_ops;
-	bridge->base.encoder = encoder;
-
-	priv = dev->dev_private;
-
-	rc = drm_bridge_attach(encoder, &bridge->base, NULL);
-	if (rc) {
-		pr_err("failed to attach bridge, rc=%d\n", rc);
-		goto error_free_bridge;
-	}
-
-	rc = display->request_irq(display);
-	if (rc) {
-		pr_err("request_irq failed, rc=%d\n", rc);
-		goto error_free_bridge;
-	}
-
-	encoder->bridge = &bridge->base;
-	priv->bridges[priv->num_bridges++] = &bridge->base;
-	display->bridge = bridge;
-
-	return 0;
-error_free_bridge:
-	kfree(bridge);
-error:
-	return rc;
-}
-
-void dp_drm_bridge_deinit(void *data)
-{
-	struct dp_display *display = data;
-	struct dp_bridge *bridge = display->bridge;
-
-	if (bridge && bridge->base.encoder)
-		bridge->base.encoder->bridge = NULL;
-
-	kfree(bridge);
-}
-
-enum drm_mode_status dp_connector_mode_valid(struct drm_connector *connector,
-		struct drm_display_mode *mode,
-		void *display)
-{
-	struct dp_display *dp_disp;
-	struct dp_debug *debug;
-
-	if (!mode || !display) {
-		pr_err("invalid params\n");
-		return MODE_ERROR;
-	}
-
-	dp_disp = display;
-	debug = dp_disp->get_debug(dp_disp);
-
-	if (debug->debug_en) {
-		if (mode->hdisplay == debug->hdisplay &&
-				mode->vdisplay == debug->vdisplay &&
-				mode->vrefresh == debug->vrefresh &&
-				mode->clock <= dp_disp->max_pclk_khz)
-			return MODE_OK;
-		else
-			return MODE_ERROR;
-	} else {
-		if (mode->vrefresh == 0) {
-			int vrefresh = (mode->clock * 1000) /
-				(mode->vtotal * mode->htotal);
-			if (vrefresh > 60)
-				return MODE_BAD;
-		}
-
-		if (mode->clock > dp_disp->max_pclk_khz)
-			return MODE_BAD;
-		else
-			return MODE_OK;
-	}
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_drm.h b/drivers/gpu/drm/msm/dp/dp_drm.h
deleted file mode 100644
index 08d1f2d..0000000
--- a/drivers/gpu/drm/msm/dp/dp_drm.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_DRM_H_
-#define _DP_DRM_H_
-
-#include <linux/types.h>
-#include <drm/drmP.h>
-#include <drm/drm_crtc.h>
-#include <drm/drm_crtc_helper.h>
-
-#include "msm_drv.h"
-#include "dp_display.h"
-
-struct dp_bridge {
-	struct drm_bridge base;
-	u32 id;
-
-	struct dp_display *display;
-	struct dp_display_mode dp_mode;
-};
-
-/**
- * dp_connector_post_init - callback to perform additional initialization steps
- * @connector: Pointer to drm connector structure
- * @info: Pointer to dpu connector info structure
- * @display: Pointer to private display handle
- * Returns: Zero on success
- */
-int dp_connector_post_init(struct drm_connector *connector,
-		void *info,
-		void *display);
-
-/**
- * dp_connector_detect - callback to determine if connector is connected
- * @connector: Pointer to drm connector structure
- * @force: Force detect setting from drm framework
- * @display: Pointer to private display handle
- * Returns: Connector 'is connected' status
- */
-enum drm_connector_status dp_connector_detect(struct drm_connector *conn,
-		bool force,
-		void *display);
-
-/**
- * dp_connector_get_modes - callback to add drm modes via drm_mode_probed_add()
- * @connector: Pointer to drm connector structure
- * @display: Pointer to private display handle
- * Returns: Number of modes added
- */
-int dp_connector_get_modes(struct drm_connector *connector,
-		void *display);
-
-/**
- * dp_connector_mode_valid - callback to determine if specified mode is valid
- * @connector: Pointer to drm connector structure
- * @mode: Pointer to drm mode structure
- * @display: Pointer to private display handle
- * Returns: Validity status for specified mode
- */
-enum drm_mode_status dp_connector_mode_valid(struct drm_connector *connector,
-		struct drm_display_mode *mode,
-		void *display);
-
-/**
- * dp_connector_get_mode_info - retrieve information of the mode selected
- * @drm_mode: Display mode set for the display
- * @mode_info: Out parameter. Information of the mode
- * @max_mixer_width: max width supported by HW layer mixer
- * Returns: zero on success
- */
-int dp_connector_get_mode_info(const struct drm_display_mode *drm_mode,
-		struct msm_mode_info *mode_info,
-		u32 max_mixer_width);
-
-int dp_connector_get_info(struct msm_display_info *info, void *display);
-
-void dp_connector_send_hpd_event(void *display);
-
-int dp_drm_bridge_init(void *display,
-	struct drm_encoder *encoder);
-
-void dp_drm_bridge_deinit(void *display);
-#endif /* _DP_DRM_H_ */
-
diff --git a/drivers/gpu/drm/msm/dp/dp_hdcp2p2.c b/drivers/gpu/drm/msm/dp/dp_hdcp2p2.c
deleted file mode 100644
index 2366469..0000000
--- a/drivers/gpu/drm/msm/dp/dp_hdcp2p2.c
+++ /dev/null
@@ -1,927 +0,0 @@
-/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#define pr_fmt(fmt)	"[dp-hdcp2p2] %s: " fmt, __func__
-
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include <linux/stat.h>
-#include <linux/types.h>
-#include <linux/kthread.h>
-#include <linux/hdcp_qseecom.h>
-#include <drm/drm_dp_helper.h>
-
-#include "dpu_hdcp.h"
-
-#define DP_INTR_STATUS2				(0x00000024)
-#define DP_INTR_STATUS3				(0x00000028)
-#define dp_read(offset) readl_relaxed((offset))
-#define dp_write(offset, data) writel_relaxed((data), (offset))
-#define DP_HDCP_RXCAPS_LENGTH 3
-
-enum dp_hdcp2p2_sink_status {
-	SINK_DISCONNECTED,
-	SINK_CONNECTED
-};
-
-enum dp_auth_status {
-	DP_HDCP_AUTH_STATUS_FAILURE,
-	DP_HDCP_AUTH_STATUS_SUCCESS
-};
-
-struct dp_hdcp2p2_ctrl {
-	atomic_t auth_state;
-	enum dp_hdcp2p2_sink_status sink_status; /* Is sink connected */
-	struct dp_hdcp2p2_interrupts *intr;
-	struct dpu_hdcp_init_data init_data;
-	struct mutex mutex; /* mutex to protect access to ctrl */
-	struct mutex msg_lock; /* mutex to protect access to msg buffer */
-	struct mutex wakeup_mutex; /* mutex to protect access to wakeup call*/
-	struct dpu_hdcp_ops *ops;
-	void *lib_ctx; /* Handle to HDCP 2.2 Trustzone library */
-	struct hdcp_txmtr_ops *lib; /* Ops for driver to call into TZ */
-	enum hdcp_wakeup_cmd wakeup_cmd;
-	enum dp_auth_status auth_status;
-
-	struct task_struct *thread;
-	struct kthread_worker worker;
-	struct kthread_work status;
-	struct kthread_work auth;
-	struct kthread_work send_msg;
-	struct kthread_work recv_msg;
-	struct kthread_work link;
-	char *msg_buf;
-	uint32_t send_msg_len; /* length of all parameters in msg */
-	uint32_t timeout;
-	uint32_t num_messages;
-	struct hdcp_msg_part msg_part[HDCP_MAX_MESSAGE_PARTS];
-	u8 sink_rx_status;
-	u8 rx_status;
-	char abort_mask;
-
-	bool cp_irq_done;
-	bool polling;
-};
-
-struct dp_hdcp2p2_int_set {
-	u32 interrupt;
-	char *name;
-	void (*func)(struct dp_hdcp2p2_ctrl *ctrl);
-};
-
-struct dp_hdcp2p2_interrupts {
-	u32 reg;
-	struct dp_hdcp2p2_int_set *int_set;
-};
-
-static inline bool dp_hdcp2p2_is_valid_state(struct dp_hdcp2p2_ctrl *ctrl)
-{
-	if (ctrl->wakeup_cmd == HDCP_WKUP_CMD_AUTHENTICATE)
-		return true;
-
-	if (atomic_read(&ctrl->auth_state) != HDCP_STATE_INACTIVE)
-		return true;
-
-	return false;
-}
-
-static int dp_hdcp2p2_copy_buf(struct dp_hdcp2p2_ctrl *ctrl,
-	struct hdcp_wakeup_data *data)
-{
-	int i = 0;
-
-	if (!data || !data->message_data)
-		return 0;
-
-	mutex_lock(&ctrl->msg_lock);
-
-	ctrl->timeout = data->timeout;
-	ctrl->num_messages = data->message_data->num_messages;
-	ctrl->send_msg_len = 0; /* Total len of all messages */
-
-	for (i = 0; i < ctrl->num_messages ; i++)
-		ctrl->send_msg_len += data->message_data->messages[i].length;
-
-	memcpy(ctrl->msg_part, data->message_data->messages,
-		sizeof(data->message_data->messages));
-
-	ctrl->rx_status = data->message_data->rx_status;
-	ctrl->abort_mask = data->abort_mask;
-
-	if (!data->send_msg_len) {
-		mutex_unlock(&ctrl->msg_lock);
-		return 0;
-	}
-
-	kzfree(ctrl->msg_buf);
-
-	ctrl->msg_buf = kzalloc(ctrl->send_msg_len, GFP_KERNEL);
-
-	if (!ctrl->msg_buf) {
-		mutex_unlock(&ctrl->msg_lock);
-		return -ENOMEM;
-	}
-
-	/* ignore first byte as it contains message id */
-	memcpy(ctrl->msg_buf, data->send_msg_buf + 1, ctrl->send_msg_len);
-
-	mutex_unlock(&ctrl->msg_lock);
-
-	return 0;
-}
-
-static int dp_hdcp2p2_wakeup(struct hdcp_wakeup_data *data)
-{
-	struct dp_hdcp2p2_ctrl *ctrl;
-	u32 const default_timeout_us = 500;
-
-	if (!data) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	ctrl = data->context;
-	if (!ctrl) {
-		pr_err("invalid ctrl\n");
-		return -EINVAL;
-	}
-
-	mutex_lock(&ctrl->wakeup_mutex);
-
-	ctrl->wakeup_cmd = data->cmd;
-
-	if (data->timeout)
-		ctrl->timeout = (data->timeout) * 2;
-	else
-		ctrl->timeout = default_timeout_us;
-
-	if (!dp_hdcp2p2_is_valid_state(ctrl)) {
-		pr_err("invalid state\n");
-		goto exit;
-	}
-
-	if (dp_hdcp2p2_copy_buf(ctrl, data))
-		goto exit;
-
-	if (ctrl->wakeup_cmd == HDCP_WKUP_CMD_STATUS_SUCCESS)
-		ctrl->auth_status = DP_HDCP_AUTH_STATUS_SUCCESS;
-	else if (ctrl->wakeup_cmd == HDCP_WKUP_CMD_STATUS_FAILED)
-		ctrl->auth_status = DP_HDCP_AUTH_STATUS_FAILURE;
-
-	switch (ctrl->wakeup_cmd) {
-	case HDCP_WKUP_CMD_SEND_MESSAGE:
-		kthread_queue_work(&ctrl->worker, &ctrl->send_msg);
-		break;
-	case HDCP_WKUP_CMD_RECV_MESSAGE:
-		kthread_queue_work(&ctrl->worker, &ctrl->recv_msg);
-		break;
-	case HDCP_WKUP_CMD_STATUS_SUCCESS:
-	case HDCP_WKUP_CMD_STATUS_FAILED:
-		kthread_queue_work(&ctrl->worker, &ctrl->status);
-		break;
-	case HDCP_WKUP_CMD_LINK_POLL:
-		if (ctrl->cp_irq_done)
-			kthread_queue_work(&ctrl->worker, &ctrl->recv_msg);
-		else
-			ctrl->polling = true;
-		break;
-	case HDCP_WKUP_CMD_AUTHENTICATE:
-		kthread_queue_work(&ctrl->worker, &ctrl->auth);
-		break;
-	default:
-		pr_err("invalid wakeup command %d\n", ctrl->wakeup_cmd);
-	}
-exit:
-	mutex_unlock(&ctrl->wakeup_mutex);
-
-	return 0;
-}
-
-static inline void dp_hdcp2p2_wakeup_lib(struct dp_hdcp2p2_ctrl *ctrl,
-	struct hdcp_lib_wakeup_data *data)
-{
-	int rc = 0;
-
-	if (ctrl && ctrl->lib && ctrl->lib->wakeup &&
-		data && (data->cmd != HDCP_LIB_WKUP_CMD_INVALID)) {
-		rc = ctrl->lib->wakeup(data);
-		if (rc)
-			pr_err("error sending %s to lib\n",
-				hdcp_lib_cmd_to_str(data->cmd));
-	}
-}
-
-static void dp_hdcp2p2_reset(struct dp_hdcp2p2_ctrl *ctrl)
-{
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	ctrl->sink_status = SINK_DISCONNECTED;
-	atomic_set(&ctrl->auth_state, HDCP_STATE_INACTIVE);
-}
-
-static void dp_hdcp2p2_set_interrupts(struct dp_hdcp2p2_ctrl *ctrl, bool enable)
-{
-	void __iomem *base = ctrl->init_data.core_io->base;
-	struct dp_hdcp2p2_interrupts *intr = ctrl->intr;
-
-	while (intr && intr->reg) {
-		struct dp_hdcp2p2_int_set *int_set = intr->int_set;
-		u32 interrupts = 0;
-
-		while (int_set && int_set->interrupt) {
-			interrupts |= int_set->interrupt;
-			int_set++;
-		}
-
-		if (enable)
-			dp_write(base + intr->reg,
-				dp_read(base + intr->reg) | interrupts);
-		else
-			dp_write(base + intr->reg,
-				dp_read(base + intr->reg) & ~interrupts);
-		intr++;
-	}
-}
-
-static void dp_hdcp2p2_off(void *input)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = (struct dp_hdcp2p2_ctrl *)input;
-	struct hdcp_wakeup_data cdata = {HDCP_WKUP_CMD_AUTHENTICATE};
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_INACTIVE) {
-		pr_err("hdcp is off\n");
-		return;
-	}
-
-	dp_hdcp2p2_set_interrupts(ctrl, false);
-
-	dp_hdcp2p2_reset(ctrl);
-
-	kthread_flush_worker(&ctrl->worker);
-
-	cdata.context = input;
-	dp_hdcp2p2_wakeup(&cdata);
-}
-
-static int dp_hdcp2p2_authenticate(void *input)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = input;
-	struct hdcp_wakeup_data cdata = {HDCP_WKUP_CMD_AUTHENTICATE};
-	int rc = 0;
-
-	kthread_flush_worker(&ctrl->worker);
-
-	dp_hdcp2p2_set_interrupts(ctrl, true);
-
-	ctrl->sink_status = SINK_CONNECTED;
-	atomic_set(&ctrl->auth_state, HDCP_STATE_AUTHENTICATING);
-
-	cdata.context = input;
-	dp_hdcp2p2_wakeup(&cdata);
-
-	return rc;
-}
-
-static int dp_hdcp2p2_reauthenticate(void *input)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = (struct dp_hdcp2p2_ctrl *)input;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	dp_hdcp2p2_reset((struct dp_hdcp2p2_ctrl *)input);
-
-	return  dp_hdcp2p2_authenticate(input);
-}
-
-static void dp_hdcp2p2_min_level_change(void *client_ctx,
-		int min_enc_level)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = (struct dp_hdcp2p2_ctrl *)client_ctx;
-	struct hdcp_lib_wakeup_data cdata = {
-		HDCP_LIB_WKUP_CMD_QUERY_STREAM_TYPE};
-	bool enc_notify = true;
-	int enc_lvl;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	switch (min_enc_level) {
-	case 0:
-		enc_lvl = HDCP_STATE_AUTH_ENC_NONE;
-		break;
-	case 1:
-		enc_lvl = HDCP_STATE_AUTH_ENC_1X;
-		break;
-	case 2:
-		enc_lvl = HDCP_STATE_AUTH_ENC_2P2;
-		break;
-	default:
-		enc_notify = false;
-	}
-
-	pr_debug("enc level changed %d\n", min_enc_level);
-
-	cdata.context = ctrl->lib_ctx;
-	dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
-
-	if (enc_notify && ctrl->init_data.notify_status)
-		ctrl->init_data.notify_status(ctrl->init_data.cb_data, enc_lvl);
-}
-
-static void dp_hdcp2p2_auth_failed(struct dp_hdcp2p2_ctrl *ctrl)
-{
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	dp_hdcp2p2_set_interrupts(ctrl, false);
-
-	atomic_set(&ctrl->auth_state, HDCP_STATE_AUTH_FAIL);
-
-	/* notify DP about HDCP failure */
-	ctrl->init_data.notify_status(ctrl->init_data.cb_data,
-		HDCP_STATE_AUTH_FAIL);
-}
-
-static int dp_hdcp2p2_aux_read_message(struct dp_hdcp2p2_ctrl *ctrl,
-	u8 *buf, int size, int offset, u32 timeout)
-{
-	int const max_size = 16;
-	int rc = 0, read_size = 0, bytes_read = 0;
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_INACTIVE) {
-		pr_err("hdcp is off\n");
-		return -EINVAL;
-	}
-
-	do {
-		read_size = min(size, max_size);
-
-		bytes_read = drm_dp_dpcd_read(ctrl->init_data.drm_aux,
-				offset, buf, read_size);
-		if (bytes_read != read_size) {
-			pr_err("fail: offset(0x%x), size(0x%x), rc(0x%x)\n",
-					offset, read_size, bytes_read);
-			break;
-		}
-
-		buf += read_size;
-		offset += read_size;
-		size -= read_size;
-	} while (size > 0);
-
-	return rc;
-}
-
-static int dp_hdcp2p2_aux_write_message(struct dp_hdcp2p2_ctrl *ctrl,
-	u8 *buf, int size, uint offset, uint timeout)
-{
-	int const max_size = 16;
-	int rc = 0, write_size = 0, bytes_written = 0;
-
-	do {
-		write_size = min(size, max_size);
-
-		bytes_written = drm_dp_dpcd_write(ctrl->init_data.drm_aux,
-				offset, buf, write_size);
-		if (bytes_written != write_size) {
-			pr_err("fail: offset(0x%x), size(0x%x), rc(0x%x)\n",
-					offset, write_size, bytes_written);
-			break;
-		}
-
-		buf += write_size;
-		offset += write_size;
-		size -= write_size;
-	} while (size > 0);
-
-	return rc;
-}
-
-static bool dp_hdcp2p2_feature_supported(void *input)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = input;
-	struct hdcp_txmtr_ops *lib = NULL;
-	bool supported = false;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		goto end;
-	}
-
-	lib = ctrl->lib;
-	if (!lib) {
-		pr_err("invalid lib ops data\n");
-		goto end;
-	}
-
-	if (lib->feature_supported)
-		supported = lib->feature_supported(
-			ctrl->lib_ctx);
-end:
-	return supported;
-}
-
-static void dp_hdcp2p2_send_msg_work(struct kthread_work *work)
-{
-	int rc = 0;
-	struct dp_hdcp2p2_ctrl *ctrl = container_of(work,
-		struct dp_hdcp2p2_ctrl, send_msg);
-	struct hdcp_lib_wakeup_data cdata = {HDCP_LIB_WKUP_CMD_INVALID};
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	cdata.context = ctrl->lib_ctx;
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_INACTIVE) {
-		pr_err("hdcp is off\n");
-		goto exit;
-	}
-
-	mutex_lock(&ctrl->msg_lock);
-
-	rc = dp_hdcp2p2_aux_write_message(ctrl, ctrl->msg_buf,
-			ctrl->send_msg_len, ctrl->msg_part->offset,
-			ctrl->timeout);
-	if (rc) {
-		pr_err("Error sending msg to sink %d\n", rc);
-		mutex_unlock(&ctrl->msg_lock);
-		goto exit;
-	}
-
-	cdata.cmd = HDCP_LIB_WKUP_CMD_MSG_SEND_SUCCESS;
-	cdata.timeout = ctrl->timeout;
-	mutex_unlock(&ctrl->msg_lock);
-
-exit:
-	if (rc == -ETIMEDOUT)
-		cdata.cmd = HDCP_LIB_WKUP_CMD_MSG_RECV_TIMEOUT;
-	else if (rc)
-		cdata.cmd = HDCP_LIB_WKUP_CMD_MSG_RECV_FAILED;
-
-	dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
-}
-
-static int dp_hdcp2p2_get_msg_from_sink(struct dp_hdcp2p2_ctrl *ctrl)
-{
-	int rc = 0;
-	char *recvd_msg_buf = NULL;
-	struct hdcp_lib_wakeup_data cdata = { HDCP_LIB_WKUP_CMD_INVALID };
-
-	cdata.context = ctrl->lib_ctx;
-
-	recvd_msg_buf = kzalloc(ctrl->send_msg_len, GFP_KERNEL);
-	if (!recvd_msg_buf) {
-		rc = -ENOMEM;
-		goto exit;
-	}
-
-	rc = dp_hdcp2p2_aux_read_message(ctrl, recvd_msg_buf,
-		ctrl->send_msg_len, ctrl->msg_part->offset,
-		ctrl->timeout);
-	if (rc) {
-		pr_err("error reading message %d\n", rc);
-		goto exit;
-	}
-
-	cdata.recvd_msg_buf = recvd_msg_buf;
-	cdata.recvd_msg_len = ctrl->send_msg_len;
-	cdata.timeout = ctrl->timeout;
-exit:
-	if (rc == -ETIMEDOUT)
-		cdata.cmd = HDCP_LIB_WKUP_CMD_MSG_RECV_TIMEOUT;
-	else if (rc)
-		cdata.cmd = HDCP_LIB_WKUP_CMD_MSG_RECV_FAILED;
-	else
-		cdata.cmd = HDCP_LIB_WKUP_CMD_MSG_RECV_SUCCESS;
-
-	dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
-	kfree(recvd_msg_buf);
-
-	return rc;
-}
-
-static void dp_hdcp2p2_recv_msg_work(struct kthread_work *work)
-{
-	struct hdcp_lib_wakeup_data cdata = { HDCP_LIB_WKUP_CMD_INVALID };
-	struct dp_hdcp2p2_ctrl *ctrl = container_of(work,
-		struct dp_hdcp2p2_ctrl, recv_msg);
-
-	cdata.context = ctrl->lib_ctx;
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_INACTIVE) {
-		pr_err("hdcp is off\n");
-		return;
-	}
-
-	if (ctrl->rx_status) {
-		if (!ctrl->cp_irq_done) {
-			pr_debug("waiting for CP_IRQ\n");
-			ctrl->polling = true;
-			return;
-		}
-
-		if (ctrl->rx_status & ctrl->sink_rx_status) {
-			ctrl->cp_irq_done = false;
-			ctrl->sink_rx_status = 0;
-			ctrl->rx_status = 0;
-		}
-	}
-
-	dp_hdcp2p2_get_msg_from_sink(ctrl);
-}
-
-static void dp_hdcp2p2_auth_status_work(struct kthread_work *work)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = container_of(work,
-		struct dp_hdcp2p2_ctrl, status);
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_INACTIVE) {
-		pr_err("hdcp is off\n");
-		return;
-	}
-
-	if (ctrl->auth_status == DP_HDCP_AUTH_STATUS_SUCCESS) {
-		ctrl->init_data.notify_status(ctrl->init_data.cb_data,
-			HDCP_STATE_AUTHENTICATED);
-
-		atomic_set(&ctrl->auth_state, HDCP_STATE_AUTHENTICATED);
-	} else {
-		dp_hdcp2p2_auth_failed(ctrl);
-	}
-}
-
-static void dp_hdcp2p2_link_work(struct kthread_work *work)
-{
-	int rc = 0;
-	struct dp_hdcp2p2_ctrl *ctrl = container_of(work,
-		struct dp_hdcp2p2_ctrl, link);
-	struct hdcp_lib_wakeup_data cdata = {HDCP_LIB_WKUP_CMD_INVALID};
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_AUTH_FAIL ||
-		atomic_read(&ctrl->auth_state) == HDCP_STATE_INACTIVE) {
-		pr_err("invalid hdcp state\n");
-		return;
-	}
-
-	cdata.context = ctrl->lib_ctx;
-
-	if (ctrl->sink_rx_status & ctrl->abort_mask) {
-		if (ctrl->sink_rx_status & BIT(3))
-			pr_err("reauth_req set by sink\n");
-
-		if (ctrl->sink_rx_status & BIT(4))
-			pr_err("link failure reported by sink\n");
-
-		ctrl->sink_rx_status = 0;
-		ctrl->rx_status = 0;
-
-		rc = -ENOLINK;
-
-		cdata.cmd = HDCP_LIB_WKUP_CMD_LINK_FAILED;
-		atomic_set(&ctrl->auth_state, HDCP_STATE_AUTH_FAIL);
-		goto exit;
-	}
-
-	if (ctrl->polling && (ctrl->sink_rx_status & ctrl->rx_status)) {
-		ctrl->sink_rx_status = 0;
-		ctrl->rx_status = 0;
-
-		dp_hdcp2p2_get_msg_from_sink(ctrl);
-
-		ctrl->polling = false;
-	} else {
-		ctrl->cp_irq_done = true;
-	}
-exit:
-	if (rc)
-		dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
-}
-
-static void dp_hdcp2p2_auth_work(struct kthread_work *work)
-{
-	struct hdcp_lib_wakeup_data cdata = {HDCP_LIB_WKUP_CMD_INVALID};
-	struct dp_hdcp2p2_ctrl *ctrl = container_of(work,
-		struct dp_hdcp2p2_ctrl, auth);
-
-	cdata.context = ctrl->lib_ctx;
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_AUTHENTICATING)
-		cdata.cmd = HDCP_LIB_WKUP_CMD_START;
-	else
-		cdata.cmd = HDCP_LIB_WKUP_CMD_STOP;
-
-	dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
-}
-
-static int dp_hdcp2p2_read_rx_status(struct dp_hdcp2p2_ctrl *ctrl,
-		u8 *rx_status)
-{
-	u32 const cp_irq_dpcd_offset = 0x201;
-	u32 const rxstatus_dpcd_offset = 0x69493;
-	ssize_t const bytes_to_read = 1;
-	ssize_t bytes_read = 0;
-	u8 buf = 0;
-	int rc = 0;
-	bool cp_irq = 0;
-
-	*rx_status = 0;
-
-	bytes_read = drm_dp_dpcd_read(ctrl->init_data.drm_aux,
-			cp_irq_dpcd_offset, &buf, bytes_to_read);
-	if (bytes_read != bytes_to_read) {
-		pr_err("cp irq read failed\n");
-		rc = bytes_read;
-		goto error;
-	}
-
-	cp_irq = buf & BIT(2);
-	pr_debug("cp_irq=0x%x\n", cp_irq);
-	buf = 0;
-
-	if (cp_irq) {
-		bytes_read = drm_dp_dpcd_read(ctrl->init_data.drm_aux,
-				rxstatus_dpcd_offset, &buf, bytes_to_read);
-		if (bytes_read != bytes_to_read) {
-			pr_err("rxstatus read failed\n");
-			rc = bytes_read;
-			goto error;
-		}
-		*rx_status = buf;
-		pr_debug("rx_status=0x%x\n", *rx_status);
-	}
-
-error:
-	return rc;
-}
-
-static int dp_hdcp2p2_cp_irq(void *input)
-{
-	int rc = 0;
-	struct dp_hdcp2p2_ctrl *ctrl = input;
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	if (atomic_read(&ctrl->auth_state) == HDCP_STATE_AUTH_FAIL ||
-		atomic_read(&ctrl->auth_state) == HDCP_STATE_INACTIVE) {
-		pr_err("invalid hdcp state\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	ctrl->sink_rx_status = 0;
-	rc = dp_hdcp2p2_read_rx_status(ctrl, &ctrl->sink_rx_status);
-	if (rc) {
-		pr_err("failed to read rx status\n");
-		goto error;
-	}
-
-	pr_debug("sink_rx_status=0x%x\n", ctrl->sink_rx_status);
-
-	if (!ctrl->sink_rx_status) {
-		pr_debug("not a hdcp 2.2 irq\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	kthread_queue_work(&ctrl->worker, &ctrl->link);
-
-	return 0;
-error:
-	return rc;
-}
-
-static int dp_hdcp2p2_isr(void *input)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = (struct dp_hdcp2p2_ctrl *)input;
-	int rc = 0;
-	struct dss_io_data *io;
-	struct dp_hdcp2p2_interrupts *intr;
-	u32 hdcp_int_val = 0;
-
-	if (!ctrl || !ctrl->init_data.core_io) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	io = ctrl->init_data.core_io;
-	intr = ctrl->intr;
-
-	while (intr && intr->reg) {
-		struct dp_hdcp2p2_int_set *int_set = intr->int_set;
-
-		hdcp_int_val = dp_read(io->base + intr->reg);
-
-		while (int_set && int_set->interrupt) {
-			if (hdcp_int_val & (int_set->interrupt >> 2)) {
-				pr_debug("%s\n", int_set->name);
-
-				if (int_set->func)
-					int_set->func(ctrl);
-
-				dp_write(io->base + intr->reg, hdcp_int_val |
-					(int_set->interrupt >> 1));
-			}
-			int_set++;
-		}
-		intr++;
-	}
-end:
-	return rc;
-}
-
-void dpu_dp_hdcp2p2_deinit(void *input)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = (struct dp_hdcp2p2_ctrl *)input;
-	struct hdcp_lib_wakeup_data cdata = {HDCP_LIB_WKUP_CMD_INVALID};
-
-	if (!ctrl) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	cdata.cmd = HDCP_LIB_WKUP_CMD_STOP;
-	cdata.context = ctrl->lib_ctx;
-	dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
-
-	kthread_stop(ctrl->thread);
-
-	mutex_destroy(&ctrl->mutex);
-	mutex_destroy(&ctrl->msg_lock);
-	mutex_destroy(&ctrl->wakeup_mutex);
-	kzfree(ctrl->msg_buf);
-	kfree(ctrl);
-}
-
-void *dpu_dp_hdcp2p2_init(struct dpu_hdcp_init_data *init_data)
-{
-	int rc;
-	struct dp_hdcp2p2_ctrl *ctrl;
-	static struct hdcp_txmtr_ops txmtr_ops;
-	struct hdcp_register_data register_data;
-	static struct dpu_hdcp_ops ops = {
-		.isr = dp_hdcp2p2_isr,
-		.reauthenticate = dp_hdcp2p2_reauthenticate,
-		.authenticate = dp_hdcp2p2_authenticate,
-		.feature_supported = dp_hdcp2p2_feature_supported,
-		.off = dp_hdcp2p2_off,
-		.cp_irq = dp_hdcp2p2_cp_irq,
-	};
-
-	static struct hdcp_client_ops client_ops = {
-		.wakeup = dp_hdcp2p2_wakeup,
-		.notify_lvl_change = dp_hdcp2p2_min_level_change,
-	};
-	static struct dp_hdcp2p2_int_set int_set1[] = {
-		{BIT(17), "authentication successful", NULL},
-		{BIT(20), "authentication failed", NULL},
-		{BIT(24), "encryption enabled", NULL},
-		{BIT(27), "encryption disabled", NULL},
-		{0},
-	};
-	static struct dp_hdcp2p2_int_set int_set2[] = {
-		{BIT(2),  "key fifo underflow", NULL},
-		{0},
-	};
-	static struct dp_hdcp2p2_interrupts intr[] = {
-		{DP_INTR_STATUS2, int_set1},
-		{DP_INTR_STATUS3, int_set2},
-		{0}
-	};
-
-	if (!init_data || !init_data->cb_data ||
-			!init_data->notify_status || !init_data->drm_aux) {
-		pr_err("invalid input\n");
-		return ERR_PTR(-EINVAL);
-	}
-
-	ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
-	if (!ctrl)
-		return ERR_PTR(-ENOMEM);
-
-	ctrl->init_data = *init_data;
-	ctrl->lib = &txmtr_ops;
-	ctrl->msg_buf = NULL;
-
-	ctrl->sink_status = SINK_DISCONNECTED;
-	ctrl->intr = intr;
-
-	atomic_set(&ctrl->auth_state, HDCP_STATE_INACTIVE);
-
-	ctrl->ops = &ops;
-	mutex_init(&ctrl->mutex);
-	mutex_init(&ctrl->msg_lock);
-	mutex_init(&ctrl->wakeup_mutex);
-
-	register_data.hdcp_ctx = &ctrl->lib_ctx;
-	register_data.client_ops = &client_ops;
-	register_data.txmtr_ops = &txmtr_ops;
-	register_data.device_type = HDCP_TXMTR_DP;
-	register_data.client_ctx = ctrl;
-
-	rc = hdcp_library_register(&register_data);
-	if (rc) {
-		pr_err("Unable to register with HDCP 2.2 library\n");
-		goto error;
-	}
-
-	kthread_init_worker(&ctrl->worker);
-
-	kthread_init_work(&ctrl->auth,     dp_hdcp2p2_auth_work);
-	kthread_init_work(&ctrl->send_msg, dp_hdcp2p2_send_msg_work);
-	kthread_init_work(&ctrl->recv_msg, dp_hdcp2p2_recv_msg_work);
-	kthread_init_work(&ctrl->status,   dp_hdcp2p2_auth_status_work);
-	kthread_init_work(&ctrl->link,     dp_hdcp2p2_link_work);
-
-	ctrl->thread = kthread_run(kthread_worker_fn,
-		&ctrl->worker, "dp_hdcp2p2");
-
-	if (IS_ERR(ctrl->thread)) {
-		pr_err("unable to start DP hdcp2p2 thread\n");
-		rc = PTR_ERR(ctrl->thread);
-		ctrl->thread = NULL;
-		goto error;
-	}
-
-	return ctrl;
-error:
-	kfree(ctrl);
-	return ERR_PTR(rc);
-}
-
-static bool dp_hdcp2p2_supported(struct dp_hdcp2p2_ctrl *ctrl)
-{
-	u32 const rxcaps_dpcd_offset = 0x6921d;
-	ssize_t bytes_read = 0;
-	u8 buf[DP_HDCP_RXCAPS_LENGTH];
-
-	bytes_read = drm_dp_dpcd_read(ctrl->init_data.drm_aux,
-			rxcaps_dpcd_offset, &buf, DP_HDCP_RXCAPS_LENGTH);
-	if (bytes_read != DP_HDCP_RXCAPS_LENGTH) {
-		pr_err("RxCaps read failed\n");
-		goto error;
-	}
-
-	pr_debug("HDCP_CAPABLE=%lu\n", (buf[2] & BIT(1)) >> 1);
-	pr_debug("VERSION=%d\n", buf[0]);
-
-	if ((buf[2] & BIT(1)) && (buf[0] == 0x2))
-		return true;
-
-error:
-	return false;
-}
-
-struct dpu_hdcp_ops *dpu_dp_hdcp2p2_start(void *input)
-{
-	struct dp_hdcp2p2_ctrl *ctrl = input;
-
-	pr_debug("Checking sink capability\n");
-	if (dp_hdcp2p2_supported(ctrl))
-		return ctrl->ops;
-	else
-		return NULL;
-}
-
diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c
deleted file mode 100644
index 9480861..0000000
--- a/drivers/gpu/drm/msm/dp/dp_link.c
+++ /dev/null
@@ -1,1548 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include "dp_link.h"
-#include "dp_panel.h"
-
-enum dynamic_range {
-	DP_DYNAMIC_RANGE_RGB_VESA = 0x00,
-	DP_DYNAMIC_RANGE_RGB_CEA = 0x01,
-	DP_DYNAMIC_RANGE_UNKNOWN = 0xFFFFFFFF,
-};
-
-enum audio_sample_rate {
-	AUDIO_SAMPLE_RATE_32_KHZ	= 0x00,
-	AUDIO_SAMPLE_RATE_44_1_KHZ	= 0x01,
-	AUDIO_SAMPLE_RATE_48_KHZ	= 0x02,
-	AUDIO_SAMPLE_RATE_88_2_KHZ	= 0x03,
-	AUDIO_SAMPLE_RATE_96_KHZ	= 0x04,
-	AUDIO_SAMPLE_RATE_176_4_KHZ	= 0x05,
-	AUDIO_SAMPLE_RATE_192_KHZ	= 0x06,
-};
-
-enum audio_pattern_type {
-	AUDIO_TEST_PATTERN_OPERATOR_DEFINED	= 0x00,
-	AUDIO_TEST_PATTERN_SAWTOOTH		= 0x01,
-};
-
-struct dp_link_request {
-	u32 test_requested;
-	u32 test_link_rate;
-	u32 test_lane_count;
-};
-
-struct dp_link_private {
-	u32 prev_sink_count;
-	struct device *dev;
-	struct dp_aux *aux;
-	struct dp_link dp_link;
-
-	struct dp_link_request request;
-	u8 link_status[DP_LINK_STATUS_SIZE];
-};
-
-static char *dp_link_get_audio_test_pattern(u32 pattern)
-{
-	switch (pattern) {
-	case AUDIO_TEST_PATTERN_OPERATOR_DEFINED:
-		return DP_LINK_ENUM_STR(AUDIO_TEST_PATTERN_OPERATOR_DEFINED);
-	case AUDIO_TEST_PATTERN_SAWTOOTH:
-		return DP_LINK_ENUM_STR(AUDIO_TEST_PATTERN_SAWTOOTH);
-	default:
-		return "unknown";
-	}
-}
-
-static char *dp_link_get_audio_sample_rate(u32 rate)
-{
-	switch (rate) {
-	case AUDIO_SAMPLE_RATE_32_KHZ:
-		return DP_LINK_ENUM_STR(AUDIO_SAMPLE_RATE_32_KHZ);
-	case AUDIO_SAMPLE_RATE_44_1_KHZ:
-		return DP_LINK_ENUM_STR(AUDIO_SAMPLE_RATE_44_1_KHZ);
-	case AUDIO_SAMPLE_RATE_48_KHZ:
-		return DP_LINK_ENUM_STR(AUDIO_SAMPLE_RATE_48_KHZ);
-	case AUDIO_SAMPLE_RATE_88_2_KHZ:
-		return DP_LINK_ENUM_STR(AUDIO_SAMPLE_RATE_88_2_KHZ);
-	case AUDIO_SAMPLE_RATE_96_KHZ:
-		return DP_LINK_ENUM_STR(AUDIO_SAMPLE_RATE_96_KHZ);
-	case AUDIO_SAMPLE_RATE_176_4_KHZ:
-		return DP_LINK_ENUM_STR(AUDIO_SAMPLE_RATE_176_4_KHZ);
-	case AUDIO_SAMPLE_RATE_192_KHZ:
-		return DP_LINK_ENUM_STR(AUDIO_SAMPLE_RATE_192_KHZ);
-	default:
-		return "unknown";
-	}
-}
-
-static int dp_link_get_period(struct dp_link_private *link, int const addr)
-{
-	int ret = 0;
-	u8 bp;
-	u8 data;
-	u32 const param_len = 0x1;
-	u32 const max_audio_period = 0xA;
-
-	/* TEST_AUDIO_PERIOD_CH_XX */
-	if (drm_dp_dpcd_read(link->aux->drm_aux, addr, &bp,
-		param_len) < param_len) {
-		pr_err("failed to read test_audio_period (0x%x)\n", addr);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	data = bp;
-
-	/* Period - Bits 3:0 */
-	data = data & 0xF;
-	if ((int)data > max_audio_period) {
-		pr_err("invalid test_audio_period_ch_1 = 0x%x\n", data);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	ret = data;
-exit:
-	return ret;
-}
-
-static int dp_link_parse_audio_channel_period(struct dp_link_private *link)
-{
-	int ret = 0;
-	struct dp_link_test_audio *req = &link->dp_link.test_audio;
-
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH1);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_1 = ret;
-	pr_debug("test_audio_period_ch_1 = 0x%x\n", ret);
-
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH2);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_2 = ret;
-	pr_debug("test_audio_period_ch_2 = 0x%x\n", ret);
-
-	/* TEST_AUDIO_PERIOD_CH_3 (Byte 0x275) */
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH3);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_3 = ret;
-	pr_debug("test_audio_period_ch_3 = 0x%x\n", ret);
-
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH4);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_4 = ret;
-	pr_debug("test_audio_period_ch_4 = 0x%x\n", ret);
-
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH5);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_5 = ret;
-	pr_debug("test_audio_period_ch_5 = 0x%x\n", ret);
-
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH6);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_6 = ret;
-	pr_debug("test_audio_period_ch_6 = 0x%x\n", ret);
-
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH7);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_7 = ret;
-	pr_debug("test_audio_period_ch_7 = 0x%x\n", ret);
-
-	ret = dp_link_get_period(link, DP_TEST_AUDIO_PERIOD_CH8);
-	if (ret == -EINVAL)
-		goto exit;
-
-	req->test_audio_period_ch_8 = ret;
-	pr_debug("test_audio_period_ch_8 = 0x%x\n", ret);
-exit:
-	return ret;
-}
-
-static int dp_link_parse_audio_pattern_type(struct dp_link_private *link)
-{
-	int ret = 0;
-	u8 bp;
-	u8 data;
-	int rlen;
-	int const param_len = 0x1;
-	int const max_audio_pattern_type = 0x1;
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux,
-		DP_TEST_AUDIO_PATTERN_TYPE, &bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read link audio mode data\n");
-		ret = -EINVAL;
-		goto exit;
-	}
-	data = bp;
-
-	/* Audio Pattern Type - Bits 7:0 */
-	if ((int)data > max_audio_pattern_type) {
-		pr_err("invalid audio pattern type = 0x%x\n", data);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	link->dp_link.test_audio.test_audio_pattern_type = data;
-	pr_debug("audio pattern type = %s\n",
-			dp_link_get_audio_test_pattern(data));
-exit:
-	return ret;
-}
-
-static int dp_link_parse_audio_mode(struct dp_link_private *link)
-{
-	int ret = 0;
-	u8 bp;
-	u8 data;
-	int rlen;
-	int const param_len = 0x1;
-	int const max_audio_sampling_rate = 0x6;
-	int const max_audio_channel_count = 0x8;
-	int sampling_rate = 0x0;
-	int channel_count = 0x0;
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_TEST_AUDIO_MODE,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read link audio mode data\n");
-		ret = -EINVAL;
-		goto exit;
-	}
-	data = bp;
-
-	/* Sampling Rate - Bits 3:0 */
-	sampling_rate = data & 0xF;
-	if (sampling_rate > max_audio_sampling_rate) {
-		pr_err("sampling rate (0x%x) greater than max (0x%x)\n",
-				sampling_rate, max_audio_sampling_rate);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	/* Channel Count - Bits 7:4 */
-	channel_count = ((data & 0xF0) >> 4) + 1;
-	if (channel_count > max_audio_channel_count) {
-		pr_err("channel_count (0x%x) greater than max (0x%x)\n",
-				channel_count, max_audio_channel_count);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	link->dp_link.test_audio.test_audio_sampling_rate = sampling_rate;
-	link->dp_link.test_audio.test_audio_channel_count = channel_count;
-	pr_debug("sampling_rate = %s, channel_count = 0x%x\n",
-		dp_link_get_audio_sample_rate(sampling_rate), channel_count);
-exit:
-	return ret;
-}
-
-/**
- * dp_parse_audio_pattern_params() - parses audio pattern parameters from DPCD
- * @link: Display Port Driver data
- *
- * Returns 0 if it successfully parses the audio link pattern parameters.
- */
-static int dp_link_parse_audio_pattern_params(struct dp_link_private *link)
-{
-	int ret = 0;
-
-	ret = dp_link_parse_audio_mode(link);
-	if (ret)
-		goto exit;
-
-	ret = dp_link_parse_audio_pattern_type(link);
-	if (ret)
-		goto exit;
-
-	ret = dp_link_parse_audio_channel_period(link);
-
-exit:
-	return ret;
-}
-
-/**
- * dp_link_is_video_pattern_valid() - validates the video pattern
- * @pattern: video pattern requested by the sink
- *
- * Returns true if the requested video pattern is supported.
- */
-static bool dp_link_is_video_pattern_valid(u32 pattern)
-{
-	switch (pattern) {
-	case DP_NO_TEST_PATTERN:
-	case DP_COLOR_RAMP:
-	case DP_BLACK_AND_WHITE_VERTICAL_LINES:
-	case DP_COLOR_SQUARE:
-		return true;
-	default:
-		return false;
-	}
-}
-
-static char *dp_link_video_pattern_to_string(u32 test_video_pattern)
-{
-	switch (test_video_pattern) {
-	case DP_NO_TEST_PATTERN:
-		return DP_LINK_ENUM_STR(DP_NO_TEST_PATTERN);
-	case DP_COLOR_RAMP:
-		return DP_LINK_ENUM_STR(DP_COLOR_RAMP);
-	case DP_BLACK_AND_WHITE_VERTICAL_LINES:
-		return DP_LINK_ENUM_STR(DP_BLACK_AND_WHITE_VERTICAL_LINES);
-	case DP_COLOR_SQUARE:
-		return DP_LINK_ENUM_STR(DP_COLOR_SQUARE);
-	default:
-		return "unknown";
-	}
-}
-
-/**
- * dp_link_is_dynamic_range_valid() - validates the dynamic range
- * @bit_depth: the dynamic range value to be checked
- *
- * Returns true if the dynamic range value is supported.
- */
-static bool dp_link_is_dynamic_range_valid(u32 dr)
-{
-	switch (dr) {
-	case DP_DYNAMIC_RANGE_RGB_VESA:
-	case DP_DYNAMIC_RANGE_RGB_CEA:
-		return true;
-	default:
-		return false;
-	}
-}
-
-static char *dp_link_dynamic_range_to_string(u32 dr)
-{
-	switch (dr) {
-	case DP_DYNAMIC_RANGE_RGB_VESA:
-		return DP_LINK_ENUM_STR(DP_DYNAMIC_RANGE_RGB_VESA);
-	case DP_DYNAMIC_RANGE_RGB_CEA:
-		return DP_LINK_ENUM_STR(DP_DYNAMIC_RANGE_RGB_CEA);
-	case DP_DYNAMIC_RANGE_UNKNOWN:
-	default:
-		return "unknown";
-	}
-}
-
-/**
- * dp_link_is_bit_depth_valid() - validates the bit depth requested
- * @bit_depth: bit depth requested by the sink
- *
- * Returns true if the requested bit depth is supported.
- */
-static bool dp_link_is_bit_depth_valid(u32 tbd)
-{
-	/* DP_TEST_VIDEO_PATTERN_NONE is treated as invalid */
-	switch (tbd) {
-	case DP_TEST_BIT_DEPTH_6:
-	case DP_TEST_BIT_DEPTH_8:
-	case DP_TEST_BIT_DEPTH_10:
-		return true;
-	default:
-		return false;
-	}
-}
-
-static char *dp_link_bit_depth_to_string(u32 tbd)
-{
-	switch (tbd) {
-	case DP_TEST_BIT_DEPTH_6:
-		return DP_LINK_ENUM_STR(DP_TEST_BIT_DEPTH_6);
-	case DP_TEST_BIT_DEPTH_8:
-		return DP_LINK_ENUM_STR(DP_TEST_BIT_DEPTH_8);
-	case DP_TEST_BIT_DEPTH_10:
-		return DP_LINK_ENUM_STR(DP_TEST_BIT_DEPTH_10);
-	case DP_TEST_BIT_DEPTH_UNKNOWN:
-	default:
-		return "unknown";
-	}
-}
-
-static int dp_link_parse_timing_params1(struct dp_link_private *link,
-	int const addr, int const len, u32 *val)
-{
-	u8 bp[2];
-	int rlen;
-
-	if (len < 2)
-		return -EINVAL;
-
-	/* Read the requested video link pattern (Byte 0x221). */
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, bp, len);
-	if (rlen < len) {
-		pr_err("failed to read 0x%x\n", addr);
-		return -EINVAL;
-	}
-
-	*val = bp[1] | (bp[0] << 8);
-
-	return 0;
-}
-
-static int dp_link_parse_timing_params2(struct dp_link_private *link,
-	int const addr, int const len, u32 *val1, u32 *val2)
-{
-	u8 bp[2];
-	int rlen;
-
-	if (len < 2)
-		return -EINVAL;
-
-	/* Read the requested video link pattern (Byte 0x221). */
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, bp, len);
-	if (rlen < len) {
-		pr_err("failed to read 0x%x\n", addr);
-		return -EINVAL;
-	}
-
-	*val1 = (bp[0] & BIT(7)) >> 7;
-	*val2 = bp[1] | ((bp[0] & 0x7F) << 8);
-
-	return 0;
-}
-
-static int dp_link_parse_timing_params3(struct dp_link_private *link,
-	int const addr, u32 *val)
-{
-	u8 bp;
-	u32 len = 1;
-	int rlen;
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, addr, &bp, len);
-	if (rlen < 1) {
-		pr_err("failed to read 0x%x\n", addr);
-		return -EINVAL;
-	}
-	*val = bp;
-
-	return 0;
-}
-
-/**
- * dp_parse_video_pattern_params() - parses video pattern parameters from DPCD
- * @link: Display Port Driver data
- *
- * Returns 0 if it successfully parses the video link pattern and the link
- * bit depth requested by the sink and, and if the values parsed are valid.
- */
-static int dp_link_parse_video_pattern_params(struct dp_link_private *link)
-{
-	int ret = 0;
-	int rlen;
-	u8 bp;
-	u8 data;
-	u32 dyn_range;
-	int const param_len = 0x1;
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_TEST_PATTERN,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read link video pattern\n");
-		ret = -EINVAL;
-		goto exit;
-	}
-	data = bp;
-
-	if (!dp_link_is_video_pattern_valid(data)) {
-		pr_err("invalid link video pattern = 0x%x\n", data);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	link->dp_link.test_video.test_video_pattern = data;
-	pr_debug("link video pattern = 0x%x (%s)\n",
-		link->dp_link.test_video.test_video_pattern,
-		dp_link_video_pattern_to_string(
-			link->dp_link.test_video.test_video_pattern));
-
-	/* Read the requested color bit depth and dynamic range (Byte 0x232) */
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_TEST_MISC0,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read link bit depth\n");
-		ret = -EINVAL;
-		goto exit;
-	}
-	data = bp;
-
-	/* Dynamic Range */
-	dyn_range = (data & DP_TEST_DYNAMIC_RANGE_CEA) >> 3;
-	if (!dp_link_is_dynamic_range_valid(dyn_range)) {
-		pr_err("invalid link dynamic range = 0x%x", dyn_range);
-		ret = -EINVAL;
-		goto exit;
-	}
-	link->dp_link.test_video.test_dyn_range = dyn_range;
-	pr_debug("link dynamic range = 0x%x (%s)\n",
-		link->dp_link.test_video.test_dyn_range,
-		dp_link_dynamic_range_to_string(
-			link->dp_link.test_video.test_dyn_range));
-
-	/* Color bit depth */
-	data &= DP_TEST_BIT_DEPTH_MASK;
-	if (!dp_link_is_bit_depth_valid(data)) {
-		pr_err("invalid link bit depth = 0x%x\n", data);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	link->dp_link.test_video.test_bit_depth = data;
-	pr_debug("link bit depth = 0x%x (%s)\n",
-		link->dp_link.test_video.test_bit_depth,
-		dp_link_bit_depth_to_string(
-		link->dp_link.test_video.test_bit_depth));
-
-	/* resolution timing params */
-	ret = dp_link_parse_timing_params1(link, DP_TEST_H_TOTAL_HI, 2,
-			&link->dp_link.test_video.test_h_total);
-	if (ret) {
-		pr_err("failed to parse test_h_total (DP_TEST_H_TOTAL_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_H_TOTAL = %d\n", link->dp_link.test_video.test_h_total);
-
-	ret = dp_link_parse_timing_params1(link, DP_TEST_V_TOTAL_HI, 2,
-			&link->dp_link.test_video.test_v_total);
-	if (ret) {
-		pr_err("failed to parse test_v_total (DP_TEST_V_TOTAL_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_V_TOTAL = %d\n", link->dp_link.test_video.test_v_total);
-
-	ret = dp_link_parse_timing_params1(link, DP_TEST_H_START_HI, 2,
-			&link->dp_link.test_video.test_h_start);
-	if (ret) {
-		pr_err("failed to parse test_h_start (DP_TEST_H_START_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_H_START = %d\n", link->dp_link.test_video.test_h_start);
-
-	ret = dp_link_parse_timing_params1(link, DP_TEST_V_START_HI, 2,
-			&link->dp_link.test_video.test_v_start);
-	if (ret) {
-		pr_err("failed to parse test_v_start (DP_TEST_V_START_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_V_START = %d\n", link->dp_link.test_video.test_v_start);
-
-	ret = dp_link_parse_timing_params2(link, DP_TEST_HSYNC_HI, 2,
-			&link->dp_link.test_video.test_hsync_pol,
-			&link->dp_link.test_video.test_hsync_width);
-	if (ret) {
-		pr_err("failed to parse (DP_TEST_HSYNC_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_HSYNC_POL = %d\n",
-		link->dp_link.test_video.test_hsync_pol);
-	pr_debug("TEST_HSYNC_WIDTH = %d\n",
-		link->dp_link.test_video.test_hsync_width);
-
-	ret = dp_link_parse_timing_params2(link, DP_TEST_VSYNC_HI, 2,
-			&link->dp_link.test_video.test_vsync_pol,
-			&link->dp_link.test_video.test_vsync_width);
-	if (ret) {
-		pr_err("failed to parse (DP_TEST_VSYNC_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_VSYNC_POL = %d\n",
-		link->dp_link.test_video.test_vsync_pol);
-	pr_debug("TEST_VSYNC_WIDTH = %d\n",
-		link->dp_link.test_video.test_vsync_width);
-
-	ret = dp_link_parse_timing_params1(link, DP_TEST_H_WIDTH_HI, 2,
-			&link->dp_link.test_video.test_h_width);
-	if (ret) {
-		pr_err("failed to parse test_h_width (DP_TEST_H_WIDTH_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_H_WIDTH = %d\n", link->dp_link.test_video.test_h_width);
-
-	ret = dp_link_parse_timing_params1(link, DP_TEST_V_HEIGHT_HI, 2,
-			&link->dp_link.test_video.test_v_height);
-	if (ret) {
-		pr_err("failed to parse test_v_height (DP_TEST_V_HEIGHT_HI)\n");
-		goto exit;
-	}
-	pr_debug("TEST_V_HEIGHT = %d\n",
-		link->dp_link.test_video.test_v_height);
-
-	ret = dp_link_parse_timing_params3(link, DP_TEST_MISC1,
-		&link->dp_link.test_video.test_rr_d);
-	link->dp_link.test_video.test_rr_d &= DP_TEST_REFRESH_DENOMINATOR;
-	if (ret) {
-		pr_err("failed to parse test_rr_d (DP_TEST_MISC1)\n");
-		goto exit;
-	}
-	pr_debug("TEST_REFRESH_DENOMINATOR = %d\n",
-		link->dp_link.test_video.test_rr_d);
-
-	ret = dp_link_parse_timing_params3(link, DP_TEST_REFRESH_RATE_NUMERATOR,
-		&link->dp_link.test_video.test_rr_n);
-	if (ret) {
-		pr_err("failed to parse test_rr_n (DP_TEST_REFRESH_RATE_NUMERATOR)\n");
-		goto exit;
-	}
-	pr_debug("TEST_REFRESH_NUMERATOR = %d\n",
-		link->dp_link.test_video.test_rr_n);
-exit:
-	return ret;
-}
-
-/**
- * dp_link_parse_link_training_params() - parses link training parameters from
- * DPCD
- * @link: Display Port Driver data
- *
- * Returns 0 if it successfully parses the link rate (Byte 0x219) and lane
- * count (Byte 0x220), and if these values parse are valid.
- */
-static int dp_link_parse_link_training_params(struct dp_link_private *link)
-{
-	u8 bp;
-	u8 data;
-	int ret = 0;
-	int rlen;
-	int const param_len = 0x1;
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_TEST_LINK_RATE,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read link rate\n");
-		ret = -EINVAL;
-		goto exit;
-	}
-	data = bp;
-
-	if (!is_link_rate_valid(data)) {
-		pr_err("invalid link rate = 0x%x\n", data);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	link->request.test_link_rate = data;
-	pr_debug("link rate = 0x%x\n", link->request.test_link_rate);
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_TEST_LANE_COUNT,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read lane count\n");
-		ret = -EINVAL;
-		goto exit;
-	}
-	data = bp;
-	data &= 0x1F;
-
-	if (!is_lane_count_valid(data)) {
-		pr_err("invalid lane count = 0x%x\n", data);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	link->request.test_lane_count = data;
-	pr_debug("lane count = 0x%x\n", link->request.test_lane_count);
-exit:
-	return ret;
-}
-
-static bool dp_link_is_phy_test_pattern_supported(u32 phy_test_pattern_sel)
-{
-	switch (phy_test_pattern_sel) {
-	case DP_TEST_PHY_PATTERN_NONE:
-	case DP_TEST_PHY_PATTERN_D10_2_NO_SCRAMBLING:
-	case DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT:
-	case DP_TEST_PHY_PATTERN_PRBS7:
-	case DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN:
-	case DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN:
-		return true;
-	default:
-		return false;
-	}
-}
-
-/**
- * dp_parse_phy_test_params() - parses the phy link parameters
- * @link: Display Port Driver data
- *
- * Parses the DPCD (Byte 0x248) for the DP PHY link pattern that is being
- * requested.
- */
-static int dp_link_parse_phy_test_params(struct dp_link_private *link)
-{
-	u8 bp;
-	u8 data;
-	int rlen;
-	int const param_len = 0x1;
-	int ret = 0;
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_TEST_PHY_PATTERN,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read phy link pattern\n");
-		ret = -EINVAL;
-		goto end;
-	}
-
-	data = bp;
-
-	link->dp_link.phy_params.phy_test_pattern_sel = data;
-
-	pr_debug("phy_test_pattern_sel = %s\n",
-			dp_link_get_phy_test_pattern(data));
-
-	if (!dp_link_is_phy_test_pattern_supported(data))
-		ret = -EINVAL;
-end:
-	return ret;
-}
-
-static char *dp_link_get_test_name(u32 test_requested)
-{
-	switch (test_requested) {
-	case DP_TEST_LINK_TRAINING:
-		return DP_LINK_ENUM_STR(DP_TEST_LINK_TRAINING);
-	case DP_TEST_LINK_VIDEO_PATTERN:
-		return DP_LINK_ENUM_STR(DP_TEST_LINK_VIDEO_PATTERN);
-	case DP_TEST_LINK_EDID_READ:
-		return DP_LINK_ENUM_STR(DP_TEST_LINK_EDID_READ);
-	case DP_TEST_LINK_PHY_TEST_PATTERN:
-		return DP_LINK_ENUM_STR(DP_TEST_LINK_PHY_TEST_PATTERN);
-	case DP_TEST_LINK_AUDIO_PATTERN:
-		return DP_LINK_ENUM_STR(DP_TEST_LINK_AUDIO_PATTERN);
-	default:
-		return "unknown";
-	}
-}
-
-/**
- * dp_link_is_video_audio_test_requested() - checks for audio/video link request
- * @link: link requested by the sink
- *
- * Returns true if the requested link is a permitted audio/video link.
- */
-static bool dp_link_is_video_audio_test_requested(u32 link)
-{
-	return (link == DP_TEST_LINK_VIDEO_PATTERN) ||
-		(link == (DP_TEST_LINK_AUDIO_PATTERN |
-		DP_TEST_LINK_VIDEO_PATTERN)) ||
-		(link == DP_TEST_LINK_AUDIO_PATTERN) ||
-		(link == (DP_TEST_LINK_AUDIO_PATTERN |
-		DP_TEST_LINK_AUDIO_DISABLED_VIDEO));
-}
-
-/**
- * dp_link_supported() - checks if link requested by sink is supported
- * @test_requested: link requested by the sink
- *
- * Returns true if the requested link is supported.
- */
-static bool dp_link_is_test_supported(u32 test_requested)
-{
-	return (test_requested == DP_TEST_LINK_TRAINING) ||
-		(test_requested == DP_TEST_LINK_EDID_READ) ||
-		(test_requested == DP_TEST_LINK_PHY_TEST_PATTERN) ||
-		dp_link_is_video_audio_test_requested(test_requested);
-}
-
-static bool dp_link_is_test_edid_read(struct dp_link_private *link)
-{
-	return (link->request.test_requested == DP_TEST_LINK_EDID_READ);
-}
-
-/**
- * dp_sink_parse_test_request() - parses link request parameters from sink
- * @link: Display Port Driver data
- *
- * Parses the DPCD to check if an automated link is requested (Byte 0x201),
- * and what type of link automation is being requested (Byte 0x218).
- */
-static int dp_link_parse_request(struct dp_link_private *link)
-{
-	int ret = 0;
-	u8 bp;
-	u8 data;
-	int rlen;
-	u32 const param_len = 0x1;
-
-	/**
-	 * Read the device service IRQ vector (Byte 0x201) to determine
-	 * whether an automated link has been requested by the sink.
-	 */
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux,
-		DP_DEVICE_SERVICE_IRQ_VECTOR, &bp, param_len);
-	if (rlen < param_len) {
-		pr_err("aux read failed\n");
-		ret = -EINVAL;
-		goto end;
-	}
-
-	data = bp;
-
-	pr_debug("device service irq vector = 0x%x\n", data);
-
-	if (!(data & DP_AUTOMATED_TEST_REQUEST)) {
-		pr_debug("no test requested\n");
-		return 0;
-	}
-
-	/**
-	 * Read the link request byte (Byte 0x218) to determine what type
-	 * of automated link has been requested by the sink.
-	 */
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_TEST_REQUEST,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("aux read failed\n");
-		ret = -EINVAL;
-		goto end;
-	}
-
-	data = bp;
-
-	if (!dp_link_is_test_supported(data)) {
-		pr_debug("link 0x%x not supported\n", data);
-		goto end;
-	}
-
-	pr_debug("%s (0x%x) requested\n", dp_link_get_test_name(data), data);
-	link->request.test_requested = data;
-
-	if (link->request.test_requested == DP_TEST_LINK_PHY_TEST_PATTERN) {
-		ret = dp_link_parse_phy_test_params(link);
-		if (ret)
-			goto end;
-		ret = dp_link_parse_link_training_params(link);
-	}
-
-	if (link->request.test_requested == DP_TEST_LINK_TRAINING)
-		ret = dp_link_parse_link_training_params(link);
-
-	if (dp_link_is_video_audio_test_requested(
-			link->request.test_requested)) {
-		ret = dp_link_parse_video_pattern_params(link);
-		if (ret)
-			goto end;
-
-		ret = dp_link_parse_audio_pattern_params(link);
-	}
-end:
-	/**
-	 * Send a DP_TEST_ACK if all link parameters are valid, otherwise send
-	 * a DP_TEST_NAK.
-	 */
-	if (ret) {
-		link->dp_link.test_response = DP_TEST_NAK;
-	} else {
-		if (!dp_link_is_test_edid_read(link))
-			link->dp_link.test_response = DP_TEST_ACK;
-		else
-			link->dp_link.test_response =
-				DP_TEST_EDID_CHECKSUM_WRITE;
-	}
-
-	return ret;
-}
-
-/**
- * dp_link_parse_sink_count() - parses the sink count
- *
- * Parses the DPCD to check if there is an update to the sink count
- * (Byte 0x200), and whether all the sink devices connected have Content
- * Protection enabled.
- */
-static int dp_link_parse_sink_count(struct dp_link *dp_link)
-{
-	int rlen;
-	int const param_len = 0x1;
-	struct dp_link_private *link = container_of(dp_link,
-			struct dp_link_private, dp_link);
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_SINK_COUNT,
-			&link->dp_link.sink_count.count, param_len);
-	if (rlen < param_len) {
-		pr_err("failed to read sink count\n");
-		return -EINVAL;
-	}
-
-	link->dp_link.sink_count.cp_ready =
-		link->dp_link.sink_count.count & DP_SINK_CP_READY;
-	/* BIT 7, BIT 5:0 */
-	link->dp_link.sink_count.count =
-		DP_GET_SINK_COUNT(link->dp_link.sink_count.count);
-
-	pr_debug("sink_count = 0x%x, cp_ready = 0x%x\n",
-		link->dp_link.sink_count.count,
-		link->dp_link.sink_count.cp_ready);
-	return 0;
-}
-
-static void dp_link_parse_sink_status_field(struct dp_link_private *link)
-{
-	int len = 0;
-
-	link->prev_sink_count = link->dp_link.sink_count.count;
-	dp_link_parse_sink_count(&link->dp_link);
-
-	len = drm_dp_dpcd_read_link_status(link->aux->drm_aux,
-		link->link_status);
-	if (len < DP_LINK_STATUS_SIZE)
-		pr_err("DP link status read failed\n");
-	dp_link_parse_request(link);
-}
-
-static bool dp_link_is_link_training_requested(struct dp_link_private *link)
-{
-	return (link->request.test_requested == DP_TEST_LINK_TRAINING);
-}
-
-/**
- * dp_link_process_link_training_request() - processes new training requests
- * @link: Display Port link data
- *
- * This function will handle new link training requests that are initiated by
- * the sink. In particular, it will update the requested lane count and link
- * link rate, and then trigger the link retraining procedure.
- *
- * The function will return 0 if a link training request has been processed,
- * otherwise it will return -EINVAL.
- */
-static int dp_link_process_link_training_request(struct dp_link_private *link)
-{
-	if (!dp_link_is_link_training_requested(link))
-		return -EINVAL;
-
-	pr_debug("%s link rate = 0x%x, lane count = 0x%x\n",
-			dp_link_get_test_name(DP_TEST_LINK_TRAINING),
-			link->request.test_link_rate,
-			link->request.test_lane_count);
-
-	link->dp_link.link_params.lane_count = link->request.test_lane_count;
-	link->dp_link.link_params.bw_code = link->request.test_link_rate;
-
-	return 0;
-}
-
-static void dp_link_send_test_response(struct dp_link *dp_link)
-{
-	struct dp_link_private *link = NULL;
-	u32 const response_len = 0x1;
-
-	if (!dp_link) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	drm_dp_dpcd_write(link->aux->drm_aux, DP_TEST_RESPONSE,
-			&dp_link->test_response, response_len);
-}
-
-static int dp_link_psm_config(struct dp_link *dp_link,
-	struct drm_dp_link *link_info, bool enable)
-{
-	struct dp_link_private *link = NULL;
-	int ret = 0;
-
-	if (!dp_link) {
-		pr_err("invalid params\n");
-		return -EINVAL;
-	}
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	if (enable)
-		ret = drm_dp_link_power_down(link->aux->drm_aux, link_info);
-	else
-		ret = drm_dp_link_power_up(link->aux->drm_aux, link_info);
-
-	if (ret)
-		pr_err("Failed to %s low power mode\n",
-			(enable ? "enter" : "exit"));
-	else
-		dp_link->psm_enabled = enable;
-
-	return ret;
-}
-
-static void dp_link_send_edid_checksum(struct dp_link *dp_link, u8 checksum)
-{
-	struct dp_link_private *link = NULL;
-	u32 const response_len = 0x1;
-
-	if (!dp_link) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	drm_dp_dpcd_write(link->aux->drm_aux, DP_TEST_EDID_CHECKSUM,
-			&checksum, response_len);
-}
-
-static int dp_link_parse_vx_px(struct dp_link_private *link)
-{
-	u8 bp;
-	u8 data;
-	int const param_len = 0x1;
-	int ret = 0;
-	u32 v0, p0, v1, p1, v2, p2, v3, p3;
-	int rlen;
-
-	pr_debug("\n");
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_ADJUST_REQUEST_LANE0_1,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed reading lanes 0/1\n");
-		ret = -EINVAL;
-		goto end;
-	}
-
-	data = bp;
-
-	pr_debug("lanes 0/1 (Byte 0x206): 0x%x\n", data);
-
-	v0 = data & 0x3;
-	data = data >> 2;
-	p0 = data & 0x3;
-	data = data >> 2;
-
-	v1 = data & 0x3;
-	data = data >> 2;
-	p1 = data & 0x3;
-	data = data >> 2;
-
-	rlen = drm_dp_dpcd_read(link->aux->drm_aux, DP_ADJUST_REQUEST_LANE2_3,
-			&bp, param_len);
-	if (rlen < param_len) {
-		pr_err("failed reading lanes 2/3\n");
-		ret = -EINVAL;
-		goto end;
-	}
-
-	data = bp;
-
-	pr_debug("lanes 2/3 (Byte 0x207): 0x%x\n", data);
-
-	v2 = data & 0x3;
-	data = data >> 2;
-	p2 = data & 0x3;
-	data = data >> 2;
-
-	v3 = data & 0x3;
-	data = data >> 2;
-	p3 = data & 0x3;
-	data = data >> 2;
-
-	pr_debug("vx: 0=%d, 1=%d, 2=%d, 3=%d\n", v0, v1, v2, v3);
-	pr_debug("px: 0=%d, 1=%d, 2=%d, 3=%d\n", p0, p1, p2, p3);
-
-	/**
-	 * Update the voltage and pre-emphasis levels as per DPCD request
-	 * vector.
-	 */
-	pr_debug("Current: v_level = 0x%x, p_level = 0x%x\n",
-			link->dp_link.phy_params.v_level,
-			link->dp_link.phy_params.p_level);
-	pr_debug("Requested: v_level = 0x%x, p_level = 0x%x\n", v0, p0);
-	link->dp_link.phy_params.v_level = v0;
-	link->dp_link.phy_params.p_level = p0;
-
-	pr_debug("Success\n");
-end:
-	return ret;
-}
-
-/**
- * dp_link_process_phy_test_pattern_request() - process new phy link requests
- * @link: Display Port Driver data
- *
- * This function will handle new phy link pattern requests that are initiated
- * by the sink. The function will return 0 if a phy link pattern has been
- * processed, otherwise it will return -EINVAL.
- */
-static int dp_link_process_phy_test_pattern_request(
-		struct dp_link_private *link)
-{
-	u32 test_link_rate = 0, test_lane_count = 0;
-
-	if (!(link->request.test_requested & DP_TEST_LINK_PHY_TEST_PATTERN)) {
-		pr_debug("no phy test\n");
-		return -EINVAL;
-	}
-
-	test_link_rate = link->request.test_link_rate;
-	test_lane_count = link->request.test_lane_count;
-
-	if (!is_link_rate_valid(test_link_rate) ||
-		!is_lane_count_valid(test_lane_count)) {
-		pr_err("Invalid params: link rate = 0x%x, lane count = 0x%x\n",
-				test_link_rate, test_lane_count);
-		return -EINVAL;
-	}
-
-	pr_debug("start\n");
-
-	pr_info("Current: bw_code = 0x%x, lane count = 0x%x\n",
-			link->dp_link.link_params.bw_code,
-			link->dp_link.link_params.lane_count);
-
-	pr_info("Requested: bw_code = 0x%x, lane count = 0x%x\n",
-			test_link_rate, test_lane_count);
-
-	link->dp_link.link_params.lane_count = link->request.test_lane_count;
-	link->dp_link.link_params.bw_code = link->request.test_link_rate;
-
-	dp_link_parse_vx_px(link);
-
-	pr_debug("end\n");
-
-	return 0;
-}
-
-static u8 get_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r)
-{
-	return link_status[r - DP_LANE0_1_STATUS];
-}
-
-/**
- * dp_link_process_link_status_update() - processes link status updates
- * @link: Display Port link module data
- *
- * This function will check for changes in the link status, e.g. clock
- * recovery done on all lanes, and trigger link training if there is a
- * failure/error on the link.
- *
- * The function will return 0 if the a link status update has been processed,
- * otherwise it will return -EINVAL.
- */
-static int dp_link_process_link_status_update(struct dp_link_private *link)
-{
-	if (!(get_link_status(link->link_status, DP_LANE_ALIGN_STATUS_UPDATED) &
-		DP_LINK_STATUS_UPDATED) || /* link status updated */
-		(drm_dp_clock_recovery_ok(link->link_status,
-			link->dp_link.link_params.lane_count) &&
-	     drm_dp_channel_eq_ok(link->link_status,
-			link->dp_link.link_params.lane_count)))
-		return -EINVAL;
-
-	pr_debug("channel_eq_done = %d, clock_recovery_done = %d\n",
-			drm_dp_clock_recovery_ok(link->link_status,
-			link->dp_link.link_params.lane_count),
-			drm_dp_clock_recovery_ok(link->link_status,
-			link->dp_link.link_params.lane_count));
-
-	return 0;
-}
-
-static bool dp_link_is_ds_port_status_changed(struct dp_link_private *link)
-{
-	if (get_link_status(link->link_status, DP_LANE_ALIGN_STATUS_UPDATED) &
-		DP_DOWNSTREAM_PORT_STATUS_CHANGED) /* port status changed */
-		return true;
-
-	if (link->prev_sink_count != link->dp_link.sink_count.count)
-		return true;
-
-	return false;
-}
-
-/**
- * dp_link_process_downstream_port_status_change() - process port status changes
- * @link: Display Port Driver data
- *
- * This function will handle downstream port updates that are initiated by
- * the sink. If the downstream port status has changed, the EDID is read via
- * AUX.
- *
- * The function will return 0 if a downstream port update has been
- * processed, otherwise it will return -EINVAL.
- */
-static int dp_link_process_ds_port_status_change(struct dp_link_private *link)
-{
-	if (!dp_link_is_ds_port_status_changed(link))
-		return -EINVAL;
-
-	/* reset prev_sink_count */
-	link->prev_sink_count = link->dp_link.sink_count.count;
-
-	return 0;
-}
-
-static bool dp_link_is_video_pattern_requested(struct dp_link_private *link)
-{
-	return (link->request.test_requested & DP_TEST_LINK_VIDEO_PATTERN)
-		&& !(link->request.test_requested &
-		DP_TEST_LINK_AUDIO_DISABLED_VIDEO);
-}
-
-static bool dp_link_is_audio_pattern_requested(struct dp_link_private *link)
-{
-	return (link->request.test_requested & DP_TEST_LINK_AUDIO_PATTERN);
-}
-
-/**
- * dp_link_process_video_pattern_request() - process new video pattern request
- * @link: Display Port link module's data
- *
- * This function will handle a new video pattern request that are initiated by
- * the sink. This is acheieved by first sending a disconnect notification to
- * the sink followed by a subsequent connect notification to the user modules,
- * where it is expected that the user modules would draw the required link
- * pattern.
- */
-static int dp_link_process_video_pattern_request(struct dp_link_private *link)
-{
-	if (!dp_link_is_video_pattern_requested(link))
-		goto end;
-
-	pr_debug("%s: bit depth=%d(%d bpp) pattern=%s\n",
-		dp_link_get_test_name(DP_TEST_LINK_VIDEO_PATTERN),
-		link->dp_link.test_video.test_bit_depth,
-		dp_link_bit_depth_to_bpp(
-		link->dp_link.test_video.test_bit_depth),
-		dp_link_video_pattern_to_string(
-			link->dp_link.test_video.test_video_pattern));
-
-	return 0;
-end:
-	return -EINVAL;
-}
-
-/**
- * dp_link_process_audio_pattern_request() - process new audio pattern request
- * @link: Display Port link module data
- *
- * This function will handle a new audio pattern request that is initiated by
- * the sink. This is acheieved by sending the necessary secondary data packets
- * to the sink. It is expected that any simulatenous requests for video
- * patterns will be handled before the audio pattern is sent to the sink.
- */
-static int dp_link_process_audio_pattern_request(struct dp_link_private *link)
-{
-	if (!dp_link_is_audio_pattern_requested(link))
-		return -EINVAL;
-
-	pr_debug("sampling_rate=%s, channel_count=%d, pattern_type=%s\n",
-		dp_link_get_audio_sample_rate(
-			link->dp_link.test_audio.test_audio_sampling_rate),
-		link->dp_link.test_audio.test_audio_channel_count,
-		dp_link_get_audio_test_pattern(
-			link->dp_link.test_audio.test_audio_pattern_type));
-
-	pr_debug("audio_period: ch1=0x%x, ch2=0x%x, ch3=0x%x, ch4=0x%x\n",
-		link->dp_link.test_audio.test_audio_period_ch_1,
-		link->dp_link.test_audio.test_audio_period_ch_2,
-		link->dp_link.test_audio.test_audio_period_ch_3,
-		link->dp_link.test_audio.test_audio_period_ch_4);
-
-	pr_debug("audio_period: ch5=0x%x, ch6=0x%x, ch7=0x%x, ch8=0x%x\n",
-		link->dp_link.test_audio.test_audio_period_ch_5,
-		link->dp_link.test_audio.test_audio_period_ch_6,
-		link->dp_link.test_audio.test_audio_period_ch_7,
-		link->dp_link.test_audio.test_audio_period_ch_8);
-
-	return 0;
-}
-
-static void dp_link_reset_data(struct dp_link_private *link)
-{
-	link->request = (const struct dp_link_request){ 0 };
-	link->dp_link.test_video = (const struct dp_link_test_video){ 0 };
-	link->dp_link.test_video.test_bit_depth = DP_TEST_BIT_DEPTH_UNKNOWN;
-	link->dp_link.test_audio = (const struct dp_link_test_audio){ 0 };
-	link->dp_link.phy_params.phy_test_pattern_sel = 0;
-	link->dp_link.sink_request = 0;
-	link->dp_link.test_response = 0;
-}
-
-/**
- * dp_link_process_request() - handle HPD IRQ transition to HIGH
- * @link: pointer to link module data
- *
- * This function will handle the HPD IRQ state transitions from LOW to HIGH
- * (including cases when there are back to back HPD IRQ HIGH) indicating
- * the start of a new link training request or sink status update.
- */
-static int dp_link_process_request(struct dp_link *dp_link)
-{
-	int ret = 0;
-	struct dp_link_private *link;
-
-	if (!dp_link) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	pr_debug("start\n");
-
-	dp_link_reset_data(link);
-
-	dp_link_parse_sink_status_field(link);
-
-	if (dp_link_is_test_edid_read(link)) {
-		dp_link->sink_request |= DP_TEST_LINK_EDID_READ;
-		goto exit;
-	}
-
-	ret = dp_link_process_ds_port_status_change(link);
-	if (!ret) {
-		dp_link->sink_request |= DS_PORT_STATUS_CHANGED;
-		goto exit;
-	}
-
-	ret = dp_link_process_link_training_request(link);
-	if (!ret) {
-		dp_link->sink_request |= DP_TEST_LINK_TRAINING;
-		goto exit;
-	}
-
-	ret = dp_link_process_phy_test_pattern_request(link);
-	if (!ret) {
-		dp_link->sink_request |= DP_TEST_LINK_PHY_TEST_PATTERN;
-		goto exit;
-	}
-
-	ret = dp_link_process_link_status_update(link);
-	if (!ret) {
-		dp_link->sink_request |= DP_LINK_STATUS_UPDATED;
-		goto exit;
-	}
-
-	ret = dp_link_process_video_pattern_request(link);
-	if (!ret) {
-		dp_link->sink_request |= DP_TEST_LINK_VIDEO_PATTERN;
-		goto exit;
-	}
-
-	ret = dp_link_process_audio_pattern_request(link);
-	if (!ret) {
-		dp_link->sink_request |= DP_TEST_LINK_AUDIO_PATTERN;
-		goto exit;
-	}
-
-	pr_debug("done\n");
-exit:
-	return ret;
-}
-
-static int dp_link_get_colorimetry_config(struct dp_link *dp_link)
-{
-	u32 cc;
-	enum dynamic_range dr;
-	struct dp_link_private *link;
-
-	if (!dp_link) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	/* unless a video pattern CTS test is ongoing, use CEA_VESA */
-	if (dp_link_is_video_pattern_requested(link))
-		dr = link->dp_link.test_video.test_dyn_range;
-	else
-		dr = DP_DYNAMIC_RANGE_RGB_VESA;
-
-	/* Only RGB_VESA nd RGB_CEA supported for now */
-	switch (dr) {
-	case DP_DYNAMIC_RANGE_RGB_CEA:
-		cc = BIT(3);
-		break;
-	case DP_DYNAMIC_RANGE_RGB_VESA:
-	default:
-		cc = 0;
-	}
-
-	return cc;
-}
-
-static int dp_link_adjust_levels(struct dp_link *dp_link, u8 *link_status)
-{
-	int i;
-	int max = 0;
-	u8 data;
-	struct dp_link_private *link;
-
-	if (!dp_link) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	/* use the max level across lanes */
-	for (i = 0; i < dp_link->link_params.lane_count; i++) {
-		data = drm_dp_get_adjust_request_voltage(link_status, i);
-		pr_debug("lane=%d req_voltage_swing=%d\n", i, data);
-		if (max < data)
-			max = data;
-	}
-
-	dp_link->phy_params.v_level = max >> DP_TRAIN_VOLTAGE_SWING_SHIFT;
-
-	/* use the max level across lanes */
-	max = 0;
-	for (i = 0; i < dp_link->link_params.lane_count; i++) {
-		data = drm_dp_get_adjust_request_pre_emphasis(link_status, i);
-		pr_debug("lane=%d req_pre_emphasis=%d\n", i, data);
-		if (max < data)
-			max = data;
-	}
-
-	dp_link->phy_params.p_level = max >> DP_TRAIN_PRE_EMPHASIS_SHIFT;
-
-	/**
-	 * Adjust the voltage swing and pre-emphasis level combination to within
-	 * the allowable range.
-	 */
-	if (dp_link->phy_params.v_level > DP_LINK_VOLTAGE_MAX) {
-		pr_debug("Requested vSwingLevel=%d, change to %d\n",
-			dp_link->phy_params.v_level, DP_LINK_VOLTAGE_MAX);
-		dp_link->phy_params.v_level = DP_LINK_VOLTAGE_MAX;
-	}
-
-	if (dp_link->phy_params.p_level > DP_LINK_PRE_EMPHASIS_MAX) {
-		pr_debug("Requested preEmphasisLevel=%d, change to %d\n",
-			dp_link->phy_params.p_level, DP_LINK_PRE_EMPHASIS_MAX);
-		dp_link->phy_params.p_level = DP_LINK_PRE_EMPHASIS_MAX;
-	}
-
-	if ((dp_link->phy_params.p_level > DP_LINK_PRE_EMPHASIS_LEVEL_1)
-		&& (dp_link->phy_params.v_level == DP_LINK_VOLTAGE_LEVEL_2)) {
-		pr_debug("Requested preEmphasisLevel=%d, change to %d\n",
-			dp_link->phy_params.p_level,
-			DP_LINK_PRE_EMPHASIS_LEVEL_1);
-		dp_link->phy_params.p_level = DP_LINK_PRE_EMPHASIS_LEVEL_1;
-	}
-
-	pr_debug("adjusted: v_level=%d, p_level=%d\n",
-		dp_link->phy_params.v_level, dp_link->phy_params.p_level);
-
-	return 0;
-}
-
-static int dp_link_send_psm_request(struct dp_link *dp_link, bool req)
-{
-	struct dp_link_private *link;
-
-	if (!dp_link) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	return 0;
-}
-
-static u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp)
-{
-	u32 tbd;
-
-	/*
-	 * Few simplistic rules and assumptions made here:
-	 *    1. Test bit depth is bit depth per color component
-	 *    2. Assume 3 color components
-	 */
-	switch (bpp) {
-	case 18:
-		tbd = DP_TEST_BIT_DEPTH_6;
-		break;
-	case 24:
-		tbd = DP_TEST_BIT_DEPTH_8;
-		break;
-	case 30:
-		tbd = DP_TEST_BIT_DEPTH_10;
-		break;
-	default:
-		tbd = DP_TEST_BIT_DEPTH_UNKNOWN;
-		break;
-	}
-
-	if (tbd != DP_TEST_BIT_DEPTH_UNKNOWN)
-		tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT);
-
-	return tbd;
-}
-
-struct dp_link *dp_link_get(struct device *dev, struct dp_aux *aux)
-{
-	int rc = 0;
-	struct dp_link_private *link;
-	struct dp_link *dp_link;
-
-	if (!dev || !aux) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	link = devm_kzalloc(dev, sizeof(*link), GFP_KERNEL);
-	if (!link) {
-		rc = -EINVAL;
-		goto error;
-	}
-
-	link->dev   = dev;
-	link->aux   = aux;
-
-	dp_link = &link->dp_link;
-
-	dp_link->process_request        = dp_link_process_request;
-	dp_link->get_test_bits_depth    = dp_link_get_test_bits_depth;
-	dp_link->get_colorimetry_config = dp_link_get_colorimetry_config;
-	dp_link->adjust_levels          = dp_link_adjust_levels;
-	dp_link->send_psm_request       = dp_link_send_psm_request;
-	dp_link->send_test_response     = dp_link_send_test_response;
-	dp_link->psm_config             = dp_link_psm_config;
-	dp_link->send_edid_checksum     = dp_link_send_edid_checksum;
-
-	return dp_link;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_link_put(struct dp_link *dp_link)
-{
-	struct dp_link_private *link;
-
-	if (!dp_link)
-		return;
-
-	link = container_of(dp_link, struct dp_link_private, dp_link);
-
-	devm_kfree(link->dev, link);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_link.h b/drivers/gpu/drm/msm/dp/dp_link.h
deleted file mode 100644
index 6d6ef43..0000000
--- a/drivers/gpu/drm/msm/dp/dp_link.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_LINK_H_
-#define _DP_LINK_H_
-
-#include "dp_aux.h"
-
-#define DS_PORT_STATUS_CHANGED 0x200
-#define DP_TEST_BIT_DEPTH_UNKNOWN 0xFFFFFFFF
-#define DP_LINK_ENUM_STR(x)		#x
-
-enum dp_link_voltage_level {
-	DP_LINK_VOLTAGE_LEVEL_0	= 0,
-	DP_LINK_VOLTAGE_LEVEL_1	= 1,
-	DP_LINK_VOLTAGE_LEVEL_2	= 2,
-	DP_LINK_VOLTAGE_MAX	= DP_LINK_VOLTAGE_LEVEL_2,
-};
-
-enum dp_link_preemaphasis_level {
-	DP_LINK_PRE_EMPHASIS_LEVEL_0	= 0,
-	DP_LINK_PRE_EMPHASIS_LEVEL_1	= 1,
-	DP_LINK_PRE_EMPHASIS_LEVEL_2	= 2,
-	DP_LINK_PRE_EMPHASIS_MAX	= DP_LINK_PRE_EMPHASIS_LEVEL_2,
-};
-
-struct dp_link_sink_count {
-	u32 count;
-	bool cp_ready;
-};
-
-struct dp_link_test_video {
-	u32 test_video_pattern;
-	u32 test_bit_depth;
-	u32 test_dyn_range;
-	u32 test_h_total;
-	u32 test_v_total;
-	u32 test_h_start;
-	u32 test_v_start;
-	u32 test_hsync_pol;
-	u32 test_hsync_width;
-	u32 test_vsync_pol;
-	u32 test_vsync_width;
-	u32 test_h_width;
-	u32 test_v_height;
-	u32 test_rr_d;
-	u32 test_rr_n;
-};
-
-struct dp_link_test_audio {
-	u32 test_audio_sampling_rate;
-	u32 test_audio_channel_count;
-	u32 test_audio_pattern_type;
-	u32 test_audio_period_ch_1;
-	u32 test_audio_period_ch_2;
-	u32 test_audio_period_ch_3;
-	u32 test_audio_period_ch_4;
-	u32 test_audio_period_ch_5;
-	u32 test_audio_period_ch_6;
-	u32 test_audio_period_ch_7;
-	u32 test_audio_period_ch_8;
-};
-
-struct dp_link_phy_params {
-	u32 phy_test_pattern_sel;
-	u8 v_level;
-	u8 p_level;
-};
-
-struct dp_link_params {
-	u32 lane_count;
-	u32 bw_code;
-};
-
-struct dp_link {
-	u32 sink_request;
-	u32 test_response;
-	bool psm_enabled;
-
-	struct dp_link_sink_count sink_count;
-	struct dp_link_test_video test_video;
-	struct dp_link_test_audio test_audio;
-	struct dp_link_phy_params phy_params;
-	struct dp_link_params link_params;
-
-	u32 (*get_test_bits_depth)(struct dp_link *dp_link, u32 bpp);
-	int (*process_request)(struct dp_link *dp_link);
-	int (*get_colorimetry_config)(struct dp_link *dp_link);
-	int (*adjust_levels)(struct dp_link *dp_link, u8 *link_status);
-	int (*send_psm_request)(struct dp_link *dp_link, bool req);
-	void (*send_test_response)(struct dp_link *dp_link);
-	int (*psm_config)(struct dp_link *dp_link,
-		struct drm_dp_link *link_info, bool enable);
-	void (*send_edid_checksum)(struct dp_link *dp_link, u8 checksum);
-};
-
-static inline char *dp_link_get_phy_test_pattern(u32 phy_test_pattern_sel)
-{
-	switch (phy_test_pattern_sel) {
-	case DP_TEST_PHY_PATTERN_NONE:
-		return DP_LINK_ENUM_STR(DP_TEST_PHY_PATTERN_NONE);
-	case DP_TEST_PHY_PATTERN_D10_2_NO_SCRAMBLING:
-		return DP_LINK_ENUM_STR(
-			DP_TEST_PHY_PATTERN_D10_2_NO_SCRAMBLING);
-	case DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT:
-		return DP_LINK_ENUM_STR(
-			DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT);
-	case DP_TEST_PHY_PATTERN_PRBS7:
-		return DP_LINK_ENUM_STR(DP_TEST_PHY_PATTERN_PRBS7);
-	case DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN:
-		return DP_LINK_ENUM_STR(
-			DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN);
-	case DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN:
-		return DP_LINK_ENUM_STR(
-			DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN);
-	default:
-		return "unknown";
-	}
-}
-
-/**
- * mdss_dp_test_bit_depth_to_bpp() - convert test bit depth to bpp
- * @tbd: test bit depth
- *
- * Returns the bits per pixel (bpp) to be used corresponding to the
- * git bit depth value. This function assumes that bit depth has
- * already been validated.
- */
-static inline u32 dp_link_bit_depth_to_bpp(u32 tbd)
-{
-	u32 bpp;
-
-	/*
-	 * Few simplistic rules and assumptions made here:
-	 *    1. Bit depth is per color component
-	 *    2. If bit depth is unknown return 0
-	 *    3. Assume 3 color components
-	 */
-	switch (tbd) {
-	case DP_TEST_BIT_DEPTH_6:
-		bpp = 18;
-		break;
-	case DP_TEST_BIT_DEPTH_8:
-		bpp = 24;
-		break;
-	case DP_TEST_BIT_DEPTH_10:
-		bpp = 30;
-		break;
-	case DP_TEST_BIT_DEPTH_UNKNOWN:
-	default:
-		bpp = 0;
-	}
-
-	return bpp;
-}
-
-/**
- * dp_link_get() - get the functionalities of dp test module
- *
- *
- * return: a pointer to dp_link struct
- */
-struct dp_link *dp_link_get(struct device *dev, struct dp_aux *aux);
-
-/**
- * dp_link_put() - releases the dp test module's resources
- *
- * @dp_link: an instance of dp_link module
- *
- */
-void dp_link_put(struct dp_link *dp_link);
-
-#endif /* _DP_LINK_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
deleted file mode 100644
index 63f9bf4..0000000
--- a/drivers/gpu/drm/msm/dp/dp_panel.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include "dp_panel.h"
-
-#include <drm/drm_connector.h>
-#include <drm/drm_edid.h>
-
-#define DP_PANEL_DEFAULT_BPP 24
-#define DP_MAX_DS_PORT_COUNT 1
-
-enum {
-	DP_LINK_RATE_MULTIPLIER = 27000000,
-};
-
-struct dp_panel_private {
-	struct device *dev;
-	struct dp_panel dp_panel;
-	struct dp_aux *aux;
-	struct dp_link *link;
-	struct dp_catalog_panel *catalog;
-	bool aux_cfg_update_done;
-};
-
-static const struct dp_panel_info fail_safe = {
-	.h_active = 640,
-	.v_active = 480,
-	.h_back_porch = 48,
-	.h_front_porch = 16,
-	.h_sync_width = 96,
-	.h_active_low = 0,
-	.v_back_porch = 33,
-	.v_front_porch = 10,
-	.v_sync_width = 2,
-	.v_active_low = 0,
-	.h_skew = 0,
-	.refresh_rate = 60,
-	.pixel_clk_khz = 25200,
-	.bpp = 24,
-};
-
-static int dp_panel_read_dpcd(struct dp_panel *dp_panel)
-{
-	int rlen, rc = 0;
-	struct dp_panel_private *panel;
-	struct drm_dp_link *link_info;
-	u8 *dpcd, major = 0, minor = 0;
-	u32 dfp_count = 0;
-	unsigned long caps = DP_LINK_CAP_ENHANCED_FRAMING;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	dpcd = dp_panel->dpcd;
-
-	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-	link_info = &dp_panel->link_info;
-
-	rlen = drm_dp_dpcd_read(panel->aux->drm_aux, DP_DPCD_REV,
-		dpcd, (DP_RECEIVER_CAP_SIZE + 1));
-	if (rlen < (DP_RECEIVER_CAP_SIZE + 1)) {
-		pr_err("dpcd read failed, rlen=%d\n", rlen);
-		rc = -EINVAL;
-		goto end;
-	}
-
-	link_info->revision = dp_panel->dpcd[DP_DPCD_REV];
-
-	major = (link_info->revision >> 4) & 0x0f;
-	minor = link_info->revision & 0x0f;
-	pr_debug("version: %d.%d\n", major, minor);
-
-	link_info->rate =
-		drm_dp_bw_code_to_link_rate(dp_panel->dpcd[DP_MAX_LINK_RATE]);
-	pr_debug("link_rate=%d\n", link_info->rate);
-
-	link_info->num_lanes = dp_panel->dpcd[DP_MAX_LANE_COUNT] &
-				DP_MAX_LANE_COUNT_MASK;
-
-	pr_debug("lane_count=%d\n", link_info->num_lanes);
-
-	if (drm_dp_enhanced_frame_cap(dpcd))
-		link_info->capabilities |= caps;
-
-	dfp_count = dpcd[DP_DOWN_STREAM_PORT_COUNT] &
-						DP_DOWN_STREAM_PORT_COUNT;
-
-	if ((dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT)
-		&& (dpcd[DP_DPCD_REV] > 0x10)) {
-		rlen = drm_dp_dpcd_read(panel->aux->drm_aux,
-			DP_DOWNSTREAM_PORT_0, dp_panel->ds_ports,
-			DP_MAX_DOWNSTREAM_PORTS);
-		if (rlen < DP_MAX_DOWNSTREAM_PORTS) {
-			pr_err("ds port status failed, rlen=%d\n", rlen);
-			rc = -EINVAL;
-			goto end;
-		}
-	}
-
-	if (dfp_count > DP_MAX_DS_PORT_COUNT)
-		pr_debug("DS port count %d greater that max (%d) supported\n",
-			dfp_count, DP_MAX_DS_PORT_COUNT);
-
-end:
-	return rc;
-}
-
-static int dp_panel_set_default_link_params(struct dp_panel *dp_panel)
-{
-	struct drm_dp_link *link_info;
-	const int default_bw_code = 162000;
-	const int default_num_lanes = 1;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-	link_info = &dp_panel->link_info;
-	link_info->rate = default_bw_code;
-	link_info->num_lanes = default_num_lanes;
-	pr_debug("link_rate=%d num_lanes=%d\n",
-		link_info->rate, link_info->num_lanes);
-	return 0;
-}
-
-static int dp_panel_read_edid(struct dp_panel *dp_panel,
-	struct drm_connector *connector)
-{
-	int retry_cnt = 0;
-	const int max_retry = 10;
-	struct dp_panel_private *panel;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-
-	do {
-		kfree(dp_panel->edid);
-		dp_panel->edid = drm_get_edid(connector,
-					      &panel->aux->drm_aux->ddc);
-		if (!dp_panel->edid) {
-			pr_err("EDID read failed\n");
-			retry_cnt++;
-			panel->aux->reconfig(panel->aux);
-			panel->aux_cfg_update_done = true;
-		} else {
-			return 0;
-		}
-	} while (retry_cnt < max_retry);
-
-	return drm_add_edid_modes(connector, dp_panel->edid);
-}
-
-static int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
-	struct drm_connector *connector)
-{
-	int rc = 0;
-	struct dp_panel_private *panel;
-
-	if (!dp_panel || !connector) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-
-	rc = dp_panel_read_dpcd(dp_panel);
-	if (rc || !is_link_rate_valid(drm_dp_link_rate_to_bw_code(
-		dp_panel->link_info.rate)) || !is_lane_count_valid(
-		dp_panel->link_info.num_lanes)) {
-		pr_err("panel dpcd read failed/incorrect, set default params\n");
-		dp_panel_set_default_link_params(dp_panel);
-	}
-
-	rc = dp_panel_read_edid(dp_panel, connector);
-	if (rc < 0) {
-		pr_err("panel edid read failed, set failsafe mode\n");
-		return rc;
-	}
-
-	if (panel->aux_cfg_update_done) {
-		pr_debug("read DPCD with updated AUX config\n");
-		dp_panel_read_dpcd(dp_panel);
-		panel->aux_cfg_update_done = false;
-	}
-
-	return 0;
-}
-
-static u32 dp_panel_get_max_pclk(struct dp_panel *dp_panel)
-{
-	struct drm_dp_link *link_info;
-	const u8 num_components = 3;
-	u32 bpc = 0, bpp = 0, max_data_rate_khz = 0, max_pclk_rate_khz = 0;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		return 0;
-	}
-
-	link_info = &dp_panel->link_info;
-
-	bpc = dp_panel->connector->display_info.bpc;
-	bpp = bpc * num_components;
-	if (!bpp)
-		bpp = DP_PANEL_DEFAULT_BPP;
-
-	max_data_rate_khz = (link_info->num_lanes * link_info->rate * 8);
-	max_pclk_rate_khz = max_data_rate_khz / bpp;
-
-	pr_debug("bpp=%d, max_lane_cnt=%d\n", bpp, link_info->num_lanes);
-	pr_debug("max_data_rate=%dKHz, max_pclk_rate=%dKHz\n",
-		max_data_rate_khz, max_pclk_rate_khz);
-
-	return max_pclk_rate_khz;
-}
-
-static void dp_panel_set_test_mode(struct dp_panel_private *panel,
-		struct dp_display_mode *mode)
-{
-	struct dp_panel_info *pinfo = NULL;
-	struct dp_link_test_video *test_info = NULL;
-
-	if (!panel) {
-		pr_err("invalid params\n");
-		return;
-	}
-
-	pinfo = &mode->timing;
-	test_info = &panel->link->test_video;
-
-	pinfo->h_active = test_info->test_h_width;
-	pinfo->h_sync_width = test_info->test_hsync_width;
-	pinfo->h_back_porch = test_info->test_h_start -
-		test_info->test_hsync_width;
-	pinfo->h_front_porch = test_info->test_h_total -
-		(test_info->test_h_start + test_info->test_h_width);
-
-	pinfo->v_active = test_info->test_v_height;
-	pinfo->v_sync_width = test_info->test_vsync_width;
-	pinfo->v_back_porch = test_info->test_v_start -
-		test_info->test_vsync_width;
-	pinfo->v_front_porch = test_info->test_v_total -
-		(test_info->test_v_start + test_info->test_v_height);
-
-	pinfo->bpp = dp_link_bit_depth_to_bpp(test_info->test_bit_depth);
-	pinfo->h_active_low = test_info->test_hsync_pol;
-	pinfo->v_active_low = test_info->test_vsync_pol;
-
-	pinfo->refresh_rate = test_info->test_rr_n;
-	pinfo->pixel_clk_khz = test_info->test_h_total *
-		test_info->test_v_total * pinfo->refresh_rate;
-
-	if (test_info->test_rr_d == 0)
-		pinfo->pixel_clk_khz /= 1000;
-	else
-		pinfo->pixel_clk_khz /= 1001;
-
-	if (test_info->test_h_width == 640)
-		pinfo->pixel_clk_khz = 25170;
-}
-
-static int dp_panel_get_modes(struct dp_panel *dp_panel,
-	struct drm_connector *connector, struct dp_display_mode *mode)
-{
-	struct dp_panel_private *panel;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-
-	if (dp_panel->video_test) {
-		dp_panel_set_test_mode(panel, mode);
-		return 1;
-	} else if (dp_panel->edid) {
-		return dp_panel_read_edid(dp_panel, connector);
-	}
-
-	/* fail-safe mode */
-	memcpy(&mode->timing, &fail_safe,
-		sizeof(fail_safe));
-	return 1;
-}
-
-static u8 dp_panel_get_edid_checksum(struct edid *edid)
-{
-	struct edid *last_block = NULL;
-	u8 *raw_edid = NULL;
-
-	if (!edid) {
-		pr_err("invalid edid input\n");
-		return 0;
-	}
-
-	raw_edid = (u8 *)edid;
-	raw_edid += (edid->extensions * EDID_LENGTH);
-	last_block = (struct edid *)raw_edid;
-
-	if (last_block)
-		return last_block->checksum;
-
-	pr_err("Invalid block, no checksum\n");
-	return 0;
-}
-
-static void dp_panel_handle_sink_request(struct dp_panel *dp_panel)
-{
-	struct dp_panel_private *panel;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-
-	if (panel->link->sink_request & DP_TEST_LINK_EDID_READ) {
-		u8 checksum = dp_panel_get_edid_checksum(dp_panel->edid);
-
-		panel->link->send_edid_checksum(panel->link, checksum);
-		panel->link->send_test_response(panel->link);
-	}
-}
-
-static int dp_panel_timing_cfg(struct dp_panel *dp_panel)
-{
-	int rc = 0;
-	u32 data, total_ver, total_hor;
-	struct dp_catalog_panel *catalog;
-	struct dp_panel_private *panel;
-	struct dp_panel_info *pinfo;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-	catalog = panel->catalog;
-	pinfo = &panel->dp_panel.pinfo;
-
-	pr_debug("width=%d hporch= %d %d %d\n",
-		pinfo->h_active, pinfo->h_back_porch,
-		pinfo->h_front_porch, pinfo->h_sync_width);
-
-	pr_debug("height=%d vporch= %d %d %d\n",
-		pinfo->v_active, pinfo->v_back_porch,
-		pinfo->v_front_porch, pinfo->v_sync_width);
-
-	total_hor = pinfo->h_active + pinfo->h_back_porch +
-		pinfo->h_front_porch + pinfo->h_sync_width;
-
-	total_ver = pinfo->v_active + pinfo->v_back_porch +
-			pinfo->v_front_porch + pinfo->v_sync_width;
-
-	data = total_ver;
-	data <<= 16;
-	data |= total_hor;
-
-	catalog->total = data;
-
-	data = (pinfo->v_back_porch + pinfo->v_sync_width);
-	data <<= 16;
-	data |= (pinfo->h_back_porch + pinfo->h_sync_width);
-
-	catalog->sync_start = data;
-
-	data = pinfo->v_sync_width;
-	data <<= 16;
-	data |= (pinfo->v_active_low << 31);
-	data |= pinfo->h_sync_width;
-	data |= (pinfo->h_active_low << 15);
-
-	catalog->width_blanking = data;
-
-	data = pinfo->v_active;
-	data <<= 16;
-	data |= pinfo->h_active;
-
-	catalog->dp_active = data;
-
-	panel->catalog->timing_cfg(catalog);
-end:
-	return rc;
-}
-
-static int dp_panel_init_panel_info(struct dp_panel *dp_panel)
-{
-	int rc = 0;
-	struct dp_panel_info *pinfo;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	pinfo = &dp_panel->pinfo;
-
-	/*
-	 * print resolution info as this is a result
-	 * of user initiated action of cable connection
-	 */
-	pr_info("SET NEW RESOLUTION:\n");
-	pr_info("%dx%d@%dfps\n", pinfo->h_active,
-		pinfo->v_active, pinfo->refresh_rate);
-	pr_info("h_porches(back|front|width) = (%d|%d|%d)\n",
-			pinfo->h_back_porch,
-			pinfo->h_front_porch,
-			pinfo->h_sync_width);
-	pr_info("v_porches(back|front|width) = (%d|%d|%d)\n",
-			pinfo->v_back_porch,
-			pinfo->v_front_porch,
-			pinfo->v_sync_width);
-	pr_info("pixel clock (KHz)=(%d)\n", pinfo->pixel_clk_khz);
-	pr_info("bpp = %d\n", pinfo->bpp);
-	pr_info("active low (h|v)=(%d|%d)\n", pinfo->h_active_low,
-		pinfo->v_active_low);
-
-	pinfo->bpp = max_t(u32, 18, min_t(u32, pinfo->bpp, 30));
-	pr_info("updated bpp = %d\n", pinfo->bpp);
-end:
-	return rc;
-}
-
-static u32 dp_panel_get_min_req_link_rate(struct dp_panel *dp_panel)
-{
-	const u32 encoding_factx10 = 8;
-	u32 min_link_rate_khz = 0, lane_cnt;
-	struct dp_panel_info *pinfo;
-
-	if (!dp_panel) {
-		pr_err("invalid input\n");
-		goto end;
-	}
-
-	lane_cnt = dp_panel->link_info.num_lanes;
-	pinfo = &dp_panel->pinfo;
-
-	/* num_lanes * lane_count * 8 >= pclk * bpp * 10 */
-	min_link_rate_khz = pinfo->pixel_clk_khz /
-				(lane_cnt * encoding_factx10);
-	min_link_rate_khz *= pinfo->bpp;
-
-	pr_debug("min lclk req=%d khz for pclk=%d khz, lanes=%d, bpp=%d\n",
-		min_link_rate_khz, pinfo->pixel_clk_khz, lane_cnt,
-		pinfo->bpp);
-end:
-	return min_link_rate_khz;
-}
-
-struct dp_panel *dp_panel_get(struct dp_panel_in *in)
-{
-	int rc = 0;
-	struct dp_panel_private *panel;
-	struct dp_panel *dp_panel;
-
-	if (!in->dev || !in->catalog || !in->aux || !in->link) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	panel = devm_kzalloc(in->dev, sizeof(*panel), GFP_KERNEL);
-	if (!panel) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	panel->dev = in->dev;
-	panel->aux = in->aux;
-	panel->catalog = in->catalog;
-	panel->link = in->link;
-
-	dp_panel = &panel->dp_panel;
-	panel->aux_cfg_update_done = false;
-
-	dp_panel->init_info = dp_panel_init_panel_info;
-	dp_panel->timing_cfg = dp_panel_timing_cfg;
-	dp_panel->read_sink_caps = dp_panel_read_sink_caps;
-	dp_panel->get_min_req_link_rate = dp_panel_get_min_req_link_rate;
-	dp_panel->get_max_pclk = dp_panel_get_max_pclk;
-	dp_panel->get_modes = dp_panel_get_modes;
-	dp_panel->handle_sink_request = dp_panel_handle_sink_request;
-
-	return dp_panel;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_panel_put(struct dp_panel *dp_panel)
-{
-	struct dp_panel_private *panel;
-
-	if (!dp_panel)
-		return;
-
-	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-
-	kfree(dp_panel->edid);
-	dp_panel->edid = NULL;
-	devm_kfree(panel->dev, panel);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h
deleted file mode 100644
index d6ebdb9..0000000
--- a/drivers/gpu/drm/msm/dp/dp_panel.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_PANEL_H_
-#define _DP_PANEL_H_
-
-#include "dp_aux.h"
-#include "dp_link.h"
-#include "dp_usbpd.h"
-
-struct edid;
-
-enum dp_lane_count {
-	DP_LANE_COUNT_1	= 1,
-	DP_LANE_COUNT_2	= 2,
-	DP_LANE_COUNT_4	= 4,
-};
-
-#define DP_MAX_DOWNSTREAM_PORTS 0x10
-
-struct dp_panel_info {
-	u32 h_active;
-	u32 v_active;
-	u32 h_back_porch;
-	u32 h_front_porch;
-	u32 h_sync_width;
-	u32 h_active_low;
-	u32 v_back_porch;
-	u32 v_front_porch;
-	u32 v_sync_width;
-	u32 v_active_low;
-	u32 h_skew;
-	u32 refresh_rate;
-	u32 pixel_clk_khz;
-	u32 bpp;
-};
-
-struct dp_display_mode {
-	struct dp_panel_info timing;
-	u32 capabilities;
-};
-
-struct dp_panel_in {
-	struct device *dev;
-	struct dp_aux *aux;
-	struct dp_link *link;
-	struct dp_catalog_panel *catalog;
-};
-
-struct dp_panel {
-	/* dpcd raw data */
-	u8 dpcd[DP_RECEIVER_CAP_SIZE];
-	u8 ds_ports[DP_MAX_DOWNSTREAM_PORTS];
-
-	struct drm_dp_link link_info;
-	struct edid *edid;
-	struct drm_connector *connector;
-	struct dp_panel_info pinfo;
-	bool video_test;
-
-	u32 vic;
-	u32 max_pclk_khz;
-
-	int (*init_info)(struct dp_panel *dp_panel);
-	int (*timing_cfg)(struct dp_panel *dp_panel);
-	int (*read_sink_caps)(struct dp_panel *dp_panel,
-		struct drm_connector *connector);
-	u32 (*get_min_req_link_rate)(struct dp_panel *dp_panel);
-	u32 (*get_max_pclk)(struct dp_panel *dp_panel);
-	int (*get_modes)(struct dp_panel *dp_panel,
-		struct drm_connector *connector, struct dp_display_mode *mode);
-	void (*handle_sink_request)(struct dp_panel *dp_panel);
-};
-
-/**
- * is_link_rate_valid() - validates the link rate
- * @lane_rate: link rate requested by the sink
- *
- * Returns true if the requested link rate is supported.
- */
-static inline bool is_link_rate_valid(u32 bw_code)
-{
-	return ((bw_code == DP_LINK_BW_1_62) ||
-		(bw_code == DP_LINK_BW_2_7) ||
-		(bw_code == DP_LINK_BW_5_4) ||
-		(bw_code == DP_LINK_BW_8_1));
-}
-
-/**
- * dp_link_is_lane_count_valid() - validates the lane count
- * @lane_count: lane count requested by the sink
- *
- * Returns true if the requested lane count is supported.
- */
-static inline bool is_lane_count_valid(u32 lane_count)
-{
-	return (lane_count == DP_LANE_COUNT_1) ||
-		(lane_count == DP_LANE_COUNT_2) ||
-		(lane_count == DP_LANE_COUNT_4);
-}
-
-struct dp_panel *dp_panel_get(struct dp_panel_in *in);
-void dp_panel_put(struct dp_panel *dp_panel);
-#endif /* _DP_PANEL_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c
deleted file mode 100644
index b78c311..0000000
--- a/drivers/gpu/drm/msm/dp/dp_parser.c
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/of_gpio.h>
-
-#include "dp_parser.h"
-
-static void dp_parser_unmap_io_resources(struct dp_parser *parser)
-{
-	struct dp_io *io = &parser->io;
-
-	msm_dss_iounmap(&io->ctrl_io);
-	msm_dss_iounmap(&io->phy_io);
-	msm_dss_iounmap(&io->ln_tx0_io);
-	msm_dss_iounmap(&io->ln_tx0_io);
-	msm_dss_iounmap(&io->dp_pll_io);
-	msm_dss_iounmap(&io->dp_cc_io);
-	msm_dss_iounmap(&io->usb3_dp_com);
-	msm_dss_iounmap(&io->qfprom_io);
-	msm_dss_iounmap(&io->hdcp_io);
-}
-
-static int dp_parser_ctrl_res(struct dp_parser *parser)
-{
-	int rc = 0;
-	u32 index;
-	struct platform_device *pdev = parser->pdev;
-	struct device_node *of_node = parser->pdev->dev.of_node;
-	struct dp_io *io = &parser->io;
-
-	rc = of_property_read_u32(of_node, "cell-index", &index);
-	if (rc) {
-		pr_err("cell-index not specified, rc=%d\n", rc);
-		goto err;
-	}
-
-	rc = msm_dss_ioremap_byname(pdev, &io->ctrl_io, "dp_ctrl");
-	if (rc) {
-		pr_err("unable to remap dp io resources\n");
-		goto err;
-	}
-
-	rc = msm_dss_ioremap_byname(pdev, &io->phy_io, "dp_phy");
-	if (rc) {
-		pr_err("unable to remap dp PHY resources\n");
-		goto err;
-	}
-
-	rc = msm_dss_ioremap_byname(pdev, &io->ln_tx0_io, "dp_ln_tx0");
-	if (rc) {
-		pr_err("unable to remap dp TX0 resources\n");
-		goto err;
-	}
-
-	rc = msm_dss_ioremap_byname(pdev, &io->ln_tx1_io, "dp_ln_tx1");
-	if (rc) {
-		pr_err("unable to remap dp TX1 resources\n");
-		goto err;
-	}
-
-	rc = msm_dss_ioremap_byname(pdev, &io->dp_pll_io, "dp_pll");
-	if (rc) {
-		pr_err("unable to remap DP PLL resources\n");
-		goto err;
-	}
-
-	rc = msm_dss_ioremap_byname(pdev, &io->usb3_dp_com, "usb3_dp_com");
-	if (rc) {
-		pr_err("unable to remap USB3 DP com resources\n");
-		goto err;
-	}
-
-	if (msm_dss_ioremap_byname(pdev, &io->dp_cc_io, "dp_mmss_cc")) {
-		pr_err("unable to remap dp MMSS_CC resources\n");
-		goto err;
-	}
-
-	if (msm_dss_ioremap_byname(pdev, &io->qfprom_io, "qfprom_physical"))
-		pr_warn("unable to remap dp qfprom resources\n");
-
-	if (msm_dss_ioremap_byname(pdev, &io->hdcp_io, "hdcp_physical"))
-		pr_warn("unable to remap dp hdcp resources\n");
-
-	return 0;
-err:
-	dp_parser_unmap_io_resources(parser);
-	return rc;
-}
-
-static const char *dp_get_phy_aux_config_property(u32 cfg_type)
-{
-	switch (cfg_type) {
-	case PHY_AUX_CFG0:
-		return "qcom,aux-cfg0-settings";
-	case PHY_AUX_CFG1:
-		return "qcom,aux-cfg1-settings";
-	case PHY_AUX_CFG2:
-		return "qcom,aux-cfg2-settings";
-	case PHY_AUX_CFG3:
-		return "qcom,aux-cfg3-settings";
-	case PHY_AUX_CFG4:
-		return "qcom,aux-cfg4-settings";
-	case PHY_AUX_CFG5:
-		return "qcom,aux-cfg5-settings";
-	case PHY_AUX_CFG6:
-		return "qcom,aux-cfg6-settings";
-	case PHY_AUX_CFG7:
-		return "qcom,aux-cfg7-settings";
-	case PHY_AUX_CFG8:
-		return "qcom,aux-cfg8-settings";
-	case PHY_AUX_CFG9:
-		return "qcom,aux-cfg9-settings";
-	default:
-		return "unknown";
-	}
-}
-
-static void dp_parser_phy_aux_cfg_reset(struct dp_parser *parser)
-{
-	int i = 0;
-
-	for (i = 0; i < PHY_AUX_CFG_MAX; i++)
-		parser->aux_cfg[i] = (const struct dp_aux_cfg){ 0 };
-}
-
-static int dp_parser_aux(struct dp_parser *parser)
-{
-	struct device_node *of_node = parser->pdev->dev.of_node;
-	int len = 0, i = 0, j = 0, config_count = 0;
-	const char *data;
-	int const minimum_config_count = 1;
-
-	for (i = 0; i < PHY_AUX_CFG_MAX; i++) {
-		const char *property = dp_get_phy_aux_config_property(i);
-
-		data = of_get_property(of_node, property, &len);
-		if (!data) {
-			pr_err("Unable to read %s\n", property);
-			goto error;
-		}
-
-		config_count = len - 1;
-		if ((config_count < minimum_config_count) ||
-			(config_count > DP_AUX_CFG_MAX_VALUE_CNT)) {
-			pr_err("Invalid config count (%d) configs for %s\n",
-					config_count, property);
-			goto error;
-		}
-
-		parser->aux_cfg[i].offset = data[0];
-		parser->aux_cfg[i].cfg_cnt = config_count;
-		pr_debug("%s offset=0x%x, cfg_cnt=%d\n",
-				property,
-				parser->aux_cfg[i].offset,
-				parser->aux_cfg[i].cfg_cnt);
-		for (j = 1; j < len; j++) {
-			parser->aux_cfg[i].lut[j - 1] = data[j];
-			pr_debug("%s lut[%d]=0x%x\n",
-					property,
-					i,
-					parser->aux_cfg[i].lut[j - 1]);
-		}
-	}
-		return 0;
-
-error:
-	dp_parser_phy_aux_cfg_reset(parser);
-	return -EINVAL;
-}
-
-static int dp_parser_misc(struct dp_parser *parser)
-{
-	int rc = 0;
-	struct device_node *of_node = parser->pdev->dev.of_node;
-
-	rc = of_property_read_u32(of_node,
-		"qcom,max-pclk-frequency-khz", &parser->max_pclk_khz);
-	if (rc)
-		parser->max_pclk_khz = DP_MAX_PIXEL_CLK_KHZ;
-
-	return 0;
-}
-
-static int dp_parser_pinctrl(struct dp_parser *parser)
-{
-	int rc = 0;
-	struct dp_pinctrl *pinctrl = &parser->pinctrl;
-
-	pinctrl->pin = devm_pinctrl_get(&parser->pdev->dev);
-
-	if (IS_ERR_OR_NULL(pinctrl->pin)) {
-		rc = PTR_ERR(pinctrl->pin);
-		pr_err("failed to get pinctrl, rc=%d\n", rc);
-		goto error;
-	}
-
-	pinctrl->state_active = pinctrl_lookup_state(pinctrl->pin,
-					"mdss_dp_active");
-	if (IS_ERR_OR_NULL(pinctrl->state_active)) {
-		rc = PTR_ERR(pinctrl->state_active);
-		pr_err("failed to get pinctrl active state, rc=%d\n", rc);
-		goto error;
-	}
-
-	pinctrl->state_suspend = pinctrl_lookup_state(pinctrl->pin,
-					"mdss_dp_sleep");
-	if (IS_ERR_OR_NULL(pinctrl->state_suspend)) {
-		rc = PTR_ERR(pinctrl->state_suspend);
-		pr_err("failed to get pinctrl suspend state, rc=%d\n", rc);
-		goto error;
-	}
-error:
-	return rc;
-}
-
-static int dp_parser_gpio(struct dp_parser *parser)
-{
-	int i = 0;
-	struct device *dev = &parser->pdev->dev;
-	struct device_node *of_node = dev->of_node;
-	struct dss_module_power *mp = &parser->mp[DP_CORE_PM];
-	static const char * const dp_gpios[] = {
-		"qcom,aux-en-gpio",
-		"qcom,aux-sel-gpio",
-		"qcom,usbplug-cc-gpio",
-	};
-
-	mp->gpio_config = devm_kzalloc(dev,
-		sizeof(struct dss_gpio) * ARRAY_SIZE(dp_gpios), GFP_KERNEL);
-	mp->num_gpio = ARRAY_SIZE(dp_gpios);
-
-	for (i = 0; i < ARRAY_SIZE(dp_gpios); i++) {
-		mp->gpio_config[i].gpio = of_get_named_gpio(of_node,
-			dp_gpios[i], 0);
-
-		if (!gpio_is_valid(mp->gpio_config[i].gpio)) {
-			pr_err("%s gpio not specified\n", dp_gpios[i]);
-			return -EINVAL;
-		}
-
-		strlcpy(mp->gpio_config[i].gpio_name, dp_gpios[i],
-			sizeof(mp->gpio_config[i].gpio_name));
-
-		mp->gpio_config[i].value = 0;
-	}
-
-	return 0;
-}
-
-static const char *dp_parser_supply_node_name(enum dp_pm_type module)
-{
-	switch (module) {
-	case DP_CORE_PM:	return "qcom,core-supply-entries";
-	case DP_CTRL_PM:	return "qcom,ctrl-supply-entries";
-	case DP_PHY_PM:		return "qcom,phy-supply-entries";
-	default:		return "???";
-	}
-}
-
-static int dp_parser_get_vreg(struct dp_parser *parser,
-		enum dp_pm_type module)
-{
-	int i = 0, rc = 0;
-	u32 tmp = 0;
-	const char *pm_supply_name = NULL;
-	struct device_node *supply_node = NULL;
-	struct device_node *of_node = parser->pdev->dev.of_node;
-	struct device_node *supply_root_node = NULL;
-	struct dss_module_power *mp = &parser->mp[module];
-
-	mp->num_vreg = 0;
-	pm_supply_name = dp_parser_supply_node_name(module);
-	supply_root_node = of_get_child_by_name(of_node, pm_supply_name);
-	if (!supply_root_node) {
-		pr_err("no supply entry present: %s\n", pm_supply_name);
-		goto novreg;
-	}
-
-	mp->num_vreg = of_get_available_child_count(supply_root_node);
-
-	if (mp->num_vreg == 0) {
-		pr_debug("no vreg\n");
-		goto novreg;
-	} else {
-		pr_debug("vreg found. count=%d\n", mp->num_vreg);
-	}
-
-	mp->vreg_config = devm_kzalloc(&parser->pdev->dev,
-		sizeof(struct dss_vreg) * mp->num_vreg, GFP_KERNEL);
-	if (!mp->vreg_config) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	for_each_child_of_node(supply_root_node, supply_node) {
-		const char *st = NULL;
-		/* vreg-name */
-		rc = of_property_read_string(supply_node,
-			"qcom,supply-name", &st);
-		if (rc) {
-			pr_err("error reading name. rc=%d\n",
-				 rc);
-			goto error;
-		}
-		snprintf(mp->vreg_config[i].vreg_name,
-			ARRAY_SIZE((mp->vreg_config[i].vreg_name)), "%s", st);
-		/* vreg-min-voltage */
-		rc = of_property_read_u32(supply_node,
-			"qcom,supply-min-voltage", &tmp);
-		if (rc) {
-			pr_err("error reading min volt. rc=%d\n",
-				rc);
-			goto error;
-		}
-		mp->vreg_config[i].min_voltage = tmp;
-
-		/* vreg-max-voltage */
-		rc = of_property_read_u32(supply_node,
-			"qcom,supply-max-voltage", &tmp);
-		if (rc) {
-			pr_err("error reading max volt. rc=%d\n",
-				rc);
-			goto error;
-		}
-		mp->vreg_config[i].max_voltage = tmp;
-
-		/* enable-load */
-		rc = of_property_read_u32(supply_node,
-			"qcom,supply-enable-load", &tmp);
-		if (rc) {
-			pr_err("error reading enable load. rc=%d\n",
-				rc);
-			goto error;
-		}
-		mp->vreg_config[i].enable_load = tmp;
-
-		/* disable-load */
-		rc = of_property_read_u32(supply_node,
-			"qcom,supply-disable-load", &tmp);
-		if (rc) {
-			pr_err("error reading disable load. rc=%d\n",
-				rc);
-			goto error;
-		}
-		mp->vreg_config[i].disable_load = tmp;
-
-		pr_debug("%s min=%d, max=%d, enable=%d, disable=%d\n",
-			mp->vreg_config[i].vreg_name,
-			mp->vreg_config[i].min_voltage,
-			mp->vreg_config[i].max_voltage,
-			mp->vreg_config[i].enable_load,
-			mp->vreg_config[i].disable_load
-			);
-		++i;
-	}
-
-	return rc;
-
-error:
-	if (mp->vreg_config) {
-		devm_kfree(&parser->pdev->dev, mp->vreg_config);
-		mp->vreg_config = NULL;
-	}
-novreg:
-	mp->num_vreg = 0;
-
-	return rc;
-}
-
-static void dp_parser_put_vreg_data(struct device *dev,
-	struct dss_module_power *mp)
-{
-	if (!mp) {
-		DEV_ERR("invalid input\n");
-		return;
-	}
-
-	if (mp->vreg_config) {
-		devm_kfree(dev, mp->vreg_config);
-		mp->vreg_config = NULL;
-	}
-	mp->num_vreg = 0;
-}
-
-static int dp_parser_regulator(struct dp_parser *parser)
-{
-	int i, rc = 0;
-	struct platform_device *pdev = parser->pdev;
-
-	/* Parse the regulator information */
-	for (i = DP_CORE_PM; i < DP_MAX_PM; i++) {
-		rc = dp_parser_get_vreg(parser, i);
-		if (rc) {
-			pr_err("get_dt_vreg_data failed for %s. rc=%d\n",
-				dp_parser_pm_name(i), rc);
-			i--;
-			for (; i >= DP_CORE_PM; i--)
-				dp_parser_put_vreg_data(&pdev->dev,
-					&parser->mp[i]);
-			break;
-		}
-	}
-
-	return rc;
-}
-
-static bool dp_parser_check_prefix(const char *clk_prefix, const char *clk_name)
-{
-	return !!strnstr(clk_name, clk_prefix, strlen(clk_name));
-}
-
-static void dp_parser_put_clk_data(struct device *dev,
-	struct dss_module_power *mp)
-{
-	if (!mp) {
-		DEV_ERR("%s: invalid input\n", __func__);
-		return;
-	}
-
-	if (mp->clk_config) {
-		devm_kfree(dev, mp->clk_config);
-		mp->clk_config = NULL;
-	}
-
-	mp->num_clk = 0;
-}
-
-static int dp_parser_init_clk_data(struct dp_parser *parser)
-{
-	int num_clk = 0, i = 0, rc = 0;
-	int core_clk_count = 0, ctrl_clk_count = 0;
-	const char *core_clk = "core";
-	const char *ctrl_clk = "ctrl";
-	const char *clk_name;
-	struct device *dev = &parser->pdev->dev;
-	struct dss_module_power *core_power = &parser->mp[DP_CORE_PM];
-	struct dss_module_power *ctrl_power = &parser->mp[DP_CTRL_PM];
-
-	num_clk = of_property_count_strings(dev->of_node, "clock-names");
-	if (num_clk <= 0) {
-		pr_err("no clocks are defined\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	for (i = 0; i < num_clk; i++) {
-		of_property_read_string_index(dev->of_node,
-				"clock-names", i, &clk_name);
-
-		if (dp_parser_check_prefix(core_clk, clk_name))
-			core_clk_count++;
-
-		if (dp_parser_check_prefix(ctrl_clk, clk_name))
-			ctrl_clk_count++;
-	}
-
-	/* Initialize the CORE power module */
-	if (core_clk_count <= 0) {
-		pr_err("no core clocks are defined\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	core_power->num_clk = core_clk_count;
-	core_power->clk_config = devm_kzalloc(dev,
-			sizeof(struct dss_clk) * core_power->num_clk,
-			GFP_KERNEL);
-	if (!core_power->clk_config) {
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	/* Initialize the CTRL power module */
-	if (ctrl_clk_count <= 0) {
-		pr_err("no ctrl clocks are defined\n");
-		rc = -EINVAL;
-		goto ctrl_clock_error;
-	}
-
-	ctrl_power->num_clk = ctrl_clk_count;
-	ctrl_power->clk_config = devm_kzalloc(dev,
-			sizeof(struct dss_clk) * ctrl_power->num_clk,
-			GFP_KERNEL);
-	if (!ctrl_power->clk_config) {
-		ctrl_power->num_clk = 0;
-		rc = -EINVAL;
-		goto ctrl_clock_error;
-	}
-
-	return rc;
-
-ctrl_clock_error:
-	dp_parser_put_clk_data(dev, core_power);
-exit:
-	return rc;
-}
-
-static int dp_parser_clock(struct dp_parser *parser)
-{
-	int rc = 0, i = 0;
-	int num_clk = 0;
-	int core_clk_index = 0, ctrl_clk_index = 0;
-	int core_clk_count = 0, ctrl_clk_count = 0;
-	const char *clk_name;
-	const char *core_clk = "core";
-	const char *ctrl_clk = "ctrl";
-	struct device *dev = &parser->pdev->dev;
-	struct dss_module_power *core_power = &parser->mp[DP_CORE_PM];
-	struct dss_module_power *ctrl_power = &parser->mp[DP_CTRL_PM];
-
-	core_power = &parser->mp[DP_CORE_PM];
-	ctrl_power = &parser->mp[DP_CTRL_PM];
-
-	rc =  dp_parser_init_clk_data(parser);
-	if (rc) {
-		pr_err("failed to initialize power data\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	core_clk_count = core_power->num_clk;
-	ctrl_clk_count = ctrl_power->num_clk;
-
-	num_clk = core_clk_count + ctrl_clk_count;
-
-	for (i = 0; i < num_clk; i++) {
-		of_property_read_string_index(dev->of_node, "clock-names",
-				i, &clk_name);
-
-		if (dp_parser_check_prefix(core_clk, clk_name) &&
-				core_clk_index < core_clk_count) {
-			struct dss_clk *clk =
-				&core_power->clk_config[core_clk_index];
-			strlcpy(clk->clk_name, clk_name, sizeof(clk->clk_name));
-			clk->type = DSS_CLK_AHB;
-			core_clk_index++;
-		} else if (dp_parser_check_prefix(ctrl_clk, clk_name) &&
-			   ctrl_clk_index < ctrl_clk_count) {
-			struct dss_clk *clk =
-				&ctrl_power->clk_config[ctrl_clk_index];
-			strlcpy(clk->clk_name, clk_name, sizeof(clk->clk_name));
-			ctrl_clk_index++;
-
-			if (!strcmp(clk_name, "ctrl_link_clk") ||
-			    !strcmp(clk_name, "ctrl_pixel_clk"))
-				clk->type = DSS_CLK_PCLK;
-			else
-				clk->type = DSS_CLK_AHB;
-		}
-	}
-
-	pr_debug("clock parsing successful\n");
-
-exit:
-	return rc;
-}
-
-static int dp_parser_parse(struct dp_parser *parser)
-{
-	int rc = 0;
-
-	if (!parser) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto err;
-	}
-
-	rc = dp_parser_ctrl_res(parser);
-	if (rc)
-		goto err;
-
-	rc = dp_parser_aux(parser);
-	if (rc)
-		goto err;
-
-	rc = dp_parser_misc(parser);
-	if (rc)
-		goto err;
-
-	rc = dp_parser_clock(parser);
-	if (rc)
-		goto err;
-
-	rc = dp_parser_regulator(parser);
-	if (rc)
-		goto err;
-
-	rc = dp_parser_gpio(parser);
-	if (rc)
-		goto err;
-
-	rc = dp_parser_pinctrl(parser);
-err:
-	return rc;
-}
-
-struct dp_parser *dp_parser_get(struct platform_device *pdev)
-{
-	struct dp_parser *parser;
-
-	parser = devm_kzalloc(&pdev->dev, sizeof(*parser), GFP_KERNEL);
-	if (!parser)
-		return ERR_PTR(-ENOMEM);
-
-	parser->parse = dp_parser_parse;
-	parser->pdev = pdev;
-
-	return parser;
-}
-
-void dp_parser_put(struct dp_parser *parser)
-{
-	int i = 0;
-	struct dss_module_power *power = NULL;
-
-	if (!parser) {
-		pr_err("invalid parser module\n");
-		return;
-	}
-
-	power = parser->mp;
-
-	for (i = 0; i < DP_MAX_PM; i++) {
-		struct dss_module_power *mp = &power[i];
-
-		devm_kfree(&parser->pdev->dev, mp->clk_config);
-		devm_kfree(&parser->pdev->dev, mp->vreg_config);
-		devm_kfree(&parser->pdev->dev, mp->gpio_config);
-	}
-
-	devm_kfree(&parser->pdev->dev, parser);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h
deleted file mode 100644
index a9cfd03..0000000
--- a/drivers/gpu/drm/msm/dp/dp_parser.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_PARSER_H_
-#define _DP_PARSER_H_
-
-#include <linux/dpu_io_util.h>
-
-#define DP_LABEL "MDSS DP DISPLAY"
-#define AUX_CFG_LEN	10
-#define DP_MAX_PIXEL_CLK_KHZ	675000
-
-enum dp_pm_type {
-	DP_CORE_PM,
-	DP_CTRL_PM,
-	DP_PHY_PM,
-	DP_MAX_PM
-};
-
-static inline const char *dp_parser_pm_name(enum dp_pm_type module)
-{
-	switch (module) {
-	case DP_CORE_PM:	return "DP_CORE_PM";
-	case DP_CTRL_PM:	return "DP_CTRL_PM";
-	case DP_PHY_PM:		return "DP_PHY_PM";
-	default:		return "???";
-	}
-}
-
-/**
- * struct dp_display_data  - display related device tree data.
- *
- * @ctrl_node: referece to controller device
- * @phy_node:  reference to phy device
- * @is_active: is the controller currently active
- * @name: name of the display
- * @display_type: type of the display
- */
-struct dp_display_data {
-	struct device_node *ctrl_node;
-	struct device_node *phy_node;
-	bool is_active;
-	const char *name;
-	const char *display_type;
-};
-
-/**
- * struct dp_ctrl_resource - controller's IO related data
- *
- * @ctrl_io: controller's mapped memory address
- * @phy_io: phy's mapped memory address
- * @ln_tx0_io: USB-DP lane TX0's mapped memory address
- * @ln_tx1_io: USB-DP lane TX1's mapped memory address
- * @dp_cc_io: DP cc's mapped memory address
- * @qfprom_io: qfprom's mapped memory address
- * @dp_pll_io: DP PLL mapped memory address
- * @usb3_dp_com: USB3 DP PHY combo mapped memory address
- * @hdcp_io: hdcp's mapped memory address
- */
-struct dp_io {
-	struct dss_io_data ctrl_io;
-	struct dss_io_data phy_io;
-	struct dss_io_data ln_tx0_io;
-	struct dss_io_data ln_tx1_io;
-	struct dss_io_data dp_cc_io;
-	struct dss_io_data qfprom_io;
-	struct dss_io_data dp_pll_io;
-	struct dss_io_data usb3_dp_com;
-	struct dss_io_data hdcp_io;
-};
-
-/**
- * struct dp_pinctrl - DP's pin control
- *
- * @pin: pin-controller's instance
- * @state_active: active state pin control
- * @state_hpd_active: hpd active state pin control
- * @state_suspend: suspend state pin control
- */
-struct dp_pinctrl {
-	struct pinctrl *pin;
-	struct pinctrl_state *state_active;
-	struct pinctrl_state *state_hpd_active;
-	struct pinctrl_state *state_suspend;
-};
-
-#define DP_ENUM_STR(x)	#x
-#define DP_AUX_CFG_MAX_VALUE_CNT 3
-/**
- * struct dp_aux_cfg - DP's AUX configuration settings
- *
- * @cfg_cnt: count of the configurable settings for the AUX register
- * @current_index: current index of the AUX config lut
- * @offset: register offset of the AUX config register
- * @lut: look up table for the AUX config values for this register
- */
-struct dp_aux_cfg {
-	u32 cfg_cnt;
-	u32 current_index;
-	u32 offset;
-	u32 lut[DP_AUX_CFG_MAX_VALUE_CNT];
-};
-
-/* PHY AUX config registers */
-enum dp_phy_aux_config_type {
-	PHY_AUX_CFG0,
-	PHY_AUX_CFG1,
-	PHY_AUX_CFG2,
-	PHY_AUX_CFG3,
-	PHY_AUX_CFG4,
-	PHY_AUX_CFG5,
-	PHY_AUX_CFG6,
-	PHY_AUX_CFG7,
-	PHY_AUX_CFG8,
-	PHY_AUX_CFG9,
-	PHY_AUX_CFG_MAX,
-};
-
-static inline char *dp_phy_aux_config_type_to_string(u32 cfg_type)
-{
-	switch (cfg_type) {
-	case PHY_AUX_CFG0:
-		return DP_ENUM_STR(PHY_AUX_CFG0);
-	case PHY_AUX_CFG1:
-		return DP_ENUM_STR(PHY_AUX_CFG1);
-	case PHY_AUX_CFG2:
-		return DP_ENUM_STR(PHY_AUX_CFG2);
-	case PHY_AUX_CFG3:
-		return DP_ENUM_STR(PHY_AUX_CFG3);
-	case PHY_AUX_CFG4:
-		return DP_ENUM_STR(PHY_AUX_CFG4);
-	case PHY_AUX_CFG5:
-		return DP_ENUM_STR(PHY_AUX_CFG5);
-	case PHY_AUX_CFG6:
-		return DP_ENUM_STR(PHY_AUX_CFG6);
-	case PHY_AUX_CFG7:
-		return DP_ENUM_STR(PHY_AUX_CFG7);
-	case PHY_AUX_CFG8:
-		return DP_ENUM_STR(PHY_AUX_CFG8);
-	case PHY_AUX_CFG9:
-		return DP_ENUM_STR(PHY_AUX_CFG9);
-	default:
-		return "unknown";
-	}
-}
-
-/**
- * struct dp_parser - DP parser's data exposed to clients
- *
- * @pdev: platform data of the client
- * @mp: gpio, regulator and clock related data
- * @pinctrl: pin-control related data
- * @disp_data: controller's display related data
- * @parse: function to be called by client to parse device tree.
- */
-struct dp_parser {
-	struct platform_device *pdev;
-	struct dss_module_power mp[DP_MAX_PM];
-	struct dp_pinctrl pinctrl;
-	struct dp_io io;
-	struct dp_display_data disp_data;
-
-	u8 l_map[4];
-	struct dp_aux_cfg aux_cfg[AUX_CFG_LEN];
-	u32 max_pclk_khz;
-
-	int (*parse)(struct dp_parser *parser);
-};
-
-/**
- * dp_parser_get() - get the DP's device tree parser module
- *
- * @pdev: platform data of the client
- * return: pointer to dp_parser structure.
- *
- * This function provides client capability to parse the
- * device tree and populate the data structures. The data
- * related to clock, regulators, pin-control and other
- * can be parsed using this module.
- */
-struct dp_parser *dp_parser_get(struct platform_device *pdev);
-
-/**
- * dp_parser_put() - cleans the dp_parser module
- *
- * @parser: pointer to the parser's data.
- */
-void dp_parser_put(struct dp_parser *parser);
-#endif
diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c
deleted file mode 100644
index 2a85b38..0000000
--- a/drivers/gpu/drm/msm/dp/dp_power.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/clk.h>
-#include "dp_power.h"
-
-#define DP_CLIENT_NAME_SIZE	20
-
-struct dp_power_private {
-	struct dp_parser *parser;
-	struct platform_device *pdev;
-	struct clk *pixel_clk_rcg;
-	struct clk *pixel_parent;
-
-	struct dp_power dp_power;
-
-	bool core_clks_on;
-	bool link_clks_on;
-};
-
-static int dp_power_regulator_init(struct dp_power_private *power)
-{
-	int rc = 0, i = 0, j = 0;
-	struct platform_device *pdev;
-	struct dp_parser *parser;
-
-	parser = power->parser;
-	pdev = power->pdev;
-
-	for (i = DP_CORE_PM; !rc && (i < DP_MAX_PM); i++) {
-		rc = msm_dss_config_vreg(&pdev->dev,
-			parser->mp[i].vreg_config,
-			parser->mp[i].num_vreg, 1);
-		if (rc) {
-			pr_err("failed to init vregs for %s\n",
-				dp_parser_pm_name(i));
-			for (j = i - 1; j >= DP_CORE_PM; j--) {
-				msm_dss_config_vreg(&pdev->dev,
-				parser->mp[j].vreg_config,
-				parser->mp[j].num_vreg, 0);
-			}
-
-			goto error;
-		}
-	}
-error:
-	return rc;
-}
-
-static void dp_power_regulator_deinit(struct dp_power_private *power)
-{
-	int rc = 0, i = 0;
-	struct platform_device *pdev;
-	struct dp_parser *parser;
-
-	parser = power->parser;
-	pdev = power->pdev;
-
-	for (i = DP_CORE_PM; (i < DP_MAX_PM); i++) {
-		rc = msm_dss_config_vreg(&pdev->dev,
-			parser->mp[i].vreg_config,
-			parser->mp[i].num_vreg, 0);
-		if (rc)
-			pr_err("failed to deinit vregs for %s\n",
-				dp_parser_pm_name(i));
-	}
-}
-
-static int dp_power_regulator_ctrl(struct dp_power_private *power, bool enable)
-{
-	int rc = 0, i = 0, j = 0;
-	struct dp_parser *parser;
-
-	parser = power->parser;
-
-	for (i = DP_CORE_PM; i < DP_MAX_PM; i++) {
-		rc = msm_dss_enable_vreg(
-			parser->mp[i].vreg_config,
-			parser->mp[i].num_vreg, enable);
-		if (rc) {
-			pr_err("failed to '%s' vregs for %s\n",
-					enable ? "enable" : "disable",
-					dp_parser_pm_name(i));
-			if (enable) {
-				for (j = i-1; j >= DP_CORE_PM; j--) {
-					msm_dss_enable_vreg(
-					parser->mp[j].vreg_config,
-					parser->mp[j].num_vreg, 0);
-				}
-			}
-			goto error;
-		}
-	}
-error:
-	return rc;
-}
-
-static int dp_power_pinctrl_set(struct dp_power_private *power, bool active)
-{
-	int rc = -EFAULT;
-	struct pinctrl_state *pin_state;
-	struct dp_parser *parser;
-
-	parser = power->parser;
-
-	if (IS_ERR_OR_NULL(parser->pinctrl.pin))
-		return PTR_ERR(parser->pinctrl.pin);
-
-	pin_state = active ? parser->pinctrl.state_active
-				: parser->pinctrl.state_suspend;
-	if (!IS_ERR_OR_NULL(pin_state)) {
-		rc = pinctrl_select_state(parser->pinctrl.pin,
-				pin_state);
-		if (rc)
-			pr_err("can not set %s pins\n",
-			       active ? "dp_active"
-			       : "dp_sleep");
-	} else {
-		pr_err("invalid '%s' pinstate\n",
-		       active ? "dp_active"
-		       : "dp_sleep");
-	}
-
-	return rc;
-}
-
-static int dp_power_clk_init(struct dp_power_private *power, bool enable)
-{
-	int rc = 0;
-	struct dss_module_power *core, *ctrl;
-	struct device *dev;
-
-	core = &power->parser->mp[DP_CORE_PM];
-	ctrl = &power->parser->mp[DP_CTRL_PM];
-
-	dev = &power->pdev->dev;
-
-	if (!core || !ctrl) {
-		pr_err("invalid power_data\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	if (enable) {
-		rc = msm_dss_get_clk(dev, core->clk_config, core->num_clk);
-		if (rc) {
-			pr_err("failed to get %s clk. err=%d\n",
-				dp_parser_pm_name(DP_CORE_PM), rc);
-			goto exit;
-		}
-
-		rc = msm_dss_get_clk(dev, ctrl->clk_config, ctrl->num_clk);
-		if (rc) {
-			pr_err("failed to get %s clk. err=%d\n",
-				dp_parser_pm_name(DP_CTRL_PM), rc);
-			goto ctrl_get_error;
-		}
-
-		power->pixel_clk_rcg = devm_clk_get(dev, "pixel_clk_rcg");
-		if (IS_ERR(power->pixel_clk_rcg)) {
-			pr_debug("Unable to get DP pixel clk RCG\n");
-			power->pixel_clk_rcg = NULL;
-		}
-
-		power->pixel_parent = devm_clk_get(dev, "pixel_parent");
-		if (IS_ERR(power->pixel_parent)) {
-			pr_debug("Unable to get DP pixel RCG parent\n");
-			power->pixel_parent = NULL;
-		}
-	} else {
-		if (power->pixel_parent)
-			devm_clk_put(dev, power->pixel_parent);
-
-		if (power->pixel_clk_rcg)
-			devm_clk_put(dev, power->pixel_clk_rcg);
-
-		msm_dss_put_clk(ctrl->clk_config, ctrl->num_clk);
-		msm_dss_put_clk(core->clk_config, core->num_clk);
-	}
-
-	return rc;
-
-ctrl_get_error:
-	msm_dss_put_clk(core->clk_config, core->num_clk);
-exit:
-	return rc;
-}
-
-static int dp_power_clk_set_rate(struct dp_power_private *power,
-		enum dp_pm_type module, bool enable)
-{
-	int rc = 0;
-	struct dss_module_power *mp;
-
-	if (!power) {
-		pr_err("invalid power data\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	mp = &power->parser->mp[module];
-
-	if (enable) {
-		rc = msm_dss_clk_set_rate(mp->clk_config, mp->num_clk);
-		if (rc) {
-			pr_err("failed to set clks rate.\n");
-			goto exit;
-		}
-
-		rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, 1);
-		if (rc) {
-			pr_err("failed to enable clks\n");
-			goto exit;
-		}
-	} else {
-		rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, 0);
-		if (rc) {
-			pr_err("failed to disable clks\n");
-				goto exit;
-		}
-	}
-exit:
-	return rc;
-}
-
-static int dp_power_clk_enable(struct dp_power *dp_power,
-		enum dp_pm_type pm_type, bool enable)
-{
-	int rc = 0;
-	struct dss_module_power *mp;
-	struct dp_power_private *power;
-
-	if (!dp_power) {
-		pr_err("invalid power data\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	power = container_of(dp_power, struct dp_power_private, dp_power);
-
-	mp = &power->parser->mp[pm_type];
-
-	if ((pm_type != DP_CORE_PM) && (pm_type != DP_CTRL_PM)) {
-		pr_err("unsupported power module: %s\n",
-				dp_parser_pm_name(pm_type));
-		return -EINVAL;
-	}
-
-	if (enable) {
-		if ((pm_type == DP_CORE_PM)
-			&& (power->core_clks_on)) {
-			pr_debug("core clks already enabled\n");
-			return 0;
-		}
-
-		if ((pm_type == DP_CTRL_PM)
-			&& (power->link_clks_on)) {
-			pr_debug("links clks already enabled\n");
-			return 0;
-		}
-
-		if ((pm_type == DP_CTRL_PM) && (!power->core_clks_on)) {
-			pr_debug("Need to enable core clks before link clks\n");
-
-			rc = dp_power_clk_set_rate(power, pm_type, enable);
-			if (rc) {
-				pr_err("failed to enable clks: %s. err=%d\n",
-					dp_parser_pm_name(DP_CORE_PM), rc);
-				goto error;
-			} else {
-				power->core_clks_on = true;
-			}
-		}
-	}
-
-	rc = dp_power_clk_set_rate(power, pm_type, enable);
-	if (rc) {
-		pr_err("failed to '%s' clks for: %s. err=%d\n",
-			enable ? "enable" : "disable",
-			dp_parser_pm_name(pm_type), rc);
-			goto error;
-	}
-
-	if (pm_type == DP_CORE_PM)
-		power->core_clks_on = enable;
-	else
-		power->link_clks_on = enable;
-
-	pr_debug("%s clocks for %s\n",
-			enable ? "enable" : "disable",
-			dp_parser_pm_name(pm_type));
-	pr_debug("link_clks:%s core_clks:%s\n",
-		power->link_clks_on ? "on" : "off",
-		power->core_clks_on ? "on" : "off");
-error:
-	return rc;
-}
-
-static int dp_power_request_gpios(struct dp_power_private *power)
-{
-	int rc = 0, i;
-	struct device *dev;
-	struct dss_module_power *mp;
-	static const char * const gpio_names[] = {
-		"aux_enable", "aux_sel", "usbplug_cc",
-	};
-
-	if (!power) {
-		pr_err("invalid power data\n");
-		return -EINVAL;
-	}
-
-	dev = &power->pdev->dev;
-	mp = &power->parser->mp[DP_CORE_PM];
-
-	for (i = 0; i < ARRAY_SIZE(gpio_names); i++) {
-		unsigned int gpio = mp->gpio_config[i].gpio;
-
-		if (gpio_is_valid(gpio)) {
-			rc = devm_gpio_request(dev, gpio, gpio_names[i]);
-			if (rc) {
-				pr_err("request %s gpio failed, rc=%d\n",
-					       gpio_names[i], rc);
-				goto error;
-			}
-		}
-	}
-	return 0;
-error:
-	for (i = 0; i < ARRAY_SIZE(gpio_names); i++) {
-		unsigned int gpio = mp->gpio_config[i].gpio;
-
-		if (gpio_is_valid(gpio))
-			gpio_free(gpio);
-	}
-	return rc;
-}
-
-static bool dp_power_find_gpio(const char *gpio1, const char *gpio2)
-{
-	return !!strnstr(gpio1, gpio2, strlen(gpio1));
-}
-
-static void dp_power_set_gpio(struct dp_power_private *power, bool flip)
-{
-	int i;
-	struct dss_module_power *mp = &power->parser->mp[DP_CORE_PM];
-	struct dss_gpio *config = mp->gpio_config;
-
-	for (i = 0; i < mp->num_gpio; i++) {
-		if (dp_power_find_gpio(config->gpio_name, "aux-sel"))
-			config->value = flip;
-
-		if (gpio_is_valid(config->gpio)) {
-			pr_debug("gpio %s, value %d\n", config->gpio_name,
-				config->value);
-
-			if (dp_power_find_gpio(config->gpio_name, "aux-en") ||
-			    dp_power_find_gpio(config->gpio_name, "aux-sel"))
-				gpio_direction_output(config->gpio,
-					config->value);
-			else
-				gpio_set_value(config->gpio, config->value);
-
-		}
-		config++;
-	}
-}
-
-static int dp_power_config_gpios(struct dp_power_private *power, bool flip,
-					bool enable)
-{
-	int rc = 0, i;
-	struct dss_module_power *mp;
-	struct dss_gpio *config;
-
-	mp = &power->parser->mp[DP_CORE_PM];
-	config = mp->gpio_config;
-
-	if (enable) {
-		rc = dp_power_request_gpios(power);
-		if (rc) {
-			pr_err("gpio request failed\n");
-			return rc;
-		}
-
-		dp_power_set_gpio(power, flip);
-	} else {
-		for (i = 0; i < mp->num_gpio; i++) {
-			gpio_set_value(config[i].gpio, 0);
-			gpio_free(config[i].gpio);
-		}
-	}
-
-	return 0;
-}
-
-static int dp_power_client_init(struct dp_power *dp_power)
-{
-	int rc = 0;
-	struct dp_power_private *power;
-	char dp_client_name[DP_CLIENT_NAME_SIZE];
-
-	if (!dp_power) {
-		pr_err("invalid power data\n");
-		return -EINVAL;
-	}
-
-	power = container_of(dp_power, struct dp_power_private, dp_power);
-
-	rc = dp_power_regulator_init(power);
-	if (rc) {
-		pr_err("failed to init regulators\n");
-		goto error_power;
-	}
-
-	rc = dp_power_clk_init(power, true);
-	if (rc) {
-		pr_err("failed to init clocks\n");
-		goto error_clk;
-	}
-
-	return 0;
-
-error_clk:
-	dp_power_regulator_deinit(power);
-error_power:
-	return rc;
-}
-
-static void dp_power_client_deinit(struct dp_power *dp_power)
-{
-	struct dp_power_private *power;
-
-	if (!dp_power) {
-		pr_err("invalid power data\n");
-		return;
-	}
-
-	power = container_of(dp_power, struct dp_power_private, dp_power);
-
-	dp_power_clk_init(power, false);
-	dp_power_regulator_deinit(power);
-}
-
-static int dp_power_set_pixel_clk_parent(struct dp_power *dp_power)
-{
-	int rc = 0;
-	struct dp_power_private *power;
-
-	if (!dp_power) {
-		pr_err("invalid power data\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	power = container_of(dp_power, struct dp_power_private, dp_power);
-
-	if (power->pixel_clk_rcg && power->pixel_parent)
-		clk_set_parent(power->pixel_clk_rcg, power->pixel_parent);
-exit:
-	return rc;
-}
-
-static int dp_power_init(struct dp_power *dp_power, bool flip)
-{
-	int rc = 0;
-	struct dp_power_private *power;
-
-	if (!dp_power) {
-		pr_err("invalid power data\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	power = container_of(dp_power, struct dp_power_private, dp_power);
-
-	rc = dp_power_regulator_ctrl(power, true);
-	if (rc) {
-		pr_err("failed to enable regulators\n");
-		goto exit;
-	}
-
-	rc = dp_power_pinctrl_set(power, true);
-	if (rc) {
-		pr_err("failed to set pinctrl state\n");
-		goto err_pinctrl;
-	}
-
-	rc = dp_power_config_gpios(power, flip, true);
-	if (rc) {
-		pr_err("failed to enable gpios\n");
-		goto err_gpio;
-	}
-
-	rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true);
-	if (rc) {
-		pr_err("failed to enable DP core clocks\n");
-		goto err_clk;
-	}
-
-	return 0;
-
-err_clk:
-	dp_power_config_gpios(power, flip, false);
-err_gpio:
-	dp_power_pinctrl_set(power, false);
-err_pinctrl:
-	dp_power_regulator_ctrl(power, false);
-exit:
-	return rc;
-}
-
-static int dp_power_deinit(struct dp_power *dp_power)
-{
-	int rc = 0;
-	struct dp_power_private *power;
-
-	if (!dp_power) {
-		pr_err("invalid power data\n");
-		rc = -EINVAL;
-		goto exit;
-	}
-
-	power = container_of(dp_power, struct dp_power_private, dp_power);
-
-	dp_power_clk_enable(dp_power, DP_CORE_PM, false);
-	dp_power_config_gpios(power, false, false);
-	dp_power_pinctrl_set(power, false);
-	dp_power_regulator_ctrl(power, false);
-exit:
-	return rc;
-}
-
-struct dp_power *dp_power_get(struct dp_parser *parser)
-{
-	int rc = 0;
-	struct dp_power_private *power;
-	struct dp_power *dp_power;
-
-	if (!parser) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	power = devm_kzalloc(&parser->pdev->dev, sizeof(*power), GFP_KERNEL);
-	if (!power) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	power->parser = parser;
-	power->pdev = parser->pdev;
-
-	dp_power = &power->dp_power;
-
-	dp_power->init = dp_power_init;
-	dp_power->deinit = dp_power_deinit;
-	dp_power->clk_enable = dp_power_clk_enable;
-	dp_power->set_pixel_clk_parent = dp_power_set_pixel_clk_parent;
-	dp_power->power_client_init = dp_power_client_init;
-	dp_power->power_client_deinit = dp_power_client_deinit;
-
-	return dp_power;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_power_put(struct dp_power *dp_power)
-{
-	struct dp_power_private *power = NULL;
-
-	if (!dp_power)
-		return;
-
-	power = container_of(dp_power, struct dp_power_private, dp_power);
-
-	devm_kfree(&power->pdev->dev, power);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_power.h b/drivers/gpu/drm/msm/dp/dp_power.h
deleted file mode 100644
index d9dab72..0000000
--- a/drivers/gpu/drm/msm/dp/dp_power.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_POWER_H_
-#define _DP_POWER_H_
-
-#include "dp_parser.h"
-
-/**
- * sruct dp_power - DisplayPort's power related data
- *
- * @init: initializes the regulators/core clocks/GPIOs/pinctrl
- * @deinit: turns off the regulators/core clocks/GPIOs/pinctrl
- * @clk_enable: enable/disable the DP clocks
- * @set_pixel_clk_parent: set the parent of DP pixel clock
- */
-struct dp_power {
-	int (*init)(struct dp_power *power, bool flip);
-	int (*deinit)(struct dp_power *power);
-	int (*clk_enable)(struct dp_power *power, enum dp_pm_type pm_type,
-				bool enable);
-	int (*set_pixel_clk_parent)(struct dp_power *power);
-	int (*power_client_init)(struct dp_power *power);
-	void (*power_client_deinit)(struct dp_power *power);
-};
-
-/**
- * dp_power_get() - configure and get the DisplayPort power module data
- *
- * @parser: instance of parser module
- * return: pointer to allocated power module data
- *
- * This API will configure the DisplayPort's power module and provides
- * methods to be called by the client to configure the power related
- * modueles.
- */
-struct dp_power *dp_power_get(struct dp_parser *parser);
-
-/**
- * dp_power_put() - release the power related resources
- *
- * @power: pointer to the power module's data
- */
-void dp_power_put(struct dp_power *power);
-#endif /* _DP_POWER_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_reg.h b/drivers/gpu/drm/msm/dp/dp_reg.h
deleted file mode 100644
index dba9098..0000000
--- a/drivers/gpu/drm/msm/dp/dp_reg.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_REG_H_
-#define _DP_REG_H_
-
-/* DP_TX Registers */
-#define DP_HW_VERSION				(0x00000000)
-#define DP_SW_RESET				(0x00000010)
-#define DP_PHY_CTRL				(0x00000014)
-#define DP_CLK_CTRL				(0x00000018)
-#define DP_CLK_ACTIVE				(0x0000001C)
-#define DP_INTR_STATUS				(0x00000020)
-#define DP_INTR_STATUS2				(0x00000024)
-#define DP_INTR_STATUS3				(0x00000028)
-
-#define DP_DP_HPD_CTRL				(0x00000200)
-#define DP_DP_HPD_INT_STATUS			(0x00000204)
-#define DP_DP_HPD_INT_ACK			(0x00000208)
-#define DP_DP_HPD_INT_MASK			(0x0000020C)
-#define DP_DP_HPD_REFTIMER			(0x00000218)
-#define DP_DP_HPD_EVENT_TIME_0			(0x0000021C)
-#define DP_DP_HPD_EVENT_TIME_1			(0x00000220)
-#define DP_AUX_CTRL				(0x00000230)
-#define DP_AUX_DATA				(0x00000234)
-#define DP_AUX_TRANS_CTRL			(0x00000238)
-#define DP_TIMEOUT_COUNT			(0x0000023C)
-#define DP_AUX_LIMITS				(0x00000240)
-#define DP_AUX_STATUS				(0x00000244)
-
-#define DP_DPCD_CP_IRQ				(0x201)
-#define DP_DPCD_RXSTATUS			(0x69493)
-
-#define DP_INTERRUPT_TRANS_NUM			(0x000002A0)
-
-#define DP_MAINLINK_CTRL			(0x00000400)
-#define DP_STATE_CTRL				(0x00000404)
-#define DP_CONFIGURATION_CTRL			(0x00000408)
-#define DP_SOFTWARE_MVID			(0x00000410)
-#define DP_SOFTWARE_NVID			(0x00000418)
-#define DP_TOTAL_HOR_VER			(0x0000041C)
-#define DP_START_HOR_VER_FROM_SYNC		(0x00000420)
-#define DP_HSYNC_VSYNC_WIDTH_POLARITY		(0x00000424)
-#define DP_ACTIVE_HOR_VER			(0x00000428)
-#define DP_MISC1_MISC0				(0x0000042C)
-#define DP_VALID_BOUNDARY			(0x00000430)
-#define DP_VALID_BOUNDARY_2			(0x00000434)
-#define DP_LOGICAL2PHYSCIAL_LANE_MAPPING	(0x00000438)
-
-#define DP_MAINLINK_READY			(0x00000440)
-#define DP_MAINLINK_LEVELS			(0x00000444)
-#define DP_TU					(0x0000044C)
-
-#define DP_HBR2_COMPLIANCE_SCRAMBLER_RESET	(0x00000454)
-#define DP_TEST_80BIT_CUSTOM_PATTERN_REG0	(0x000004C0)
-#define DP_TEST_80BIT_CUSTOM_PATTERN_REG1	(0x000004C4)
-#define DP_TEST_80BIT_CUSTOM_PATTERN_REG2	(0x000004C8)
-
-#define MMSS_DP_MISC1_MISC0			(0x0000042C)
-#define MMSS_DP_AUDIO_TIMING_GEN		(0x00000480)
-#define MMSS_DP_AUDIO_TIMING_RBR_32		(0x00000484)
-#define MMSS_DP_AUDIO_TIMING_HBR_32		(0x00000488)
-#define MMSS_DP_AUDIO_TIMING_RBR_44		(0x0000048C)
-#define MMSS_DP_AUDIO_TIMING_HBR_44		(0x00000490)
-#define MMSS_DP_AUDIO_TIMING_RBR_48		(0x00000494)
-#define MMSS_DP_AUDIO_TIMING_HBR_48		(0x00000498)
-
-#define MMSS_DP_PSR_CRC_RG			(0x00000554)
-#define MMSS_DP_PSR_CRC_B			(0x00000558)
-
-#define DP_COMPRESSION_MODE_CTRL		(0x00000580)
-
-#define MMSS_DP_AUDIO_CFG			(0x00000600)
-#define MMSS_DP_AUDIO_STATUS			(0x00000604)
-#define MMSS_DP_AUDIO_PKT_CTRL			(0x00000608)
-#define MMSS_DP_AUDIO_PKT_CTRL2			(0x0000060C)
-#define MMSS_DP_AUDIO_ACR_CTRL			(0x00000610)
-#define MMSS_DP_AUDIO_CTRL_RESET		(0x00000614)
-
-#define MMSS_DP_SDP_CFG				(0x00000628)
-#define MMSS_DP_SDP_CFG2			(0x0000062C)
-#define MMSS_DP_AUDIO_TIMESTAMP_0		(0x00000630)
-#define MMSS_DP_AUDIO_TIMESTAMP_1		(0x00000634)
-
-#define MMSS_DP_AUDIO_STREAM_0			(0x00000640)
-#define MMSS_DP_AUDIO_STREAM_1			(0x00000644)
-
-#define MMSS_DP_EXTENSION_0			(0x00000650)
-#define MMSS_DP_EXTENSION_1			(0x00000654)
-#define MMSS_DP_EXTENSION_2			(0x00000658)
-#define MMSS_DP_EXTENSION_3			(0x0000065C)
-#define MMSS_DP_EXTENSION_4			(0x00000660)
-#define MMSS_DP_EXTENSION_5			(0x00000664)
-#define MMSS_DP_EXTENSION_6			(0x00000668)
-#define MMSS_DP_EXTENSION_7			(0x0000066C)
-#define MMSS_DP_EXTENSION_8			(0x00000670)
-#define MMSS_DP_EXTENSION_9			(0x00000674)
-#define MMSS_DP_AUDIO_COPYMANAGEMENT_0		(0x00000678)
-#define MMSS_DP_AUDIO_COPYMANAGEMENT_1		(0x0000067C)
-#define MMSS_DP_AUDIO_COPYMANAGEMENT_2		(0x00000680)
-#define MMSS_DP_AUDIO_COPYMANAGEMENT_3		(0x00000684)
-#define MMSS_DP_AUDIO_COPYMANAGEMENT_4		(0x00000688)
-#define MMSS_DP_AUDIO_COPYMANAGEMENT_5		(0x0000068C)
-#define MMSS_DP_AUDIO_ISRC_0			(0x00000690)
-#define MMSS_DP_AUDIO_ISRC_1			(0x00000694)
-#define MMSS_DP_AUDIO_ISRC_2			(0x00000698)
-#define MMSS_DP_AUDIO_ISRC_3			(0x0000069C)
-#define MMSS_DP_AUDIO_ISRC_4			(0x000006A0)
-#define MMSS_DP_AUDIO_ISRC_5			(0x000006A4)
-#define MMSS_DP_AUDIO_INFOFRAME_0		(0x000006A8)
-#define MMSS_DP_AUDIO_INFOFRAME_1		(0x000006AC)
-#define MMSS_DP_AUDIO_INFOFRAME_2		(0x000006B0)
-
-#define MMSS_DP_GENERIC0_0			(0x00000700)
-#define MMSS_DP_GENERIC0_1			(0x00000704)
-#define MMSS_DP_GENERIC0_2			(0x00000708)
-#define MMSS_DP_GENERIC0_3			(0x0000070C)
-#define MMSS_DP_GENERIC0_4			(0x00000710)
-#define MMSS_DP_GENERIC0_5			(0x00000714)
-#define MMSS_DP_GENERIC0_6			(0x00000718)
-#define MMSS_DP_GENERIC0_7			(0x0000071C)
-#define MMSS_DP_GENERIC0_8			(0x00000720)
-#define MMSS_DP_GENERIC0_9			(0x00000724)
-#define MMSS_DP_GENERIC1_0			(0x00000728)
-#define MMSS_DP_GENERIC1_1			(0x0000072C)
-#define MMSS_DP_GENERIC1_2			(0x00000730)
-#define MMSS_DP_GENERIC1_3			(0x00000734)
-#define MMSS_DP_GENERIC1_4			(0x00000738)
-#define MMSS_DP_GENERIC1_5			(0x0000073C)
-#define MMSS_DP_GENERIC1_6			(0x00000740)
-#define MMSS_DP_GENERIC1_7			(0x00000744)
-#define MMSS_DP_GENERIC1_8			(0x00000748)
-#define MMSS_DP_GENERIC1_9			(0x0000074C)
-
-#define MMSS_DP_VSCEXT_0			(0x000006D0)
-#define MMSS_DP_VSCEXT_1			(0x000006D4)
-#define MMSS_DP_VSCEXT_2			(0x000006D8)
-#define MMSS_DP_VSCEXT_3			(0x000006DC)
-#define MMSS_DP_VSCEXT_4			(0x000006E0)
-#define MMSS_DP_VSCEXT_5			(0x000006E4)
-#define MMSS_DP_VSCEXT_6			(0x000006E8)
-#define MMSS_DP_VSCEXT_7			(0x000006EC)
-#define MMSS_DP_VSCEXT_8			(0x000006F0)
-#define MMSS_DP_VSCEXT_9			(0x000006F4)
-
-#define MMSS_DP_TIMING_ENGINE_EN		(0x00000A10)
-#define MMSS_DP_ASYNC_FIFO_CONFIG		(0x00000A88)
-
-/*DP PHY Register offsets */
-#define DP_PHY_REVISION_ID0                     (0x00000000)
-#define DP_PHY_REVISION_ID1                     (0x00000004)
-#define DP_PHY_REVISION_ID2                     (0x00000008)
-#define DP_PHY_REVISION_ID3                     (0x0000000C)
-
-#define DP_PHY_CFG                              (0x00000010)
-#define DP_PHY_PD_CTL                           (0x00000018)
-#define DP_PHY_MODE                             (0x0000001C)
-
-#define DP_PHY_AUX_CFG0                         (0x00000020)
-#define DP_PHY_AUX_CFG1                         (0x00000024)
-#define DP_PHY_AUX_CFG2                         (0x00000028)
-#define DP_PHY_AUX_CFG3                         (0x0000002C)
-#define DP_PHY_AUX_CFG4                         (0x00000030)
-#define DP_PHY_AUX_CFG5                         (0x00000034)
-#define DP_PHY_AUX_CFG6                         (0x00000038)
-#define DP_PHY_AUX_CFG7                         (0x0000003C)
-#define DP_PHY_AUX_CFG8                         (0x00000040)
-#define DP_PHY_AUX_CFG9                         (0x00000044)
-#define DP_PHY_AUX_INTERRUPT_MASK               (0x00000048)
-#define DP_PHY_AUX_INTERRUPT_CLEAR              (0x0000004C)
-
-#define DP_PHY_SPARE0				(0x00AC)
-
-#define TXn_TX_EMP_POST1_LVL			(0x000C)
-#define TXn_TX_DRV_LVL				(0x001C)
-
-#define QSERDES_COM_BIAS_EN_CLKBUFLR_EN		(0x004)
-
-/* DP MMSS_CC registers */
-#define MMSS_DP_LINK_CMD_RCGR			(0x0138)
-#define MMSS_DP_LINK_CFG_RCGR			(0x013C)
-#define MMSS_DP_PIXEL_M				(0x0174)
-#define MMSS_DP_PIXEL_N				(0x0178)
-
-/* DP HDCP 1.3 registers */
-#define DP_HDCP_CTRL                                   (0x0A0)
-#define DP_HDCP_STATUS                                 (0x0A4)
-#define DP_HDCP_SW_UPPER_AKSV                          (0x298)
-#define DP_HDCP_SW_LOWER_AKSV                          (0x29C)
-#define DP_HDCP_ENTROPY_CTRL0                          (0x750)
-#define DP_HDCP_ENTROPY_CTRL1                          (0x75C)
-#define DP_HDCP_SHA_STATUS                             (0x0C8)
-#define DP_HDCP_RCVPORT_DATA2_0                        (0x0B0)
-#define DP_HDCP_RCVPORT_DATA3                          (0x2A4)
-#define DP_HDCP_RCVPORT_DATA4                          (0x2A8)
-#define DP_HDCP_RCVPORT_DATA5                          (0x0C0)
-#define DP_HDCP_RCVPORT_DATA6                          (0x0C4)
-
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_SHA_CTRL           (0x024)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_SHA_DATA           (0x028)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA0      (0x004)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA1      (0x008)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA7      (0x00C)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA8      (0x010)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA9      (0x014)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA10     (0x018)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA11     (0x01C)
-#define HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA12     (0x020)
-
-/* USB3 DP COM registers */
-#define USB3_DP_COM_RESET_OVRD_CTRL (0x1C)
-#define USB3_DP_COM_PHY_MODE_CTRL   (0x00)
-#define USB3_DP_COM_SW_RESET        (0x04)
-#define USB3_DP_COM_TYPEC_CTRL      (0x10)
-#define USB3_DP_COM_SWI_CTRL        (0x0c)
-#define USB3_DP_COM_POWER_DOWN_CTRL (0x08)
-
-
-
-#endif /* _DP_REG_H_ */
diff --git a/drivers/gpu/drm/msm/dp/dp_usbpd.c b/drivers/gpu/drm/msm/dp/dp_usbpd.c
deleted file mode 100644
index 6f0e380..0000000
--- a/drivers/gpu/drm/msm/dp/dp_usbpd.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
-
-#include <linux/slab.h>
-#include <linux/device.h>
-
-#include "dp_usbpd.h"
-
-/* DP specific VDM commands */
-#define DP_USBPD_VDM_STATUS	0x10
-#define DP_USBPD_VDM_CONFIGURE	0x11
-
-/* USBPD-TypeC specific Macros */
-#define VDM_VERSION		0x0
-#define USB_C_DP_SID		0xFF01
-
-enum dp_usbpd_pin_assignment {
-	DP_USBPD_PIN_A,
-	DP_USBPD_PIN_B,
-	DP_USBPD_PIN_C,
-	DP_USBPD_PIN_D,
-	DP_USBPD_PIN_E,
-	DP_USBPD_PIN_F,
-	DP_USBPD_PIN_MAX,
-};
-
-enum dp_usbpd_events {
-	DP_USBPD_EVT_DISCOVER,
-	DP_USBPD_EVT_ENTER,
-	DP_USBPD_EVT_STATUS,
-	DP_USBPD_EVT_CONFIGURE,
-	DP_USBPD_EVT_CC_PIN_POLARITY,
-	DP_USBPD_EVT_EXIT,
-	DP_USBPD_EVT_ATTENTION,
-};
-
-enum dp_usbpd_alt_mode {
-	DP_USBPD_ALT_MODE_NONE	    = 0,
-	DP_USBPD_ALT_MODE_INIT	    = BIT(0),
-	DP_USBPD_ALT_MODE_DISCOVER  = BIT(1),
-	DP_USBPD_ALT_MODE_ENTER	    = BIT(2),
-	DP_USBPD_ALT_MODE_STATUS    = BIT(3),
-	DP_USBPD_ALT_MODE_CONFIGURE = BIT(4),
-};
-
-struct dp_usbpd_capabilities {
-	enum dp_usbpd_port port;
-	bool receptacle_state;
-	u8 ulink_pin_config;
-	u8 dlink_pin_config;
-};
-
-struct dp_usbpd_private {
-	u32 vdo;
-	struct device *dev;
-	struct usbpd *pd;
-	struct usbpd_svid_handler svid_handler;
-	struct dp_usbpd_cb *dp_cb;
-	struct dp_usbpd_capabilities cap;
-	struct dp_usbpd dp_usbpd;
-	enum dp_usbpd_alt_mode alt_mode;
-	u32 dp_usbpd_config;
-};
-
-static const char *dp_usbpd_pin_name(u8 pin)
-{
-	switch (pin) {
-	case DP_USBPD_PIN_A: return "DP_USBPD_PIN_ASSIGNMENT_A";
-	case DP_USBPD_PIN_B: return "DP_USBPD_PIN_ASSIGNMENT_B";
-	case DP_USBPD_PIN_C: return "DP_USBPD_PIN_ASSIGNMENT_C";
-	case DP_USBPD_PIN_D: return "DP_USBPD_PIN_ASSIGNMENT_D";
-	case DP_USBPD_PIN_E: return "DP_USBPD_PIN_ASSIGNMENT_E";
-	case DP_USBPD_PIN_F: return "DP_USBPD_PIN_ASSIGNMENT_F";
-	default: return "UNKNOWN";
-	}
-}
-
-static const char *dp_usbpd_port_name(enum dp_usbpd_port port)
-{
-	switch (port) {
-	case DP_USBPD_PORT_NONE: return "DP_USBPD_PORT_NONE";
-	case DP_USBPD_PORT_UFP_D: return "DP_USBPD_PORT_UFP_D";
-	case DP_USBPD_PORT_DFP_D: return "DP_USBPD_PORT_DFP_D";
-	case DP_USBPD_PORT_D_UFP_D: return "DP_USBPD_PORT_D_UFP_D";
-	default: return "DP_USBPD_PORT_NONE";
-	}
-}
-
-static const char *dp_usbpd_cmd_name(u8 cmd)
-{
-	switch (cmd) {
-	case USBPD_SVDM_DISCOVER_MODES: return "USBPD_SVDM_DISCOVER_MODES";
-	case USBPD_SVDM_ENTER_MODE: return "USBPD_SVDM_ENTER_MODE";
-	case USBPD_SVDM_ATTENTION: return "USBPD_SVDM_ATTENTION";
-	case DP_USBPD_VDM_STATUS: return "DP_USBPD_VDM_STATUS";
-	case DP_USBPD_VDM_CONFIGURE: return "DP_USBPD_VDM_CONFIGURE";
-	default: return "DP_USBPD_VDM_ERROR";
-	}
-}
-
-static void dp_usbpd_init_port(enum dp_usbpd_port *port, u32 in_port)
-{
-	switch (in_port) {
-	case 0:
-		*port = DP_USBPD_PORT_NONE;
-		break;
-	case 1:
-		*port = DP_USBPD_PORT_UFP_D;
-		break;
-	case 2:
-		*port = DP_USBPD_PORT_DFP_D;
-		break;
-	case 3:
-		*port = DP_USBPD_PORT_D_UFP_D;
-		break;
-	default:
-		*port = DP_USBPD_PORT_NONE;
-	}
-	pr_debug("port:%s\n", dp_usbpd_port_name(*port));
-}
-
-static void dp_usbpd_get_capabilities(struct dp_usbpd_private *pd)
-{
-	struct dp_usbpd_capabilities *cap = &pd->cap;
-	u32 buf = pd->vdo;
-	int port = buf & 0x3;
-
-	cap->receptacle_state = (buf & BIT(6)) ? true : false;
-	cap->dlink_pin_config = (buf >> 8) & 0xff;
-	cap->ulink_pin_config = (buf >> 16) & 0xff;
-
-	dp_usbpd_init_port(&cap->port, port);
-}
-
-static void dp_usbpd_get_status(struct dp_usbpd_private *pd)
-{
-	struct dp_usbpd *status = &pd->dp_usbpd;
-	u32 buf = pd->vdo;
-	int port = buf & 0x3;
-
-	status->low_pow_st     = (buf & BIT(2)) ? true : false;
-	status->adaptor_dp_en  = (buf & BIT(3)) ? true : false;
-	status->multi_func     = (buf & BIT(4)) ? true : false;
-	status->usb_config_req = (buf & BIT(5)) ? true : false;
-	status->exit_dp_mode   = (buf & BIT(6)) ? true : false;
-	status->hpd_high       = (buf & BIT(7)) ? true : false;
-	status->hpd_irq        = (buf & BIT(8)) ? true : false;
-
-	pr_debug("low_pow_st = %d, adaptor_dp_en = %d, multi_func = %d\n",
-			status->low_pow_st, status->adaptor_dp_en,
-			status->multi_func);
-	pr_debug("usb_config_req = %d, exit_dp_mode = %d, hpd_high =%d\n",
-			status->usb_config_req,
-			status->exit_dp_mode, status->hpd_high);
-	pr_debug("hpd_irq = %d\n", status->hpd_irq);
-
-	dp_usbpd_init_port(&status->port, port);
-}
-
-static u32 dp_usbpd_gen_config_pkt(struct dp_usbpd_private *pd)
-{
-	u8 pin_cfg, pin;
-	u32 config = 0;
-	const u32 ufp_d_config = 0x2, dp_ver = 0x1;
-
-	if (pd->cap.receptacle_state)
-		pin_cfg = pd->cap.ulink_pin_config;
-	else
-		pin_cfg = pd->cap.dlink_pin_config;
-
-	for (pin = DP_USBPD_PIN_A; pin < DP_USBPD_PIN_MAX; pin++) {
-		if (pin_cfg & BIT(pin)) {
-			if (pd->dp_usbpd.multi_func) {
-				if (pin == DP_USBPD_PIN_D)
-					break;
-			} else {
-				break;
-			}
-		}
-	}
-
-	if (pin == DP_USBPD_PIN_MAX)
-		pin = DP_USBPD_PIN_C;
-
-	pr_debug("pin assignment: %s\n", dp_usbpd_pin_name(pin));
-
-	config |= BIT(pin) << 8;
-
-	config |= (dp_ver << 2);
-	config |= ufp_d_config;
-
-	pr_debug("config = 0x%x\n", config);
-	return config;
-}
-
-static void dp_usbpd_send_event(struct dp_usbpd_private *pd,
-		enum dp_usbpd_events event)
-{
-	u32 config;
-
-	switch (event) {
-	case DP_USBPD_EVT_DISCOVER:
-		usbpd_send_svdm(pd->pd, USB_C_DP_SID,
-			USBPD_SVDM_DISCOVER_MODES,
-			SVDM_CMD_TYPE_INITIATOR, 0x0, 0x0, 0x0);
-		break;
-	case DP_USBPD_EVT_ENTER:
-		usbpd_send_svdm(pd->pd, USB_C_DP_SID,
-			USBPD_SVDM_ENTER_MODE,
-			SVDM_CMD_TYPE_INITIATOR, 0x1, 0x0, 0x0);
-		break;
-	case DP_USBPD_EVT_EXIT:
-		usbpd_send_svdm(pd->pd, USB_C_DP_SID,
-			USBPD_SVDM_EXIT_MODE,
-			SVDM_CMD_TYPE_INITIATOR, 0x1, 0x0, 0x0);
-		break;
-	case DP_USBPD_EVT_STATUS:
-		config = 0x1; /* DFP_D connected */
-		usbpd_send_svdm(pd->pd, USB_C_DP_SID, DP_USBPD_VDM_STATUS,
-			SVDM_CMD_TYPE_INITIATOR, 0x1, &config, 0x1);
-		break;
-	case DP_USBPD_EVT_CONFIGURE:
-		config = dp_usbpd_gen_config_pkt(pd);
-		usbpd_send_svdm(pd->pd, USB_C_DP_SID, DP_USBPD_VDM_CONFIGURE,
-			SVDM_CMD_TYPE_INITIATOR, 0x1, &config, 0x1);
-		break;
-	default:
-		pr_err("unknown event:%d\n", event);
-	}
-}
-
-static void dp_usbpd_connect_cb(struct usbpd_svid_handler *hdlr)
-{
-	struct dp_usbpd_private *pd;
-
-	pd = container_of(hdlr, struct dp_usbpd_private, svid_handler);
-	if (!pd) {
-		pr_err("get_usbpd phandle failed\n");
-		return;
-	}
-
-	pr_debug("\n");
-	dp_usbpd_send_event(pd, DP_USBPD_EVT_DISCOVER);
-}
-
-static void dp_usbpd_disconnect_cb(struct usbpd_svid_handler *hdlr)
-{
-	struct dp_usbpd_private *pd;
-
-	pd = container_of(hdlr, struct dp_usbpd_private, svid_handler);
-	if (!pd) {
-		pr_err("get_usbpd phandle failed\n");
-		return;
-	}
-
-	pd->alt_mode = DP_USBPD_ALT_MODE_NONE;
-	pd->dp_usbpd.alt_mode_cfg_done = false;
-	pr_debug("\n");
-
-	if (pd->dp_cb && pd->dp_cb->disconnect)
-		pd->dp_cb->disconnect(pd->dev);
-}
-
-static int dp_usbpd_validate_callback(u8 cmd,
-	enum usbpd_svdm_cmd_type cmd_type, int num_vdos)
-{
-	int ret = 0;
-
-	if (cmd_type == SVDM_CMD_TYPE_RESP_NAK) {
-		pr_err("error: NACK\n");
-		ret = -EINVAL;
-		goto end;
-	}
-
-	if (cmd_type == SVDM_CMD_TYPE_RESP_BUSY) {
-		pr_err("error: BUSY\n");
-		ret = -EBUSY;
-		goto end;
-	}
-
-	if (cmd == USBPD_SVDM_ATTENTION) {
-		if (cmd_type != SVDM_CMD_TYPE_INITIATOR) {
-			pr_err("error: invalid cmd type for attention\n");
-			ret = -EINVAL;
-			goto end;
-		}
-
-		if (!num_vdos) {
-			pr_err("error: no vdo provided\n");
-			ret = -EINVAL;
-			goto end;
-		}
-	} else {
-		if (cmd_type != SVDM_CMD_TYPE_RESP_ACK) {
-			pr_err("error: invalid cmd type\n");
-			ret = -EINVAL;
-		}
-	}
-end:
-	return ret;
-}
-
-static void dp_usbpd_response_cb(struct usbpd_svid_handler *hdlr, u8 cmd,
-				enum usbpd_svdm_cmd_type cmd_type,
-				const u32 *vdos, int num_vdos)
-{
-	struct dp_usbpd_private *pd;
-
-	pd = container_of(hdlr, struct dp_usbpd_private, svid_handler);
-
-	pr_debug("callback -> cmd: %s, *vdos = 0x%x, num_vdos = %d\n",
-				dp_usbpd_cmd_name(cmd), *vdos, num_vdos);
-
-	if (dp_usbpd_validate_callback(cmd, cmd_type, num_vdos)) {
-		pr_debug("invalid callback received\n");
-		return;
-	}
-
-	switch (cmd) {
-	case USBPD_SVDM_DISCOVER_MODES:
-		pd->vdo = *vdos;
-		dp_usbpd_get_capabilities(pd);
-
-		pd->alt_mode |= DP_USBPD_ALT_MODE_DISCOVER;
-
-		if (pd->cap.port & BIT(0))
-			dp_usbpd_send_event(pd, DP_USBPD_EVT_ENTER);
-		break;
-	case USBPD_SVDM_ENTER_MODE:
-		pd->alt_mode |= DP_USBPD_ALT_MODE_ENTER;
-
-		dp_usbpd_send_event(pd, DP_USBPD_EVT_STATUS);
-		break;
-	case USBPD_SVDM_ATTENTION:
-		if (pd->dp_usbpd.forced_disconnect)
-			break;
-
-		pd->vdo = *vdos;
-		dp_usbpd_get_status(pd);
-
-		if (pd->dp_cb && pd->dp_cb->attention)
-			pd->dp_cb->attention(pd->dev);
-
-		if (!pd->dp_usbpd.alt_mode_cfg_done)
-			dp_usbpd_send_event(pd, DP_USBPD_EVT_CONFIGURE);
-		break;
-	case DP_USBPD_VDM_STATUS:
-		pd->vdo = *vdos;
-		dp_usbpd_get_status(pd);
-
-		if (!(pd->alt_mode & DP_USBPD_ALT_MODE_CONFIGURE)) {
-			pd->alt_mode |= DP_USBPD_ALT_MODE_STATUS;
-
-			if (pd->dp_usbpd.port & BIT(1))
-				dp_usbpd_send_event(pd, DP_USBPD_EVT_CONFIGURE);
-		}
-		break;
-	case DP_USBPD_VDM_CONFIGURE:
-		pd->alt_mode |= DP_USBPD_ALT_MODE_CONFIGURE;
-		pd->dp_usbpd.alt_mode_cfg_done = true;
-		dp_usbpd_get_status(pd);
-
-		pd->dp_usbpd.orientation = usbpd_get_plug_orientation(pd->pd);
-
-		/*
-		 * By default, USB reserves two lanes for Super Speed.
-		 * Which means DP has remaining two lanes to operate on.
-		 * If multi-function is not supported, request USB to
-		 * release the Super Speed lanes so that DP can use
-		 * all four lanes in case DPCD indicates support for
-		 * four lanes.
-		 */
-		if (!pd->dp_usbpd.multi_func)
-			pd->svid_handler.request_usb_ss_lane(pd->pd,
-				&pd->svid_handler);
-
-		if (pd->dp_cb && pd->dp_cb->configure)
-			pd->dp_cb->configure(pd->dev);
-		break;
-	default:
-		pr_err("unknown cmd: %d\n", cmd);
-		break;
-	}
-}
-
-static int dp_usbpd_connect(struct dp_usbpd *dp_usbpd, bool hpd)
-{
-	int rc = 0;
-	struct dp_usbpd_private *pd;
-
-	if (!dp_usbpd) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	pd = container_of(dp_usbpd, struct dp_usbpd_private, dp_usbpd);
-
-	dp_usbpd->hpd_high = hpd;
-	dp_usbpd->forced_disconnect = !hpd;
-
-	if (hpd)
-		pd->dp_cb->configure(pd->dev);
-	else
-		pd->dp_cb->disconnect(pd->dev);
-
-error:
-	return rc;
-}
-
-struct dp_usbpd *dp_usbpd_get(struct device *dev, struct dp_usbpd_cb *cb)
-{
-	int rc = 0;
-	const char *pd_phandle = "qcom,dp-usbpd-detection";
-	struct usbpd *pd = NULL;
-	struct dp_usbpd_private *usbpd;
-	struct dp_usbpd *dp_usbpd;
-	struct usbpd_svid_handler svid_handler = {
-		.svid		= USB_C_DP_SID,
-		.vdm_received	= NULL,
-		.connect	= &dp_usbpd_connect_cb,
-		.svdm_received	= &dp_usbpd_response_cb,
-		.disconnect	= &dp_usbpd_disconnect_cb,
-	};
-
-	if (!cb) {
-		pr_err("invalid cb data\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	pd = devm_usbpd_get_by_phandle(dev, pd_phandle);
-	if (IS_ERR(pd)) {
-		pr_err("usbpd phandle failed (%ld)\n", PTR_ERR(pd));
-		rc = PTR_ERR(pd);
-		goto error;
-	}
-
-	usbpd = devm_kzalloc(dev, sizeof(*usbpd), GFP_KERNEL);
-	if (!usbpd) {
-		rc = -ENOMEM;
-		goto error;
-	}
-
-	usbpd->dev = dev;
-	usbpd->pd = pd;
-	usbpd->svid_handler = svid_handler;
-	usbpd->dp_cb = cb;
-
-	rc = usbpd_register_svid(pd, &usbpd->svid_handler);
-	if (rc) {
-		pr_err("pd registration failed\n");
-		rc = -ENODEV;
-		devm_kfree(dev, usbpd);
-		goto error;
-	}
-
-	dp_usbpd = &usbpd->dp_usbpd;
-	dp_usbpd->connect = dp_usbpd_connect;
-
-	return dp_usbpd;
-error:
-	return ERR_PTR(rc);
-}
-
-void dp_usbpd_put(struct dp_usbpd *dp_usbpd)
-{
-	struct dp_usbpd_private *usbpd;
-
-	if (!dp_usbpd)
-		return;
-
-	usbpd = container_of(dp_usbpd, struct dp_usbpd_private, dp_usbpd);
-
-	usbpd_unregister_svid(usbpd->pd, &usbpd->svid_handler);
-
-	devm_kfree(usbpd->dev, usbpd);
-}
diff --git a/drivers/gpu/drm/msm/dp/dp_usbpd.h b/drivers/gpu/drm/msm/dp/dp_usbpd.h
deleted file mode 100644
index 94953b3..0000000
--- a/drivers/gpu/drm/msm/dp/dp_usbpd.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _DP_USBPD_H_
-#define _DP_USBPD_H_
-
-#include <linux/usb/usbpd.h>
-
-#include <linux/types.h>
-#include <linux/device.h>
-
-/**
- * enum dp_usbpd_port - usb/dp port type
- * @DP_USBPD_PORT_NONE: port not configured
- * @DP_USBPD_PORT_UFP_D: Upstream Facing Port - DisplayPort
- * @DP_USBPD_PORT_DFP_D: Downstream Facing Port - DisplayPort
- * @DP_USBPD_PORT_D_UFP_D: Both UFP & DFP - DisplayPort
- */
-
-enum dp_usbpd_port {
-	DP_USBPD_PORT_NONE,
-	DP_USBPD_PORT_UFP_D,
-	DP_USBPD_PORT_DFP_D,
-	DP_USBPD_PORT_D_UFP_D,
-};
-
-/**
- * struct dp_usbpd - DisplayPort status
- *
- * @port: port configured
- * orientation: plug orientation configuration
- * @low_pow_st: low power state
- * @adaptor_dp_en: adaptor functionality enabled
- * @multi_func: multi-function preferred
- * @usb_config_req: request to switch to usb
- * @exit_dp_mode: request exit from displayport mode
- * @hpd_high: Hot Plug Detect signal is high.
- * @hpd_irq: Change in the status since last message
- * @alt_mode_cfg_done: bool to specify alt mode status
- * @debug_en: bool to specify debug mode
- * @connect: simulate disconnect or connect for debug mode
- */
-struct dp_usbpd {
-	enum dp_usbpd_port port;
-	enum plug_orientation orientation;
-	bool low_pow_st;
-	bool adaptor_dp_en;
-	bool multi_func;
-	bool usb_config_req;
-	bool exit_dp_mode;
-	bool hpd_high;
-	bool hpd_irq;
-	bool alt_mode_cfg_done;
-	bool debug_en;
-	bool forced_disconnect;
-
-	int (*connect)(struct dp_usbpd *dp_usbpd, bool hpd);
-};
-
-/**
- * struct dp_usbpd_cb - callback functions provided by the client
- *
- * @configure: called by usbpd module when PD communication has
- * been completed and the usb peripheral has been configured on
- * dp mode.
- * @disconnect: notify the cable disconnect issued by usb.
- * @attention: notify any attention message issued by usb.
- */
-struct dp_usbpd_cb {
-	int (*configure)(struct device *dev);
-	int (*disconnect)(struct device *dev);
-	int (*attention)(struct device *dev);
-};
-
-/**
- * dp_usbpd_get() - setup usbpd module
- *
- * @dev: device instance of the caller
- * @cb: struct containing callback function pointers.
- *
- * This function allows the client to initialize the usbpd
- * module. The module will communicate with usb driver and
- * handles the power delivery (PD) communication with the
- * sink/usb device. This module will notify the client using
- * the callback functions about the connection and status.
- */
-struct dp_usbpd *dp_usbpd_get(struct device *dev, struct dp_usbpd_cb *cb);
-
-void dp_usbpd_put(struct dp_usbpd *pd);
-#endif /* _DP_USBPD_H_ */
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index b30120e..84a125d 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -335,7 +335,6 @@
 # define DP_LINK_BW_1_62		    0x06
 # define DP_LINK_BW_2_7			    0x0a
 # define DP_LINK_BW_5_4			    0x14    /* 1.2 */
-# define DP_LINK_BW_8_1			    0x1e
 
 #define DP_LANE_COUNT_SET	            0x101
 # define DP_LANE_COUNT_MASK		    0x0f
@@ -520,8 +519,6 @@
 # define DP_TEST_LINK_EDID_READ		    (1 << 2)
 # define DP_TEST_LINK_PHY_TEST_PATTERN	    (1 << 3) /* DPCD >= 1.1 */
 # define DP_TEST_LINK_FAUX_PATTERN	    (1 << 4) /* DPCD >= 1.2 */
-# define DP_TEST_LINK_AUDIO_PATTERN     (1 << 5)
-# define DP_TEST_LINK_AUDIO_DISABLED_VIDEO (1 << 6)
 
 #define DP_TEST_LINK_RATE		    0x219
 # define DP_LINK_RATE_162		    (0x6)
@@ -610,13 +607,6 @@
 #define	DP_TEST_80BIT_CUSTOM_PATTERN_71_64  0x258
 #define	DP_TEST_80BIT_CUSTOM_PATTERN_79_72  0x259
 
-#define DP_TEST_PHY_PATTERN_NONE			0x0
-#define DP_TEST_PHY_PATTERN_D10_2_NO_SCRAMBLING	0x1
-#define DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT 0x2
-#define DP_TEST_PHY_PATTERN_PRBS7			0x3
-#define DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN	0x4
-#define DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN	0x5
-
 #define DP_TEST_RESPONSE		    0x260
 # define DP_TEST_ACK			    (1 << 0)
 # define DP_TEST_NAK			    (1 << 1)
@@ -627,19 +617,6 @@
 #define DP_TEST_SINK			    0x270
 # define DP_TEST_SINK_START		    (1 << 0)
 
-#define DP_TEST_AUDIO_MODE		    0x271
-
-#define DP_TEST_AUDIO_PATTERN_TYPE	    0x272
-
-#define DP_TEST_AUDIO_PERIOD_CH1	    0x273
-#define DP_TEST_AUDIO_PERIOD_CH2	    0x274
-#define DP_TEST_AUDIO_PERIOD_CH3	    0x275
-#define DP_TEST_AUDIO_PERIOD_CH4	    0x276
-#define DP_TEST_AUDIO_PERIOD_CH5	    0x277
-#define DP_TEST_AUDIO_PERIOD_CH6	    0x278
-#define DP_TEST_AUDIO_PERIOD_CH7	    0x279
-#define DP_TEST_AUDIO_PERIOD_CH8	    0x27A
-
 #define DP_PAYLOAD_TABLE_UPDATE_STATUS      0x2c0   /* 1.2 MST */
 # define DP_PAYLOAD_TABLE_UPDATED           (1 << 0)
 # define DP_PAYLOAD_ACT_HANDLED             (1 << 1)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 04/11] dt-bindings: msm/disp: remove unused writeback bindings
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
                     ` (2 preceding siblings ...)
  2018-05-30 14:49   ` [DPU PATCH 03/11] Revert "drm/msm: Add DisplayPort support" Rajesh Yadav
@ 2018-05-30 14:49   ` Rajesh Yadav
  2018-05-30 14:49   ` [DPU PATCH 07/11] drm/msm/dpu: remove dt parsing logic for bus_scale config Rajesh Yadav
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

DPU writeback support is not enabled yet so
removing the bindings. The corresponding driver
code is also removed. The bindings will be added
back when writeback support is reworked and enabled
based on new DRM writeback connector at a later stage.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 .../devicetree/bindings/drm/msm/dpu-wb.txt         | 23 ----------------------
 1 file changed, 23 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/drm/msm/dpu-wb.txt

diff --git a/Documentation/devicetree/bindings/drm/msm/dpu-wb.txt b/Documentation/devicetree/bindings/drm/msm/dpu-wb.txt
deleted file mode 100644
index 02845536..0000000
--- a/Documentation/devicetree/bindings/drm/msm/dpu-wb.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-QTI Snapdragon Display Engine (DPU) writeback display
-
-Required properties:
-- compatible:		"qcom,wb-display"
-
-Optional properties:
-- cell-index:		Index of writeback device instance.
-			Default to 0 if not specified.
-- label:		String to describe this writeback display.
-			Default to "unknown" if not specified.
-
-Example:
-
-/ {
-	...
-
-	dpu_wb: qcom,wb-display {
-		compatible = "qcom,wb-display";
-		cell-index = <2>;
-		label = "wb_display";
-	};
-
-};
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 05/11] drm/msm/dpu: remove writeback support
  2018-05-30 14:49 [DPU PATCH 00/11] Remove unused code and cleanup devicetree bindings for DPU driver Rajesh Yadav
@ 2018-05-30 14:49 ` Rajesh Yadav
  2018-05-30 14:49 ` [DPU PATCH 06/11] drm/msm/dpu: remove hdcp support Rajesh Yadav
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel, freedreno, linux-arm-msm, devicetree; +Cc: Rajesh Yadav, hoegsberg

Remove writeback support from dpu driver
as it is not enabled.
Writeback support will be added back later
based on DRM writeback connector.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 drivers/gpu/drm/msm/Makefile                       |    5 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h           |    3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   94 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h        |    2 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h   |   63 -
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c    | 1349 --------------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c     |   41 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h     |   77 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c         |    3 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c         |   19 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h         |    6 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c         |   12 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h         |    4 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c          |  321 -----
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h          |  186 ---
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c            |    5 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h            |    1 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |    2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c             |   42 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.c             |  767 -----------
 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.h             |  232 ----
 21 files changed, 23 insertions(+), 3211 deletions(-)
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.c
 delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_wb.h

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 7fc3974..f4c5951 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -68,7 +68,6 @@ msm-y := \
 	disp/dpu1/dpu_hw_top.o \
 	disp/dpu1/dpu_hw_util.o \
 	disp/dpu1/dpu_hw_vbif.o \
-	disp/dpu1/dpu_hw_wb.o \
 	disp/dpu1/dpu_irq.o \
 	disp/dpu1/dpu_kms.o \
 	disp/dpu1/dpu_kms_utils.o \
@@ -99,9 +98,6 @@ msm-y := \
 
 msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o
 
-msm_wb-$(CONFIG_DRM_MSM_WRITEBACK) += disp/dpu1/dpu_wb.o \
-				      disp/dpu1/dpu_encoder_phys_wb.o
-
 msm-$(CONFIG_DRM_MSM_ROTATOR) += disp/dpu1/dpu_hw_rot.o
 
 msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
@@ -134,4 +130,3 @@ msm-$(CONFIG_DRM_MSM_DSI_10NM_PHY) += dsi/pll/dsi_pll_10nm.o
 endif
 
 obj-$(CONFIG_DRM_MSM)	+= msm.o
-obj-$(CONFIG_DRM_MSM_WRITEBACK) += msm_wb.o
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
index 0f3aa60..39def93 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
@@ -440,8 +440,7 @@ static inline enum dpu_crtc_client_type dpu_crtc_get_client_type(
 	if (!cstate)
 		return NRT_CLIENT;
 
-	return dpu_crtc_get_intf_mode(crtc) == INTF_MODE_WB_LINE ? NRT_CLIENT :
-			RT_CLIENT;
+	return RT_CLIENT;
 }
 
 /**
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 1d45c8f..7dd609c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1405,15 +1405,6 @@ static enum dpu_intf dpu_encoder_get_intf(struct dpu_mdss_cfg *catalog,
 	return INTF_MAX;
 }
 
-static enum dpu_wb dpu_encoder_get_wb(struct dpu_mdss_cfg *catalog,
-		enum dpu_intf_type type, u32 controller_id)
-{
-	if (controller_id < catalog->wb_count)
-		return catalog->wb[controller_id].id;
-
-	return WB_MAX;
-}
-
 static void dpu_encoder_vblank_callback(struct drm_encoder *drm_enc,
 		struct dpu_encoder_phys *phy_enc)
 {
@@ -2144,12 +2135,6 @@ static int _dpu_encoder_status_show(struct seq_file *s, void *data)
 		case INTF_MODE_CMD:
 			seq_puts(s, "mode: command\n");
 			break;
-		case INTF_MODE_WB_BLOCK:
-			seq_puts(s, "mode: wb block\n");
-			break;
-		case INTF_MODE_WB_LINE:
-			seq_puts(s, "mode: wb line\n");
-			break;
 		default:
 			seq_puts(s, "mode: ???\n");
 			break;
@@ -2409,39 +2394,6 @@ static int dpu_encoder_virt_add_phys_encs(
 	return 0;
 }
 
-static int dpu_encoder_virt_add_phys_enc_wb(struct dpu_encoder_virt *dpu_enc,
-		struct dpu_enc_phys_init_params *params)
-{
-#ifdef CONFIG_DRM_MSM_WRITEBACK
-	struct dpu_encoder_phys *enc = NULL;
-
-	if (!dpu_enc) {
-		DPU_ERROR("invalid encoder\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG_ENC(dpu_enc, "\n");
-
-	if (dpu_enc->num_phys_encs + 1 >= ARRAY_SIZE(dpu_enc->phys_encs)) {
-		DPU_ERROR_ENC(dpu_enc, "too many physical encoders %d\n",
-			  dpu_enc->num_phys_encs);
-		return -EINVAL;
-	}
-
-	enc = dpu_encoder_phys_wb_init(params);
-
-	if (IS_ERR_OR_NULL(enc)) {
-		DPU_ERROR_ENC(dpu_enc, "failed to init wb enc: %ld\n",
-			PTR_ERR(enc));
-		return enc == 0 ? -EINVAL : PTR_ERR(enc);
-	}
-
-	dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc;
-	++dpu_enc->num_phys_encs;
-#endif
-	return 0;
-}
-
 static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 				 struct dpu_kms *dpu_kms,
 				 struct msm_display_info *disp_info,
@@ -2480,9 +2432,6 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 	} else if (disp_info->intf_type == DRM_MODE_CONNECTOR_DisplayPort) {
 		*drm_enc_mode = DRM_MODE_ENCODER_TMDS;
 		intf_type = INTF_DP;
-	} else if (disp_info->intf_type == DRM_MODE_CONNECTOR_VIRTUAL) {
-		*drm_enc_mode = DRM_MODE_ENCODER_VIRTUAL;
-		intf_type = INTF_WB;
 	} else {
 		DPU_ERROR_ENC(dpu_enc, "unsupported display interface type\n");
 		return -EINVAL;
@@ -2520,42 +2469,21 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 		DPU_DEBUG("h_tile_instance %d = %d, split_role %d\n",
 				i, controller_id, phys_params.split_role);
 
-		if (intf_type == INTF_WB) {
-			phys_params.intf_idx = INTF_MAX;
-			phys_params.wb_idx = dpu_encoder_get_wb(
-					dpu_kms->catalog,
-					intf_type, controller_id);
-			if (phys_params.wb_idx == WB_MAX) {
-				DPU_ERROR_ENC(dpu_enc,
-					"could not get wb: type %d, id %d\n",
-					intf_type, controller_id);
-				ret = -EINVAL;
-			}
-		} else {
-			phys_params.wb_idx = WB_MAX;
-			phys_params.intf_idx = dpu_encoder_get_intf(
-					dpu_kms->catalog, intf_type,
-					controller_id);
-			if (phys_params.intf_idx == INTF_MAX) {
-				DPU_ERROR_ENC(dpu_enc,
-					"could not get wb: type %d, id %d\n",
-					intf_type, controller_id);
-				ret = -EINVAL;
-			}
+		phys_params.intf_idx = dpu_encoder_get_intf(dpu_kms->catalog,
+													intf_type,
+													controller_id);
+		if (phys_params.intf_idx == INTF_MAX) {
+			DPU_ERROR_ENC(dpu_enc, "could not get intf: type %d, id %d\n",
+						  intf_type, controller_id);
+			ret = -EINVAL;
 		}
 
 		if (!ret) {
-			if (intf_type == INTF_WB)
-				ret = dpu_encoder_virt_add_phys_enc_wb(dpu_enc,
-						&phys_params);
-			else
-				ret = dpu_encoder_virt_add_phys_encs(
-						disp_info->capabilities,
-						dpu_enc,
-						&phys_params);
+			ret = dpu_encoder_virt_add_phys_encs(disp_info->capabilities,
+												 dpu_enc,
+												 &phys_params);
 			if (ret)
-				DPU_ERROR_ENC(dpu_enc,
-						"failed to add phys encs\n");
+				DPU_ERROR_ENC(dpu_enc, "failed to add phys encs\n");
 		}
 	}
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
index 0339dfd..ce92901 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
@@ -32,7 +32,6 @@
 /**
  * Encoder functions and data types
  * @intfs:	Interfaces this encoder is using, INTF_MODE_NONE if unused
- * @wbs:	Writebacks this encoder is using, INTF_MODE_NONE if unused
  * @needs_cdm:	Encoder requests a CDM based on pixel format conversion needs
  * @display_num_of_h_tiles: Number of horizontal tiles in case of split
  *                          interface
@@ -40,7 +39,6 @@
  */
 struct dpu_encoder_hw_resources {
 	enum dpu_intf_mode intfs[INTF_MAX];
-	enum dpu_intf_mode wbs[WB_MAX];
 	bool needs_cdm;
 	u32 display_num_of_h_tiles;
 };
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
index 35beefa..15459be 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
@@ -22,7 +22,6 @@
 #include "dpu_hw_pingpong.h"
 #include "dpu_hw_ctl.h"
 #include "dpu_hw_top.h"
-#include "dpu_hw_wb.h"
 #include "dpu_hw_cdm.h"
 #include "dpu_encoder.h"
 
@@ -303,61 +302,12 @@ struct dpu_encoder_phys_cmd {
 };
 
 /**
- * struct dpu_encoder_phys_wb - sub-class of dpu_encoder_phys to handle
- *	writeback specific operations
- * @base:		Baseclass physical encoder structure
- * @hw_wb:		Hardware interface to the wb registers
- * @irq_idx:		IRQ interface lookup index
- * @wbdone_timeout:	Timeout value for writeback done in msec
- * @bypass_irqreg:	Bypass irq register/unregister if non-zero
- * @wbdone_complete:	for wbdone irq synchronization
- * @wb_cfg:		Writeback hardware configuration
- * @cdp_cfg:		Writeback CDP configuration
- * @intf_cfg:		Interface hardware configuration
- * @wb_roi:		Writeback region-of-interest
- * @wb_fmt:		Writeback pixel format
- * @wb_fb:		Pointer to current writeback framebuffer
- * @wb_aspace:		Pointer to current writeback address space
- * @frame_count:	Counter of completed writeback operations
- * @kickoff_count:	Counter of issued writeback operations
- * @aspace:		address space identifier for non-secure/secure domain
- * @wb_dev:		Pointer to writeback device
- * @start_time:		Start time of writeback latest request
- * @end_time:		End time of writeback latest request
- * @bo_disable:		Buffer object(s) to use during the disabling state
- * @fb_disable:		Frame buffer to use during the disabling state
- */
-struct dpu_encoder_phys_wb {
-	struct dpu_encoder_phys base;
-	struct dpu_hw_wb *hw_wb;
-	int irq_idx;
-	struct dpu_irq_callback irq_cb;
-	u32 wbdone_timeout;
-	u32 bypass_irqreg;
-	struct completion wbdone_complete;
-	struct dpu_hw_wb_cfg wb_cfg;
-	struct dpu_hw_wb_cdp_cfg cdp_cfg;
-	struct dpu_hw_intf_cfg intf_cfg;
-	struct dpu_rect wb_roi;
-	const struct dpu_format *wb_fmt;
-	struct drm_framebuffer *wb_fb;
-	u32 frame_count;
-	u32 kickoff_count;
-	struct dpu_wb_device *wb_dev;
-	ktime_t start_time;
-	ktime_t end_time;
-	struct drm_gem_object *bo_disable[DPU_MAX_PLANES];
-	struct drm_framebuffer *fb_disable;
-};
-
-/**
  * struct dpu_enc_phys_init_params - initialization parameters for phys encs
  * @dpu_kms:		Pointer to the dpu_kms top level
  * @parent:		Pointer to the containing virtual encoder
  * @parent_ops:		Callbacks exposed by the parent to the phys_enc
  * @split_role:		Role to play in a split-panel configuration
  * @intf_idx:		Interface index this phys_enc will control
- * @wb_idx:		Writeback index this phys_enc will control
  * @enc_spinlock:	Virtual-Encoder-Wide Spin Lock for IRQ purposes
  */
 struct dpu_enc_phys_init_params {
@@ -366,7 +316,6 @@ struct dpu_enc_phys_init_params {
 	struct dpu_encoder_virt_ops parent_ops;
 	enum dpu_enc_split_role split_role;
 	enum dpu_intf intf_idx;
-	enum dpu_wb wb_idx;
 	spinlock_t *enc_spinlock;
 };
 
@@ -399,18 +348,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
 		struct dpu_enc_phys_init_params *p);
 
 /**
- * dpu_encoder_phys_wb_init - Construct a new writeback physical encoder
- * @p:	Pointer to init params structure
- * Return: Error code or newly allocated encoder
- */
-struct dpu_encoder_phys *dpu_encoder_phys_wb_init(
-		struct dpu_enc_phys_init_params *p);
-
-void dpu_encoder_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
-		struct drm_framebuffer *fb, const struct dpu_format *format,
-		struct dpu_rect *wb_roi);
-
-/**
  * dpu_encoder_helper_trigger_start - control start helper function
  *	This helper function may be optionally specified by physical
  *	encoders if they require ctl_start triggering.
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
deleted file mode 100644
index fd7b5ea..0000000
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
- * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
-#include <linux/debugfs.h>
-
-#include "dpu_encoder_phys.h"
-#include "dpu_formats.h"
-#include "dpu_hw_top.h"
-#include "dpu_hw_interrupts.h"
-#include "dpu_core_irq.h"
-#include "dpu_wb.h"
-#include "dpu_vbif.h"
-#include "dpu_crtc.h"
-
-#define to_dpu_encoder_phys_wb(x) \
-	container_of(x, struct dpu_encoder_phys_wb, base)
-
-#define WBID(wb_enc) ((wb_enc) ? wb_enc->wb_dev->wb_idx : -1)
-
-#define TO_S15D16(_x_)	((_x_) << 7)
-
-/**
- * dpu_rgb2yuv_601l - rgb to yuv color space conversion matrix
- *
- */
-static struct dpu_csc_cfg dpu_encoder_phys_wb_rgb2yuv_601l = {
-	{
-		TO_S15D16(0x0083), TO_S15D16(0x0102), TO_S15D16(0x0032),
-		TO_S15D16(0x1fb5), TO_S15D16(0x1f6c), TO_S15D16(0x00e1),
-		TO_S15D16(0x00e1), TO_S15D16(0x1f45), TO_S15D16(0x1fdc)
-	},
-	{ 0x00, 0x00, 0x00 },
-	{ 0x0040, 0x0200, 0x0200 },
-	{ 0x000, 0x3ff, 0x000, 0x3ff, 0x000, 0x3ff },
-	{ 0x040, 0x3ac, 0x040, 0x3c0, 0x040, 0x3c0 },
-};
-
-/**
- * dpu_encoder_phys_wb_is_master - report wb always as master encoder
- */
-static bool dpu_encoder_phys_wb_is_master(struct dpu_encoder_phys *phys_enc)
-{
-	return true;
-}
-
-/**
- * dpu_encoder_phys_wb_get_intr_type - get interrupt type based on block mode
- * @hw_wb:	Pointer to h/w writeback driver
- */
-static enum dpu_intr_type dpu_encoder_phys_wb_get_intr_type(
-		struct dpu_hw_wb *hw_wb)
-{
-	return (hw_wb->caps->features & BIT(DPU_WB_BLOCK_MODE)) ?
-			DPU_IRQ_TYPE_WB_ROT_COMP : DPU_IRQ_TYPE_WB_WFD_COMP;
-}
-
-/**
- * dpu_encoder_phys_wb_set_ot_limit - set OT limit for writeback interface
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_set_ot_limit(
-		struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	struct dpu_vbif_set_ot_params ot_params;
-
-	memset(&ot_params, 0, sizeof(ot_params));
-	ot_params.xin_id = hw_wb->caps->xin_id;
-	ot_params.num = hw_wb->idx - WB_0;
-	ot_params.width = wb_enc->wb_roi.w;
-	ot_params.height = wb_enc->wb_roi.h;
-	ot_params.is_wfd = true;
-	ot_params.frame_rate = phys_enc->cached_mode.vrefresh;
-	ot_params.vbif_idx = hw_wb->caps->vbif_idx;
-	ot_params.clk_ctrl = hw_wb->caps->clk_ctrl;
-	ot_params.rd = false;
-
-	dpu_vbif_set_ot_limit(phys_enc->dpu_kms, &ot_params);
-}
-
-/**
- * dpu_encoder_phys_wb_set_traffic_shaper - set traffic shaper for writeback
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_set_traffic_shaper(
-		struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb_cfg *wb_cfg = &wb_enc->wb_cfg;
-
-	/* traffic shaper is only enabled for rotator */
-	wb_cfg->ts_cfg.en = false;
-}
-
-/**
- * dpu_encoder_phys_wb_set_qos_remap - set QoS remapper for writeback
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_set_qos_remap(
-		struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc;
-	struct dpu_hw_wb *hw_wb;
-	struct drm_crtc *crtc;
-	struct dpu_vbif_set_qos_params qos_params;
-
-	if (!phys_enc || !phys_enc->parent || !phys_enc->parent->crtc) {
-		DPU_ERROR("invalid arguments\n");
-		return;
-	}
-
-	wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	crtc = phys_enc->parent->crtc;
-
-	if (!wb_enc->hw_wb || !wb_enc->hw_wb->caps) {
-		DPU_ERROR("invalid writeback hardware\n");
-		return;
-	}
-
-	hw_wb = wb_enc->hw_wb;
-
-	memset(&qos_params, 0, sizeof(qos_params));
-	qos_params.vbif_idx = hw_wb->caps->vbif_idx;
-	qos_params.xin_id = hw_wb->caps->xin_id;
-	qos_params.clk_ctrl = hw_wb->caps->clk_ctrl;
-	qos_params.num = hw_wb->idx - WB_0;
-	qos_params.is_rt = dpu_crtc_get_client_type(crtc) != NRT_CLIENT;
-
-	DPU_DEBUG("[qos_remap] wb:%d vbif:%d xin:%d rt:%d\n",
-			qos_params.num,
-			qos_params.vbif_idx,
-			qos_params.xin_id, qos_params.is_rt);
-
-	dpu_vbif_set_qos_remap(phys_enc->dpu_kms, &qos_params);
-}
-
-/**
- * dpu_encoder_phys_setup_cdm - setup chroma down block
- * @phys_enc:	Pointer to physical encoder
- * @fb:		Pointer to output framebuffer
- * @format:	Output format
- */
-void dpu_encoder_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
-		struct drm_framebuffer *fb, const struct dpu_format *format,
-		struct dpu_rect *wb_roi)
-{
-	struct dpu_hw_cdm *hw_cdm;
-	struct dpu_hw_cdm_cfg *cdm_cfg;
-	int ret;
-
-	if (!phys_enc || !format)
-		return;
-
-	cdm_cfg = &phys_enc->cdm_cfg;
-	hw_cdm = phys_enc->hw_cdm;
-	if (!hw_cdm)
-		return;
-
-	if (!DPU_FORMAT_IS_YUV(format)) {
-		DPU_DEBUG("[cdm_disable fmt:%x]\n",
-				format->base.pixel_format);
-
-		if (hw_cdm && hw_cdm->ops.disable)
-			hw_cdm->ops.disable(hw_cdm);
-
-		return;
-	}
-
-	memset(cdm_cfg, 0, sizeof(struct dpu_hw_cdm_cfg));
-
-	if (!wb_roi)
-		return;
-
-	cdm_cfg->output_width = wb_roi->w;
-	cdm_cfg->output_height = wb_roi->h;
-	cdm_cfg->output_fmt = format;
-	cdm_cfg->output_type = CDM_CDWN_OUTPUT_WB;
-	cdm_cfg->output_bit_depth = DPU_FORMAT_IS_DX(format) ?
-		CDM_CDWN_OUTPUT_10BIT : CDM_CDWN_OUTPUT_8BIT;
-
-	/* enable 10 bit logic */
-	switch (cdm_cfg->output_fmt->chroma_sample) {
-	case DPU_CHROMA_RGB:
-		cdm_cfg->h_cdwn_type = CDM_CDWN_DISABLE;
-		cdm_cfg->v_cdwn_type = CDM_CDWN_DISABLE;
-		break;
-	case DPU_CHROMA_H2V1:
-		cdm_cfg->h_cdwn_type = CDM_CDWN_COSITE;
-		cdm_cfg->v_cdwn_type = CDM_CDWN_DISABLE;
-		break;
-	case DPU_CHROMA_420:
-		cdm_cfg->h_cdwn_type = CDM_CDWN_COSITE;
-		cdm_cfg->v_cdwn_type = CDM_CDWN_OFFSITE;
-		break;
-	case DPU_CHROMA_H1V2:
-	default:
-		DPU_ERROR("unsupported chroma sampling type\n");
-		cdm_cfg->h_cdwn_type = CDM_CDWN_DISABLE;
-		cdm_cfg->v_cdwn_type = CDM_CDWN_DISABLE;
-		break;
-	}
-
-	DPU_DEBUG("[cdm_enable:%d,%d,%X,%d,%d,%d,%d]\n",
-			cdm_cfg->output_width,
-			cdm_cfg->output_height,
-			cdm_cfg->output_fmt->base.pixel_format,
-			cdm_cfg->output_type,
-			cdm_cfg->output_bit_depth,
-			cdm_cfg->h_cdwn_type,
-			cdm_cfg->v_cdwn_type);
-
-	if (hw_cdm && hw_cdm->ops.setup_csc_data) {
-		ret = hw_cdm->ops.setup_csc_data(hw_cdm,
-				&dpu_encoder_phys_wb_rgb2yuv_601l);
-		if (ret < 0) {
-			DPU_ERROR("failed to setup CSC %d\n", ret);
-			return;
-		}
-	}
-
-	if (hw_cdm && hw_cdm->ops.setup_cdwn) {
-		ret = hw_cdm->ops.setup_cdwn(hw_cdm, cdm_cfg);
-		if (ret < 0) {
-			DPU_ERROR("failed to setup CDM %d\n", ret);
-			return;
-		}
-	}
-
-	if (hw_cdm && hw_cdm->ops.enable) {
-		ret = hw_cdm->ops.enable(hw_cdm, cdm_cfg);
-		if (ret < 0) {
-			DPU_ERROR("failed to enable CDM %d\n", ret);
-			return;
-		}
-	}
-}
-
-/**
- * dpu_encoder_phys_wb_setup_fb - setup output framebuffer
- * @phys_enc:	Pointer to physical encoder
- * @fb:		Pointer to output framebuffer
- * @wb_roi:	Pointer to output region of interest
- */
-static void dpu_encoder_phys_wb_setup_fb(struct dpu_encoder_phys *phys_enc,
-		struct drm_framebuffer *fb, struct dpu_rect *wb_roi)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb;
-	struct dpu_hw_wb_cfg *wb_cfg;
-	struct dpu_hw_wb_cdp_cfg *cdp_cfg;
-	const struct msm_format *format;
-	int ret;
-	struct msm_gem_address_space *aspace;
-
-	if (!phys_enc || !phys_enc->dpu_kms || !phys_enc->dpu_kms->catalog ||
-			!phys_enc->connector) {
-		DPU_ERROR("invalid encoder\n");
-		return;
-	}
-
-	hw_wb = wb_enc->hw_wb;
-	wb_cfg = &wb_enc->wb_cfg;
-	cdp_cfg = &wb_enc->cdp_cfg;
-	memset(wb_cfg, 0, sizeof(struct dpu_hw_wb_cfg));
-
-	wb_cfg->intf_mode = phys_enc->intf_mode;
-
-	aspace = phys_enc->dpu_kms->base.aspace;
-
-	ret = msm_framebuffer_prepare(fb, aspace);
-	if (ret) {
-		DPU_ERROR("prep fb failed, %d\n", ret);
-		return;
-	}
-
-	/* cache framebuffer for cleanup in writeback done */
-	wb_enc->wb_fb = fb;
-
-	format = msm_framebuffer_format(fb);
-	if (!format) {
-		DPU_DEBUG("invalid format for fb\n");
-		return;
-	}
-
-	wb_cfg->dest.format = dpu_get_dpu_format_ext(
-			format->pixel_format,
-			fb->modifier);
-	if (!wb_cfg->dest.format) {
-		/* this error should be detected during atomic_check */
-		DPU_ERROR("failed to get format %x\n", format->pixel_format);
-		return;
-	}
-	wb_cfg->roi = *wb_roi;
-
-	if (hw_wb->caps->features & BIT(DPU_WB_XY_ROI_OFFSET)) {
-		ret = dpu_format_populate_layout(aspace, fb, &wb_cfg->dest);
-		if (ret) {
-			DPU_DEBUG("failed to populate layout %d\n", ret);
-			return;
-		}
-		wb_cfg->dest.width = fb->width;
-		wb_cfg->dest.height = fb->height;
-		wb_cfg->dest.num_planes = wb_cfg->dest.format->num_planes;
-	} else {
-		ret = dpu_format_populate_layout_with_roi(aspace, fb, wb_roi,
-			&wb_cfg->dest);
-		if (ret) {
-			/* this error should be detected during atomic_check */
-			DPU_DEBUG("failed to populate layout %d\n", ret);
-			return;
-		}
-	}
-
-	if ((wb_cfg->dest.format->fetch_planes == DPU_PLANE_PLANAR) &&
-			(wb_cfg->dest.format->element[0] == C1_B_Cb))
-		swap(wb_cfg->dest.plane_addr[1], wb_cfg->dest.plane_addr[2]);
-
-	DPU_DEBUG("[fb_offset:%8.8x,%8.8x,%8.8x,%8.8x]\n",
-			wb_cfg->dest.plane_addr[0],
-			wb_cfg->dest.plane_addr[1],
-			wb_cfg->dest.plane_addr[2],
-			wb_cfg->dest.plane_addr[3]);
-	DPU_DEBUG("[fb_stride:%8.8x,%8.8x,%8.8x,%8.8x]\n",
-			wb_cfg->dest.plane_pitch[0],
-			wb_cfg->dest.plane_pitch[1],
-			wb_cfg->dest.plane_pitch[2],
-			wb_cfg->dest.plane_pitch[3]);
-
-	if (hw_wb->ops.setup_roi)
-		hw_wb->ops.setup_roi(hw_wb, wb_cfg);
-
-	if (hw_wb->ops.setup_outformat)
-		hw_wb->ops.setup_outformat(hw_wb, wb_cfg);
-
-	if (hw_wb->ops.setup_cdp) {
-		memset(cdp_cfg, 0, sizeof(struct dpu_hw_wb_cdp_cfg));
-
-		cdp_cfg->enable = phys_enc->dpu_kms->catalog->perf.cdp_cfg
-				[DPU_PERF_CDP_USAGE_NRT].wr_enable;
-		cdp_cfg->ubwc_meta_enable =
-				DPU_FORMAT_IS_UBWC(wb_cfg->dest.format);
-		cdp_cfg->tile_amortize_enable =
-				DPU_FORMAT_IS_UBWC(wb_cfg->dest.format) ||
-				DPU_FORMAT_IS_TILE(wb_cfg->dest.format);
-		cdp_cfg->preload_ahead = DPU_WB_CDP_PRELOAD_AHEAD_64;
-
-		hw_wb->ops.setup_cdp(hw_wb, cdp_cfg);
-	}
-
-	if (hw_wb->ops.setup_outaddress) {
-		DPU_EVT32(hw_wb->idx,
-				wb_cfg->dest.width,
-				wb_cfg->dest.height,
-				wb_cfg->dest.plane_addr[0],
-				wb_cfg->dest.plane_size[0],
-				wb_cfg->dest.plane_addr[1],
-				wb_cfg->dest.plane_size[1],
-				wb_cfg->dest.plane_addr[2],
-				wb_cfg->dest.plane_size[2],
-				wb_cfg->dest.plane_addr[3],
-				wb_cfg->dest.plane_size[3]);
-		hw_wb->ops.setup_outaddress(hw_wb, wb_cfg);
-	}
-}
-
-/**
- * dpu_encoder_phys_wb_setup_cdp - setup chroma down prefetch block
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_setup_cdp(struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	struct dpu_hw_intf_cfg *intf_cfg = &wb_enc->intf_cfg;
-
-	memset(intf_cfg, 0, sizeof(struct dpu_hw_intf_cfg));
-
-	intf_cfg->intf = DPU_NONE;
-	intf_cfg->wb = hw_wb->idx;
-	intf_cfg->mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
-
-	if (phys_enc->hw_ctl && phys_enc->hw_ctl->ops.setup_intf_cfg)
-		phys_enc->hw_ctl->ops.setup_intf_cfg(phys_enc->hw_ctl,
-				intf_cfg);
-}
-
-/**
- * dpu_encoder_phys_wb_atomic_check - verify and fixup given atomic states
- * @phys_enc:	Pointer to physical encoder
- * @crtc_state:	Pointer to CRTC atomic state
- * @conn_state:	Pointer to connector atomic state
- */
-static int dpu_encoder_phys_wb_atomic_check(
-		struct dpu_encoder_phys *phys_enc,
-		struct drm_crtc_state *crtc_state,
-		struct drm_connector_state *conn_state)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	const struct dpu_wb_cfg *wb_cfg = hw_wb->caps;
-	struct drm_framebuffer *fb;
-	const struct dpu_format *fmt;
-	struct dpu_rect wb_roi;
-	const struct drm_display_mode *mode = &crtc_state->mode;
-	int rc;
-
-	DPU_DEBUG("[atomic_check:%d,%d,\"%s\",%d,%d]\n",
-			hw_wb->idx - WB_0, mode->base.id, mode->name,
-			mode->hdisplay, mode->vdisplay);
-
-	if (!conn_state || !conn_state->connector) {
-		DPU_ERROR("invalid connector state\n");
-		return -EINVAL;
-	} else if (conn_state->connector->status !=
-			connector_status_connected) {
-		DPU_ERROR("connector not connected %d\n",
-				conn_state->connector->status);
-		return -EINVAL;
-	}
-
-	memset(&wb_roi, 0, sizeof(struct dpu_rect));
-
-	rc = dpu_wb_connector_state_get_output_roi(conn_state, &wb_roi);
-	if (rc) {
-		DPU_ERROR("failed to get roi %d\n", rc);
-		return rc;
-	}
-
-	DPU_DEBUG("[roi:%u,%u,%u,%u]\n", wb_roi.x, wb_roi.y,
-			wb_roi.w, wb_roi.h);
-
-	fb = dpu_wb_connector_state_get_output_fb(conn_state);
-	if (!fb) {
-		DPU_ERROR("no output framebuffer\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("[fb_id:%u][fb:%u,%u]\n", fb->base.id,
-			fb->width, fb->height);
-
-	fmt = dpu_get_dpu_format_ext(fb->format->format, fb->modifier);
-	if (!fmt) {
-		DPU_ERROR("unsupported output pixel format:%x\n",
-				fb->format->format);
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("[fb_fmt:%x,%llx]\n", fb->format->format,
-			fb->modifier);
-
-	if (DPU_FORMAT_IS_YUV(fmt) &&
-			!(wb_cfg->features & BIT(DPU_WB_YUV_CONFIG))) {
-		DPU_ERROR("invalid output format %x\n", fmt->base.pixel_format);
-		return -EINVAL;
-	}
-
-	if (DPU_FORMAT_IS_UBWC(fmt) &&
-			!(wb_cfg->features & BIT(DPU_WB_UBWC))) {
-		DPU_ERROR("invalid output format %x\n", fmt->base.pixel_format);
-		return -EINVAL;
-	}
-
-	if (DPU_FORMAT_IS_YUV(fmt) != !!phys_enc->hw_cdm)
-		crtc_state->mode_changed = true;
-
-	if (wb_roi.w && wb_roi.h) {
-		if (wb_roi.w != mode->hdisplay) {
-			DPU_ERROR("invalid roi w=%d, mode w=%d\n", wb_roi.w,
-					mode->hdisplay);
-			return -EINVAL;
-		} else if (wb_roi.h != mode->vdisplay) {
-			DPU_ERROR("invalid roi h=%d, mode h=%d\n", wb_roi.h,
-					mode->vdisplay);
-			return -EINVAL;
-		} else if (wb_roi.x + wb_roi.w > fb->width) {
-			DPU_ERROR("invalid roi x=%d, w=%d, fb w=%d\n",
-					wb_roi.x, wb_roi.w, fb->width);
-			return -EINVAL;
-		} else if (wb_roi.y + wb_roi.h > fb->height) {
-			DPU_ERROR("invalid roi y=%d, h=%d, fb h=%d\n",
-					wb_roi.y, wb_roi.h, fb->height);
-			return -EINVAL;
-		} else if (wb_roi.w > wb_cfg->sblk->maxlinewidth) {
-			DPU_ERROR("invalid roi w=%d, maxlinewidth=%u\n",
-					wb_roi.w, wb_cfg->sblk->maxlinewidth);
-			return -EINVAL;
-		}
-	} else {
-		if (wb_roi.x || wb_roi.y) {
-			DPU_ERROR("invalid roi x=%d, y=%d\n",
-					wb_roi.x, wb_roi.y);
-			return -EINVAL;
-		} else if (fb->width != mode->hdisplay) {
-			DPU_ERROR("invalid fb w=%d, mode w=%d\n", fb->width,
-					mode->hdisplay);
-			return -EINVAL;
-		} else if (fb->height != mode->vdisplay) {
-			DPU_ERROR("invalid fb h=%d, mode h=%d\n", fb->height,
-					mode->vdisplay);
-			return -EINVAL;
-		} else if (fb->width > wb_cfg->sblk->maxlinewidth) {
-			DPU_ERROR("invalid fb w=%d, maxlinewidth=%u\n",
-					fb->width, wb_cfg->sblk->maxlinewidth);
-			return -EINVAL;
-		}
-	}
-
-	return 0;
-}
-
-/**
- * _dpu_encoder_phys_wb_update_flush - flush hardware update
- * @phys_enc:	Pointer to physical encoder
- */
-static void _dpu_encoder_phys_wb_update_flush(struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb;
-	struct dpu_hw_ctl *hw_ctl;
-	struct dpu_hw_cdm *hw_cdm;
-	u32 flush_mask = 0;
-
-	if (!phys_enc)
-		return;
-
-	hw_wb = wb_enc->hw_wb;
-	hw_ctl = phys_enc->hw_ctl;
-	hw_cdm = phys_enc->hw_cdm;
-
-	DPU_DEBUG("[wb:%d]\n", hw_wb->idx - WB_0);
-
-	if (!hw_ctl) {
-		DPU_DEBUG("[wb:%d] no ctl assigned\n", hw_wb->idx - WB_0);
-		return;
-	}
-
-	if (hw_ctl->ops.get_bitmask_wb)
-		hw_ctl->ops.get_bitmask_wb(hw_ctl, &flush_mask, hw_wb->idx);
-
-	if (hw_ctl->ops.get_bitmask_cdm && hw_cdm)
-		hw_ctl->ops.get_bitmask_cdm(hw_ctl, &flush_mask, hw_cdm->idx);
-
-	if (hw_ctl->ops.update_pending_flush)
-		hw_ctl->ops.update_pending_flush(hw_ctl, flush_mask);
-
-	if (hw_ctl->ops.get_pending_flush)
-		flush_mask = hw_ctl->ops.get_pending_flush(hw_ctl);
-
-	DPU_DEBUG("Pending flush mask for CTL_%d is 0x%x, WB %d\n",
-			hw_ctl->idx - CTL_0, flush_mask, hw_wb->idx - WB_0);
-}
-
-/**
- * dpu_encoder_phys_wb_setup - setup writeback encoder
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_setup(
-		struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	struct drm_display_mode mode = phys_enc->cached_mode;
-	struct drm_framebuffer *fb;
-	struct dpu_rect *wb_roi = &wb_enc->wb_roi;
-
-	DPU_DEBUG("[mode_set:%d,%d,\"%s\",%d,%d]\n",
-			hw_wb->idx - WB_0, mode.base.id, mode.name,
-			mode.hdisplay, mode.vdisplay);
-
-	memset(wb_roi, 0, sizeof(struct dpu_rect));
-
-	/* clear writeback framebuffer - will be updated in setup_fb */
-	wb_enc->wb_fb = NULL;
-
-	if (phys_enc->enable_state == DPU_ENC_DISABLING) {
-		fb = wb_enc->fb_disable;
-		wb_roi->w = 0;
-		wb_roi->h = 0;
-	} else {
-		fb = dpu_wb_get_output_fb(wb_enc->wb_dev);
-		dpu_wb_get_output_roi(wb_enc->wb_dev, wb_roi);
-	}
-
-	if (!fb) {
-		DPU_DEBUG("no output framebuffer\n");
-		return;
-	}
-
-	DPU_DEBUG("[fb_id:%u][fb:%u,%u]\n", fb->base.id,
-			fb->width, fb->height);
-
-	if (wb_roi->w == 0 || wb_roi->h == 0) {
-		wb_roi->x = 0;
-		wb_roi->y = 0;
-		wb_roi->w = fb->width;
-		wb_roi->h = fb->height;
-	}
-
-	DPU_DEBUG("[roi:%u,%u,%u,%u]\n", wb_roi->x, wb_roi->y,
-			wb_roi->w, wb_roi->h);
-
-	wb_enc->wb_fmt = dpu_get_dpu_format_ext(fb->format->format,
-							fb->modifier);
-	if (!wb_enc->wb_fmt) {
-		DPU_ERROR("unsupported output pixel format: %d\n",
-				fb->format->format);
-		return;
-	}
-
-	DPU_DEBUG("[fb_fmt:%x,%llx]\n", fb->format->format,
-			fb->modifier);
-
-	dpu_encoder_phys_wb_set_ot_limit(phys_enc);
-
-	dpu_encoder_phys_wb_set_traffic_shaper(phys_enc);
-
-	dpu_encoder_phys_wb_set_qos_remap(phys_enc);
-
-	dpu_encoder_phys_setup_cdm(phys_enc, fb, wb_enc->wb_fmt, wb_roi);
-
-	dpu_encoder_phys_wb_setup_fb(phys_enc, fb, wb_roi);
-
-	dpu_encoder_phys_wb_setup_cdp(phys_enc);
-}
-
-/**
- * dpu_encoder_phys_wb_unregister_irq - unregister writeback interrupt handler
- * @phys_enc:	Pointer to physical encoder
- */
-static int dpu_encoder_phys_wb_unregister_irq(
-		struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-
-	if (wb_enc->bypass_irqreg)
-		return 0;
-
-	dpu_core_irq_disable(phys_enc->dpu_kms, &wb_enc->irq_idx, 1);
-	dpu_core_irq_unregister_callback(phys_enc->dpu_kms, wb_enc->irq_idx,
-			&wb_enc->irq_cb);
-
-	DPU_DEBUG("un-register IRQ for wb %d, irq_idx=%d\n",
-			hw_wb->idx - WB_0,
-			wb_enc->irq_idx);
-
-	return 0;
-}
-
-/**
- * dpu_encoder_phys_wb_done_irq - writeback interrupt handler
- * @arg:	Pointer to writeback encoder
- * @irq_idx:	interrupt index
- */
-static void dpu_encoder_phys_wb_done_irq(void *arg, int irq_idx)
-{
-	struct dpu_encoder_phys_wb *wb_enc = arg;
-	struct dpu_encoder_phys *phys_enc = &wb_enc->base;
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	u32 event = 0;
-
-	DPU_DEBUG("[wb:%d,%u]\n", hw_wb->idx - WB_0,
-			wb_enc->frame_count);
-
-	/* don't notify upper layer for internal commit */
-	if (phys_enc->enable_state == DPU_ENC_DISABLING)
-		goto complete;
-
-	event = DPU_ENCODER_FRAME_EVENT_DONE;
-
-	if (phys_enc->parent_ops.handle_frame_done)
-		phys_enc->parent_ops.handle_frame_done(phys_enc->parent,
-				phys_enc, event);
-
-	if (phys_enc->parent_ops.handle_vblank_virt)
-		phys_enc->parent_ops.handle_vblank_virt(phys_enc->parent,
-				phys_enc);
-
-	DPU_EVT32_IRQ(DRMID(phys_enc->parent), hw_wb->idx - WB_0, event);
-
-complete:
-	complete_all(&wb_enc->wbdone_complete);
-}
-
-/**
- * dpu_encoder_phys_wb_register_irq - register writeback interrupt handler
- * @phys_enc:	Pointer to physical encoder
- */
-static int dpu_encoder_phys_wb_register_irq(struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	struct dpu_irq_callback *irq_cb = &wb_enc->irq_cb;
-	enum dpu_intr_type intr_type;
-	int ret = 0;
-
-	if (wb_enc->bypass_irqreg)
-		return 0;
-
-	intr_type = dpu_encoder_phys_wb_get_intr_type(hw_wb);
-	wb_enc->irq_idx = dpu_core_irq_idx_lookup(phys_enc->dpu_kms,
-			intr_type, hw_wb->idx);
-	if (wb_enc->irq_idx < 0) {
-		DPU_ERROR(
-			"failed to lookup IRQ index for WB_DONE with wb=%d\n",
-			hw_wb->idx - WB_0);
-		return -EINVAL;
-	}
-
-	irq_cb->func = dpu_encoder_phys_wb_done_irq;
-	irq_cb->arg = wb_enc;
-	ret = dpu_core_irq_register_callback(phys_enc->dpu_kms,
-			wb_enc->irq_idx, irq_cb);
-	if (ret) {
-		DPU_ERROR("failed to register IRQ callback WB_DONE\n");
-		return ret;
-	}
-
-	ret = dpu_core_irq_enable(phys_enc->dpu_kms, &wb_enc->irq_idx, 1);
-	if (ret) {
-		DPU_ERROR(
-			"failed to enable IRQ for WB_DONE, wb %d, irq_idx=%d\n",
-				hw_wb->idx - WB_0,
-				wb_enc->irq_idx);
-		wb_enc->irq_idx = -EINVAL;
-
-		/* Unregister callback on IRQ enable failure */
-		dpu_core_irq_unregister_callback(phys_enc->dpu_kms,
-				wb_enc->irq_idx, irq_cb);
-		return ret;
-	}
-
-	DPU_DEBUG("registered IRQ for wb %d, irq_idx=%d\n",
-			hw_wb->idx - WB_0,
-			wb_enc->irq_idx);
-
-	return ret;
-}
-
-/**
- * dpu_encoder_phys_wb_mode_set - set display mode
- * @phys_enc:	Pointer to physical encoder
- * @mode:	Pointer to requested display mode
- * @adj_mode:	Pointer to adjusted display mode
- */
-static void dpu_encoder_phys_wb_mode_set(
-		struct dpu_encoder_phys *phys_enc,
-		struct drm_display_mode *mode,
-		struct drm_display_mode *adj_mode)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_rm *rm = &phys_enc->dpu_kms->rm;
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	struct dpu_rm_hw_iter iter;
-	int i, instance;
-
-	phys_enc->cached_mode = *adj_mode;
-	instance = phys_enc->split_role == ENC_ROLE_SLAVE ? 1 : 0;
-
-	DPU_DEBUG("[mode_set_cache:%d,%d,\"%s\",%d,%d]\n",
-			hw_wb->idx - WB_0, mode->base.id,
-			mode->name, mode->hdisplay, mode->vdisplay);
-
-	phys_enc->hw_ctl = NULL;
-	phys_enc->hw_cdm = NULL;
-
-	/* Retrieve previously allocated HW Resources. CTL shouldn't fail */
-	dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_CTL);
-	for (i = 0; i <= instance; i++) {
-		dpu_rm_get_hw(rm, &iter);
-		if (i == instance)
-			phys_enc->hw_ctl = (struct dpu_hw_ctl *) iter.hw;
-	}
-
-	if (IS_ERR_OR_NULL(phys_enc->hw_ctl)) {
-		DPU_ERROR("failed init ctl: %ld\n", PTR_ERR(phys_enc->hw_ctl));
-		phys_enc->hw_ctl = NULL;
-		return;
-	}
-
-	/* CDM is optional */
-	dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_CDM);
-	for (i = 0; i <= instance; i++) {
-		dpu_rm_get_hw(rm, &iter);
-		if (i == instance)
-			phys_enc->hw_cdm = (struct dpu_hw_cdm *) iter.hw;
-	}
-
-	if (IS_ERR(phys_enc->hw_cdm)) {
-		DPU_ERROR("CDM required but not allocated: %ld\n",
-				PTR_ERR(phys_enc->hw_cdm));
-		phys_enc->hw_ctl = NULL;
-	}
-}
-
-/**
- * dpu_encoder_phys_wb_wait_for_commit_done - wait until request is committed
- * @phys_enc:	Pointer to physical encoder
- */
-static int dpu_encoder_phys_wb_wait_for_commit_done(
-		struct dpu_encoder_phys *phys_enc)
-{
-	unsigned long ret;
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	u32 irq_status, event = 0;
-	u64 wb_time = 0;
-	int rc = 0;
-	u32 timeout = max_t(u32, wb_enc->wbdone_timeout, KICKOFF_TIMEOUT_MS);
-
-	/* Return EWOULDBLOCK since we know the wait isn't necessary */
-	if (phys_enc->enable_state == DPU_ENC_DISABLED) {
-		DPU_ERROR("encoder already disabled\n");
-		return -EWOULDBLOCK;
-	}
-
-	DPU_EVT32(DRMID(phys_enc->parent), WBID(wb_enc), wb_enc->frame_count);
-
-	ret = wait_for_completion_timeout(&wb_enc->wbdone_complete,
-			msecs_to_jiffies(timeout));
-
-	if (!ret) {
-		DPU_EVT32(DRMID(phys_enc->parent), WBID(wb_enc),
-				wb_enc->frame_count);
-		irq_status = dpu_core_irq_read(phys_enc->dpu_kms,
-				wb_enc->irq_idx, true);
-		if (irq_status) {
-			DPU_DEBUG("wb:%d done but irq not triggered\n",
-					wb_enc->wb_dev->wb_idx - WB_0);
-			dpu_encoder_phys_wb_done_irq(wb_enc, wb_enc->irq_idx);
-		} else {
-			DPU_ERROR("wb:%d kickoff timed out\n",
-					wb_enc->wb_dev->wb_idx - WB_0);
-
-			event = DPU_ENCODER_FRAME_EVENT_ERROR;
-			if (phys_enc->parent_ops.handle_frame_done)
-				phys_enc->parent_ops.handle_frame_done(
-					phys_enc->parent, phys_enc, event);
-			rc = -ETIMEDOUT;
-		}
-	}
-
-	dpu_encoder_phys_wb_unregister_irq(phys_enc);
-
-	if (!rc)
-		wb_enc->end_time = ktime_get();
-
-	/* once operation is done, disable traffic shaper */
-	if (wb_enc->wb_cfg.ts_cfg.en && wb_enc->hw_wb &&
-			wb_enc->hw_wb->ops.setup_trafficshaper) {
-		wb_enc->wb_cfg.ts_cfg.en = false;
-		wb_enc->hw_wb->ops.setup_trafficshaper(
-				wb_enc->hw_wb, &wb_enc->wb_cfg);
-	}
-
-	/* remove vote for iommu/clk/bus */
-	wb_enc->frame_count++;
-
-	if (!rc) {
-		wb_time = (u64)ktime_to_us(wb_enc->end_time) -
-				(u64)ktime_to_us(wb_enc->start_time);
-		DPU_DEBUG("wb:%d took %llu us\n",
-			wb_enc->wb_dev->wb_idx - WB_0, wb_time);
-	}
-
-	/* cleanup writeback framebuffer */
-	if (wb_enc->wb_fb) {
-		msm_framebuffer_cleanup(wb_enc->wb_fb,
-			phys_enc->dpu_kms->base.aspace);
-		wb_enc->wb_fb = NULL;
-	}
-
-	DPU_EVT32(DRMID(phys_enc->parent), WBID(wb_enc), wb_enc->frame_count,
-			wb_time, event, rc);
-
-	return rc;
-}
-
-/**
- * dpu_encoder_phys_wb_prepare_for_kickoff - pre-kickoff processing
- * @phys_enc:	Pointer to physical encoder
- * @params:	kickoff parameters
- */
-static void dpu_encoder_phys_wb_prepare_for_kickoff(
-		struct dpu_encoder_phys *phys_enc,
-		struct dpu_encoder_kickoff_params *params)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	int ret;
-
-	DPU_DEBUG("[wb:%d,%u]\n", wb_enc->hw_wb->idx - WB_0,
-			wb_enc->kickoff_count);
-
-	reinit_completion(&wb_enc->wbdone_complete);
-
-	ret = dpu_encoder_phys_wb_register_irq(phys_enc);
-	if (ret) {
-		DPU_ERROR("failed to register irq %d\n", ret);
-		return;
-	}
-
-	wb_enc->kickoff_count++;
-
-	/* set OT limit & enable traffic shaper */
-	dpu_encoder_phys_wb_setup(phys_enc);
-
-	_dpu_encoder_phys_wb_update_flush(phys_enc);
-
-	/* vote for iommu/clk/bus */
-	wb_enc->start_time = ktime_get();
-
-	DPU_EVT32(DRMID(phys_enc->parent), WBID(wb_enc), wb_enc->kickoff_count);
-}
-
-/**
- * dpu_encoder_phys_wb_handle_post_kickoff - post-kickoff processing
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_handle_post_kickoff(
-		struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-
-	DPU_DEBUG("[wb:%d]\n", wb_enc->hw_wb->idx - WB_0);
-
-	DPU_EVT32(DRMID(phys_enc->parent), WBID(wb_enc));
-}
-
-/**
- * _dpu_encoder_phys_wb_init_internal_fb - create fb for internal commit
- * @wb_enc:		Pointer to writeback encoder
- * @pixel_format:	DRM pixel format
- * @width:		Desired fb width
- * @height:		Desired fb height
- * @pitch:		Desired fb pitch
- */
-static int _dpu_encoder_phys_wb_init_internal_fb(
-		struct dpu_encoder_phys_wb *wb_enc,
-		uint32_t pixel_format, uint32_t width,
-		uint32_t height, uint32_t pitch)
-{
-	struct drm_device *dev;
-	struct drm_framebuffer *fb;
-	struct drm_mode_fb_cmd2 mode_cmd;
-	uint32_t size;
-	int nplanes, i, ret;
-	struct msm_gem_address_space *aspace;
-
-	if (!wb_enc || !wb_enc->base.parent || !wb_enc->base.dpu_kms) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	aspace = wb_enc->base.dpu_kms->base.aspace;
-	if (!aspace) {
-		DPU_ERROR("invalid address space\n");
-		return -EINVAL;
-	}
-
-	dev = wb_enc->base.dpu_kms->dev;
-	if (!dev) {
-		DPU_ERROR("invalid dev\n");
-		return -EINVAL;
-	}
-
-	memset(&mode_cmd, 0, sizeof(mode_cmd));
-	mode_cmd.pixel_format = pixel_format;
-	mode_cmd.width = width;
-	mode_cmd.height = height;
-	mode_cmd.pitches[0] = pitch;
-
-	size = dpu_format_get_framebuffer_size(pixel_format,
-			mode_cmd.width, mode_cmd.height,
-			mode_cmd.pitches, 0);
-	if (!size) {
-		DPU_DEBUG("not creating zero size buffer\n");
-		return -EINVAL;
-	}
-
-	/* allocate gem tracking object */
-	nplanes = drm_format_num_planes(pixel_format);
-	if (nplanes > DPU_MAX_PLANES) {
-		DPU_ERROR("requested format has too many planes\n");
-		return -EINVAL;
-	}
-	mutex_lock(&dev->struct_mutex);
-	wb_enc->bo_disable[0] = msm_gem_new(dev, size,
-			MSM_BO_SCANOUT | MSM_BO_WC);
-	mutex_unlock(&dev->struct_mutex);
-
-	if (IS_ERR_OR_NULL(wb_enc->bo_disable[0])) {
-		ret = PTR_ERR(wb_enc->bo_disable[0]);
-		wb_enc->bo_disable[0] = NULL;
-
-		DPU_ERROR("failed to create bo, %d\n", ret);
-		return ret;
-	}
-
-	for (i = 0; i < nplanes; ++i) {
-		wb_enc->bo_disable[i] = wb_enc->bo_disable[0];
-		mode_cmd.pitches[i] = width *
-			drm_format_plane_cpp(pixel_format, i);
-	}
-
-	fb = msm_framebuffer_init(dev, &mode_cmd, wb_enc->bo_disable);
-	if (IS_ERR_OR_NULL(fb)) {
-		ret = PTR_ERR(fb);
-		drm_gem_object_put(wb_enc->bo_disable[0]);
-		wb_enc->bo_disable[0] = NULL;
-
-		DPU_ERROR("failed to init fb, %d\n", ret);
-		return ret;
-	}
-
-	/* prepare the backing buffer now so that it's available later */
-	ret = msm_framebuffer_prepare(fb, aspace);
-	if (!ret)
-		wb_enc->fb_disable = fb;
-	return ret;
-}
-
-/**
- * _dpu_encoder_phys_wb_destroy_internal_fb - deconstruct internal fb
- * @wb_enc:		Pointer to writeback encoder
- */
-static void _dpu_encoder_phys_wb_destroy_internal_fb(
-		struct dpu_encoder_phys_wb *wb_enc)
-{
-	if (!wb_enc)
-		return;
-
-	if (wb_enc->fb_disable) {
-		drm_framebuffer_unregister_private(wb_enc->fb_disable);
-		drm_framebuffer_remove(wb_enc->fb_disable);
-		wb_enc->fb_disable = NULL;
-	}
-
-	if (wb_enc->bo_disable[0]) {
-		drm_gem_object_put(wb_enc->bo_disable[0]);
-		wb_enc->bo_disable[0] = NULL;
-	}
-}
-
-/**
- * dpu_encoder_phys_wb_enable - enable writeback encoder
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_enable(struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-	struct drm_device *dev;
-	struct drm_connector *connector;
-
-	DPU_DEBUG("[wb:%d]\n", hw_wb->idx - WB_0);
-
-	if (!wb_enc->base.parent || !wb_enc->base.parent->dev) {
-		DPU_ERROR("invalid drm device\n");
-		return;
-	}
-	dev = wb_enc->base.parent->dev;
-
-	/* find associated writeback connector */
-	connector = phys_enc->connector;
-
-	if (!connector || connector->encoder != phys_enc->parent) {
-		DPU_ERROR("failed to find writeback connector\n");
-		return;
-	}
-	wb_enc->wb_dev = dpu_wb_connector_get_wb(connector);
-
-	phys_enc->enable_state = DPU_ENC_ENABLED;
-}
-
-/**
- * dpu_encoder_phys_wb_disable - disable writeback encoder
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_disable(struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-
-	DPU_DEBUG("[wb:%d]\n", hw_wb->idx - WB_0);
-
-	if (phys_enc->enable_state == DPU_ENC_DISABLED) {
-		DPU_ERROR("encoder is already disabled\n");
-		return;
-	}
-
-	if (wb_enc->frame_count != wb_enc->kickoff_count) {
-		DPU_DEBUG("[wait_for_done: wb:%d, frame:%u, kickoff:%u]\n",
-				hw_wb->idx - WB_0, wb_enc->frame_count,
-				wb_enc->kickoff_count);
-		dpu_encoder_phys_wb_wait_for_commit_done(phys_enc);
-	}
-
-	if (!phys_enc->hw_ctl || !phys_enc->parent ||
-			!phys_enc->dpu_kms || !wb_enc->fb_disable) {
-		DPU_DEBUG("invalid enc, skipping extra commit\n");
-		goto exit;
-	}
-
-	/* reset h/w before final flush */
-	if (dpu_encoder_helper_hw_release(phys_enc, wb_enc->fb_disable))
-		goto exit;
-
-	phys_enc->enable_state = DPU_ENC_DISABLING;
-	dpu_encoder_phys_wb_prepare_for_kickoff(phys_enc, NULL);
-	if (phys_enc->hw_ctl->ops.trigger_flush)
-		phys_enc->hw_ctl->ops.trigger_flush(phys_enc->hw_ctl);
-	dpu_encoder_helper_trigger_start(phys_enc);
-	dpu_encoder_phys_wb_wait_for_commit_done(phys_enc);
-exit:
-	phys_enc->enable_state = DPU_ENC_DISABLED;
-}
-
-/**
- * dpu_encoder_phys_wb_get_hw_resources - get hardware resources
- * @phys_enc:	Pointer to physical encoder
- * @hw_res:	Pointer to encoder resources
- */
-static void dpu_encoder_phys_wb_get_hw_resources(
-		struct dpu_encoder_phys *phys_enc,
-		struct dpu_encoder_hw_resources *hw_res,
-		struct drm_connector_state *conn_state)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb;
-	struct drm_framebuffer *fb;
-	const struct dpu_format *fmt;
-
-	if (!phys_enc) {
-		DPU_ERROR("invalid encoder\n");
-		return;
-	}
-
-	fb = dpu_wb_connector_state_get_output_fb(conn_state);
-	if (!fb) {
-		DPU_ERROR("no output framebuffer\n");
-		return;
-	}
-
-	fmt = dpu_get_dpu_format_ext(fb->format->format, fb->modifier);
-	if (!fmt) {
-		DPU_ERROR("unsupported output pixel format:%d\n",
-				fb->format->format);
-		return;
-	}
-
-	hw_wb = wb_enc->hw_wb;
-	hw_res->wbs[hw_wb->idx - WB_0] = phys_enc->intf_mode;
-	hw_res->needs_cdm = DPU_FORMAT_IS_YUV(fmt);
-	DPU_DEBUG("[wb:%d] intf_mode=%d needs_cdm=%d\n", hw_wb->idx - WB_0,
-			hw_res->wbs[hw_wb->idx - WB_0],
-			hw_res->needs_cdm);
-}
-
-#ifdef CONFIG_DEBUG_FS
-/**
- * dpu_encoder_phys_wb_init_debugfs - initialize writeback encoder debugfs
- * @phys_enc:		Pointer to physical encoder
- * @debugfs_root:	Pointer to virtual encoder's debugfs_root dir
- */
-static int dpu_encoder_phys_wb_init_debugfs(
-		struct dpu_encoder_phys *phys_enc, struct dentry *debugfs_root)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-
-	if (!phys_enc || !wb_enc->hw_wb || !debugfs_root)
-		return -EINVAL;
-
-	if (!debugfs_create_u32("wbdone_timeout", 0600,
-			debugfs_root, &wb_enc->wbdone_timeout)) {
-		DPU_ERROR("failed to create debugfs/wbdone_timeout\n");
-		return -ENOMEM;
-	}
-
-	if (!debugfs_create_u32("bypass_irqreg", 0600,
-			debugfs_root, &wb_enc->bypass_irqreg)) {
-		DPU_ERROR("failed to create debugfs/bypass_irqreg\n");
-		return -ENOMEM;
-	}
-
-	return 0;
-}
-#else
-static int dpu_encoder_phys_wb_init_debugfs(
-		struct dpu_encoder_phys *phys_enc, struct dentry *debugfs_root)
-{
-	return 0;
-}
-#endif
-
-static int dpu_encoder_phys_wb_late_register(struct dpu_encoder_phys *phys_enc,
-		struct dentry *debugfs_root)
-{
-	return dpu_encoder_phys_wb_init_debugfs(phys_enc, debugfs_root);
-}
-
-/**
- * dpu_encoder_phys_wb_destroy - destroy writeback encoder
- * @phys_enc:	Pointer to physical encoder
- */
-static void dpu_encoder_phys_wb_destroy(struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
-	struct dpu_hw_wb *hw_wb = wb_enc->hw_wb;
-
-	DPU_DEBUG("[wb:%d]\n", hw_wb->idx - WB_0);
-
-	if (!phys_enc)
-		return;
-
-	_dpu_encoder_phys_wb_destroy_internal_fb(wb_enc);
-
-	kfree(wb_enc);
-}
-
-/**
- * dpu_encoder_phys_wb_init_ops - initialize writeback operations
- * @ops:	Pointer to encoder operation table
- */
-static void dpu_encoder_phys_wb_init_ops(struct dpu_encoder_phys_ops *ops)
-{
-	ops->late_register = dpu_encoder_phys_wb_late_register;
-	ops->is_master = dpu_encoder_phys_wb_is_master;
-	ops->mode_set = dpu_encoder_phys_wb_mode_set;
-	ops->enable = dpu_encoder_phys_wb_enable;
-	ops->disable = dpu_encoder_phys_wb_disable;
-	ops->destroy = dpu_encoder_phys_wb_destroy;
-	ops->atomic_check = dpu_encoder_phys_wb_atomic_check;
-	ops->get_hw_resources = dpu_encoder_phys_wb_get_hw_resources;
-	ops->wait_for_commit_done = dpu_encoder_phys_wb_wait_for_commit_done;
-	ops->prepare_for_kickoff = dpu_encoder_phys_wb_prepare_for_kickoff;
-	ops->handle_post_kickoff = dpu_encoder_phys_wb_handle_post_kickoff;
-	ops->trigger_start = dpu_encoder_helper_trigger_start;
-	ops->hw_reset = dpu_encoder_helper_hw_reset;
-}
-
-/**
- * dpu_encoder_phys_wb_init - initialize writeback encoder
- * @init:	Pointer to init info structure with initialization params
- */
-struct dpu_encoder_phys *dpu_encoder_phys_wb_init(
-		struct dpu_enc_phys_init_params *p)
-{
-	struct dpu_encoder_phys *phys_enc;
-	struct dpu_encoder_phys_wb *wb_enc;
-	struct dpu_hw_mdp *hw_mdp;
-	int ret = 0;
-
-	DPU_DEBUG("\n");
-
-	if (!p || !p->parent) {
-		DPU_ERROR("invalid params\n");
-		ret = -EINVAL;
-		goto fail_alloc;
-	}
-
-	wb_enc = kzalloc(sizeof(*wb_enc), GFP_KERNEL);
-	if (!wb_enc) {
-		DPU_ERROR("failed to allocate wb enc\n");
-		ret = -ENOMEM;
-		goto fail_alloc;
-	}
-	wb_enc->irq_idx = -EINVAL;
-	wb_enc->wbdone_timeout = KICKOFF_TIMEOUT_MS;
-	init_completion(&wb_enc->wbdone_complete);
-
-	phys_enc = &wb_enc->base;
-
-	hw_mdp = dpu_rm_get_mdp(&p->dpu_kms->rm);
-	if (IS_ERR_OR_NULL(hw_mdp)) {
-		ret = PTR_ERR(hw_mdp);
-		DPU_ERROR("failed to init hw_top: %d\n", ret);
-		goto fail_mdp_init;
-	}
-	phys_enc->hw_mdptop = hw_mdp;
-
-	/**
-	 * hw_wb resource permanently assigned to this encoder
-	 * Other resources allocated at atomic commit time by use case
-	 */
-	if (p->wb_idx != DPU_NONE) {
-		struct dpu_rm_hw_iter iter;
-
-		dpu_rm_init_hw_iter(&iter, 0, DPU_HW_BLK_WB);
-		while (dpu_rm_get_hw(&p->dpu_kms->rm, &iter)) {
-			struct dpu_hw_wb *hw_wb = (struct dpu_hw_wb *)iter.hw;
-
-			if (hw_wb->idx == p->wb_idx) {
-				wb_enc->hw_wb = hw_wb;
-				break;
-			}
-		}
-
-		if (!wb_enc->hw_wb) {
-			ret = -EINVAL;
-			DPU_ERROR("failed to init hw_wb%d\n", p->wb_idx - WB_0);
-			goto fail_wb_init;
-		}
-	} else {
-		ret = -EINVAL;
-		DPU_ERROR("invalid wb_idx\n");
-		goto fail_wb_check;
-	}
-
-	dpu_encoder_phys_wb_init_ops(&phys_enc->ops);
-	phys_enc->parent = p->parent;
-	phys_enc->parent_ops = p->parent_ops;
-	phys_enc->dpu_kms = p->dpu_kms;
-	phys_enc->split_role = p->split_role;
-	phys_enc->intf_mode = INTF_MODE_WB_LINE;
-	phys_enc->intf_idx = p->intf_idx;
-	phys_enc->enc_spinlock = p->enc_spinlock;
-	INIT_LIST_HEAD(&wb_enc->irq_cb.list);
-
-	/* create internal buffer for disable logic */
-	if (_dpu_encoder_phys_wb_init_internal_fb(wb_enc,
-				DRM_FORMAT_RGB888, 2, 1, 6)) {
-		DPU_ERROR("failed to init internal fb\n");
-		goto fail_wb_init;
-	}
-
-	DPU_DEBUG("Created dpu_encoder_phys_wb for wb %d\n",
-			wb_enc->hw_wb->idx - WB_0);
-
-	return phys_enc;
-
-fail_wb_init:
-fail_wb_check:
-fail_mdp_init:
-	kfree(wb_enc);
-fail_alloc:
-	return ERR_PTR(ret);
-}
-
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index 7c1d84c..3da8c2d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -37,10 +37,6 @@
 #define PINGPONG_SDM845_SPLIT_MASK \
 	(PINGPONG_SDM845_MASK | BIT(DPU_PINGPONG_TE2))
 
-#define WB2_SDM845_MASK \
-	(BIT(DPU_WB_LINE_MODE) | BIT(DPU_WB_TRAFFIC_SHAPER) | BIT(DPU_WB_CDP) |\
-	BIT(DPU_WB_YUV_CONFIG) | BIT(DPU_WB_QOS_8LVL) | BIT(DPU_WB_UBWC))
-
 #define DEFAULT_PIXEL_RAM_SIZE		(50 * 1024)
 #define DEFAULT_DPU_LINE_WIDTH		2048
 #define DEFAULT_DPU_OUTPUT_LINE_WIDTH	2560
@@ -92,8 +88,6 @@
 			.reg_off = 0x2BC, .bit_off = 8},
 	.clk_ctrls[DPU_CLK_CTRL_CURSOR1] = {
 			.reg_off = 0x2C4, .bit_off = 8},
-	.clk_ctrls[DPU_CLK_CTRL_WB2] = {
-			.reg_off = 0x3b8, .bit_off = 24},
 	},
 };
 
@@ -339,33 +333,14 @@
 };
 
 /*************************************************************
- * WB and CDM sub blocks config
+ * CDM sub blocks config
  *************************************************************/
-/* Writeback 2 capability */
-static const struct dpu_wb_sub_blocks sdm845_wb2_sblk = {
-	.maxlinewidth = 4096,
-};
-
-static struct dpu_wb_cfg sdm845_wb[] = {
-	{
-	.name = "wb_2", .id = WB_2,
-	.base = 0x65000, .len = 0x2c8,
-	.features = WB2_SDM845_MASK,
-	.sblk = &sdm845_wb2_sblk,
-	.format_list = wb2_formats,
-	.vbif_idx = VBIF_NRT,
-	.xin_id = 6,
-	.clk_ctrl = DPU_CLK_CTRL_WB2
-	},
-};
-
 static struct dpu_cdm_cfg sdm845_cdm[] = {
 	{
 	.name = "cdm_0", .id = CDM_0,
 	.base = 0x79200, .len = 0x224,
 	.features = 0,
-	.intf_connect = BIT(INTF_3),
-	.wb_connect = BIT(WB_2)
+	.intf_connect = BIT(INTF_3)
 	},
 };
 
@@ -432,11 +407,6 @@
 	{.fl = 0, .lut = 0x0},
 };
 
-static struct dpu_qos_lut_entry sdm845_qos_cwb[] = {
-	{.fl = 0, .lut = 0x7530000000000000},
-};
-
-
 static struct dpu_perf_cfg sdm845_perf_data = {
 	.max_bw_low = 6800000,
 	.max_bw_high = 6800000,
@@ -458,7 +428,7 @@
 	.downscaling_prefill_lines = 1,
 	.amortizable_threshold = 25,
 	.min_prefill_lines = 24,
-	.danger_lut_tbl = {0xf, 0xffff, 0x0, 0x0},
+	.danger_lut_tbl = {0xf, 0xffff, 0x0},
 	.qos_lut_tbl = {
 		{.nentry = ARRAY_SIZE(sdm845_qos_linear),
 		.entries = sdm845_qos_linear
@@ -469,9 +439,6 @@
 		{.nentry = ARRAY_SIZE(sdm845_qos_nrt),
 		.entries = sdm845_qos_nrt
 		},
-		{.nentry = ARRAY_SIZE(sdm845_qos_cwb),
-		.entries = sdm845_qos_cwb
-		},
 	},
 	.cdp_cfg = {
 		{.rd_enable = 1, .wr_enable = 1},
@@ -507,8 +474,6 @@ void sdm845_cfg_init(struct dpu_mdss_cfg *dpu_cfg)
 		.cdm = sdm845_cdm,
 		.intf_count = ARRAY_SIZE(sdm845_intf),
 		.intf = sdm845_intf,
-		.wb_count = ARRAY_SIZE(sdm845_wb),
-		.wb = sdm845_wb,
 		.vbif_count = ARRAY_SIZE(sdm845_vbif),
 		.vbif = sdm845_vbif,
 		.reg_dma_count = 1,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
index 12c544b..f0cb0d4 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
@@ -179,46 +179,6 @@ enum {
 };
 
 /**
- * WB sub-blocks and features
- * @DPU_WB_LINE_MODE        Writeback module supports line/linear mode
- * @DPU_WB_BLOCK_MODE       Writeback module supports block mode read
- * @DPU_WB_ROTATE           rotation support,this is available if writeback
- *                          supports block mode read
- * @DPU_WB_CSC              Writeback color conversion block support
- * @DPU_WB_CHROMA_DOWN,     Writeback chroma down block,
- * @DPU_WB_DOWNSCALE,       Writeback integer downscaler,
- * @DPU_WB_DITHER,          Dither block
- * @DPU_WB_TRAFFIC_SHAPER,  Writeback traffic shaper bloc
- * @DPU_WB_UBWC,            Writeback Universal bandwidth compression
- * @DPU_WB_YUV_CONFIG       Writeback supports output of YUV colorspace
- * @DPU_WB_PIPE_ALPHA       Writeback supports pipe alpha
- * @DPU_WB_XY_ROI_OFFSET    Writeback supports x/y-offset of out ROI in
- *                          the destination image
- * @DPU_WB_QOS,             Writeback supports QoS control, danger/safe/creq
- * @DPU_WB_QOS_8LVL,        Writeback supports 8-level QoS control
- * @DPU_WB_CDP              Writeback supports client driven prefetch
- * @DPU_WB_MAX              maximum value
- */
-enum {
-	DPU_WB_LINE_MODE = 0x1,
-	DPU_WB_BLOCK_MODE,
-	DPU_WB_ROTATE = DPU_WB_BLOCK_MODE,
-	DPU_WB_CSC,
-	DPU_WB_CHROMA_DOWN,
-	DPU_WB_DOWNSCALE,
-	DPU_WB_DITHER,
-	DPU_WB_TRAFFIC_SHAPER,
-	DPU_WB_UBWC,
-	DPU_WB_YUV_CONFIG,
-	DPU_WB_PIPE_ALPHA,
-	DPU_WB_XY_ROI_OFFSET,
-	DPU_WB_QOS,
-	DPU_WB_QOS_8LVL,
-	DPU_WB_CDP,
-	DPU_WB_MAX
-};
-
-/**
  * VBIF sub-blocks and features
  * @DPU_VBIF_QOS_OTLIM        VBIF supports OT Limit
  * @DPU_VBIF_QOS_REMAP        VBIF supports QoS priority remap
@@ -309,7 +269,6 @@ enum dpu_qos_lut_usage {
 	DPU_QOS_LUT_USAGE_LINEAR,
 	DPU_QOS_LUT_USAGE_MACROTILE,
 	DPU_QOS_LUT_USAGE_NRT,
-	DPU_QOS_LUT_USAGE_CWB,
 	DPU_QOS_LUT_USAGE_MAX,
 };
 
@@ -431,10 +390,6 @@ struct dpu_pingpong_sub_blks {
 	struct dpu_pp_blk dither;
 };
 
-struct dpu_wb_sub_blocks {
-	u32 maxlinewidth;
-};
-
 /**
  * dpu_clk_ctrl_type - Defines top level clock control signals
  */
@@ -453,11 +408,7 @@ enum dpu_clk_ctrl_type {
 	DPU_CLK_CTRL_DMA1,
 	DPU_CLK_CTRL_CURSOR0,
 	DPU_CLK_CTRL_CURSOR1,
-	DPU_CLK_CTRL_WB0,
-	DPU_CLK_CTRL_WB1,
-	DPU_CLK_CTRL_WB2,
 	DPU_CLK_CTRL_INLINE_ROT0_SSPP,
-	DPU_CLK_CTRL_INLINE_ROT0_WB,
 	DPU_CLK_CTRL_MAX,
 };
 
@@ -584,12 +535,10 @@ struct dpu_pingpong_cfg  {
  * @base               register offset of this block
  * @features           bit mask identifying sub-blocks/features
  * @intf_connect       Bitmask of INTF IDs this CDM can connect to
- * @wb_connect:        Bitmask of Writeback IDs this CDM can connect to
  */
 struct dpu_cdm_cfg   {
 	DPU_HW_BLK_INFO;
 	unsigned long intf_connect;
-	unsigned long wb_connect;
 };
 
 /**
@@ -609,26 +558,6 @@ struct dpu_intf_cfg  {
 };
 
 /**
- * struct dpu_wb_cfg - information of writeback blocks
- * @id                 enum identifying this block
- * @base               register offset of this block
- * @features           bit mask identifying sub-blocks/features
- * @sblk               sub-block information
- * @format_list: Pointer to list of supported formats
- * @vbif_idx           vbif identifier
- * @xin_id             client interface identifier
- * @clk_ctrl           clock control identifier
- */
-struct dpu_wb_cfg {
-	DPU_HW_BLK_INFO;
-	const struct dpu_wb_sub_blocks *sblk;
-	const struct dpu_format_extended *format_list;
-	u32 vbif_idx;
-	u32 xin_id;
-	enum dpu_clk_ctrl_type clk_ctrl;
-};
-
-/**
  * struct dpu_vbif_dynamic_ot_cfg - dynamic OT setting
  * @pps                pixel per seconds
  * @ot_limit           OT limit to use up to specified pixel per second
@@ -781,7 +710,6 @@ struct dpu_perf_cfg {
  * @dma_formats        Supported formats for dma pipe
  * @cursor_formats     Supported formats for cursor pipe
  * @vig_formats        Supported formats for vig pipe
- * @wb_formats         Supported formats for wb
  */
 struct dpu_mdss_cfg {
 	u32 hwversion;
@@ -812,9 +740,6 @@ struct dpu_mdss_cfg {
 	u32 intf_count;
 	struct dpu_intf_cfg *intf;
 
-	u32 wb_count;
-	struct dpu_wb_cfg *wb;
-
 	u32 vbif_count;
 	struct dpu_vbif_cfg *vbif;
 
@@ -829,7 +754,6 @@ struct dpu_mdss_cfg {
 	struct dpu_format_extended *dma_formats;
 	struct dpu_format_extended *cursor_formats;
 	struct dpu_format_extended *vig_formats;
-	struct dpu_format_extended *wb_formats;
 };
 
 struct dpu_mdss_hw_cfg_handler {
@@ -851,7 +775,6 @@ struct dpu_mdss_hw_cfg_handler {
 #define BLK_PINGPONG(s) ((s)->pingpong)
 #define BLK_CDM(s) ((s)->cdm)
 #define BLK_INTF(s) ((s)->intf)
-#define BLK_WB(s) ((s)->wb)
 #define BLK_AD(s) ((s)->ad)
 
 /**
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
index 771ffe4..24b0dbc 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
@@ -235,9 +235,6 @@ int dpu_hw_cdm_enable(struct dpu_hw_cdm *ctx,
 		opmode = BIT(0);
 		opmode |= (fmt->chroma_sample << 1);
 		cdm_cfg.intf_en = true;
-	} else {
-		opmode = 0;
-		cdm_cfg.wb_en = true;
 	}
 
 	csc |= BIT(2);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
index 4865427..ad02316 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
@@ -224,21 +224,6 @@ static inline int dpu_hw_ctl_get_bitmask_intf(struct dpu_hw_ctl *ctx,
 	return 0;
 }
 
-static inline int dpu_hw_ctl_get_bitmask_wb(struct dpu_hw_ctl *ctx,
-		u32 *flushbits, enum dpu_wb wb)
-{
-	switch (wb) {
-	case WB_0:
-	case WB_1:
-	case WB_2:
-		*flushbits |= BIT(16);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
 static inline int dpu_hw_ctl_get_bitmask_cdm(struct dpu_hw_ctl *ctx,
 		u32 *flushbits, enum dpu_cdm cdm)
 {
@@ -460,9 +445,6 @@ static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx,
 
 	intf_cfg |= (cfg->intf & 0xF) << 4;
 
-	if (cfg->wb)
-		intf_cfg |= (cfg->wb & 0x3) + 2;
-
 	if (cfg->mode_3d) {
 		intf_cfg |= BIT(19);
 		intf_cfg |= (cfg->mode_3d - 0x1) << 20;
@@ -504,7 +486,6 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops,
 	ops->get_bitmask_mixer = dpu_hw_ctl_get_bitmask_mixer;
 	ops->get_bitmask_intf = dpu_hw_ctl_get_bitmask_intf;
 	ops->get_bitmask_cdm = dpu_hw_ctl_get_bitmask_cdm;
-	ops->get_bitmask_wb = dpu_hw_ctl_get_bitmask_wb;
 };
 
 static struct dpu_hw_blk_ops dpu_hw_ops = {
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h
index b773a5a..c66a71f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h
@@ -44,14 +44,12 @@ struct dpu_hw_stage_cfg {
 /**
  * struct dpu_hw_intf_cfg :Describes how the DPU writes data to output interface
  * @intf :                 Interface id
- * @wb:                    Writeback id
  * @mode_3d:               3d mux configuration
  * @intf_mode_sel:         Interface mode, cmd / vid
  * @stream_sel:            Stream selection for multi-stream interfaces
  */
 struct dpu_hw_intf_cfg {
 	enum dpu_intf intf;
-	enum dpu_wb wb;
 	enum dpu_3d_blend_mode mode_3d;
 	enum dpu_ctl_mode_sel intf_mode_sel;
 	int stream_sel;
@@ -148,10 +146,6 @@ struct dpu_hw_ctl_ops {
 		u32 *flushbits,
 		enum dpu_cdm blk);
 
-	int (*get_bitmask_wb)(struct dpu_hw_ctl *ctx,
-		u32 *flushbits,
-		enum dpu_wb blk);
-
 	/**
 	 * Set all blend stages to disabled
 	 * @ctx       : ctl path ctx pointer
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c
index 8f7f932..115eeed 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c
@@ -109,9 +109,7 @@ static void dpu_hw_setup_cdm_output(struct dpu_hw_mdp *mdp,
 
 	c = &mdp->hw;
 
-	if (cfg->wb_en)
-		out_ctl |= BIT(24);
-	else if (cfg->intf_en)
+	if (cfg->intf_en)
 		out_ctl |= BIT(19);
 
 	DPU_REG_WRITE(c, MDP_OUT_CTL_0, out_ctl);
@@ -178,10 +176,6 @@ static void dpu_hw_get_danger_status(struct dpu_hw_mdp *mdp,
 	status->sspp[SSPP_DMA3] = (value >> 30) & 0x3;
 	status->sspp[SSPP_CURSOR0] = (value >> 24) & 0x3;
 	status->sspp[SSPP_CURSOR1] = (value >> 26) & 0x3;
-	status->wb[WB_0] = 0;
-	status->wb[WB_1] = 0;
-	status->wb[WB_2] = (value >> 2) & 0x3;
-	status->wb[WB_3] = 0;
 }
 
 static void dpu_hw_setup_vsync_source(struct dpu_hw_mdp *mdp,
@@ -279,10 +273,6 @@ static void dpu_hw_get_safe_status(struct dpu_hw_mdp *mdp,
 	status->sspp[SSPP_DMA3] = (value >> 30) & 0x1;
 	status->sspp[SSPP_CURSOR0] = (value >> 24) & 0x1;
 	status->sspp[SSPP_CURSOR1] = (value >> 26) & 0x1;
-	status->wb[WB_0] = 0;
-	status->wb[WB_1] = 0;
-	status->wb[WB_2] = (value >> 2) & 0x1;
-	status->wb[WB_3] = 0;
 }
 
 void dpu_hw_reset_ubwc(struct dpu_hw_mdp *mdp, struct dpu_mdss_cfg *m)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h
index 5429cd5..899925a 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h
@@ -53,11 +53,9 @@ struct split_pipe_cfg {
 
 /**
  * struct cdm_output_cfg: output configuration for cdm
- * @wb_en     : enable/disable writeback output
  * @intf_en   : enable/disable interface output
  */
 struct cdm_output_cfg {
-	bool wb_en;
 	bool intf_en;
 };
 
@@ -65,12 +63,10 @@ struct cdm_output_cfg {
  * struct dpu_danger_safe_status: danger and safe status signals
  * @mdp: top level status
  * @sspp: source pipe status
- * @wb: writebck output status
  */
 struct dpu_danger_safe_status {
 	u8 mdp;
 	u8 sspp[SSPP_MAX];
-	u8 wb[WB_MAX];
 };
 
 /**
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c
deleted file mode 100644
index 90b2aae..0000000
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include "dpu_hw_mdss.h"
-#include "dpu_hwio.h"
-#include "dpu_hw_catalog.h"
-#include "dpu_hw_wb.h"
-#include "dpu_formats.h"
-#include "dpu_dbg.h"
-#include "dpu_kms.h"
-
-#define WB_DST_FORMAT			0x000
-#define WB_DST_OP_MODE			0x004
-#define WB_DST_PACK_PATTERN		0x008
-#define WB_DST0_ADDR			0x00C
-#define WB_DST1_ADDR			0x010
-#define WB_DST2_ADDR			0x014
-#define WB_DST3_ADDR			0x018
-#define WB_DST_YSTRIDE0			0x01C
-#define WB_DST_YSTRIDE1			0x020
-#define WB_DST_YSTRIDE1			0x020
-#define WB_DST_DITHER_BITDEPTH		0x024
-#define WB_DST_MATRIX_ROW0		0x030
-#define WB_DST_MATRIX_ROW1		0x034
-#define WB_DST_MATRIX_ROW2		0x038
-#define WB_DST_MATRIX_ROW3		0x03C
-#define WB_DST_WRITE_CONFIG		0x048
-#define WB_ROTATION_DNSCALER		0x050
-#define WB_ROTATOR_PIPE_DOWNSCALER	0x054
-#define WB_N16_INIT_PHASE_X_C03		0x060
-#define WB_N16_INIT_PHASE_X_C12		0x064
-#define WB_N16_INIT_PHASE_Y_C03		0x068
-#define WB_N16_INIT_PHASE_Y_C12		0x06C
-#define WB_OUT_SIZE			0x074
-#define WB_ALPHA_X_VALUE		0x078
-#define WB_DANGER_LUT			0x084
-#define WB_SAFE_LUT			0x088
-#define WB_QOS_CTRL			0x090
-#define WB_CREQ_LUT_0			0x098
-#define WB_CREQ_LUT_1			0x09C
-#define WB_UBWC_STATIC_CTRL		0x144
-#define WB_CSC_BASE			0x260
-#define WB_DST_ADDR_SW_STATUS		0x2B0
-#define WB_CDP_CNTL			0x2B4
-#define WB_OUT_IMAGE_SIZE		0x2C0
-#define WB_OUT_XY			0x2C4
-
-/* WB_QOS_CTRL */
-#define WB_QOS_CTRL_DANGER_SAFE_EN	BIT(0)
-
-static struct dpu_wb_cfg *_wb_offset(enum dpu_wb wb,
-		struct dpu_mdss_cfg *m,
-		void __iomem *addr,
-		struct dpu_hw_blk_reg_map *b)
-{
-	int i;
-
-	for (i = 0; i < m->wb_count; i++) {
-		if (wb == m->wb[i].id) {
-			b->base_off = addr;
-			b->blk_off = m->wb[i].base;
-			b->length = m->wb[i].len;
-			b->hwversion = m->hwversion;
-			b->log_mask = DPU_DBG_MASK_WB;
-			return &m->wb[i];
-		}
-	}
-	return ERR_PTR(-EINVAL);
-}
-
-static void dpu_hw_wb_setup_outaddress(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *data)
-{
-	struct dpu_hw_blk_reg_map *c = &ctx->hw;
-
-	DPU_REG_WRITE(c, WB_DST0_ADDR, data->dest.plane_addr[0]);
-	DPU_REG_WRITE(c, WB_DST1_ADDR, data->dest.plane_addr[1]);
-	DPU_REG_WRITE(c, WB_DST2_ADDR, data->dest.plane_addr[2]);
-	DPU_REG_WRITE(c, WB_DST3_ADDR, data->dest.plane_addr[3]);
-}
-
-static void dpu_hw_wb_setup_format(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *data)
-{
-	struct dpu_hw_blk_reg_map *c = &ctx->hw;
-	const struct dpu_format *fmt = data->dest.format;
-	u32 dst_format, pattern, ystride0, ystride1, outsize, chroma_samp;
-	u32 write_config = 0;
-	u32 opmode = 0;
-	u32 dst_addr_sw = 0;
-
-	chroma_samp = fmt->chroma_sample;
-
-	dst_format = (chroma_samp << 23) |
-			(fmt->fetch_planes << 19) |
-			(fmt->bits[C3_ALPHA] << 6) |
-			(fmt->bits[C2_R_Cr] << 4) |
-			(fmt->bits[C1_B_Cb] << 2) |
-			(fmt->bits[C0_G_Y] << 0);
-
-	if (fmt->bits[C3_ALPHA] || fmt->alpha_enable) {
-		dst_format |= BIT(8); /* DSTC3_EN */
-		if (!fmt->alpha_enable ||
-				!(ctx->caps->features & BIT(DPU_WB_PIPE_ALPHA)))
-			dst_format |= BIT(14); /* DST_ALPHA_X */
-	}
-
-	if (DPU_FORMAT_IS_YUV(fmt) &&
-			(ctx->caps->features & BIT(DPU_WB_YUV_CONFIG)))
-		dst_format |= BIT(15);
-
-	if (DPU_FORMAT_IS_DX(fmt))
-		dst_format |= BIT(21);
-
-	pattern = (fmt->element[3] << 24) |
-			(fmt->element[2] << 16) |
-			(fmt->element[1] << 8)  |
-			(fmt->element[0] << 0);
-
-	dst_format |= (fmt->unpack_align_msb << 18) |
-			(fmt->unpack_tight << 17) |
-			((fmt->unpack_count - 1) << 12) |
-			((fmt->bpp - 1) << 9);
-
-	ystride0 = data->dest.plane_pitch[0] |
-			(data->dest.plane_pitch[1] << 16);
-	ystride1 = data->dest.plane_pitch[2] |
-			(data->dest.plane_pitch[3] << 16);
-
-	if (data->roi.h && data->roi.w)
-		outsize = (data->roi.h << 16) | data->roi.w;
-	else
-		outsize = (data->dest.height << 16) | data->dest.width;
-
-	if (DPU_FORMAT_IS_UBWC(fmt)) {
-		opmode |= BIT(0);
-		dst_format |= BIT(31);
-		write_config |= (ctx->mdp->highest_bank_bit << 8);
-		if (fmt->base.pixel_format == DRM_FORMAT_RGB565)
-			write_config |= 0x8;
-		if (IS_UBWC_20_SUPPORTED(ctx->catalog->caps->ubwc_version))
-			DPU_REG_WRITE(c, WB_UBWC_STATIC_CTRL,
-					(ctx->mdp->ubwc_swizzle << 0) |
-					(ctx->mdp->highest_bank_bit << 4));
-	}
-
-	DPU_REG_WRITE(c, WB_ALPHA_X_VALUE, 0xFF);
-	DPU_REG_WRITE(c, WB_DST_FORMAT, dst_format);
-	DPU_REG_WRITE(c, WB_DST_OP_MODE, opmode);
-	DPU_REG_WRITE(c, WB_DST_PACK_PATTERN, pattern);
-	DPU_REG_WRITE(c, WB_DST_YSTRIDE0, ystride0);
-	DPU_REG_WRITE(c, WB_DST_YSTRIDE1, ystride1);
-	DPU_REG_WRITE(c, WB_OUT_SIZE, outsize);
-	DPU_REG_WRITE(c, WB_DST_WRITE_CONFIG, write_config);
-	DPU_REG_WRITE(c, WB_DST_ADDR_SW_STATUS, dst_addr_sw);
-}
-
-static void dpu_hw_wb_roi(struct dpu_hw_wb *ctx, struct dpu_hw_wb_cfg *wb)
-{
-	struct dpu_hw_blk_reg_map *c = &ctx->hw;
-	u32 image_size, out_size, out_xy;
-
-	image_size = (wb->dest.height << 16) | wb->dest.width;
-	out_xy = (wb->roi.y << 16) | wb->roi.x;
-	out_size = (wb->roi.h << 16) | wb->roi.w;
-
-	DPU_REG_WRITE(c, WB_OUT_IMAGE_SIZE, image_size);
-	DPU_REG_WRITE(c, WB_OUT_XY, out_xy);
-	DPU_REG_WRITE(c, WB_OUT_SIZE, out_size);
-}
-
-static void dpu_hw_wb_setup_danger_safe_lut(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_qos_cfg *cfg)
-{
-	struct dpu_hw_blk_reg_map *c = &ctx->hw;
-
-	if (!ctx || !cfg)
-		return;
-
-	DPU_REG_WRITE(c, WB_DANGER_LUT, cfg->danger_lut);
-	DPU_REG_WRITE(c, WB_SAFE_LUT, cfg->safe_lut);
-}
-
-static void dpu_hw_wb_setup_creq_lut(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_qos_cfg *cfg)
-{
-	struct dpu_hw_blk_reg_map *c = &ctx->hw;
-
-	if (!ctx || !cfg)
-		return;
-
-	if (ctx->caps && test_bit(DPU_WB_QOS_8LVL, &ctx->caps->features)) {
-		DPU_REG_WRITE(c, WB_CREQ_LUT_0, cfg->creq_lut);
-		DPU_REG_WRITE(c, WB_CREQ_LUT_1, cfg->creq_lut >> 32);
-	}
-}
-
-static void dpu_hw_wb_setup_qos_ctrl(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_qos_cfg *cfg)
-{
-	struct dpu_hw_blk_reg_map *c = &ctx->hw;
-	u32 qos_ctrl = 0;
-
-	if (!ctx || !cfg)
-		return;
-
-	if (cfg->danger_safe_en)
-		qos_ctrl |= WB_QOS_CTRL_DANGER_SAFE_EN;
-
-	DPU_REG_WRITE(c, WB_QOS_CTRL, qos_ctrl);
-}
-
-static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cdp_cfg *cfg)
-{
-	struct dpu_hw_blk_reg_map *c;
-	u32 cdp_cntl = 0;
-
-	if (!ctx || !cfg)
-		return;
-
-	c = &ctx->hw;
-
-	if (cfg->enable)
-		cdp_cntl |= BIT(0);
-	if (cfg->ubwc_meta_enable)
-		cdp_cntl |= BIT(1);
-	if (cfg->preload_ahead == DPU_WB_CDP_PRELOAD_AHEAD_64)
-		cdp_cntl |= BIT(3);
-
-	DPU_REG_WRITE(c, WB_CDP_CNTL, cdp_cntl);
-}
-
-static void _setup_wb_ops(struct dpu_hw_wb_ops *ops,
-	unsigned long features)
-{
-	ops->setup_outaddress = dpu_hw_wb_setup_outaddress;
-	ops->setup_outformat = dpu_hw_wb_setup_format;
-
-	if (test_bit(DPU_WB_XY_ROI_OFFSET, &features))
-		ops->setup_roi = dpu_hw_wb_roi;
-
-	if (test_bit(DPU_WB_QOS, &features)) {
-		ops->setup_danger_safe_lut =
-			dpu_hw_wb_setup_danger_safe_lut;
-		ops->setup_creq_lut = dpu_hw_wb_setup_creq_lut;
-		ops->setup_qos_ctrl = dpu_hw_wb_setup_qos_ctrl;
-	}
-
-	if (test_bit(DPU_WB_CDP, &features))
-		ops->setup_cdp = dpu_hw_wb_setup_cdp;
-}
-
-static struct dpu_hw_blk_ops dpu_hw_ops = {
-	.start = NULL,
-	.stop = NULL,
-};
-
-struct dpu_hw_wb *dpu_hw_wb_init(enum dpu_wb idx,
-		void __iomem *addr,
-		struct dpu_mdss_cfg *m,
-		struct dpu_hw_mdp *hw_mdp)
-{
-	struct dpu_hw_wb *c;
-	struct dpu_wb_cfg *cfg;
-	int rc;
-
-	if (!addr || !m || !hw_mdp)
-		return ERR_PTR(-EINVAL);
-
-	c = kzalloc(sizeof(*c), GFP_KERNEL);
-	if (!c)
-		return ERR_PTR(-ENOMEM);
-
-	cfg = _wb_offset(idx, m, addr, &c->hw);
-	if (IS_ERR(cfg)) {
-		WARN(1, "Unable to find wb idx=%d\n", idx);
-		kfree(c);
-		return ERR_PTR(-EINVAL);
-	}
-
-	/* Assign ops */
-	c->catalog = m;
-	c->mdp = &m->mdp[0];
-	c->idx = idx;
-	c->caps = cfg;
-	_setup_wb_ops(&c->ops, c->caps->features);
-	c->hw_mdp = hw_mdp;
-
-	rc = dpu_hw_blk_init(&c->base, DPU_HW_BLK_WB, idx, &dpu_hw_ops);
-	if (rc) {
-		DPU_ERROR("failed to init hw blk %d\n", rc);
-		goto blk_init_error;
-	}
-
-	dpu_dbg_reg_register_dump_range(DPU_DBG_NAME, cfg->name, c->hw.blk_off,
-			c->hw.blk_off + c->hw.length, c->hw.xin_id);
-
-	return c;
-
-blk_init_error:
-	kzfree(c);
-
-	return ERR_PTR(rc);
-}
-
-void dpu_hw_wb_destroy(struct dpu_hw_wb *hw_wb)
-{
-	if (hw_wb)
-		dpu_hw_blk_destroy(&hw_wb->base);
-	kfree(hw_wb);
-}
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h
deleted file mode 100644
index 145ebbc..0000000
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef _DPU_HW_WB_H
-#define _DPU_HW_WB_H
-
-#include "dpu_hw_catalog.h"
-#include "dpu_hw_mdss.h"
-#include "dpu_hw_top.h"
-#include "dpu_hw_util.h"
-
-struct dpu_hw_wb;
-
-struct dpu_hw_wb_cfg {
-	struct dpu_hw_fmt_layout dest;
-	enum dpu_intf_mode intf_mode;
-	struct traffic_shaper_cfg ts_cfg;
-	struct dpu_rect roi;
-};
-
-/**
- * enum CDP preload ahead address size
- */
-enum {
-	DPU_WB_CDP_PRELOAD_AHEAD_32,
-	DPU_WB_CDP_PRELOAD_AHEAD_64
-};
-
-/**
- * struct dpu_hw_wb_cdp_cfg : CDP configuration
- * @enable: true to enable CDP
- * @ubwc_meta_enable: true to enable ubwc metadata preload
- * @tile_amortize_enable: true to enable amortization control for tile format
- * @preload_ahead: number of request to preload ahead
- *	DPU_WB_CDP_PRELOAD_AHEAD_32,
- *	DPU_WB_CDP_PRELOAD_AHEAD_64
- */
-struct dpu_hw_wb_cdp_cfg {
-	bool enable;
-	bool ubwc_meta_enable;
-	bool tile_amortize_enable;
-	u32 preload_ahead;
-};
-
-/**
- * struct dpu_hw_wb_qos_cfg : Writeback pipe QoS configuration
- * @danger_lut: LUT for generate danger level based on fill level
- * @safe_lut: LUT for generate safe level based on fill level
- * @creq_lut: LUT for generate creq level based on fill level
- * @danger_safe_en: enable danger safe generation
- */
-struct dpu_hw_wb_qos_cfg {
-	u32 danger_lut;
-	u32 safe_lut;
-	u64 creq_lut;
-	bool danger_safe_en;
-};
-
-/**
- *
- * struct dpu_hw_wb_ops : Interface to the wb Hw driver functions
- *  Assumption is these functions will be called after clocks are enabled
- */
-struct dpu_hw_wb_ops {
-	void (*setup_csc_data)(struct dpu_hw_wb *ctx,
-			struct dpu_csc_cfg *data);
-
-	void (*setup_outaddress)(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *wb);
-
-	void (*setup_outformat)(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *wb);
-
-	void (*setup_rotator)(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *wb);
-
-	void (*setup_dither)(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *wb);
-
-	void (*setup_cdwn)(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *wb);
-
-	void (*setup_trafficshaper)(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *wb);
-
-	void (*setup_roi)(struct dpu_hw_wb *ctx,
-		struct dpu_hw_wb_cfg *wb);
-
-	/**
-	 * setup_danger_safe_lut - setup danger safe LUTs
-	 * @ctx: Pointer to pipe context
-	 * @cfg: Pointer to pipe QoS configuration
-	 */
-	void (*setup_danger_safe_lut)(struct dpu_hw_wb *ctx,
-			struct dpu_hw_wb_qos_cfg *cfg);
-
-	/**
-	 * setup_creq_lut - setup CREQ LUT
-	 * @ctx: Pointer to pipe context
-	 * @cfg: Pointer to pipe QoS configuration
-	 */
-	void (*setup_creq_lut)(struct dpu_hw_wb *ctx,
-			struct dpu_hw_wb_qos_cfg *cfg);
-
-	/**
-	 * setup_qos_ctrl - setup QoS control
-	 * @ctx: Pointer to pipe context
-	 * @cfg: Pointer to pipe QoS configuration
-	 */
-	void (*setup_qos_ctrl)(struct dpu_hw_wb *ctx,
-			struct dpu_hw_wb_qos_cfg *cfg);
-
-	/**
-	 * setup_cdp - setup CDP
-	 * @ctx: Pointer to pipe context
-	 * @cfg: Pointer to pipe CDP configuration
-	 */
-	void (*setup_cdp)(struct dpu_hw_wb *ctx,
-			struct dpu_hw_wb_cdp_cfg *cfg);
-};
-
-/**
- * struct dpu_hw_wb : WB driver object
- * @base: hardware block base structure
- * @hw: block hardware details
- * @catalog: back pointer to catalog
- * @mdp: pointer to associated mdp portion of the catalog
- * @idx: hardware index number within type
- * @wb_hw_caps: hardware capabilities
- * @ops: function pointers
- * @hw_mdp: MDP top level hardware block
- */
-struct dpu_hw_wb {
-	struct dpu_hw_blk base;
-	struct dpu_hw_blk_reg_map hw;
-	struct dpu_mdss_cfg *catalog;
-	struct dpu_mdp_cfg *mdp;
-
-	/* wb path */
-	int idx;
-	const struct dpu_wb_cfg *caps;
-
-	/* ops */
-	struct dpu_hw_wb_ops ops;
-
-	struct dpu_hw_mdp *hw_mdp;
-};
-
-/**
- * dpu_hw_wb - convert base object dpu_hw_base to container
- * @hw: Pointer to base hardware block
- * return: Pointer to hardware block container
- */
-static inline struct dpu_hw_wb *to_dpu_hw_wb(struct dpu_hw_blk *hw)
-{
-	return container_of(hw, struct dpu_hw_wb, base);
-}
-
-/**
- * dpu_hw_wb_init(): Initializes and return writeback hw driver object.
- * @idx:  wb_path index for which driver object is required
- * @addr: mapped register io address of MDP
- * @m :   pointer to mdss catalog data
- * @hw_mdp: pointer to mdp top hw driver object
- */
-struct dpu_hw_wb *dpu_hw_wb_init(enum dpu_wb idx,
-		void __iomem *addr,
-		struct dpu_mdss_cfg *m,
-		struct dpu_hw_mdp *hw_mdp);
-
-/**
- * dpu_hw_wb_destroy(): Destroy writeback hw driver object.
- * @hw_wb:  Pointer to writeback hw driver object
- */
-void dpu_hw_wb_destroy(struct dpu_hw_wb *hw_wb);
-
-#endif /*_DPU_HW_WB_H */
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 16629af..369eaeb 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -120,11 +120,6 @@ static int _dpu_danger_signal_status(struct seq_file *s,
 				status.sspp[i]);
 	seq_puts(s, "\n");
 
-	for (i = WB_0; i < WB_MAX; i++)
-		seq_printf(s, "WB%d     :  0x%x  \t", i - WB_0,
-				status.wb[i]);
-	seq_puts(s, "\n");
-
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
index c48ed4e..a5468ed 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
@@ -31,7 +31,6 @@
 #include "dpu_hw_ctl.h"
 #include "dpu_hw_lm.h"
 #include "dpu_hw_interrupts.h"
-#include "dpu_hw_wb.h"
 #include "dpu_hw_top.h"
 #include "dpu_rm.h"
 #include "dpu_power_handle.h"
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 38714c9..6090ace 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1374,7 +1374,7 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane,
 			cdp_cfg->tile_amortize_enable =
 					DPU_FORMAT_IS_UBWC(fmt) ||
 					DPU_FORMAT_IS_TILE(fmt);
-			cdp_cfg->preload_ahead = DPU_WB_CDP_PRELOAD_AHEAD_64;
+			cdp_cfg->preload_ahead = DPU_SSPP_CDP_PRELOAD_AHEAD_64;
 
 			pdpu->pipe_hw->ops.setup_cdp(pdpu->pipe_hw, cdp_cfg);
 		}
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index 0af2996..ab12d89 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -19,7 +19,6 @@
 #include "dpu_hw_cdm.h"
 #include "dpu_hw_pingpong.h"
 #include "dpu_hw_intf.h"
-#include "dpu_hw_wb.h"
 #include "dpu_encoder.h"
 
 #define RESERVED_BY_OTHER(h, r) \
@@ -246,9 +245,6 @@ static void _dpu_rm_hw_destroy(enum dpu_hw_blk_type type, void *hw)
 	case DPU_HW_BLK_INTF:
 		dpu_hw_intf_destroy(hw);
 		break;
-	case DPU_HW_BLK_WB:
-		dpu_hw_wb_destroy(hw);
-		break;
 	case DPU_HW_BLK_SSPP:
 		/* SSPPs are not managed by the resource manager */
 	case DPU_HW_BLK_TOP:
@@ -325,9 +321,6 @@ static int _dpu_rm_hw_blk_create(
 	case DPU_HW_BLK_INTF:
 		hw = dpu_hw_intf_init(id, mmio, cat);
 		break;
-	case DPU_HW_BLK_WB:
-		hw = dpu_hw_wb_init(id, mmio, cat, hw_mdp);
-		break;
 	case DPU_HW_BLK_SSPP:
 		/* SSPPs are not managed by the resource manager */
 	case DPU_HW_BLK_TOP:
@@ -443,15 +436,6 @@ int dpu_rm_init(struct dpu_rm *rm,
 		}
 	}
 
-	for (i = 0; i < cat->wb_count; i++) {
-		rc = _dpu_rm_hw_blk_create(rm, cat, mmio, DPU_HW_BLK_WB,
-				cat->wb[i].id, &cat->wb[i]);
-		if (rc) {
-			DPU_ERROR("failed: wb hw not available\n");
-			goto fail;
-		}
-	}
-
 	for (i = 0; i < cat->ctl_count; i++) {
 		rc = _dpu_rm_hw_blk_create(rm, cat, mmio, DPU_HW_BLK_CTL,
 				cat->ctl[i].id, &cat->ctl[i]);
@@ -683,12 +667,9 @@ static int _dpu_rm_reserve_cdm(
 
 		if (type == DPU_HW_BLK_INTF && id != INTF_MAX)
 			match = test_bit(id, &caps->intf_connect);
-		else if (type == DPU_HW_BLK_WB && id != WB_MAX)
-			match = test_bit(id, &caps->wb_connect);
 
-		DPU_DEBUG("type %d id %d, cdm intfs %lu wbs %lu match %d\n",
-				type, id, caps->intf_connect, caps->wb_connect,
-				match);
+		DPU_DEBUG("type %d id %d, cdm intfs %lu match %d\n",
+				type, id, caps->intf_connect, match);
 
 		if (!match)
 			continue;
@@ -706,7 +687,7 @@ static int _dpu_rm_reserve_cdm(
 	return 0;
 }
 
-static int _dpu_rm_reserve_intf_or_wb(
+static int _dpu_rm_reserve_intf(
 		struct dpu_rm *rm,
 		struct dpu_rm_rsvp *rsvp,
 		uint32_t id,
@@ -732,13 +713,12 @@ static int _dpu_rm_reserve_intf_or_wb(
 		break;
 	}
 
-	/* Shouldn't happen since wbs / intfs are fixed at probe */
+	/* Shouldn't happen since intfs are fixed at probe */
 	if (!iter.hw) {
 		DPU_ERROR("couldn't find type %d id %d\n", type, id);
 		return -EINVAL;
 	}
 
-	/* Expected only one intf or wb will request cdm */
 	if (needs_cdm)
 		ret = _dpu_rm_reserve_cdm(rm, rsvp, id, type);
 
@@ -757,22 +737,12 @@ static int _dpu_rm_reserve_intf_related_hw(
 		if (hw_res->intfs[i] == INTF_MODE_NONE)
 			continue;
 		id = i + INTF_0;
-		ret = _dpu_rm_reserve_intf_or_wb(rm, rsvp, id,
+		ret = _dpu_rm_reserve_intf(rm, rsvp, id,
 				DPU_HW_BLK_INTF, hw_res->needs_cdm);
 		if (ret)
 			return ret;
 	}
 
-	for (i = 0; i < ARRAY_SIZE(hw_res->wbs); i++) {
-		if (hw_res->wbs[i] == INTF_MODE_NONE)
-			continue;
-		id = i + WB_0;
-		ret = _dpu_rm_reserve_intf_or_wb(rm, rsvp, id,
-				DPU_HW_BLK_WB, hw_res->needs_cdm);
-		if (ret)
-			return ret;
-	}
-
 	return ret;
 }
 
@@ -815,7 +785,7 @@ static int _dpu_rm_make_next_rsvp(
 		return ret;
 	}
 
-	/* Assign INTFs, WBs, and blks whose usage is tied to them: CTL & CDM */
+	/* Assign INTFs and blks whose usage is tied to them: CTL & CDM */
 	ret = _dpu_rm_reserve_intf_related_hw(rm, rsvp, &reqs->hw_res);
 	if (ret)
 		return ret;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_wb.c
deleted file mode 100644
index 9b47bb2..0000000
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_wb.c
+++ /dev/null
@@ -1,767 +0,0 @@
-/*
- * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
-
-#include "msm_kms.h"
-#include "dpu_kms.h"
-#include "dpu_wb.h"
-#include "dpu_formats.h"
-
-/* maximum display mode resolution if not available from catalog */
-#define DPU_WB_MODE_MAX_WIDTH	4096
-#define DPU_WB_MODE_MAX_HEIGHT	4096
-
-/* Serialization lock for dpu_wb_list */
-static DEFINE_MUTEX(dpu_wb_list_lock);
-
-/* List of all writeback devices installed */
-static LIST_HEAD(dpu_wb_list);
-
-/**
- * dpu_wb_is_format_valid - check if given format/modifier is supported
- * @wb_dev:	Pointer to writeback device
- * @pixel_format:	Fourcc pixel format
- * @format_modifier:	Format modifier
- * Returns:		true if valid; false otherwise
- */
-static int dpu_wb_is_format_valid(struct dpu_wb_device *wb_dev,
-		u32 pixel_format, u64 format_modifier)
-{
-	const struct dpu_format_extended *fmts = wb_dev->wb_cfg->format_list;
-	int i;
-
-	if (!fmts)
-		return false;
-
-	for (i = 0; fmts[i].fourcc_format; i++)
-		if ((fmts[i].modifier == format_modifier) &&
-				(fmts[i].fourcc_format == pixel_format))
-			return true;
-
-	return false;
-}
-
-enum drm_connector_status
-dpu_wb_connector_detect(struct drm_connector *connector,
-		bool force,
-		void *display)
-{
-	enum drm_connector_status rc = connector_status_unknown;
-
-	DPU_DEBUG("\n");
-
-	if (display)
-		rc = ((struct dpu_wb_device *)display)->detect_status;
-
-	return rc;
-}
-
-int dpu_wb_connector_get_modes(struct drm_connector *connector, void *display)
-{
-	struct dpu_wb_device *wb_dev;
-	int num_modes = 0;
-
-	if (!connector || !display)
-		return 0;
-
-	wb_dev = display;
-
-	DPU_DEBUG("\n");
-
-	mutex_lock(&wb_dev->wb_lock);
-	if (wb_dev->count_modes && wb_dev->modes) {
-		struct drm_display_mode *mode;
-		int i, ret;
-
-		for (i = 0; i < wb_dev->count_modes; i++) {
-			mode = drm_mode_create(connector->dev);
-			if (!mode) {
-				DPU_ERROR("failed to create mode\n");
-				break;
-			}
-			ret = drm_mode_convert_umode(mode,
-					&wb_dev->modes[i]);
-			if (ret) {
-				DPU_ERROR("failed to convert mode %d\n", ret);
-				break;
-			}
-
-			drm_mode_probed_add(connector, mode);
-			num_modes++;
-		}
-	} else {
-		u32 max_width = (wb_dev->wb_cfg && wb_dev->wb_cfg->sblk) ?
-				wb_dev->wb_cfg->sblk->maxlinewidth :
-				DPU_WB_MODE_MAX_WIDTH;
-
-		num_modes = drm_add_modes_noedid(connector, max_width,
-				DPU_WB_MODE_MAX_HEIGHT);
-	}
-	mutex_unlock(&wb_dev->wb_lock);
-	return num_modes;
-}
-
-struct drm_framebuffer *
-dpu_wb_connector_state_get_output_fb(struct drm_connector_state *state)
-{
-	if (!state || !state->connector ||
-		(state->connector->connector_type !=
-				DRM_MODE_CONNECTOR_VIRTUAL)) {
-		DPU_ERROR("invalid params\n");
-		return NULL;
-	}
-
-	DPU_DEBUG("\n");
-
-	return dpu_connector_get_out_fb(state);
-}
-
-int dpu_wb_connector_state_get_output_roi(struct drm_connector_state *state,
-		struct dpu_rect *roi)
-{
-	if (!state || !roi || !state->connector ||
-		(state->connector->connector_type !=
-				DRM_MODE_CONNECTOR_VIRTUAL)) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	roi->x = dpu_connector_get_property(state, CONNECTOR_PROP_DST_X);
-	roi->y = dpu_connector_get_property(state, CONNECTOR_PROP_DST_Y);
-	roi->w = dpu_connector_get_property(state, CONNECTOR_PROP_DST_W);
-	roi->h = dpu_connector_get_property(state, CONNECTOR_PROP_DST_H);
-
-	return 0;
-}
-
-/**
- * dpu_wb_connector_set_modes - set writeback modes and connection status
- * @wb_dev:	Pointer to write back device
- * @count_modes:	Count of modes
- * @modes:	Pointer to writeback mode requested
- * @connected:	Connection status requested
- * Returns:	0 if success; error code otherwise
- */
-static
-int dpu_wb_connector_set_modes(struct dpu_wb_device *wb_dev,
-		u32 count_modes, struct drm_mode_modeinfo __user *modes,
-		bool connected)
-{
-	int ret = 0;
-
-	if (!wb_dev || !wb_dev->connector ||
-			(wb_dev->connector->connector_type !=
-			 DRM_MODE_CONNECTOR_VIRTUAL)) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	if (connected) {
-		DPU_DEBUG("connect\n");
-
-		if (wb_dev->modes) {
-			wb_dev->count_modes = 0;
-
-			kfree(wb_dev->modes);
-			wb_dev->modes = NULL;
-		}
-
-		if (count_modes && modes) {
-			wb_dev->modes = kcalloc(count_modes,
-					sizeof(struct drm_mode_modeinfo),
-					GFP_KERNEL);
-			if (!wb_dev->modes) {
-				DPU_ERROR("invalid params\n");
-				ret = -ENOMEM;
-				goto error;
-			}
-
-			if (copy_from_user(wb_dev->modes, modes,
-					count_modes *
-					sizeof(struct drm_mode_modeinfo))) {
-				DPU_ERROR("failed to copy modes\n");
-				kfree(wb_dev->modes);
-				wb_dev->modes = NULL;
-				ret = -EFAULT;
-				goto error;
-			}
-
-			wb_dev->count_modes = count_modes;
-		}
-
-		wb_dev->detect_status = connector_status_connected;
-	} else {
-		DPU_DEBUG("disconnect\n");
-
-		if (wb_dev->modes) {
-			wb_dev->count_modes = 0;
-
-			kfree(wb_dev->modes);
-			wb_dev->modes = NULL;
-		}
-
-		wb_dev->detect_status = connector_status_disconnected;
-	}
-
-error:
-	return ret;
-}
-
-int dpu_wb_connector_set_property(struct drm_connector *connector,
-		struct drm_connector_state *state,
-		int property_index,
-		uint64_t value,
-		void *display)
-{
-	struct dpu_wb_device *wb_dev = display;
-	struct drm_framebuffer *out_fb;
-	int rc = 0;
-
-	DPU_DEBUG("\n");
-
-	if (state && (property_index == CONNECTOR_PROP_OUT_FB)) {
-		const struct dpu_format *dpu_format;
-
-		out_fb = dpu_connector_get_out_fb(state);
-		if (!out_fb)
-			goto done;
-
-		dpu_format = dpu_get_dpu_format_ext(out_fb->format->format,
-				out_fb->modifier);
-		if (!dpu_format) {
-			DPU_ERROR("failed to get dpu format\n");
-			rc = -EINVAL;
-			goto done;
-		}
-
-		if (!dpu_wb_is_format_valid(wb_dev, out_fb->format->format,
-				out_fb->modifier)) {
-			DPU_ERROR("unsupported writeback format 0x%x/0x%llx\n",
-					out_fb->format->format,
-					out_fb->modifier);
-			rc = -EINVAL;
-			goto done;
-		}
-	}
-
-done:
-	return rc;
-}
-
-int dpu_wb_get_info(struct msm_display_info *info, void *display)
-{
-	struct dpu_wb_device *wb_dev = display;
-
-	if (!info || !wb_dev) {
-		pr_err("invalid params\n");
-		return -EINVAL;
-	}
-
-	memset(info, 0, sizeof(struct msm_display_info));
-	info->intf_type = DRM_MODE_CONNECTOR_VIRTUAL;
-	info->num_of_h_tiles = 1;
-	info->h_tile_instance[0] = dpu_wb_get_index(display);
-	info->is_connected = true;
-	info->capabilities = MSM_DISPLAY_CAP_HOT_PLUG | MSM_DISPLAY_CAP_EDID;
-	info->max_width = (wb_dev->wb_cfg && wb_dev->wb_cfg->sblk) ?
-			wb_dev->wb_cfg->sblk->maxlinewidth :
-			DPU_WB_MODE_MAX_WIDTH;
-	info->max_height = DPU_WB_MODE_MAX_HEIGHT;
-	return 0;
-}
-
-int dpu_wb_get_mode_info(const struct drm_display_mode *drm_mode,
-	struct msm_mode_info *mode_info, u32 max_mixer_width)
-{
-	const u32 dual_lm = 2;
-	const u32 single_lm = 1;
-	const u32 single_intf = 1;
-	const u32 no_enc = 0;
-	struct msm_display_topology *topology;
-
-	if (!drm_mode || !mode_info || !max_mixer_width) {
-		pr_err("invalid params\n");
-		return -EINVAL;
-	}
-
-	topology = &mode_info->topology;
-	topology->num_lm = (max_mixer_width <= drm_mode->hdisplay) ?
-							dual_lm : single_lm;
-	topology->num_enc = no_enc;
-	topology->num_intf = single_intf;
-
-	return 0;
-}
-
-int dpu_wb_connector_post_init(struct drm_connector *connector,
-		void *info,
-		void *display)
-{
-	struct dpu_connector *c_conn;
-	struct dpu_wb_device *wb_dev = display;
-	const struct dpu_format_extended *format_list;
-
-	if (!connector || !info || !display || !wb_dev->wb_cfg) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	c_conn = to_dpu_connector(connector);
-	wb_dev->connector = connector;
-	wb_dev->detect_status = connector_status_connected;
-	format_list = wb_dev->wb_cfg->format_list;
-
-	/*
-	 * Add extra connector properties
-	 */
-	msm_property_install_range(&c_conn->property_info, "FB_ID",
-			0x0, 0, ~0, ~0, CONNECTOR_PROP_OUT_FB);
-	msm_property_install_range(&c_conn->property_info, "DST_X",
-			0x0, 0, UINT_MAX, 0, CONNECTOR_PROP_DST_X);
-	msm_property_install_range(&c_conn->property_info, "DST_Y",
-			0x0, 0, UINT_MAX, 0, CONNECTOR_PROP_DST_Y);
-	msm_property_install_range(&c_conn->property_info, "DST_W",
-			0x0, 0, UINT_MAX, 0, CONNECTOR_PROP_DST_W);
-	msm_property_install_range(&c_conn->property_info, "DST_H",
-			0x0, 0, UINT_MAX, 0, CONNECTOR_PROP_DST_H);
-
-	/*
-	 * Populate info buffer
-	 */
-	if (format_list) {
-		dpu_kms_info_start(info, "pixel_formats");
-		while (format_list->fourcc_format) {
-			dpu_kms_info_append_format(info,
-					format_list->fourcc_format,
-					format_list->modifier);
-			++format_list;
-		}
-		dpu_kms_info_stop(info);
-	}
-
-	dpu_kms_info_add_keyint(info,
-			"wb_intf_index",
-			wb_dev->wb_idx - WB_0);
-
-	dpu_kms_info_add_keyint(info,
-			"maxlinewidth",
-			wb_dev->wb_cfg->sblk->maxlinewidth);
-
-	dpu_kms_info_start(info, "features");
-	if (wb_dev->wb_cfg && (wb_dev->wb_cfg->features & DPU_WB_UBWC))
-		dpu_kms_info_append(info, "wb_ubwc");
-	dpu_kms_info_stop(info);
-
-	return 0;
-}
-
-struct drm_framebuffer *dpu_wb_get_output_fb(struct dpu_wb_device *wb_dev)
-{
-	struct drm_framebuffer *fb;
-
-	if (!wb_dev || !wb_dev->connector) {
-		DPU_ERROR("invalid params\n");
-		return NULL;
-	}
-
-	DPU_DEBUG("\n");
-
-	mutex_lock(&wb_dev->wb_lock);
-	fb = dpu_wb_connector_state_get_output_fb(wb_dev->connector->state);
-	mutex_unlock(&wb_dev->wb_lock);
-
-	return fb;
-}
-
-int dpu_wb_get_output_roi(struct dpu_wb_device *wb_dev, struct dpu_rect *roi)
-{
-	int rc;
-
-	if (!wb_dev || !wb_dev->connector || !roi) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	mutex_lock(&wb_dev->wb_lock);
-	rc = dpu_wb_connector_state_get_output_roi(
-			wb_dev->connector->state, roi);
-	mutex_unlock(&wb_dev->wb_lock);
-
-	return rc;
-}
-
-u32 dpu_wb_get_num_of_displays(void)
-{
-	u32 count = 0;
-	struct dpu_wb_device *wb_dev;
-
-	DPU_DEBUG("\n");
-
-	mutex_lock(&dpu_wb_list_lock);
-	list_for_each_entry(wb_dev, &dpu_wb_list, wb_list) {
-		count++;
-	}
-	mutex_unlock(&dpu_wb_list_lock);
-
-	return count;
-}
-
-int wb_display_get_displays(void **display_array, u32 max_display_count)
-{
-	struct dpu_wb_device *curr;
-	int i = 0;
-
-	DPU_DEBUG("\n");
-
-	if (!display_array || !max_display_count) {
-		if (!display_array)
-			DPU_ERROR("invalid param\n");
-		return 0;
-	}
-
-	mutex_lock(&dpu_wb_list_lock);
-	list_for_each_entry(curr, &dpu_wb_list, wb_list) {
-		if (i >= max_display_count)
-			break;
-		display_array[i++] = curr;
-	}
-	mutex_unlock(&dpu_wb_list_lock);
-
-	return i;
-}
-
-int dpu_wb_config(struct drm_device *drm_dev, void *data,
-				struct drm_file *file_priv)
-{
-	struct dpu_drm_wb_cfg *config = data;
-	struct msm_drm_private *priv;
-	struct dpu_wb_device *wb_dev = NULL;
-	struct dpu_wb_device *curr;
-	struct drm_connector *connector;
-	uint32_t flags;
-	uint32_t connector_id;
-	uint32_t count_modes;
-	uint64_t modes;
-	int rc;
-
-	if (!drm_dev || !data) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	flags = config->flags;
-	connector_id = config->connector_id;
-	count_modes = config->count_modes;
-	modes = config->modes;
-
-	priv = drm_dev->dev_private;
-
-	connector = drm_connector_lookup(drm_dev, NULL, connector_id);
-	if (!connector) {
-		DPU_ERROR("failed to find connector\n");
-		rc = -ENOENT;
-		goto fail;
-	}
-
-	mutex_lock(&dpu_wb_list_lock);
-	list_for_each_entry(curr, &dpu_wb_list, wb_list) {
-		if (curr->connector == connector) {
-			wb_dev = curr;
-			break;
-		}
-	}
-	mutex_unlock(&dpu_wb_list_lock);
-
-	if (!wb_dev) {
-		DPU_ERROR("failed to find wb device\n");
-		rc = -ENOENT;
-		goto fail;
-	}
-
-	mutex_lock(&wb_dev->wb_lock);
-
-	rc = dpu_wb_connector_set_modes(wb_dev, count_modes,
-		(struct drm_mode_modeinfo __user *) (uintptr_t) modes,
-		(flags & DPU_DRM_WB_CFG_FLAGS_CONNECTED) ? true : false);
-
-	mutex_unlock(&wb_dev->wb_lock);
-	drm_helper_hpd_irq_event(drm_dev);
-fail:
-	return rc;
-}
-
-/**
- * _dpu_wb_dev_init - perform device initialization
- * @wb_dev:	Pointer to writeback device
- */
-static int _dpu_wb_dev_init(struct dpu_wb_device *wb_dev)
-{
-	int rc = 0;
-
-	if (!wb_dev) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	return rc;
-}
-
-/**
- * _dpu_wb_dev_deinit - perform device de-initialization
- * @wb_dev:	Pointer to writeback device
- */
-static int _dpu_wb_dev_deinit(struct dpu_wb_device *wb_dev)
-{
-	int rc = 0;
-
-	if (!wb_dev) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	return rc;
-}
-
-/**
- * dpu_wb_bind - bind writeback device with controlling device
- * @dev:        Pointer to base of platform device
- * @master:     Pointer to container of drm device
- * @data:       Pointer to private data
- * Returns:     Zero on success
- */
-static int dpu_wb_bind(struct device *dev, struct device *master, void *data)
-{
-	struct dpu_wb_device *wb_dev;
-
-	if (!dev || !master) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	wb_dev = platform_get_drvdata(to_platform_device(dev));
-	if (!wb_dev) {
-		DPU_ERROR("invalid wb device\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	mutex_lock(&wb_dev->wb_lock);
-	wb_dev->drm_dev = dev_get_drvdata(master);
-	mutex_unlock(&wb_dev->wb_lock);
-
-	return 0;
-}
-
-/**
- * dpu_wb_unbind - unbind writeback from controlling device
- * @dev:        Pointer to base of platform device
- * @master:     Pointer to container of drm device
- * @data:       Pointer to private data
- */
-static void dpu_wb_unbind(struct device *dev,
-		struct device *master, void *data)
-{
-	struct dpu_wb_device *wb_dev;
-
-	if (!dev) {
-		DPU_ERROR("invalid params\n");
-		return;
-	}
-
-	wb_dev = platform_get_drvdata(to_platform_device(dev));
-	if (!wb_dev) {
-		DPU_ERROR("invalid wb device\n");
-		return;
-	}
-
-	DPU_DEBUG("\n");
-
-	mutex_lock(&wb_dev->wb_lock);
-	wb_dev->drm_dev = NULL;
-	mutex_unlock(&wb_dev->wb_lock);
-}
-
-static const struct component_ops dpu_wb_comp_ops = {
-	.bind = dpu_wb_bind,
-	.unbind = dpu_wb_unbind,
-};
-
-/**
- * dpu_wb_drm_init - perform DRM initialization
- * @wb_dev:	Pointer to writeback device
- * @encoder:	Pointer to associated encoder
- */
-int dpu_wb_drm_init(struct dpu_wb_device *wb_dev, struct drm_encoder *encoder)
-{
-	int rc = 0;
-
-	if (!wb_dev || !wb_dev->drm_dev || !encoder) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	mutex_lock(&wb_dev->wb_lock);
-
-	if (wb_dev->drm_dev->dev_private) {
-		struct msm_drm_private *priv = wb_dev->drm_dev->dev_private;
-		struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
-
-		if (wb_dev->index < dpu_kms->catalog->wb_count) {
-			wb_dev->wb_idx = dpu_kms->catalog->wb[wb_dev->index].id;
-			wb_dev->wb_cfg = &dpu_kms->catalog->wb[wb_dev->index];
-		}
-	}
-
-	wb_dev->drm_dev = encoder->dev;
-	wb_dev->encoder = encoder;
-	mutex_unlock(&wb_dev->wb_lock);
-	return rc;
-}
-
-int dpu_wb_drm_deinit(struct dpu_wb_device *wb_dev)
-{
-	int rc = 0;
-
-	if (!wb_dev) {
-		DPU_ERROR("invalid params\n");
-		return -EINVAL;
-	}
-
-	DPU_DEBUG("\n");
-
-	return rc;
-}
-
-/**
- * dpu_wb_probe - load writeback module
- * @pdev:	Pointer to platform device
- */
-static int dpu_wb_probe(struct platform_device *pdev)
-{
-	struct dpu_wb_device *wb_dev;
-	int ret;
-
-	wb_dev = devm_kzalloc(&pdev->dev, sizeof(*wb_dev), GFP_KERNEL);
-	if (!wb_dev)
-		return -ENOMEM;
-
-	DPU_DEBUG("\n");
-
-	ret = of_property_read_u32(pdev->dev.of_node, "cell-index",
-			&wb_dev->index);
-	if (ret) {
-		DPU_DEBUG("cell index not set, default to 0\n");
-		wb_dev->index = 0;
-	}
-
-	wb_dev->name = of_get_property(pdev->dev.of_node, "label", NULL);
-	if (!wb_dev->name) {
-		DPU_DEBUG("label not set, default to unknown\n");
-		wb_dev->name = "unknown";
-	}
-
-	wb_dev->wb_idx = DPU_NONE;
-
-	mutex_init(&wb_dev->wb_lock);
-	platform_set_drvdata(pdev, wb_dev);
-
-	mutex_lock(&dpu_wb_list_lock);
-	list_add(&wb_dev->wb_list, &dpu_wb_list);
-	mutex_unlock(&dpu_wb_list_lock);
-
-	if (!_dpu_wb_dev_init(wb_dev)) {
-		ret = component_add(&pdev->dev, &dpu_wb_comp_ops);
-		if (ret)
-			pr_err("component add failed\n");
-	}
-
-	return ret;
-}
-
-/**
- * dpu_wb_remove - unload writeback module
- * @pdev:	Pointer to platform device
- */
-static int dpu_wb_remove(struct platform_device *pdev)
-{
-	struct dpu_wb_device *wb_dev;
-	struct dpu_wb_device *curr, *next;
-
-	wb_dev = platform_get_drvdata(pdev);
-	if (!wb_dev)
-		return 0;
-
-	DPU_DEBUG("\n");
-
-	(void)_dpu_wb_dev_deinit(wb_dev);
-
-	mutex_lock(&dpu_wb_list_lock);
-	list_for_each_entry_safe(curr, next, &dpu_wb_list, wb_list) {
-		if (curr == wb_dev) {
-			list_del(&wb_dev->wb_list);
-			break;
-		}
-	}
-	mutex_unlock(&dpu_wb_list_lock);
-
-	kfree(wb_dev->modes);
-	mutex_destroy(&wb_dev->wb_lock);
-
-	platform_set_drvdata(pdev, NULL);
-	devm_kfree(&pdev->dev, wb_dev);
-
-	return 0;
-}
-
-static const struct of_device_id dt_match[] = {
-	{ .compatible = "qcom,wb-display"},
-	{}
-};
-
-static struct platform_driver dpu_wb_driver = {
-	.probe = dpu_wb_probe,
-	.remove = dpu_wb_remove,
-	.driver = {
-		.name = "dpu_wb",
-		.of_match_table = dt_match,
-	},
-};
-
-static int __init dpu_wb_register(void)
-{
-	return platform_driver_register(&dpu_wb_driver);
-}
-
-static void __exit dpu_wb_unregister(void)
-{
-	platform_driver_unregister(&dpu_wb_driver);
-}
-
-module_init(dpu_wb_register);
-module_exit(dpu_wb_unregister);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_wb.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_wb.h
deleted file mode 100644
index a6063e0..0000000
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_wb.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __DPU_WB_H__
-#define __DPU_WB_H__
-
-#include <linux/platform_device.h>
-
-#include "msm_kms.h"
-#include "dpu_kms.h"
-#include "dpu_connector.h"
-
-/**
- * struct dpu_wb_device - Writeback device context
- * @drm_dev:		Pointer to controlling DRM device
- * @index:		Index of hardware instance from device tree
- * @wb_idx:		Writeback identifier of enum dpu_wb
- * @wb_cfg:		Writeback configuration catalog
- * @name:		Name of writeback device from device tree
- * @display_type:	Display type from device tree
- * @wb_list		List of all writeback devices
- * @wb_lock		Serialization lock for writeback context structure
- * @connector:		Connector associated with writeback device
- * @encoder:		Encoder associated with writeback device
- * @max_mixer_width:    Max width supported by DPU LM HW block
- * @count_modes:	Length of writeback connector modes array
- * @modes:		Writeback connector modes array
- */
-struct dpu_wb_device {
-	struct drm_device *drm_dev;
-
-	u32 index;
-	u32 wb_idx;
-	struct dpu_wb_cfg *wb_cfg;
-	const char *name;
-
-	struct list_head wb_list;
-	struct mutex wb_lock;
-
-	struct drm_connector *connector;
-	struct drm_encoder *encoder;
-
-	enum drm_connector_status detect_status;
-	u32 max_mixer_width;
-
-	u32 count_modes;
-	struct drm_mode_modeinfo *modes;
-};
-
-/**
- * dpu_wb_get_index - get device index of the given writeback device
- * @wb_dev:	Pointer to writeback device
- * Returns:	Index of hardware instance
- */
-static inline
-int dpu_wb_get_index(struct dpu_wb_device *wb_dev)
-{
-	return wb_dev ? wb_dev->index : -1;
-}
-
-/**
- * dpu_wb_get_output_fb - get framebuffer in current atomic state
- * @wb_dev:	Pointer to writeback device
- * Returns:	Pointer to framebuffer
- */
-struct drm_framebuffer *dpu_wb_get_output_fb(struct dpu_wb_device *wb_dev);
-
-/**
- * dpu_wb_get_output_roi - get region-of-interest in current atomic state
- * @wb_dev:	Pointer to writeback device
- * @roi:	Pointer to region of interest
- * Returns:	0 if success; error code otherwise
- */
-int dpu_wb_get_output_roi(struct dpu_wb_device *wb_dev, struct dpu_rect *roi);
-
-/**
- * dpu_wb_get_num_of_displays - get total number of writeback devices
- * Returns:	Number of writeback devices
- */
-u32 dpu_wb_get_num_of_displays(void);
-
-/**
- * wb_display_get_displays - returns pointers for supported display devices
- * @display_array: Pointer to display array to be filled
- * @max_display_count: Size of display_array
- * @Returns: Number of display entries filled
- */
-int wb_display_get_displays(void **display_array, u32 max_display_count);
-
-void dpu_wb_set_active_state(struct dpu_wb_device *wb_dev, bool is_active);
-bool dpu_wb_is_active(struct dpu_wb_device *wb_dev);
-
-/**
- * dpu_wb_drm_init - perform DRM initialization
- * @wb_dev:	Pointer to writeback device
- * @encoder:	Pointer to associated encoder
- * Returns:	0 if success; error code otherwise
- */
-int dpu_wb_drm_init(struct dpu_wb_device *wb_dev, struct drm_encoder *encoder);
-
-/**
- * dpu_wb_drm_deinit - perform DRM de-initialization
- * @wb_dev:	Pointer to writeback device
- * Returns:	0 if success; error code otherwise
- */
-int dpu_wb_drm_deinit(struct dpu_wb_device *wb_dev);
-
-/**
- * dpu_wb_config - setup connection status and available drm modes of the
- *			given writeback connector
- * @drm_dev:	Pointer to DRM device
- * @data:	Pointer to writeback configuration
- * @file_priv:	Pointer file private data
- * Returns:	0 if success; error code otherwise
- *
- * This function will initiate hot-plug detection event.
- */
-int dpu_wb_config(struct drm_device *drm_dev, void *data,
-				struct drm_file *file_priv);
-
-/**
- * dpu_wb_connector_post_init - perform writeback specific initialization
- * @connector: Pointer to drm connector structure
- * @info: Pointer to connector info
- * @display: Pointer to private display structure
- * Returns: Zero on success
- */
-int dpu_wb_connector_post_init(struct drm_connector *connector,
-		void *info,
-		void *display);
-
-/**
- * dpu_wb_connector_detect - perform writeback connection status detection
- * @connector:	Pointer to connector
- * @force:	Indicate force detection
- * @display:	Pointer to writeback device
- * Returns:	connector status
- */
-enum drm_connector_status
-dpu_wb_connector_detect(struct drm_connector *connector,
-		bool force,
-		void *display);
-
-/**
- * dpu_wb_connector_get_modes - get display modes of connector
- * @connector:	Pointer to connector
- * @display:	Pointer to writeback device
- * Returns:	Number of modes
- *
- * If display modes are not specified in writeback configuration IOCTL, this
- * function will install default EDID modes up to maximum resolution support.
- */
-int dpu_wb_connector_get_modes(struct drm_connector *connector, void *display);
-
-/**
- * dpu_wb_connector_set_property - set atomic connector property
- * @connector: Pointer to drm connector structure
- * @state: Pointer to drm connector state structure
- * @property_index: DRM property index
- * @value: Incoming property value
- * @display: Pointer to private display structure
- * Returns: Zero on success
- */
-int dpu_wb_connector_set_property(struct drm_connector *connector,
-		struct drm_connector_state *state,
-		int property_index,
-		uint64_t value,
-		void *display);
-
-/**
- * dpu_wb_get_info - retrieve writeback 'display' information
- * @info: Pointer to display info structure
- * @display: Pointer to private display structure
- * Returns: Zero on success
- */
-int dpu_wb_get_info(struct msm_display_info *info, void *display);
-
-/**
- * dpu_wb_get_mode_info - retrieve information of the mode selected
- * @drm_mode: Display mode set for the display
- * @mode_info: Out parameter. information of the mode.
- * @max_mixer_width: max width supported by HW layer mixer
- * Returns: zero on success
- */
-int dpu_wb_get_mode_info(const struct drm_display_mode *drm_mode,
-		struct msm_mode_info *mode_info, u32 max_mixer_width);
-
-/**
- * dpu_wb_connector_get_wb - retrieve writeback device of the given connector
- * @connector: Pointer to drm connector
- * Returns: Pointer to writeback device on success; NULL otherwise
- */
-static inline
-struct dpu_wb_device *dpu_wb_connector_get_wb(struct drm_connector *connector)
-{
-	if (!connector ||
-		(connector->connector_type != DRM_MODE_CONNECTOR_VIRTUAL)) {
-		DPU_ERROR("invalid params\n");
-		return NULL;
-	}
-
-	return dpu_connector_get_display(connector);
-}
-
-/**
- * dpu_wb_connector_state_get_output_fb - get framebuffer of given state
- * @state:	Pointer to connector state
- * Returns:	Pointer to framebuffer
- */
-struct drm_framebuffer *
-dpu_wb_connector_state_get_output_fb(struct drm_connector_state *state);
-
-/**
- * dpu_wb_connector_state_get_output_roi - get roi from given atomic state
- * @state:	Pointer to atomic state
- * @roi:	Pointer to region of interest
- * Returns:	0 if success; error code otherwise
- */
-int dpu_wb_connector_state_get_output_roi(struct drm_connector_state *state,
-		struct dpu_rect *roi);
-
-#endif /* __DPU_WB_H__ */
-
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 06/11] drm/msm/dpu: remove hdcp support
  2018-05-30 14:49 [DPU PATCH 00/11] Remove unused code and cleanup devicetree bindings for DPU driver Rajesh Yadav
  2018-05-30 14:49 ` [DPU PATCH 05/11] drm/msm/dpu: remove writeback support Rajesh Yadav
@ 2018-05-30 14:49 ` Rajesh Yadav
  2018-05-30 14:49 ` [DPU PATCH 08/11] dt-bindings: msm/disp: cleanup bindings for Snapdragon 845 DPU Rajesh Yadav
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  3 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel, freedreno, linux-arm-msm, devicetree; +Cc: Rajesh Yadav, hoegsberg

Remove hdcp 1.x support from dpu driver.
The hdcp 1.x support will be posted back with
display port driver.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 drivers/gpu/drm/msm/dpu_hdcp.h    |   74 --
 drivers/gpu/drm/msm/dpu_hdcp_1x.c | 1579 -------------------------------------
 2 files changed, 1653 deletions(-)
 delete mode 100644 drivers/gpu/drm/msm/dpu_hdcp.h
 delete mode 100644 drivers/gpu/drm/msm/dpu_hdcp_1x.c

diff --git a/drivers/gpu/drm/msm/dpu_hdcp.h b/drivers/gpu/drm/msm/dpu_hdcp.h
deleted file mode 100644
index 63a98ca..0000000
--- a/drivers/gpu/drm/msm/dpu_hdcp.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Copyright (c) 2012, 2014-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __DPU_HDCP_H__
-#define __DPU_HDCP_H__
-
-#include <soc/qcom/scm.h>
-#include <linux/types.h>
-#include <linux/bitops.h>
-#include <linux/debugfs.h>
-#include <linux/of_device.h>
-#include <linux/i2c.h>
-#include <drm/drmP.h>
-#include <drm/drm_crtc.h>
-#include <drm/drm_edid.h>
-#include "dpu_kms.h"
-
-enum dpu_hdcp_client_id {
-	HDCP_CLIENT_HDMI,
-	HDCP_CLIENT_DP,
-};
-
-enum dpu_hdcp_states {
-	HDCP_STATE_INACTIVE,
-	HDCP_STATE_AUTHENTICATING,
-	HDCP_STATE_AUTHENTICATED,
-	HDCP_STATE_AUTH_FAIL,
-	HDCP_STATE_AUTH_ENC_NONE,
-	HDCP_STATE_AUTH_ENC_1X,
-	HDCP_STATE_AUTH_ENC_2P2
-};
-
-struct dpu_hdcp_init_data {
-	struct dss_io_data *core_io;
-	struct dss_io_data *qfprom_io;
-	struct dss_io_data *hdcp_io;
-	struct drm_dp_aux *drm_aux;
-	struct mutex *mutex;
-	struct workqueue_struct *workq;
-	void *cb_data;
-	void (*notify_status)(void *cb_data, enum dpu_hdcp_states status);
-	u8 sink_rx_status;
-	unsigned char *revision;
-	u32 phy_addr;
-	bool sec_access;
-	enum dpu_hdcp_client_id client_id;
-};
-
-struct dpu_hdcp_ops {
-	int (*isr)(void *ptr);
-	int (*cp_irq)(void *ptr);
-	int (*reauthenticate)(void *input);
-	int (*authenticate)(void *hdcp_ctrl);
-	bool (*feature_supported)(void *input);
-	void (*off)(void *hdcp_ctrl);
-};
-
-void *dpu_hdcp_1x_init(struct dpu_hdcp_init_data *init_data);
-void dpu_hdcp_1x_deinit(void *input);
-struct dpu_hdcp_ops *dpu_hdcp_1x_start(void *input);
-void *dpu_dp_hdcp2p2_init(struct dpu_hdcp_init_data *init_data);
-void dpu_dp_hdcp2p2_deinit(void *input);
-const char *dpu_hdcp_state_name(enum dpu_hdcp_states hdcp_state);
-struct dpu_hdcp_ops *dpu_dp_hdcp2p2_start(void *input);
-#endif /* __DPU_HDCP_H__ */
diff --git a/drivers/gpu/drm/msm/dpu_hdcp_1x.c b/drivers/gpu/drm/msm/dpu_hdcp_1x.c
deleted file mode 100644
index ebbd591..0000000
--- a/drivers/gpu/drm/msm/dpu_hdcp_1x.c
+++ /dev/null
@@ -1,1579 +0,0 @@
-/* Copyright (c) 2010-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#define pr_fmt(fmt)	"[dpu-hdcp1x] %s: " fmt, __func__
-
-#include <linux/io.h>
-#include <linux/types.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/stat.h>
-#include <linux/iopoll.h>
-#include <linux/hdcp_qseecom.h>
-#include <drm/drm_dp_helper.h>
-#include "dpu_hdcp.h"
-#include "hdmi.xml.h"
-#include "video/msm_hdmi_hdcp_mgr.h"
-#include "dp/dp_reg.h"
-
-#define DPU_HDCP_STATE_NAME (dpu_hdcp_state_name(hdcp->hdcp_state))
-
-/* QFPROM Registers for HDMI/HDCP */
-#define QFPROM_RAW_FEAT_CONFIG_ROW0_LSB  (0x000000F8)
-#define QFPROM_RAW_FEAT_CONFIG_ROW0_MSB  (0x000000FC)
-#define QFPROM_RAW_VERSION_4             (0x000000A8)
-#define SEC_CTRL_HW_VERSION              (0x00006000)
-#define HDCP_KSV_LSB                     (0x000060D8)
-#define HDCP_KSV_MSB                     (0x000060DC)
-#define HDCP_KSV_VERSION_4_OFFSET        (0x00000014)
-
-/* SEC_CTRL version that supports HDCP SEL */
-#define HDCP_SEL_MIN_SEC_VERSION         (0x50010000)
-
-/* HDCP Keys state based on HDMI_HDCP_LINK0_STATUS:KEYS_STATE */
-#define HDCP_KEYS_STATE_NO_KEYS		0
-#define HDCP_KEYS_STATE_NOT_CHECKED	1
-#define HDCP_KEYS_STATE_CHECKING	2
-#define HDCP_KEYS_STATE_VALID		3
-#define HDCP_KEYS_STATE_AKSV_NOT_VALID	4
-#define HDCP_KEYS_STATE_CHKSUM_MISMATCH	5
-#define HDCP_KEYS_STATE_PROD_AKSV	6
-#define HDCP_KEYS_STATE_RESERVED	7
-
-#define TZ_HDCP_CMD_ID 0x00004401
-
-#define HDCP_INT_CLR (isr->auth_success_ack | isr->auth_fail_ack | \
-			isr->auth_fail_info_ack | isr->tx_req_ack | \
-			isr->encryption_ready_ack | \
-			isr->encryption_not_ready_ack | isr->tx_req_done_ack)
-
-#define HDCP_INT_EN (isr->auth_success_mask | isr->auth_fail_mask | \
-			isr->encryption_ready_mask | \
-			isr->encryption_not_ready_mask)
-
-#define HDCP_POLL_SLEEP_US   (20 * 1000)
-#define HDCP_POLL_TIMEOUT_US (HDCP_POLL_SLEEP_US * 100)
-
-#define dpu_hdcp_1x_state(x) (hdcp->hdcp_state == x)
-
-struct dpu_hdcp_sink_addr {
-	char *name;
-	u32 addr;
-	u32 len;
-};
-
-struct dpu_hdcp_1x_reg_data {
-	u32 reg_id;
-	struct dpu_hdcp_sink_addr *sink;
-};
-
-struct dpu_hdcp_sink_addr_map {
-	/* addresses to read from sink */
-	struct dpu_hdcp_sink_addr bcaps;
-	struct dpu_hdcp_sink_addr bksv;
-	struct dpu_hdcp_sink_addr r0;
-	struct dpu_hdcp_sink_addr bstatus;
-	struct dpu_hdcp_sink_addr cp_irq_status;
-	struct dpu_hdcp_sink_addr ksv_fifo;
-	struct dpu_hdcp_sink_addr v_h0;
-	struct dpu_hdcp_sink_addr v_h1;
-	struct dpu_hdcp_sink_addr v_h2;
-	struct dpu_hdcp_sink_addr v_h3;
-	struct dpu_hdcp_sink_addr v_h4;
-
-	/* addresses to write to sink */
-	struct dpu_hdcp_sink_addr an;
-	struct dpu_hdcp_sink_addr aksv;
-	struct dpu_hdcp_sink_addr ainfo;
-};
-
-struct dpu_hdcp_int_set {
-	/* interrupt register */
-	u32 int_reg;
-
-	/* interrupt enable/disable masks */
-	u32 auth_success_mask;
-	u32 auth_fail_mask;
-	u32 encryption_ready_mask;
-	u32 encryption_not_ready_mask;
-	u32 tx_req_mask;
-	u32 tx_req_done_mask;
-
-	/* interrupt acknowledgment */
-	u32 auth_success_ack;
-	u32 auth_fail_ack;
-	u32 auth_fail_info_ack;
-	u32 encryption_ready_ack;
-	u32 encryption_not_ready_ack;
-	u32 tx_req_ack;
-	u32 tx_req_done_ack;
-
-	/* interrupt status */
-	u32 auth_success_int;
-	u32 auth_fail_int;
-	u32 encryption_ready;
-	u32 encryption_not_ready;
-	u32 tx_req_int;
-	u32 tx_req_done_int;
-};
-
-struct dpu_hdcp_reg_set {
-	u32 status;
-	u32 keys_offset;
-	u32 r0_offset;
-	u32 v_offset;
-	u32 ctrl;
-	u32 aksv_lsb;
-	u32 aksv_msb;
-	u32 entropy_ctrl0;
-	u32 entropy_ctrl1;
-	u32 sec_sha_ctrl;
-	u32 sec_sha_data;
-	u32 sha_status;
-
-	u32 data2_0;
-	u32 data3;
-	u32 data4;
-	u32 data5;
-	u32 data6;
-
-	u32 sec_data0;
-	u32 sec_data1;
-	u32 sec_data7;
-	u32 sec_data8;
-	u32 sec_data9;
-	u32 sec_data10;
-	u32 sec_data11;
-	u32 sec_data12;
-
-	u32 reset;
-	u32 reset_bit;
-
-	u32 repeater;
-};
-
-#define HDCP_REG_SET_CLIENT_HDMI \
-	{0}
-
-#define HDCP_REG_SET_CLIENT_DP \
-{DP_HDCP_STATUS, 16, 14, 13, DP_HDCP_CTRL, \
-	DP_HDCP_SW_LOWER_AKSV, DP_HDCP_SW_UPPER_AKSV, \
-	DP_HDCP_ENTROPY_CTRL0, DP_HDCP_ENTROPY_CTRL1, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_SHA_CTRL, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_SHA_DATA, \
-	DP_HDCP_SHA_STATUS, DP_HDCP_RCVPORT_DATA2_0, \
-	DP_HDCP_RCVPORT_DATA3, DP_HDCP_RCVPORT_DATA4, \
-	DP_HDCP_RCVPORT_DATA5, DP_HDCP_RCVPORT_DATA6, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA0, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA1, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA7, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA8, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA9, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA10, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA11, \
-	HDCP_SEC_DP_TZ_HV_HLOS_HDCP_RCVPORT_DATA12, \
-	DP_SW_RESET, BIT(1), BIT(1)}
-
-#define HDCP_HDMI_SINK_ADDR_MAP \
-	{{"bcaps", 0x40, 1}, {"bksv", 0x00, 5}, {"r0'", 0x08, 2}, \
-	 {"bstatus", 0x41, 2}, {"??", 0x0, 0}, {"ksv-fifo", 0x43, 0}, \
-	 {"v_h0", 0x20, 4}, {"v_h1", 0x24, 4}, {"v_h2", 0x28, 4}, \
-	 {"v_h3", 0x2c, 4}, {"v_h4", 0x30, 4}, {"an", 0x18, 8}, \
-	 {"aksv", 0x10, 5}, {"ainfo", 0x00, 0},}
-
-#define HDCP_DP_SINK_ADDR_MAP \
-	{{"bcaps", 0x68028, 1}, {"bksv", 0x68000, 5}, {"r0'", 0x68005, 2}, \
-	 {"binfo", 0x6802A, 2}, {"cp_irq_status", 0x68029, 1}, \
-	 {"ksv-fifo", 0x6802C, 0}, {"v_h0", 0x68014, 4}, {"v_h1", 0x68018, 4}, \
-	 {"v_h2", 0x6801C, 4}, {"v_h3", 0x68020, 4}, {"v_h4", 0x68024, 4}, \
-	 {"an", 0x6800C, 8}, {"aksv", 0x68007, 5}, {"ainfo", 0x6803B, 1} }
-
-#define HDCP_HDMI_INT_SET \
-	{0}
-
-#define HDCP_DP_INT_SET \
-	{DP_INTR_STATUS2, \
-	 BIT(17), BIT(20), BIT(24), BIT(27), 0, 0, \
-	 BIT(16), BIT(19), BIT(21), BIT(23), BIT(26), 0, 0, \
-	 BIT(15), BIT(18), BIT(22), BIT(25), 0, 0}
-
-struct dpu_hdcp_1x {
-	u8 bcaps;
-	u32 tp_msgid;
-	u32 an_0, an_1, aksv_0, aksv_1;
-	bool sink_r0_ready;
-	bool reauth;
-	bool ksv_ready;
-	enum dpu_hdcp_states hdcp_state;
-	struct HDCP_V2V1_MSG_TOPOLOGY cached_tp;
-	struct HDCP_V2V1_MSG_TOPOLOGY current_tp;
-	struct delayed_work hdcp_auth_work;
-	struct completion r0_checked;
-	struct completion sink_r0_available;
-	struct dpu_hdcp_init_data init_data;
-	struct dpu_hdcp_ops *ops;
-	struct dpu_hdcp_reg_set reg_set;
-	struct dpu_hdcp_int_set int_set;
-	struct dpu_hdcp_sink_addr_map sink_addr;
-	struct workqueue_struct *workq;
-};
-
-const char *dpu_hdcp_state_name(enum dpu_hdcp_states hdcp_state)
-{
-	switch (hdcp_state) {
-	case HDCP_STATE_INACTIVE:	return "HDCP_STATE_INACTIVE";
-	case HDCP_STATE_AUTHENTICATING:	return "HDCP_STATE_AUTHENTICATING";
-	case HDCP_STATE_AUTHENTICATED:	return "HDCP_STATE_AUTHENTICATED";
-	case HDCP_STATE_AUTH_FAIL:	return "HDCP_STATE_AUTH_FAIL";
-	default:			return "???";
-	}
-}
-
-static int dpu_hdcp_1x_count_one(u8 *array, u8 len)
-{
-	int i, j, count = 0;
-
-	for (i = 0; i < len; i++)
-		for (j = 0; j < 8; j++)
-			count += (((array[i] >> j) & 0x1) ? 1 : 0);
-	return count;
-}
-
-static int dpu_hdcp_1x_load_keys(void *input)
-{
-	int rc = 0;
-	bool use_sw_keys = false;
-	u32 reg_val;
-	u32 ksv_lsb_addr, ksv_msb_addr;
-	u32 aksv_lsb, aksv_msb;
-	u8 aksv[5];
-	struct dss_io_data *io;
-	struct dss_io_data *qfprom_io;
-	struct dpu_hdcp_1x *hdcp = input;
-	struct dpu_hdcp_reg_set *reg_set;
-
-	if (!hdcp || !hdcp->init_data.core_io ||
-		!hdcp->init_data.qfprom_io) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_INACTIVE) &&
-	    !dpu_hdcp_1x_state(HDCP_STATE_AUTH_FAIL)) {
-		pr_err("%s: invalid state. returning\n",
-			DPU_HDCP_STATE_NAME);
-		rc = -EINVAL;
-		goto end;
-	}
-
-	io = hdcp->init_data.core_io;
-	qfprom_io = hdcp->init_data.qfprom_io;
-	reg_set = &hdcp->reg_set;
-
-	/* On compatible hardware, use SW keys */
-	reg_val = DSS_REG_R(qfprom_io, SEC_CTRL_HW_VERSION);
-	if (reg_val >= HDCP_SEL_MIN_SEC_VERSION) {
-		reg_val = DSS_REG_R(qfprom_io,
-			QFPROM_RAW_FEAT_CONFIG_ROW0_MSB +
-			QFPROM_RAW_VERSION_4);
-
-		if (!(reg_val & BIT(23)))
-			use_sw_keys = true;
-	}
-
-	if (use_sw_keys) {
-		if (hdcp1_set_keys(&aksv_msb, &aksv_lsb)) {
-			pr_err("setting hdcp SW keys failed\n");
-			rc = -EINVAL;
-			goto end;
-		}
-	} else {
-		/* Fetch aksv from QFPROM, this info should be public. */
-		ksv_lsb_addr = HDCP_KSV_LSB;
-		ksv_msb_addr = HDCP_KSV_MSB;
-
-		if (hdcp->init_data.sec_access) {
-			ksv_lsb_addr += HDCP_KSV_VERSION_4_OFFSET;
-			ksv_msb_addr += HDCP_KSV_VERSION_4_OFFSET;
-		}
-
-		aksv_lsb = DSS_REG_R(qfprom_io, ksv_lsb_addr);
-		aksv_msb = DSS_REG_R(qfprom_io, ksv_msb_addr);
-	}
-
-	pr_debug("%s: AKSV=%02x%08x\n", DPU_HDCP_STATE_NAME,
-		aksv_msb, aksv_lsb);
-
-	aksv[0] =  aksv_lsb        & 0xFF;
-	aksv[1] = (aksv_lsb >> 8)  & 0xFF;
-	aksv[2] = (aksv_lsb >> 16) & 0xFF;
-	aksv[3] = (aksv_lsb >> 24) & 0xFF;
-	aksv[4] =  aksv_msb        & 0xFF;
-
-	/* check there are 20 ones in AKSV */
-	if (dpu_hdcp_1x_count_one(aksv, 5) != 20) {
-		pr_err("AKSV bit count failed\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	DSS_REG_W(io, reg_set->aksv_lsb, aksv_lsb);
-	DSS_REG_W(io, reg_set->aksv_msb, aksv_msb);
-
-	/* Setup seed values for random number An */
-	DSS_REG_W(io, reg_set->entropy_ctrl0, 0xB1FFB0FF);
-	DSS_REG_W(io, reg_set->entropy_ctrl1, 0xF00DFACE);
-
-	/* make sure hw is programmed */
-	wmb();
-
-	/* enable hdcp engine */
-	DSS_REG_W(io, reg_set->ctrl, 0x1);
-
-	hdcp->hdcp_state = HDCP_STATE_AUTHENTICATING;
-end:
-	return rc;
-}
-
-static int dpu_hdcp_1x_read(struct dpu_hdcp_1x *hdcp,
-			  struct dpu_hdcp_sink_addr *sink,
-			  u8 *buf, bool realign)
-{
-	int const max_size = 15;
-	int rc = 0, read_size = 0, bytes_read = 0;
-
-	if (hdcp->init_data.client_id == HDCP_CLIENT_DP) {
-		int size = sink->len, offset = sink->addr;
-
-		do {
-			read_size = min(size, max_size);
-
-			bytes_read = drm_dp_dpcd_read(hdcp->init_data.drm_aux,
-					offset, buf, read_size);
-			if (bytes_read != read_size) {
-				pr_err("fail: offset(0x%x), size(0x%x), rc(0x%x)\n",
-					offset, read_size, bytes_read);
-				break;
-			}
-
-			buf += read_size;
-			offset += read_size;
-			size -= read_size;
-		} while (size > 0);
-	}
-
-	return rc;
-}
-
-static int dpu_hdcp_1x_write(struct dpu_hdcp_1x *hdcp,
-			   struct dpu_hdcp_sink_addr *sink, u8 *buf)
-{
-	int const max_size = 16;
-	int rc = 0, write_size = 0, bytes_written = 0;
-
-	if (hdcp->init_data.client_id == HDCP_CLIENT_DP) {
-		int size = sink->len, offset = sink->addr;
-
-		do {
-			write_size = min(size, max_size);
-
-			bytes_written =
-				drm_dp_dpcd_write(hdcp->init_data.drm_aux,
-						offset, buf, write_size);
-			if (bytes_written != write_size) {
-				pr_err("fail: offset(0x%x), size(0x%x), rc(0x%x)\n",
-					offset, write_size, bytes_written);
-				break;
-			}
-
-			buf += write_size;
-			offset += write_size;
-			size -= write_size;
-		} while (size > 0);
-	}
-
-	return rc;
-}
-
-static void dpu_hdcp_1x_enable_interrupts(struct dpu_hdcp_1x *hdcp)
-{
-	u32 intr_reg;
-	struct dss_io_data *io;
-	struct dpu_hdcp_int_set *isr;
-
-	io = hdcp->init_data.core_io;
-	isr = &hdcp->int_set;
-
-	intr_reg = DSS_REG_R(io, isr->int_reg);
-
-	intr_reg |= HDCP_INT_CLR | HDCP_INT_EN;
-
-	DSS_REG_W(io, isr->int_reg, intr_reg);
-}
-
-static int dpu_hdcp_1x_read_bcaps(struct dpu_hdcp_1x *hdcp)
-{
-	int rc;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-	struct dss_io_data *hdcp_io = hdcp->init_data.hdcp_io;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	rc = dpu_hdcp_1x_read(hdcp, &hdcp->sink_addr.bcaps,
-		&hdcp->bcaps, false);
-	if (rc) {
-		pr_err("error reading bcaps\n");
-		goto error;
-	}
-
-	pr_debug("bcaps read: 0x%x\n", hdcp->bcaps);
-
-	hdcp->current_tp.ds_type = hdcp->bcaps & reg_set->repeater ?
-			DS_REPEATER : DS_RECEIVER;
-
-	pr_debug("ds: %s\n", hdcp->current_tp.ds_type == DS_REPEATER ?
-			"repeater" : "receiver");
-
-	/* Write BCAPS to the hardware */
-	DSS_REG_W(hdcp_io, reg_set->sec_data12, hdcp->bcaps);
-error:
-	return rc;
-}
-
-static int dpu_hdcp_1x_wait_for_hw_ready(struct dpu_hdcp_1x *hdcp)
-{
-	int rc;
-	u32 link0_status;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-	struct dss_io_data *io = hdcp->init_data.core_io;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	/* Wait for HDCP keys to be checked and validated */
-	rc = readl_poll_timeout(io->base + reg_set->status, link0_status,
-				((link0_status >> reg_set->keys_offset) & 0x7)
-					== HDCP_KEYS_STATE_VALID ||
-				!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING),
-				HDCP_POLL_SLEEP_US, HDCP_POLL_TIMEOUT_US);
-	if (rc) {
-		pr_err("key not ready\n");
-		goto error;
-	}
-
-	/*
-	 * 1.1_Features turned off by default.
-	 * No need to write AInfo since 1.1_Features is disabled.
-	 */
-	DSS_REG_W(io, reg_set->data4, 0);
-
-	/* Wait for An0 and An1 bit to be ready */
-	rc = readl_poll_timeout(io->base + reg_set->status, link0_status,
-				(link0_status & (BIT(8) | BIT(9))) ||
-				!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING),
-				HDCP_POLL_SLEEP_US, HDCP_POLL_TIMEOUT_US);
-	if (rc) {
-		pr_err("An not ready\n");
-		goto error;
-	}
-
-	/* As per hardware recommendations, wait before reading An */
-	msleep(20);
-error:
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING))
-		rc = -EINVAL;
-
-	return rc;
-}
-
-static int dpu_hdcp_1x_send_an_aksv_to_sink(struct dpu_hdcp_1x *hdcp)
-{
-	int rc;
-	u8 an[8], aksv[5];
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	an[0] =  hdcp->an_0        & 0xFF;
-	an[1] = (hdcp->an_0 >> 8)  & 0xFF;
-	an[2] = (hdcp->an_0 >> 16) & 0xFF;
-	an[3] = (hdcp->an_0 >> 24) & 0xFF;
-	an[4] =  hdcp->an_1        & 0xFF;
-	an[5] = (hdcp->an_1 >> 8)  & 0xFF;
-	an[6] = (hdcp->an_1 >> 16) & 0xFF;
-	an[7] = (hdcp->an_1 >> 24) & 0xFF;
-
-	pr_debug("an read: 0x%2x%2x%2x%2x%2x%2x%2x%2x\n",
-		an[7], an[6], an[5], an[4], an[3], an[2], an[1], an[0]);
-
-	rc = dpu_hdcp_1x_write(hdcp, &hdcp->sink_addr.an, an);
-	if (rc) {
-		pr_err("error writing an to sink\n");
-		goto error;
-	}
-
-	/* Copy An and AKSV to byte arrays for transmission */
-	aksv[0] =  hdcp->aksv_0        & 0xFF;
-	aksv[1] = (hdcp->aksv_0 >> 8)  & 0xFF;
-	aksv[2] = (hdcp->aksv_0 >> 16) & 0xFF;
-	aksv[3] = (hdcp->aksv_0 >> 24) & 0xFF;
-	aksv[4] =  hdcp->aksv_1        & 0xFF;
-
-	pr_debug("aksv read: 0x%2x%2x%2x%2x%2x\n",
-		aksv[4], aksv[3], aksv[2], aksv[1], aksv[0]);
-
-	rc = dpu_hdcp_1x_write(hdcp, &hdcp->sink_addr.aksv, aksv);
-	if (rc) {
-		pr_err("error writing aksv to sink\n");
-		goto error;
-	}
-error:
-	return rc;
-}
-
-static int dpu_hdcp_1x_read_an_aksv_from_hw(struct dpu_hdcp_1x *hdcp)
-{
-	struct dss_io_data *io = hdcp->init_data.core_io;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	hdcp->an_0 = DSS_REG_R(io, reg_set->data5);
-	if (hdcp->init_data.client_id == HDCP_CLIENT_DP) {
-		udelay(1);
-		hdcp->an_0 = DSS_REG_R(io, reg_set->data5);
-	}
-
-	hdcp->an_1 = DSS_REG_R(io, reg_set->data6);
-	if (hdcp->init_data.client_id == HDCP_CLIENT_DP) {
-		udelay(1);
-		hdcp->an_1 = DSS_REG_R(io, reg_set->data6);
-	}
-
-	/* Read AKSV */
-	hdcp->aksv_0 = DSS_REG_R(io, reg_set->data3);
-	hdcp->aksv_1 = DSS_REG_R(io, reg_set->data4);
-
-	return 0;
-}
-
-static int dpu_hdcp_1x_get_bksv_from_sink(struct dpu_hdcp_1x *hdcp)
-{
-	int rc;
-	u8 *bksv = hdcp->current_tp.bksv;
-	u32 link0_bksv_0, link0_bksv_1;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-	struct dss_io_data *hdcp_io  = hdcp->init_data.hdcp_io;
-
-	rc = dpu_hdcp_1x_read(hdcp, &hdcp->sink_addr.bksv, bksv, false);
-	if (rc) {
-		pr_err("error reading bksv from sink\n");
-		goto error;
-	}
-
-	pr_debug("bksv read: 0x%2x%2x%2x%2x%2x\n",
-		bksv[4], bksv[3], bksv[2], bksv[1], bksv[0]);
-
-	/* check there are 20 ones in BKSV */
-	if (dpu_hdcp_1x_count_one(bksv, 5) != 20) {
-		pr_err("%s: BKSV doesn't have 20 1's and 20 0's\n",
-			DPU_HDCP_STATE_NAME);
-		rc = -EINVAL;
-		goto error;
-	}
-
-	link0_bksv_0 = bksv[3];
-	link0_bksv_0 = (link0_bksv_0 << 8) | bksv[2];
-	link0_bksv_0 = (link0_bksv_0 << 8) | bksv[1];
-	link0_bksv_0 = (link0_bksv_0 << 8) | bksv[0];
-	link0_bksv_1 = bksv[4];
-
-	DSS_REG_W(hdcp_io, reg_set->sec_data0, link0_bksv_0);
-	DSS_REG_W(hdcp_io, reg_set->sec_data1, link0_bksv_1);
-error:
-	return rc;
-}
-
-static void dpu_hdcp_1x_enable_sink_irq_hpd(struct dpu_hdcp_1x *hdcp)
-{
-	u8 const required_major = 1, required_minor = 2;
-	u8 sink_major = 0, sink_minor = 0;
-	u8 enable_hpd_irq = 0x1;
-	int rc;
-	unsigned char revision = *hdcp->init_data.revision;
-
-	sink_major = (revision >> 4) & 0x0f;
-	sink_minor = revision & 0x0f;
-	pr_debug("revision: %d.%d\n", sink_major, sink_minor);
-
-	if ((sink_minor < required_minor) || (sink_major < required_major) ||
-	  (hdcp->current_tp.ds_type != DS_REPEATER)) {
-		pr_debug("sink irq hpd not enabled\n");
-		return;
-	}
-
-	rc = dpu_hdcp_1x_write(hdcp, &hdcp->sink_addr.ainfo, &enable_hpd_irq);
-	if (rc)
-		pr_debug("error writing ainfo to sink\n");
-}
-
-static int dpu_hdcp_1x_verify_r0(struct dpu_hdcp_1x *hdcp)
-{
-	int rc, r0_retry = 3;
-	u8 buf[2];
-	u32 link0_status, timeout_count;
-	u32 const r0_read_delay_us = 1;
-	u32 const r0_read_timeout_us = r0_read_delay_us * 10;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-	struct dss_io_data *io = hdcp->init_data.core_io;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	/* Wait for HDCP R0 computation to be completed */
-	rc = readl_poll_timeout(io->base + reg_set->status, link0_status,
-				(link0_status & BIT(reg_set->r0_offset)) ||
-				!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING),
-				HDCP_POLL_SLEEP_US, HDCP_POLL_TIMEOUT_US);
-	if (rc) {
-		pr_err("R0 not ready\n");
-		goto error;
-	}
-
-	/*
-	 * HDCP Compliace Test case 1A-01:
-	 * Wait here at least 100ms before reading R0'
-	 */
-	if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI) {
-		msleep(100);
-	} else {
-		if (!hdcp->sink_r0_ready) {
-			reinit_completion(&hdcp->sink_r0_available);
-			timeout_count = wait_for_completion_timeout(
-				&hdcp->sink_r0_available, HZ / 2);
-
-			if (hdcp->reauth) {
-				pr_err("sink R0 not ready\n");
-				rc = -EINVAL;
-				goto error;
-			}
-		}
-	}
-
-	do {
-		memset(buf, 0, sizeof(buf));
-
-		rc = dpu_hdcp_1x_read(hdcp, &hdcp->sink_addr.r0,
-			buf, false);
-		if (rc) {
-			pr_err("error reading R0' from sink\n");
-			goto error;
-		}
-
-		pr_debug("sink R0'read: %2x%2x\n", buf[1], buf[0]);
-
-		DSS_REG_W(io, reg_set->data2_0, (((u32)buf[1]) << 8) | buf[0]);
-
-		rc = readl_poll_timeout(io->base + reg_set->status,
-			link0_status, (link0_status & BIT(12)) ||
-			!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING),
-			r0_read_delay_us, r0_read_timeout_us);
-	} while (rc && --r0_retry);
-error:
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING))
-		rc = -EINVAL;
-
-	return rc;
-}
-
-static int dpu_hdcp_1x_authentication_part1(struct dpu_hdcp_1x *hdcp)
-{
-	int rc;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	dpu_hdcp_1x_enable_interrupts(hdcp);
-
-	rc = dpu_hdcp_1x_read_bcaps(hdcp);
-	if (rc)
-		goto error;
-
-	rc = dpu_hdcp_1x_wait_for_hw_ready(hdcp);
-	if (rc)
-		goto error;
-
-	rc = dpu_hdcp_1x_read_an_aksv_from_hw(hdcp);
-	if (rc)
-		goto error;
-
-	rc = dpu_hdcp_1x_get_bksv_from_sink(hdcp);
-	if (rc)
-		goto error;
-
-	rc = dpu_hdcp_1x_send_an_aksv_to_sink(hdcp);
-	if (rc)
-		goto error;
-
-	dpu_hdcp_1x_enable_sink_irq_hpd(hdcp);
-
-	rc = dpu_hdcp_1x_verify_r0(hdcp);
-	if (rc)
-		goto error;
-
-	pr_info("SUCCESSFUL\n");
-
-	return 0;
-error:
-	pr_err("%s: FAILED\n", DPU_HDCP_STATE_NAME);
-
-	return rc;
-}
-
-static int dpu_hdcp_1x_transfer_v_h(struct dpu_hdcp_1x *hdcp)
-{
-	int rc = 0;
-	struct dss_io_data *io = hdcp->init_data.hdcp_io;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-	struct dpu_hdcp_1x_reg_data reg_data[]  = {
-		{reg_set->sec_data7,  &hdcp->sink_addr.v_h0},
-		{reg_set->sec_data8,  &hdcp->sink_addr.v_h1},
-		{reg_set->sec_data9,  &hdcp->sink_addr.v_h2},
-		{reg_set->sec_data10, &hdcp->sink_addr.v_h3},
-		{reg_set->sec_data11, &hdcp->sink_addr.v_h4},
-	};
-	struct dpu_hdcp_sink_addr sink = {"V", reg_data->sink->addr};
-	u32 size = ARRAY_SIZE(reg_data);
-	u8 buf[0xFF] = {0};
-	u32 i = 0, len = 0;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	for (i = 0; i < size; i++) {
-		struct dpu_hdcp_1x_reg_data *rd = reg_data + i;
-
-		len += rd->sink->len;
-	}
-
-	sink.len = len;
-
-	rc = dpu_hdcp_1x_read(hdcp, &sink, buf, false);
-	if (rc) {
-		pr_err("error reading %s\n", sink.name);
-		goto end;
-	}
-
-	for (i = 0; i < size; i++) {
-		struct dpu_hdcp_1x_reg_data *rd = reg_data + i;
-		u32 reg_data;
-
-		memcpy(&reg_data, buf + (sizeof(u32) * i), sizeof(u32));
-		DSS_REG_W(io, rd->reg_id, reg_data);
-	}
-end:
-	return rc;
-}
-
-static int dpu_hdcp_1x_validate_downstream(struct dpu_hdcp_1x *hdcp)
-{
-	int rc;
-	u8 buf[2] = {0, 0};
-	u8 device_count, depth;
-	u8 max_cascade_exceeded, max_devs_exceeded;
-	u16 bstatus;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	rc = dpu_hdcp_1x_read(hdcp, &hdcp->sink_addr.bstatus,
-			buf, false);
-	if (rc) {
-		pr_err("error reading bstatus\n");
-		goto end;
-	}
-
-	bstatus = buf[1];
-	bstatus = (bstatus << 8) | buf[0];
-
-	device_count = bstatus & 0x7F;
-
-	pr_debug("device count %d\n", device_count);
-
-	/* Cascaded repeater depth */
-	depth = (bstatus >> 8) & 0x7;
-	pr_debug("depth %d\n", depth);
-
-	/*
-	 * HDCP Compliance 1B-05:
-	 * Check if no. of devices connected to repeater
-	 * exceed max_devices_connected from bit 7 of Bstatus.
-	 */
-	max_devs_exceeded = (bstatus & BIT(7)) >> 7;
-	if (max_devs_exceeded == 0x01) {
-		pr_err("no. of devs connected exceed max allowed\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	/*
-	 * HDCP Compliance 1B-06:
-	 * Check if no. of cascade connected to repeater
-	 * exceed max_cascade_connected from bit 11 of Bstatus.
-	 */
-	max_cascade_exceeded = (bstatus & BIT(11)) >> 11;
-	if (max_cascade_exceeded == 0x01) {
-		pr_err("no. of cascade connections exceed max allowed\n");
-		rc = -EINVAL;
-		goto end;
-	}
-
-	/* Update topology information */
-	hdcp->current_tp.dev_count = device_count;
-	hdcp->current_tp.max_cascade_exceeded = max_cascade_exceeded;
-	hdcp->current_tp.max_dev_exceeded = max_devs_exceeded;
-	hdcp->current_tp.depth = depth;
-
-	DSS_REG_W(hdcp->init_data.hdcp_io,
-		  reg_set->sec_data12, hdcp->bcaps | (bstatus << 8));
-end:
-	return rc;
-}
-
-static int dpu_hdcp_1x_read_ksv_fifo(struct dpu_hdcp_1x *hdcp)
-{
-	u32 ksv_read_retry = 20, ksv_bytes, rc = 0;
-	u8 *ksv_fifo = hdcp->current_tp.ksv_list;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	memset(ksv_fifo, 0, sizeof(hdcp->current_tp.ksv_list));
-
-	/* each KSV is 5 bytes long */
-	ksv_bytes = 5 * hdcp->current_tp.dev_count;
-	hdcp->sink_addr.ksv_fifo.len = ksv_bytes;
-
-	while (ksv_bytes && --ksv_read_retry) {
-		rc = dpu_hdcp_1x_read(hdcp, &hdcp->sink_addr.ksv_fifo,
-				ksv_fifo, true);
-		if (rc)
-			pr_err("could not read ksv fifo (%d)\n",
-				ksv_read_retry);
-		else
-			break;
-	}
-
-	if (rc)
-		pr_err("error reading ksv_fifo\n");
-
-	return rc;
-}
-
-static int dpu_hdcp_1x_write_ksv_fifo(struct dpu_hdcp_1x *hdcp)
-{
-	int i, rc = 0;
-	u8 *ksv_fifo = hdcp->current_tp.ksv_list;
-	u32 ksv_bytes = hdcp->sink_addr.ksv_fifo.len;
-	struct dss_io_data *io = hdcp->init_data.core_io;
-	struct dss_io_data *sec_io = hdcp->init_data.hdcp_io;
-	struct dpu_hdcp_reg_set *reg_set = &hdcp->reg_set;
-	u32 sha_status = 0, status;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	/* reset SHA Controller */
-	DSS_REG_W(sec_io, reg_set->sec_sha_ctrl, 0x1);
-	DSS_REG_W(sec_io, reg_set->sec_sha_ctrl, 0x0);
-
-	for (i = 0; i < ksv_bytes - 1; i++) {
-		/* Write KSV byte and do not set DONE bit[0] */
-		DSS_REG_W_ND(sec_io, reg_set->sec_sha_data, ksv_fifo[i] << 16);
-
-		/*
-		 * Once 64 bytes have been written, we need to poll for
-		 * HDCP_SHA_BLOCK_DONE before writing any further
-		 */
-		if (i && !((i + 1) % 64)) {
-			rc = readl_poll_timeout(io->base + reg_set->sha_status,
-				sha_status, (sha_status & BIT(0)) ||
-				!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING),
-				HDCP_POLL_SLEEP_US, HDCP_POLL_TIMEOUT_US);
-			if (rc) {
-				pr_err("block not done\n");
-				goto error;
-			}
-		}
-	}
-
-	/* Write l to DONE bit[0] */
-	DSS_REG_W_ND(sec_io, reg_set->sec_sha_data,
-		(ksv_fifo[ksv_bytes - 1] << 16) | 0x1);
-
-	/* Now wait for HDCP_SHA_COMP_DONE */
-	rc = readl_poll_timeout(io->base + reg_set->sha_status, sha_status,
-				(sha_status & BIT(4)) ||
-				!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING),
-				HDCP_POLL_SLEEP_US, HDCP_POLL_TIMEOUT_US);
-	if (rc) {
-		pr_err("V computation not done\n");
-		goto error;
-	}
-
-	/* Wait for V_MATCHES */
-	rc = readl_poll_timeout(io->base + reg_set->status, status,
-				(status & BIT(reg_set->v_offset)) ||
-				!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING),
-				HDCP_POLL_SLEEP_US, HDCP_POLL_TIMEOUT_US);
-	if (rc) {
-		pr_err("V mismatch\n");
-		rc = -EINVAL;
-	}
-error:
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING))
-		rc = -EINVAL;
-
-	return rc;
-}
-
-static int dpu_hdcp_1x_wait_for_ksv_ready(struct dpu_hdcp_1x *hdcp)
-{
-	int rc, timeout;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	/*
-	 * Wait until READY bit is set in BCAPS, as per HDCP specifications
-	 * maximum permitted time to check for READY bit is five seconds.
-	 */
-	rc = dpu_hdcp_1x_read(hdcp, &hdcp->sink_addr.bcaps,
-		&hdcp->bcaps, false);
-	if (rc) {
-		pr_err("error reading bcaps\n");
-		goto error;
-	}
-
-	if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI) {
-		timeout = 50;
-
-		while (!(hdcp->bcaps & BIT(5)) && --timeout) {
-			rc = dpu_hdcp_1x_read(hdcp,
-				&hdcp->sink_addr.bcaps,
-				&hdcp->bcaps, false);
-			if (rc ||
-			   !dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-				pr_err("error reading bcaps\n");
-				goto error;
-			}
-			msleep(100);
-		}
-	} else {
-		u8 cp_buf = 0;
-		struct dpu_hdcp_sink_addr *sink =
-			&hdcp->sink_addr.cp_irq_status;
-
-		timeout = jiffies_to_msecs(jiffies);
-
-		while (1) {
-			rc = dpu_hdcp_1x_read(hdcp, sink, &cp_buf, false);
-			if (rc)
-				goto error;
-
-			if (cp_buf & BIT(0))
-				break;
-
-			/* max timeout of 5 sec as per hdcp 1.x spec */
-			if (abs(timeout - jiffies_to_msecs(jiffies)) > 5000) {
-				timeout = 0;
-				break;
-			}
-
-			if (hdcp->ksv_ready || hdcp->reauth ||
-			    !dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING))
-				break;
-
-			/* re-read after a minimum delay */
-			msleep(20);
-		}
-	}
-
-	if (!timeout || hdcp->reauth ||
-	    !dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("DS KSV not ready\n");
-		rc = -EINVAL;
-	} else {
-		hdcp->ksv_ready = true;
-	}
-error:
-	return rc;
-}
-
-static int dpu_hdcp_1x_authentication_part2(struct dpu_hdcp_1x *hdcp)
-{
-	int rc;
-	int v_retry = 3;
-
-	rc = dpu_hdcp_1x_validate_downstream(hdcp);
-	if (rc)
-		goto error;
-
-	rc = dpu_hdcp_1x_read_ksv_fifo(hdcp);
-	if (rc)
-		goto error;
-
-	do {
-		rc = dpu_hdcp_1x_transfer_v_h(hdcp);
-		if (rc)
-			goto error;
-
-		/* do not proceed further if no device connected */
-		if (!hdcp->current_tp.dev_count)
-			goto error;
-
-		rc = dpu_hdcp_1x_write_ksv_fifo(hdcp);
-	} while (--v_retry && rc);
-error:
-	if (rc) {
-		pr_err("%s: FAILED\n", DPU_HDCP_STATE_NAME);
-	} else {
-		hdcp->hdcp_state = HDCP_STATE_AUTHENTICATED;
-
-		pr_info("SUCCESSFUL\n");
-	}
-
-	return rc;
-}
-
-static void dpu_hdcp_1x_cache_topology(struct dpu_hdcp_1x *hdcp)
-{
-	if (!hdcp || !hdcp->init_data.core_io) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	memcpy((void *)&hdcp->cached_tp,
-		(void *) &hdcp->current_tp,
-		sizeof(hdcp->cached_tp));
-	hdcp1_cache_repeater_topology((void *)&hdcp->cached_tp);
-}
-
-static void dpu_hdcp_1x_notify_topology(void)
-{
-	hdcp1_notify_topology();
-}
-
-static void dpu_hdcp_1x_update_auth_status(struct dpu_hdcp_1x *hdcp)
-{
-	if (dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATED)) {
-		dpu_hdcp_1x_cache_topology(hdcp);
-		dpu_hdcp_1x_notify_topology();
-	}
-
-	if (hdcp->init_data.notify_status &&
-	    !dpu_hdcp_1x_state(HDCP_STATE_INACTIVE)) {
-		hdcp->init_data.notify_status(
-			hdcp->init_data.cb_data,
-			hdcp->hdcp_state);
-	}
-}
-
-static void dpu_hdcp_1x_auth_work(struct work_struct *work)
-{
-	int rc;
-	struct delayed_work *dw = to_delayed_work(work);
-	struct dpu_hdcp_1x *hdcp = container_of(dw,
-		struct dpu_hdcp_1x, hdcp_auth_work);
-	struct dss_io_data *io;
-
-	if (!hdcp) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-		pr_err("invalid state\n");
-		return;
-	}
-
-	hdcp->sink_r0_ready = false;
-	hdcp->reauth = false;
-	hdcp->ksv_ready = false;
-
-	io = hdcp->init_data.core_io;
-	/* Enabling Software DDC for HDMI and REF timer for DP */
-	if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI)
-		DSS_REG_W_ND(io, REG_HDMI_DDC_ARBITRATION, DSS_REG_R(io,
-				REG_HDMI_DDC_ARBITRATION) & ~(BIT(4)));
-	else if (hdcp->init_data.client_id == HDCP_CLIENT_DP) {
-		DSS_REG_W(io, DP_DP_HPD_REFTIMER, 0x10013);
-	}
-
-	/*
-	 * program hw to enable encryption as soon as
-	 * authentication is successful.
-	 */
-	hdcp1_set_enc(true);
-
-	rc = dpu_hdcp_1x_authentication_part1(hdcp);
-	if (rc)
-		goto end;
-
-	if (hdcp->current_tp.ds_type == DS_REPEATER) {
-		rc = dpu_hdcp_1x_wait_for_ksv_ready(hdcp);
-		if (rc)
-			goto end;
-	} else {
-		hdcp->hdcp_state = HDCP_STATE_AUTHENTICATED;
-		goto end;
-	}
-
-	hdcp->ksv_ready = false;
-
-	rc = dpu_hdcp_1x_authentication_part2(hdcp);
-	if (rc)
-		goto end;
-
-	/*
-	 * Disabling software DDC before going into part3 to make sure
-	 * there is no Arbitration between software and hardware for DDC
-	 */
-	if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI)
-		DSS_REG_W_ND(io, REG_HDMI_DDC_ARBITRATION, DSS_REG_R(io,
-				REG_HDMI_DDC_ARBITRATION) | (BIT(4)));
-end:
-	if (rc && !dpu_hdcp_1x_state(HDCP_STATE_INACTIVE))
-		hdcp->hdcp_state = HDCP_STATE_AUTH_FAIL;
-
-	dpu_hdcp_1x_update_auth_status(hdcp);
-}
-
-static int dpu_hdcp_1x_authenticate(void *input)
-{
-	struct dpu_hdcp_1x *hdcp = (struct dpu_hdcp_1x *)input;
-
-	if (!hdcp) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	flush_delayed_work(&hdcp->hdcp_auth_work);
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_INACTIVE)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	if (!dpu_hdcp_1x_load_keys(input)) {
-
-		queue_delayed_work(hdcp->workq,
-			&hdcp->hdcp_auth_work, HZ/2);
-	} else {
-		hdcp->hdcp_state = HDCP_STATE_AUTH_FAIL;
-		dpu_hdcp_1x_update_auth_status(hdcp);
-	}
-
-	return 0;
-} /* hdcp_1x_authenticate */
-
-static int dpu_hdcp_1x_reauthenticate(void *input)
-{
-	struct dpu_hdcp_1x *hdcp = (struct dpu_hdcp_1x *)input;
-	struct dss_io_data *io;
-	struct dpu_hdcp_reg_set *reg_set;
-	struct dpu_hdcp_int_set *isr;
-	u32 ret = 0, reg;
-
-	if (!hdcp || !hdcp->init_data.core_io) {
-		pr_err("invalid input\n");
-		return -EINVAL;
-	}
-
-	io = hdcp->init_data.core_io;
-	reg_set = &hdcp->reg_set;
-	isr = &hdcp->int_set;
-
-	if (!dpu_hdcp_1x_state(HDCP_STATE_AUTH_FAIL)) {
-		pr_err("invalid state\n");
-		return -EINVAL;
-	}
-
-	/* Disable HDCP interrupts */
-	DSS_REG_W(io, isr->int_reg, DSS_REG_R(io, isr->int_reg) & ~HDCP_INT_EN);
-
-	reg = DSS_REG_R(io, reg_set->reset);
-	DSS_REG_W(io, reg_set->reset, reg | reg_set->reset_bit);
-
-	/* Disable encryption and disable the HDCP block */
-	DSS_REG_W(io, reg_set->ctrl, 0);
-
-	DSS_REG_W(io, reg_set->reset, reg & ~reg_set->reset_bit);
-
-	hdcp->hdcp_state = HDCP_STATE_INACTIVE;
-	dpu_hdcp_1x_authenticate(hdcp);
-
-	return ret;
-} /* hdcp_1x_reauthenticate */
-
-static void dpu_hdcp_1x_off(void *input)
-{
-	struct dpu_hdcp_1x *hdcp = (struct dpu_hdcp_1x *)input;
-	struct dss_io_data *io;
-	struct dpu_hdcp_reg_set *reg_set;
-	struct dpu_hdcp_int_set *isr;
-	int rc = 0;
-	u32 reg;
-
-	if (!hdcp || !hdcp->init_data.core_io) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	io = hdcp->init_data.core_io;
-	reg_set = &hdcp->reg_set;
-	isr = &hdcp->int_set;
-
-	if (dpu_hdcp_1x_state(HDCP_STATE_INACTIVE)) {
-		pr_err("invalid state\n");
-		return;
-	}
-
-	/*
-	 * Disable HDCP interrupts.
-	 * Also, need to set the state to inactive here so that any ongoing
-	 * reauth works will know that the HDCP session has been turned off.
-	 */
-	mutex_lock(hdcp->init_data.mutex);
-	DSS_REG_W(io, isr->int_reg,
-		DSS_REG_R(io, isr->int_reg) & ~HDCP_INT_EN);
-	hdcp->hdcp_state = HDCP_STATE_INACTIVE;
-	mutex_unlock(hdcp->init_data.mutex);
-
-	/* complete any wait pending */
-	complete_all(&hdcp->sink_r0_available);
-	complete_all(&hdcp->r0_checked);
-	/*
-	 * Cancel any pending auth/reauth attempts.
-	 * If one is ongoing, this will wait for it to finish.
-	 * No more reauthentiaction attempts will be scheduled since we
-	 * set the currect state to inactive.
-	 */
-	rc = cancel_delayed_work_sync(&hdcp->hdcp_auth_work);
-	if (rc)
-		pr_debug("%s: Deleted hdcp auth work\n",
-			DPU_HDCP_STATE_NAME);
-
-	hdcp1_set_enc(false);
-
-	reg = DSS_REG_R(io, reg_set->reset);
-	DSS_REG_W(io, reg_set->reset, reg | reg_set->reset_bit);
-
-	/* Disable encryption and disable the HDCP block */
-	DSS_REG_W(io, reg_set->ctrl, 0);
-
-	DSS_REG_W(io, reg_set->reset, reg & ~reg_set->reset_bit);
-
-	hdcp->sink_r0_ready = false;
-
-	pr_debug("%s: HDCP: Off\n", DPU_HDCP_STATE_NAME);
-} /* hdcp_1x_off */
-
-static int dpu_hdcp_1x_isr(void *input)
-{
-	struct dpu_hdcp_1x *hdcp = (struct dpu_hdcp_1x *)input;
-	int rc = 0;
-	struct dss_io_data *io;
-	u32 hdcp_int_val;
-	struct dpu_hdcp_reg_set *reg_set;
-	struct dpu_hdcp_int_set *isr;
-
-	if (!hdcp || !hdcp->init_data.core_io) {
-		pr_err("invalid input\n");
-		rc = -EINVAL;
-		goto error;
-	}
-
-	io = hdcp->init_data.core_io;
-	reg_set = &hdcp->reg_set;
-	isr = &hdcp->int_set;
-
-	hdcp_int_val = DSS_REG_R(io, isr->int_reg);
-
-	/* Ignore HDCP interrupts if HDCP is disabled */
-	if (dpu_hdcp_1x_state(HDCP_STATE_INACTIVE)) {
-		DSS_REG_W(io, isr->int_reg, hdcp_int_val | HDCP_INT_CLR);
-		return 0;
-	}
-
-	if (hdcp_int_val & isr->auth_success_int) {
-		/* AUTH_SUCCESS_INT */
-		DSS_REG_W(io, isr->int_reg,
-			(hdcp_int_val | isr->auth_success_ack));
-		pr_debug("%s: AUTH SUCCESS\n", DPU_HDCP_STATE_NAME);
-
-		if (dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING))
-			complete_all(&hdcp->r0_checked);
-	}
-
-	if (hdcp_int_val & isr->auth_fail_int) {
-		/* AUTH_FAIL_INT */
-		u32 link_status = DSS_REG_R(io, reg_set->status);
-
-		DSS_REG_W(io, isr->int_reg,
-			(hdcp_int_val | isr->auth_fail_ack));
-
-		pr_debug("%s: AUTH FAIL, LINK0_STATUS=0x%08x\n",
-			DPU_HDCP_STATE_NAME, link_status);
-
-		if (dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATED)) {
-			hdcp->hdcp_state = HDCP_STATE_AUTH_FAIL;
-			dpu_hdcp_1x_update_auth_status(hdcp);
-		} else if (dpu_hdcp_1x_state(HDCP_STATE_AUTHENTICATING)) {
-			complete_all(&hdcp->r0_checked);
-		}
-
-		/* Clear AUTH_FAIL_INFO as well */
-		DSS_REG_W(io, isr->int_reg,
-			(hdcp_int_val | isr->auth_fail_info_ack));
-	}
-
-	if (hdcp_int_val & isr->tx_req_int) {
-		/* DDC_XFER_REQ_INT */
-		DSS_REG_W(io, isr->int_reg,
-			(hdcp_int_val | isr->tx_req_ack));
-		pr_debug("%s: DDC_XFER_REQ_INT received\n",
-			DPU_HDCP_STATE_NAME);
-	}
-
-	if (hdcp_int_val & isr->tx_req_done_int) {
-		/* DDC_XFER_DONE_INT */
-		DSS_REG_W(io, isr->int_reg,
-			(hdcp_int_val | isr->tx_req_done_ack));
-		pr_debug("%s: DDC_XFER_DONE received\n",
-			DPU_HDCP_STATE_NAME);
-	}
-
-	if (hdcp_int_val & isr->encryption_ready) {
-		/* Encryption enabled */
-		DSS_REG_W(io, isr->int_reg,
-			(hdcp_int_val | isr->encryption_ready_ack));
-		pr_debug("%s: encryption ready received\n",
-			DPU_HDCP_STATE_NAME);
-	}
-
-	if (hdcp_int_val & isr->encryption_not_ready) {
-		/* Encryption enabled */
-		DSS_REG_W(io, isr->int_reg,
-			(hdcp_int_val | isr->encryption_not_ready_ack));
-		pr_debug("%s: encryption not ready received\n",
-			DPU_HDCP_STATE_NAME);
-	}
-
-error:
-	return rc;
-}
-
-void dpu_hdcp_1x_deinit(void *input)
-{
-	struct dpu_hdcp_1x *hdcp = (struct dpu_hdcp_1x *)input;
-
-	if (!hdcp) {
-		pr_err("invalid input\n");
-		return;
-	}
-
-	if (hdcp->workq)
-		destroy_workqueue(hdcp->workq);
-
-	kfree(hdcp);
-} /* hdcp_1x_deinit */
-
-static void dpu_hdcp_1x_update_client_reg_set(struct dpu_hdcp_1x *hdcp)
-{
-	if (hdcp->init_data.client_id == HDCP_CLIENT_DP) {
-		struct dpu_hdcp_reg_set reg_set = HDCP_REG_SET_CLIENT_DP;
-		struct dpu_hdcp_sink_addr_map sink_addr = HDCP_DP_SINK_ADDR_MAP;
-		struct dpu_hdcp_int_set isr = HDCP_DP_INT_SET;
-
-		hdcp->reg_set = reg_set;
-		hdcp->sink_addr = sink_addr;
-		hdcp->int_set = isr;
-	}
-}
-
-static bool dpu_hdcp_1x_is_cp_irq_raised(struct dpu_hdcp_1x *hdcp)
-{
-	int ret;
-	u8 buf = 0;
-	struct dpu_hdcp_sink_addr sink = {"irq", 0x201, 1};
-
-	ret = dpu_hdcp_1x_read(hdcp, &sink, &buf, false);
-	if (ret)
-		pr_err("error reading irq_vector\n");
-
-	return buf & BIT(2) ? true : false;
-}
-
-static void dpu_hdcp_1x_clear_cp_irq(struct dpu_hdcp_1x *hdcp)
-{
-	int ret;
-	u8 buf = BIT(2);
-	struct dpu_hdcp_sink_addr sink = {"irq", 0x201, 1};
-
-	ret = dpu_hdcp_1x_write(hdcp, &sink, &buf);
-	if (ret)
-		pr_err("error clearing irq_vector\n");
-}
-
-static int dpu_hdcp_1x_cp_irq(void *input)
-{
-	struct dpu_hdcp_1x *hdcp = (struct dpu_hdcp_1x *)input;
-	u8 buf = 0;
-	int ret;
-
-	if (!hdcp) {
-		pr_err("invalid input\n");
-		goto irq_not_handled;
-	}
-
-	if (!dpu_hdcp_1x_is_cp_irq_raised(hdcp)) {
-		pr_debug("cp_irq not raised\n");
-		goto irq_not_handled;
-	}
-
-	ret = dpu_hdcp_1x_read(hdcp, &hdcp->sink_addr.cp_irq_status,
-			&buf, false);
-	if (ret) {
-		pr_err("error reading cp_irq_status\n");
-		goto irq_not_handled;
-	}
-
-	if ((buf & BIT(2)) || (buf & BIT(3))) {
-		pr_err("%s\n",
-			buf & BIT(2) ? "LINK_INTEGRITY_FAILURE" :
-				"REAUTHENTICATION_REQUEST");
-
-		hdcp->reauth = true;
-
-		if (!dpu_hdcp_1x_state(HDCP_STATE_INACTIVE))
-			hdcp->hdcp_state = HDCP_STATE_AUTH_FAIL;
-
-		complete_all(&hdcp->sink_r0_available);
-		dpu_hdcp_1x_update_auth_status(hdcp);
-	} else if (buf & BIT(1)) {
-		pr_debug("R0' AVAILABLE\n");
-		hdcp->sink_r0_ready = true;
-		complete_all(&hdcp->sink_r0_available);
-	} else if ((buf & BIT(0))) {
-		pr_debug("KSVs READY\n");
-
-		hdcp->ksv_ready = true;
-	} else {
-		pr_debug("spurious interrupt\n");
-	}
-
-	dpu_hdcp_1x_clear_cp_irq(hdcp);
-	return 0;
-
-irq_not_handled:
-	return -EINVAL;
-}
-
-void *dpu_hdcp_1x_init(struct dpu_hdcp_init_data *init_data)
-{
-	struct dpu_hdcp_1x *hdcp = NULL;
-	char name[20];
-	static struct dpu_hdcp_ops ops = {
-		.isr = dpu_hdcp_1x_isr,
-		.cp_irq = dpu_hdcp_1x_cp_irq,
-		.reauthenticate = dpu_hdcp_1x_reauthenticate,
-		.authenticate = dpu_hdcp_1x_authenticate,
-		.off = dpu_hdcp_1x_off
-	};
-
-	if (!init_data || !init_data->core_io || !init_data->qfprom_io ||
-		!init_data->mutex || !init_data->notify_status ||
-		!init_data->workq || !init_data->cb_data) {
-		pr_err("invalid input\n");
-		goto error;
-	}
-
-	if (init_data->sec_access && !init_data->hdcp_io) {
-		pr_err("hdcp_io required\n");
-		goto error;
-	}
-
-	hdcp = kzalloc(sizeof(*hdcp), GFP_KERNEL);
-	if (!hdcp)
-		goto error;
-
-	hdcp->init_data = *init_data;
-	hdcp->ops = &ops;
-
-	snprintf(name, sizeof(name), "hdcp_1x_%d",
-		hdcp->init_data.client_id);
-
-	hdcp->workq = create_workqueue(name);
-	if (!hdcp->workq) {
-		pr_err("Error creating workqueue\n");
-		kfree(hdcp);
-		goto error;
-	}
-
-	dpu_hdcp_1x_update_client_reg_set(hdcp);
-
-	INIT_DELAYED_WORK(&hdcp->hdcp_auth_work, dpu_hdcp_1x_auth_work);
-
-	hdcp->hdcp_state = HDCP_STATE_INACTIVE;
-	init_completion(&hdcp->r0_checked);
-	init_completion(&hdcp->sink_r0_available);
-
-	pr_debug("HDCP module initialized. HDCP_STATE=%s\n",
-		DPU_HDCP_STATE_NAME);
-
-	return (void *)hdcp;
-
-error:
-	return NULL;
-} /* hdcp_1x_init */
-
-struct dpu_hdcp_ops *dpu_hdcp_1x_start(void *input)
-{
-	return ((struct dpu_hdcp_1x *)input)->ops;
-}
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 07/11] drm/msm/dpu: remove dt parsing logic for bus_scale config
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
                     ` (3 preceding siblings ...)
  2018-05-30 14:49   ` [DPU PATCH 04/11] dt-bindings: msm/disp: remove unused writeback bindings Rajesh Yadav
@ 2018-05-30 14:49   ` Rajesh Yadav
  2018-05-30 14:49   ` [DPU PATCH 09/11] drm/msm/dpu: Remove unused code and move the header Rajesh Yadav
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

Bus scale config related dt-bindings are removed.
Add bus_scale config in driver instead.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c | 254 +++++++++++++++--------
 1 file changed, 167 insertions(+), 87 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
index bdf18de..24c3274 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
@@ -20,15 +20,137 @@
 #include <linux/slab.h>
 #include <linux/mutex.h>
 #include <linux/of_platform.h>
-#ifdef CONFIG_QCOM_BUS_SCALING
-#include <linux/msm-bus.h>
-#include <linux/msm-bus-board.h>
-#endif
 #include <linux/dpu_io_util.h>
 
 #include "dpu_power_handle.h"
 #include "dpu_trace.h"
 
+#ifdef CONFIG_QCOM_BUS_SCALING
+#include <linux/msm-bus.h>
+#include <linux/msm-bus-board.h>
+
+#define DPU_BUS_VECTOR_ENTRY(src_val, dst_val, ab_val, ib_val) \
+	{                                                          \
+		.src = src_val,                                        \
+		.dst = dst_val,                                        \
+		.ab = (ab_val),                                        \
+		.ib = (ib_val),                                        \
+	}
+
+static struct msm_bus_vectors dpu_reg_bus_vectors[] = {
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_FIRST,
+			     MSM_BUS_SLAVE_DISPLAY_CFG, 0, 0),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_FIRST,
+			     MSM_BUS_SLAVE_DISPLAY_CFG, 0, 76800000),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_FIRST,
+			     MSM_BUS_SLAVE_DISPLAY_CFG, 0, 150000000),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_FIRST,
+			     MSM_BUS_SLAVE_DISPLAY_CFG, 0, 300000000),
+};
+
+static struct msm_bus_paths dpu_reg_bus_usecases[] = { {
+		.num_paths = 1,
+		.vectors = &dpu_reg_bus_vectors[0],
+}, {
+		.num_paths = 1,
+		.vectors = &dpu_reg_bus_vectors[1],
+}, {
+		.num_paths = 1,
+		.vectors = &dpu_reg_bus_vectors[2],
+}, {
+		.num_paths = 1,
+		.vectors = &dpu_reg_bus_vectors[3],
+} };
+
+static struct msm_bus_scale_pdata dpu_reg_bus_scale_table = {
+	.usecase = dpu_reg_bus_usecases,
+	.num_usecases = ARRAY_SIZE(dpu_reg_bus_usecases),
+	.name = "mdss_reg",
+};
+
+static struct msm_bus_vectors dpu_data_bus_vectors[] = {
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MDP_PORT0,
+			     MSM_BUS_SLAVE_MNOC_HF_MEM_NOC, 0, 0),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MDP_PORT1,
+			     MSM_BUS_SLAVE_MNOC_HF_MEM_NOC, 0, 0),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MDP_PORT0,
+			     MSM_BUS_SLAVE_MNOC_HF_MEM_NOC, 0, 6400000000),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MDP_PORT1,
+			     MSM_BUS_SLAVE_MNOC_HF_MEM_NOC, 0, 6400000000),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MDP_PORT0,
+			     MSM_BUS_SLAVE_MNOC_HF_MEM_NOC, 0, 6400000000),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MDP_PORT1,
+			     MSM_BUS_SLAVE_MNOC_HF_MEM_NOC, 0, 6400000000),
+};
+
+static struct msm_bus_paths dpu_data_bus_usecases[] = { {
+		.num_paths = 2,
+		.vectors = &dpu_data_bus_vectors[0],
+}, {
+		.num_paths = 2,
+		.vectors = &dpu_data_bus_vectors[2],
+}, {
+		.num_paths = 2,
+		.vectors = &dpu_data_bus_vectors[4],
+} };
+
+static struct msm_bus_scale_pdata dpu_data_bus_scale_table = {
+	.usecase = dpu_data_bus_usecases,
+	.num_usecases = ARRAY_SIZE(dpu_data_bus_usecases),
+	.name = "mdss_mnoc",
+};
+
+static struct msm_bus_vectors dpu_llcc_bus_vectors[] = {
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MNOC_HF_MEM_NOC,
+			     MSM_BUS_SLAVE_LLCC, 0, 0),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MNOC_HF_MEM_NOC,
+			     MSM_BUS_SLAVE_LLCC, 0, 6400000000),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_MNOC_HF_MEM_NOC,
+			     MSM_BUS_SLAVE_LLCC, 0, 6400000000),
+};
+
+static struct msm_bus_paths dpu_llcc_bus_usecases[] = { {
+		.num_paths = 1,
+		.vectors = &dpu_llcc_bus_vectors[0],
+}, {
+		.num_paths = 1,
+		.vectors = &dpu_llcc_bus_vectors[1],
+}, {
+		.num_paths = 1,
+		.vectors = &dpu_llcc_bus_vectors[2],
+} };
+static struct msm_bus_scale_pdata dpu_llcc_bus_scale_table = {
+	.usecase = dpu_llcc_bus_usecases,
+	.num_usecases = ARRAY_SIZE(dpu_llcc_bus_usecases),
+	.name = "mdss_llcc",
+};
+
+static struct msm_bus_vectors dpu_ebi_bus_vectors[] = {
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_LLCC,
+			     MSM_BUS_SLAVE_EBI_CH0, 0, 0),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_LLCC,
+			     MSM_BUS_SLAVE_EBI_CH0, 0, 6400000000),
+	DPU_BUS_VECTOR_ENTRY(MSM_BUS_MASTER_LLCC,
+			     MSM_BUS_SLAVE_EBI_CH0, 0, 6400000000),
+};
+
+static struct msm_bus_paths dpu_ebi_bus_usecases[] = { {
+		.num_paths = 1,
+		.vectors = &dpu_ebi_bus_vectors[0],
+}, {
+		.num_paths = 1,
+		.vectors = &dpu_ebi_bus_vectors[1],
+}, {
+		.num_paths = 1,
+		.vectors = &dpu_ebi_bus_vectors[2],
+} };
+static struct msm_bus_scale_pdata dpu_ebi_bus_scale_table = {
+	.usecase = dpu_ebi_bus_usecases,
+	.num_usecases = ARRAY_SIZE(dpu_ebi_bus_usecases),
+	.name = "mdss_ebi",
+};
+#endif
+
 static const char *data_bus_name[DPU_POWER_HANDLE_DBUS_ID_MAX] = {
 	[DPU_POWER_HANDLE_DBUS_ID_MNOC] = "qcom,dpu-data-bus",
 	[DPU_POWER_HANDLE_DBUS_ID_LLCC] = "qcom,dpu-llcc-bus",
@@ -276,93 +398,54 @@ static void dpu_power_data_bus_unregister(
 	}
 }
 
-static int dpu_power_data_bus_parse(struct platform_device *pdev,
-	struct dpu_power_data_bus_handle *pdbus, const char *name)
+static int dpu_power_data_bus_register(struct dpu_power_handle *phandle,
+		int index)
 {
-	struct device_node *node;
-	int rc = 0;
-	int paths;
-
-	pdbus->bus_channels = 1;
-	rc = of_property_read_u32(pdev->dev.of_node,
-		"qcom,dpu-dram-channels", &pdbus->bus_channels);
-	if (rc) {
-		pr_debug("number of channels property not specified\n");
-		rc = 0;
-	}
+	struct dpu_power_data_bus_handle *pdbus = &phandle->data_bus_handle[index];
 
+	pdbus->bus_channels = 2;
 	pdbus->nrt_axi_port_cnt = 0;
-	rc = of_property_read_u32(pdev->dev.of_node,
-			"qcom,dpu-num-nrt-paths",
-			&pdbus->nrt_axi_port_cnt);
-	if (rc) {
-		pr_debug("number of axi port property not specified\n");
-		rc = 0;
+	pdbus->axi_port_cnt = 1;
+
+	switch (index) {
+	case DPU_POWER_HANDLE_DBUS_ID_MNOC:
+		pdbus->data_bus_scale_table = &dpu_data_bus_scale_table;
+		pdbus->axi_port_cnt = 2;
+		break;
+	case DPU_POWER_HANDLE_DBUS_ID_LLCC:
+		pdbus->data_bus_scale_table = &dpu_llcc_bus_scale_table;
+		break;
+	case DPU_POWER_HANDLE_DBUS_ID_EBI:
+		pdbus->data_bus_scale_table = &dpu_ebi_bus_scale_table;
+		break;
+	default:
+		pr_err("invalid data_bus type: %d", index);
+		return -EINVAL;
 	}
 
-	node = of_get_child_by_name(pdev->dev.of_node, name);
-	if (node) {
-		rc = of_property_read_u32(node,
-				"qcom,msm-bus,num-paths", &paths);
-		if (rc) {
-			pr_err("Error. qcom,msm-bus,num-paths not found\n");
-			return rc;
-		}
-		pdbus->axi_port_cnt = paths;
-
-		pdbus->data_bus_scale_table =
-				msm_bus_pdata_from_node(pdev, node);
-		if (IS_ERR_OR_NULL(pdbus->data_bus_scale_table)) {
-			pr_err("reg bus handle parsing failed\n");
-			rc = PTR_ERR(pdbus->data_bus_scale_table);
-			if (!pdbus->data_bus_scale_table)
-				rc = -EINVAL;
-			goto end;
-		}
-		pdbus->data_bus_hdl = msm_bus_scale_register_client(
-				pdbus->data_bus_scale_table);
-		if (!pdbus->data_bus_hdl) {
-			pr_err("data_bus_client register failed\n");
-			rc = -EINVAL;
-			goto end;
-		}
-		pr_debug("register %s data_bus_hdl=%x\n", name,
-				pdbus->data_bus_hdl);
+	pdbus->data_bus_hdl = msm_bus_scale_register_client(
+			pdbus->data_bus_scale_table);
+	if (!pdbus->data_bus_hdl) {
+		pr_err("data_bus_client register failed\n");
+		return -EINVAL;
 	}
+	pr_debug("register %s data_bus_hdl=%x\n", data_bus_name[index],
+			pdbus->data_bus_hdl);
 
-end:
-	return rc;
+	return 0;
 }
 
-static int dpu_power_reg_bus_parse(struct platform_device *pdev,
-	struct dpu_power_handle *phandle)
+static int dpu_power_reg_bus_register(struct dpu_power_handle *phandle)
 {
-	struct device_node *node;
-	struct msm_bus_scale_pdata *bus_scale_table;
-	int rc = 0;
-
-	node = of_get_child_by_name(pdev->dev.of_node, "qcom,dpu-reg-bus");
-	if (node) {
-		bus_scale_table = msm_bus_pdata_from_node(pdev, node);
-		if (IS_ERR_OR_NULL(bus_scale_table)) {
-			pr_err("reg bus handle parsing failed\n");
-			rc = PTR_ERR(bus_scale_table);
-			if (!bus_scale_table)
-				rc = -EINVAL;
-			goto end;
-		}
-		phandle->reg_bus_hdl = msm_bus_scale_register_client(
-			      bus_scale_table);
-		if (!phandle->reg_bus_hdl) {
-			pr_err("reg_bus_client register failed\n");
-			rc = -EINVAL;
-			goto end;
-		}
-		pr_debug("register reg_bus_hdl=%x\n", phandle->reg_bus_hdl);
+	phandle->reg_bus_hdl = msm_bus_scale_register_client(
+			&dpu_reg_bus_scale_table);
+	if (!phandle->reg_bus_hdl) {
+		pr_err("reg_bus_client register failed\n");
+		return -EINVAL;
 	}
+	pr_debug("register reg_bus_hdl=%x\n", phandle->reg_bus_hdl);
 
-end:
-	return rc;
+	return 0;
 }
 
 static void dpu_power_reg_bus_unregister(u32 reg_bus_hdl)
@@ -419,8 +502,8 @@ static int dpu_power_reg_bus_update(u32 reg_bus_hdl, u32 usecase_ndx)
 	return rc;
 }
 #else
-static int dpu_power_data_bus_parse(struct platform_device *pdev,
-		struct dpu_power_data_bus_handle *pdbus, const char *name)
+static int dpu_power_data_bus_register(struct dpu_power_handle *phandle,
+		int index)
 {
 	return 0;
 }
@@ -438,8 +521,7 @@ int dpu_power_data_bus_set_quota(struct dpu_power_handle *phandle,
 	return 0;
 }
 
-static int dpu_power_reg_bus_parse(struct platform_device *pdev,
-	struct dpu_power_handle *phandle)
+static int dpu_power_reg_bus_register(struct dpu_power_handle *phandle)
 {
 	return 0;
 }
@@ -473,7 +555,7 @@ int dpu_power_resource_init(struct platform_device *pdev,
 
 	phandle->dev = &pdev->dev;
 
-	rc = dpu_power_reg_bus_parse(pdev, phandle);
+	rc = dpu_power_reg_bus_register(phandle);
 	if (rc) {
 		pr_err("register bus parse failed rc=%d\n", rc);
 		return rc;
@@ -481,9 +563,7 @@ int dpu_power_resource_init(struct platform_device *pdev,
 
 	for (i = DPU_POWER_HANDLE_DBUS_ID_MNOC;
 			i < DPU_POWER_HANDLE_DBUS_ID_MAX; i++) {
-		rc = dpu_power_data_bus_parse(pdev,
-				&phandle->data_bus_handle[i],
-				data_bus_name[i]);
+		rc = dpu_power_data_bus_register(phandle, i);
 		if (rc) {
 			pr_err("register data bus parse failed id=%d rc=%d\n",
 					i, rc);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 08/11] dt-bindings: msm/disp: cleanup bindings for Snapdragon 845 DPU
  2018-05-30 14:49 [DPU PATCH 00/11] Remove unused code and cleanup devicetree bindings for DPU driver Rajesh Yadav
  2018-05-30 14:49 ` [DPU PATCH 05/11] drm/msm/dpu: remove writeback support Rajesh Yadav
  2018-05-30 14:49 ` [DPU PATCH 06/11] drm/msm/dpu: remove hdcp support Rajesh Yadav
@ 2018-05-30 14:49 ` Rajesh Yadav
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  3 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel, freedreno, linux-arm-msm, devicetree; +Cc: Rajesh Yadav, hoegsberg

SDM845 SoC has a MDSS top level wrapper which includes
sub-blocks as dpu, dsi, dp, hdmi etc. But current DPU
bindings are defined as if there is flat device hierarchy.
The MDSS and DPU HW blocks were represented by single device
and DSI, HDMI, DP etc. blocks are represented as separate
independent devices.
This change updates the binding as tree like hierarchy
where MDSS is parent device and DPU, DSI, DP and HDMI are
child devices to correctly model the HW associations.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 .../devicetree/bindings/display/msm/dpu.txt        | 318 ++++++++-------------
 1 file changed, 118 insertions(+), 200 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/msm/dpu.txt b/Documentation/devicetree/bindings/display/msm/dpu.txt
index 90cd3e0..a4407b8 100644
--- a/Documentation/devicetree/bindings/display/msm/dpu.txt
+++ b/Documentation/devicetree/bindings/display/msm/dpu.txt
@@ -1,206 +1,124 @@
 Qualcomm Technologies, Inc. DPU KMS
 
-Snapdragon Display Engine implements Linux DRM/KMS APIs to drive user
-interface to different panel interfaces. DPU driver is the core of
-display subsystem which manage all data paths to different panel interfaces.
-
-Required properties
-- compatible: Must be "qcom,dpu-kms"
-- compatible: "msm-hdmi-audio-codec-rx";
-- reg: Offset and length of the register set for the device.
-- reg-names : Names to refer to register sets related to this device
-- clocks: List of Phandles for clock device nodes
-    needed by the device.
-- clock-names: List of clock names needed by the device.
-- mmagic-supply: Phandle for mmagic mdss supply regulator device node.
-- vdd-supply: Phandle for vdd regulator device node.
-- interrupt-parent: Must be core interrupt controller.
-- interrupts: Interrupt associated with MDSS.
-- interrupt-controller: Mark the device node as an interrupt controller.
-- #interrupt-cells: Should be one. The first cell is interrupt number.
-- iommus: Specifies the SID's used by this context bank.
+Description:
+
+Device tree bindings for MSM Mobile Display Subsytem(MDSS) that encapsulates
+sub-blocks like DPU display controller, DSI and DP interfaces etc.
+The DPU display controller is found in SDM845 SoC.
+
+MDSS:
+Required properties:
+- compatible: "qcom,dpu-mdss"
+- reg: physical base address and length of contoller's registers.
+- reg-names: register region names. The following region is required:
+  * "mdss_phys"
+- power-domains: a power domain consumer specifier according to
+  Documentation/devicetree/bindings/power/power_domain.txt
+- clocks: list of phandles for clock device nodes needed by the device.
+- clock-names: device clock names, must be in same order as clocks property.
+  The following clocks are required:
+  * "iface"
+  * "bus"
+  * "core"
+- interrupts: interrupt signal from MDSS.
+- interrupt-controller: identifies the node as an interrupt controller.
+- #interrupt-cells: specifies the number of cells needed to encode an interrupt
+  source, should be 1.
+- iommus: phandle of iommu device node.
+- #address-cells: number of address cells for the MDSS children. Should be 1.
+- #size-cells: Should be 1.
+- ranges: parent bus address space is the same as the child bus address space.
 
 Optional properties:
-- clock-rate:		List of clock rates in Hz.
-- clock-max-rate:	List of maximum clock rate in Hz that this device supports.
-- qcom,platform-supply-entries:	A node that lists the elements of the supply. There
-				can be more than one instance of this binding,
-				in which case the entry would be appended with
-				the supply entry index.
-				e.g. qcom,platform-supply-entry@0
-				-- reg: offset and length of the register set for the device.
-				-- qcom,supply-name: name of the supply (vdd/vdda/vddio)
-				-- qcom,supply-min-voltage: minimum voltage level (uV)
-				-- qcom,supply-max-voltage: maximum voltage level (uV)
-				-- qcom,supply-enable-load: load drawn (uA) from enabled supply
-				-- qcom,supply-disable-load: load drawn (uA) from disabled supply
-				-- qcom,supply-pre-on-sleep: time to sleep (ms) before turning on
-				-- qcom,supply-post-on-sleep: time to sleep (ms) after turning on
-				-- qcom,supply-pre-off-sleep: time to sleep (ms) before turning off
-				-- qcom,supply-post-off-sleep: time to sleep (ms) after turning off
-- qcom,dpu-dram-channels:	This represents the number of channels in the
-				Bus memory controller.
-- qcom,dpu-num-nrt-paths:	Integer property represents the number of non-realtime
-				paths in each Bus Scaling Usecase. This value depends on
-				number of AXI ports that are dedicated to non-realtime VBIF
-				for particular chipset.
-				These paths must be defined after rt-paths in
-				"qcom,msm-bus,vectors-KBps" vector request.
-
-Bus Scaling Subnodes:
-- qcom,dpu-reg-bus:		Property to provide Bus scaling for register access for
-				mdss blocks.
-- qcom,dpu-data-bus:		Property to provide Bus scaling for data bus access for
-				mdss blocks.
-- qcom,dpu-llcc-bus:		Property to provide Bus scaling for data bus access for
-				mnoc to llcc.
-- qcom,dpu-ebi-bus:		Property to provide Bus scaling for data bus access for
-				llcc to ebi.
-
-- qcom,dpu-inline-rotator:	A 2 cell property, with format of (rotator phandle,
-				instance id), of inline rotator device.
-
-Bus Scaling Data:
-- qcom,msm-bus,name:		String property describing client name.
-- qcom,msm-bus,num-cases:	This is the number of Bus Scaling use cases
-				defined in the vectors property.
-- qcom,msm-bus,num-paths:	This represents the number of paths in each
-				Bus Scaling Usecase.
-- qcom,msm-bus,vectors-KBps:	* A series of 4 cell properties, with a format
-				of (src, dst, ab, ib) which is defined at
-				Documentation/devicetree/bindings/arm/msm/msm_bus.txt
-				* Current values of src & dst are defined at
-				include/linux/msm-bus-board.h
-
-SMMU Subnodes:
-- smmu_dpu_****:		Child nodes representing dpu smmu virtual
-				devices
-
-Subnode properties:
-- compatible:			Compatible names used for smmu devices.
-				names should be:
-				"qcom,smmu_dpu_unsec": smmu context bank device
-				for unsecure dpu real time domain.
-				"qcom,smmu_dpu_sec": smmu context bank device
-				for secure dpu real time domain.
-				"qcom,smmu_dpu_nrt_unsec": smmu context bank device
-				for unsecure dpu non-real time domain.
-				"qcom,smmu_dpu_nrt_sec": smmu context bank device
-				for secure dpu non-real time domain.
-
-
-Please refer to ../../interrupt-controller/interrupts.txt for a general
-description of interrupt bindings.
+- clock-frequency: list of clock frequencies sorted in the same order as the
+  clocks property.
+
+MDP:
+Required properties:
+- compatible: "qcom,dpu"
+- reg: physical base address and length of controller's registers.
+- reg-names : register region names. The following region is required:
+  * "mdp_phys"
+- clocks: list of phandles for clock device nodes needed by the device.
+- clock-names: device clock names, must be in same order as clocks property.
+  The following clocks are required.
+  * "bus"
+  * "iface"
+  * "core"
+  * "vsync"
+- interrupt-parent: phandle to MDSS block.
+- interrupts: interrupt line from DPU to MDSS.
+- ports: contains the list of output ports from DPU device. These ports connect
+  to interfaces that are external to the DPU hardware, such as DSI, DP etc.
+
+  Each output port contains an endpoint that describes how it is connected to an
+  external interface. These are described by the standard properties documented
+  here:
+	Documentation/devicetree/bindings/graph.txt
+	Documentation/devicetree/bindings/media/video-interfaces.txt
+
+	Port 0 -> DPU_INTF1 (DSI1)
+	Port 1 -> DPU_INTF2 (DSI2)
+
+Optional properties:
+- clock-frequency: list of clock frequencies sorted in the same order as the
+  clocks property.
 
 Example:
-  mdss_mdp: qcom,mdss_mdp@900000 {
-    compatible = "qcom,dpu-kms";
-    reg = <0x00900000 0x90000>,
-          <0x009b0000 0x1040>,
-          <0x009b8000 0x1040>,
-          <0x0aeac000 0x00f0>;
-    reg-names = "mdp_phys",
-      "vbif_phys",
-      "vbif_nrt_phys",
-      "regdma_phys";
-    clocks = <&clock_mmss clk_mdss_ahb_clk>,
-      <&clock_mmss clk_mdss_axi_clk>,
-      <&clock_mmss clk_mdp_clk_src>,
-      <&clock_mmss clk_mdss_mdp_vote_clk>,
-      <&clock_mmss clk_smmu_mdp_axi_clk>,
-      <&clock_mmss clk_mmagic_mdss_axi_clk>,
-      <&clock_mmss clk_mdss_vsync_clk>;
-    clock-names = "iface_clk",
-      "bus_clk",
-      "core_clk_src",
-      "core_clk",
-      "iommu_clk",
-      "mmagic_clk",
-      "vsync_clk";
-    clock-rate = <0>, <0>, <0>;
-    clock-max-rate= <0 320000000 0>;
-    mmagic-supply = <&gdsc_mmagic_mdss>;
-    vdd-supply = <&gdsc_mdss>;
-    interrupt-parent = <&intc>;
-    interrupts = <0 83 0>;
-    interrupt-controller;
-    #interrupt-cells = <1>;
-    iommus = <&mdp_smmu 0>;
-
-    qcom,dpu-dram-channels = <2>;
-    qcom,dpu-num-nrt-paths = <1>;
-
-    qcom,msm-hdmi-audio-rx {
-        compatible = "qcom,msm-hdmi-audio-codec-rx";
-    };
-
-    qcom,platform-supply-entries {
-       #address-cells = <1>;
-       #size-cells = <0>;
-       qcom,platform-supply-entry@0 {
-           reg = <0>;
-           qcom,supply-name = "vdd";
-           qcom,supply-min-voltage = <0>;
-           qcom,supply-max-voltage = <0>;
-           qcom,supply-enable-load = <0>;
-           qcom,supply-disable-load = <0>;
-           qcom,supply-pre-on-sleep = <0>;
-           qcom,supply-post-on-sleep = <0>;
-           qcom,supply-pre-off-sleep = <0>;
-           qcom,supply-post-off-sleep = <0>;
-        };
-    };
-
-    qcom,dpu-data-bus {
-        qcom,msm-bus,name = "mdss_dpu";
-        qcom,msm-bus,num-cases = <3>;
-        qcom,msm-bus,num-paths = <3>;
-        qcom,msm-bus,vectors-KBps =
-            <22 512 0 0>, <23 512 0 0>, <25 512 0 0>,
-            <22 512 0 6400000>, <23 512 0 6400000>,
-                <25 512 0 6400000>,
-            <22 512 0 6400000>, <23 512 0 6400000>,
-                <25 512 0 6400000>;
-    };
-    qcom,dpu-llcc-bus {
-        qcom,msm-bus,name = "mdss_dpu_llcc";
-        qcom,msm-bus,num-cases = <3>;
-        qcom,msm-bus,num-paths = <1>;
-        qcom,msm-bus,vectors-KBps =
-            <132 770 0 0>,
-            <132 770 0 6400000>,
-            <132 770 0 6400000>;
-    };
-    qcom,dpu-ebi-bus {
-        qcom,msm-bus,name = "mdss_dpu_ebi";
-        qcom,msm-bus,num-cases = <3>;
-        qcom,msm-bus,num-paths = <1>;
-        qcom,msm-bus,vectors-KBps =
-            <129 512 0 0>,
-            <129 512 0 6400000>,
-            <129 512 0 6400000>;
-    };
-
-    qcom,dpu-reg-bus {
-        /* Reg Bus Scale Settings */
-        qcom,msm-bus,name = "mdss_reg";
-        qcom,msm-bus,num-cases = <4>;
-        qcom,msm-bus,num-paths = <1>;
-        qcom,msm-bus,active-only;
-        qcom,msm-bus,vectors-KBps =
-              <1 590 0 0>,
-              <1 590 0 76800>,
-              <1 590 0 160000>,
-              <1 590 0 320000>;
-        };
-
-    smmu_kms_unsec: qcom,smmu_kms_unsec_cb {
-        compatible = "qcom,smmu_dpu_unsec";
-        iommus = <&mmss_smmu 0>;
-    };
-
-    smmu_kms_sec: qcom,smmu_kms_sec_cb {
-        compatible = "qcom,smmu_dpu_sec";
-        iommus = <&mmss_smmu 1>;
-    };
-  };
+
+	mdss: mdss@ae00000 {
+		compatible = "qcom,dpu-mdss";
+		reg = <0xae00000 0x1000>;
+		reg-names = "mdss_phys";
+
+		power-domains = <&clock_dispcc 0>;
+
+		clocks = <&gcc GCC_DISP_AHB_CLK>,
+				 <&gcc GCC_DISP_AXI_CLK>,
+				 <&clock_dispcc DISP_CC_MDSS_MDP_CLK>;
+		clock-names = "gcc_iface", "gcc_bus", "core_clk";
+
+		interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+
+		iommus = <&apps_smmu 0>;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		mdss_mdp: mdp@ae01000 {
+			compatible = "qcom,dpu";
+			reg = <0x0ae01000 0x8f000>;
+			reg-names = "mdp_phys";
+
+			clocks = <&clock_dispcc DISP_CC_MDSS_AHB_CLK>,
+					 <&clock_dispcc DISP_CC_MDSS_AXI_CLK>,
+					 <&clock_dispcc DISP_CC_MDSS_MDP_CLK>,
+					 <&clock_dispcc DISP_CC_MDSS_VSYNC_CLK>;
+			clock-names = "iface_clk", "bus_clk", "core_clk", "vsync_clk";
+
+			interrupt-parent = <&mdss>;
+			interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					dpu_intf1_out: endpoint {
+						remote-endpoint = <&dsi0_in>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					dpu_intf2_out: endpoint {
+						remote-endpoint = <&dsi1_in>;
+					};
+				};
+			};
+		};
+	};
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 09/11] drm/msm/dpu: Remove unused code and move the header
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
                     ` (4 preceding siblings ...)
  2018-05-30 14:49   ` [DPU PATCH 07/11] drm/msm/dpu: remove dt parsing logic for bus_scale config Rajesh Yadav
@ 2018-05-30 14:49   ` Rajesh Yadav
       [not found]     ` <1527691788-9350-10-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  2018-05-30 14:49   ` [DPU PATCH 10/11] drm/msm/dpu: correct dpu_io_util.h include path Rajesh Yadav
  2018-05-30 14:49   ` [DPU PATCH 11/11] drm/msm/dpu: move dpu_io_util to dpu folder Rajesh Yadav
  7 siblings, 1 reply; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Jordan Crouse, seanpaul-F7+t8E8rja9g9hUCZPvPmw,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav

From: Jordan Crouse <jcrouse@codeaurora.org>

Remove unused code from dpu_io_util.c.  The functions are only
used inside of the msm driver so remove the EXPORT_SYMBOL
tags and move the header dpu_io_util.h from include/linux.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
[ryadav@codeaurora.org: rebased and removed some extra unused code]
Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 drivers/gpu/drm/msm/dpu_io_util.c | 380 +-------------------------------------
 drivers/gpu/drm/msm/dpu_io_util.h |  61 ++++++
 drivers/gpu/drm/msm/msm_drv.h     |   1 -
 include/linux/dpu_io_util.h       | 115 ------------
 4 files changed, 66 insertions(+), 491 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/dpu_io_util.h
 delete mode 100644 include/linux/dpu_io_util.h

diff --git a/drivers/gpu/drm/msm/dpu_io_util.c b/drivers/gpu/drm/msm/dpu_io_util.c
index ecc297c..f7caec3 100644
--- a/drivers/gpu/drm/msm/dpu_io_util.c
+++ b/drivers/gpu/drm/msm/dpu_io_util.c
@@ -13,318 +13,9 @@
 
 #include <linux/clk.h>
 #include <linux/err.h>
-#include <linux/io.h>
-#include <linux/regulator/consumer.h>
 #include <linux/delay.h>
-#include <linux/dpu_io_util.h>
 
-#define MAX_I2C_CMDS  16
-void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
-{
-	u32 in_val;
-
-	if (!io || !io->base) {
-		DEV_ERR("%pS->%s: invalid input\n",
-			__builtin_return_address(0), __func__);
-		return;
-	}
-
-	if (offset > io->len) {
-		DEV_ERR("%pS->%s: offset out of range\n",
-			__builtin_return_address(0), __func__);
-		return;
-	}
-
-	writel_relaxed(value, io->base + offset);
-	if (debug) {
-		in_val = readl_relaxed(io->base + offset);
-		DEV_DBG("[%08x] => %08x [%08x]\n",
-			(u32)(unsigned long)(io->base + offset),
-			value, in_val);
-	}
-} /* dss_reg_w */
-EXPORT_SYMBOL(dss_reg_w);
-
-u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug)
-{
-	u32 value;
-
-	if (!io || !io->base) {
-		DEV_ERR("%pS->%s: invalid input\n",
-			__builtin_return_address(0), __func__);
-		return -EINVAL;
-	}
-
-	if (offset > io->len) {
-		DEV_ERR("%pS->%s: offset out of range\n",
-			__builtin_return_address(0), __func__);
-		return -EINVAL;
-	}
-
-	value = readl_relaxed(io->base + offset);
-	if (debug)
-		DEV_DBG("[%08x] <= %08x\n",
-			(u32)(unsigned long)(io->base + offset), value);
-
-	return value;
-} /* dss_reg_r */
-EXPORT_SYMBOL(dss_reg_r);
-
-void dss_reg_dump(void __iomem *base, u32 length, const char *prefix,
-	u32 debug)
-{
-	if (debug)
-		print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 32, 4,
-			(void *)base, length, false);
-} /* dss_reg_dump */
-EXPORT_SYMBOL(dss_reg_dump);
-
-static struct resource *msm_dss_get_res_byname(struct platform_device *pdev,
-	unsigned int type, const char *name)
-{
-	struct resource *res = NULL;
-
-	res = platform_get_resource_byname(pdev, type, name);
-	if (!res)
-		DEV_ERR("%s: '%s' resource not found\n", __func__, name);
-
-	return res;
-} /* msm_dss_get_res_byname */
-EXPORT_SYMBOL(msm_dss_get_res_byname);
-
-int msm_dss_ioremap_byname(struct platform_device *pdev,
-	struct dss_io_data *io_data, const char *name)
-{
-	struct resource *res = NULL;
-
-	if (!pdev || !io_data) {
-		DEV_ERR("%pS->%s: invalid input\n",
-			__builtin_return_address(0), __func__);
-		return -EINVAL;
-	}
-
-	res = msm_dss_get_res_byname(pdev, IORESOURCE_MEM, name);
-	if (!res) {
-		DEV_ERR("%pS->%s: '%s' msm_dss_get_res_byname failed\n",
-			__builtin_return_address(0), __func__, name);
-		return -ENODEV;
-	}
-
-	io_data->len = (u32)resource_size(res);
-	io_data->base = ioremap(res->start, io_data->len);
-	if (!io_data->base) {
-		DEV_ERR("%pS->%s: '%s' ioremap failed\n",
-			__builtin_return_address(0), __func__, name);
-		return -EIO;
-	}
-
-	return 0;
-} /* msm_dss_ioremap_byname */
-EXPORT_SYMBOL(msm_dss_ioremap_byname);
-
-void msm_dss_iounmap(struct dss_io_data *io_data)
-{
-	if (!io_data) {
-		DEV_ERR("%pS->%s: invalid input\n",
-			__builtin_return_address(0), __func__);
-		return;
-	}
-
-	if (io_data->base) {
-		iounmap(io_data->base);
-		io_data->base = NULL;
-	}
-	io_data->len = 0;
-} /* msm_dss_iounmap */
-EXPORT_SYMBOL(msm_dss_iounmap);
-
-int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
-	int num_vreg, int config)
-{
-	int i = 0, rc = 0;
-	struct dss_vreg *curr_vreg = NULL;
-	enum dss_vreg_type type;
-
-	if (!in_vreg || !num_vreg)
-		return rc;
-
-	if (config) {
-		for (i = 0; i < num_vreg; i++) {
-			curr_vreg = &in_vreg[i];
-			curr_vreg->vreg = regulator_get(dev,
-				curr_vreg->vreg_name);
-			rc = PTR_RET(curr_vreg->vreg);
-			if (rc) {
-				DEV_ERR("%pS->%s: %s get failed. rc=%d\n",
-					 __builtin_return_address(0), __func__,
-					 curr_vreg->vreg_name, rc);
-				curr_vreg->vreg = NULL;
-				goto vreg_get_fail;
-			}
-			type = (regulator_count_voltages(curr_vreg->vreg) > 0)
-					? DSS_REG_LDO : DSS_REG_VS;
-			if (type == DSS_REG_LDO) {
-				rc = regulator_set_voltage(
-					curr_vreg->vreg,
-					curr_vreg->min_voltage,
-					curr_vreg->max_voltage);
-				if (rc < 0) {
-					DEV_ERR("%pS->%s: %s set vltg fail\n",
-						__builtin_return_address(0),
-						__func__,
-						curr_vreg->vreg_name);
-					goto vreg_set_voltage_fail;
-				}
-			}
-		}
-	} else {
-		for (i = num_vreg-1; i >= 0; i--) {
-			curr_vreg = &in_vreg[i];
-			if (curr_vreg->vreg) {
-				type = (regulator_count_voltages(
-					curr_vreg->vreg) > 0)
-					? DSS_REG_LDO : DSS_REG_VS;
-				if (type == DSS_REG_LDO) {
-					regulator_set_voltage(curr_vreg->vreg,
-						0, curr_vreg->max_voltage);
-				}
-				regulator_put(curr_vreg->vreg);
-				curr_vreg->vreg = NULL;
-			}
-		}
-	}
-	return 0;
-
-vreg_unconfig:
-if (type == DSS_REG_LDO)
-	regulator_set_load(curr_vreg->vreg, 0);
-
-vreg_set_voltage_fail:
-	regulator_put(curr_vreg->vreg);
-	curr_vreg->vreg = NULL;
-
-vreg_get_fail:
-	for (i--; i >= 0; i--) {
-		curr_vreg = &in_vreg[i];
-		type = (regulator_count_voltages(curr_vreg->vreg) > 0)
-			? DSS_REG_LDO : DSS_REG_VS;
-		goto vreg_unconfig;
-	}
-	return rc;
-} /* msm_dss_config_vreg */
-EXPORT_SYMBOL(msm_dss_config_vreg);
-
-int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable)
-{
-	int i = 0, rc = 0;
-	bool need_sleep;
-
-	if (enable) {
-		for (i = 0; i < num_vreg; i++) {
-			rc = PTR_RET(in_vreg[i].vreg);
-			if (rc) {
-				DEV_ERR("%pS->%s: %s regulator error. rc=%d\n",
-					__builtin_return_address(0), __func__,
-					in_vreg[i].vreg_name, rc);
-				goto vreg_set_opt_mode_fail;
-			}
-			need_sleep = !regulator_is_enabled(in_vreg[i].vreg);
-			if (in_vreg[i].pre_on_sleep && need_sleep)
-				usleep_range(in_vreg[i].pre_on_sleep * 1000,
-					in_vreg[i].pre_on_sleep * 1000);
-			rc = regulator_set_load(in_vreg[i].vreg,
-				in_vreg[i].enable_load);
-			if (rc < 0) {
-				DEV_ERR("%pS->%s: %s set opt m fail\n",
-					__builtin_return_address(0), __func__,
-					in_vreg[i].vreg_name);
-				goto vreg_set_opt_mode_fail;
-			}
-			rc = regulator_enable(in_vreg[i].vreg);
-			if (in_vreg[i].post_on_sleep && need_sleep)
-				usleep_range(in_vreg[i].post_on_sleep * 1000,
-					in_vreg[i].post_on_sleep * 1000);
-			if (rc < 0) {
-				DEV_ERR("%pS->%s: %s enable failed\n",
-					__builtin_return_address(0), __func__,
-					in_vreg[i].vreg_name);
-				goto disable_vreg;
-			}
-		}
-	} else {
-		for (i = num_vreg-1; i >= 0; i--) {
-			if (in_vreg[i].pre_off_sleep)
-				usleep_range(in_vreg[i].pre_off_sleep * 1000,
-					in_vreg[i].pre_off_sleep * 1000);
-			regulator_set_load(in_vreg[i].vreg,
-				in_vreg[i].disable_load);
-			regulator_disable(in_vreg[i].vreg);
-			if (in_vreg[i].post_off_sleep)
-				usleep_range(in_vreg[i].post_off_sleep * 1000,
-					in_vreg[i].post_off_sleep * 1000);
-		}
-	}
-	return rc;
-
-disable_vreg:
-	regulator_set_load(in_vreg[i].vreg, in_vreg[i].disable_load);
-
-vreg_set_opt_mode_fail:
-	for (i--; i >= 0; i--) {
-		if (in_vreg[i].pre_off_sleep)
-			usleep_range(in_vreg[i].pre_off_sleep * 1000,
-				in_vreg[i].pre_off_sleep * 1000);
-		regulator_set_load(in_vreg[i].vreg,
-			in_vreg[i].disable_load);
-		regulator_disable(in_vreg[i].vreg);
-		if (in_vreg[i].post_off_sleep)
-			usleep_range(in_vreg[i].post_off_sleep * 1000,
-				in_vreg[i].post_off_sleep * 1000);
-	}
-
-	return rc;
-} /* msm_dss_enable_vreg */
-EXPORT_SYMBOL(msm_dss_enable_vreg);
-
-int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable)
-{
-	int i = 0, rc = 0;
-
-	if (enable) {
-		for (i = 0; i < num_gpio; i++) {
-			DEV_DBG("%pS->%s: %s enable\n",
-				__builtin_return_address(0), __func__,
-				in_gpio[i].gpio_name);
-
-			rc = gpio_request(in_gpio[i].gpio,
-				in_gpio[i].gpio_name);
-			if (rc < 0) {
-				DEV_ERR("%pS->%s: %s enable failed\n",
-					__builtin_return_address(0), __func__,
-					in_gpio[i].gpio_name);
-				goto disable_gpio;
-			}
-			gpio_set_value(in_gpio[i].gpio, in_gpio[i].value);
-		}
-	} else {
-		for (i = num_gpio-1; i >= 0; i--) {
-			DEV_DBG("%pS->%s: %s disable\n",
-				__builtin_return_address(0), __func__,
-				in_gpio[i].gpio_name);
-			if (in_gpio[i].gpio)
-				gpio_free(in_gpio[i].gpio);
-		}
-	}
-	return rc;
-
-disable_gpio:
-	for (i--; i >= 0; i--)
-		if (in_gpio[i].gpio)
-			gpio_free(in_gpio[i].gpio);
-
-	return rc;
-} /* msm_dss_enable_gpio */
-EXPORT_SYMBOL(msm_dss_enable_gpio);
+#include "dpu_io_util.h"
 
 void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
 {
@@ -335,8 +26,7 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
 			clk_put(clk_arry[i].clk);
 		clk_arry[i].clk = NULL;
 	}
-} /* msm_dss_put_clk */
-EXPORT_SYMBOL(msm_dss_put_clk);
+}
 
 int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
 {
@@ -363,8 +53,7 @@ int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
 	}
 
 	return rc;
-} /* msm_dss_get_clk */
-EXPORT_SYMBOL(msm_dss_get_clk);
+}
 
 int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
 {
@@ -397,8 +86,7 @@ int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
 	}
 
 	return rc;
-} /* msm_dss_clk_set_rate */
-EXPORT_SYMBOL(msm_dss_clk_set_rate);
+}
 
 int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
 {
@@ -445,8 +133,7 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
 	}
 
 	return rc;
-} /* msm_dss_enable_clk */
-EXPORT_SYMBOL(msm_dss_enable_clk);
+}
 
 int msm_dss_parse_clock(struct platform_device *pdev,
 		struct dss_module_power *mp)
@@ -497,60 +184,3 @@ int msm_dss_parse_clock(struct platform_device *pdev,
 
 	return rc;
 }
-
-int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
-			uint8_t reg_offset, uint8_t *read_buf)
-{
-	struct i2c_msg msgs[2];
-	int ret = -1;
-
-	pr_debug("%s: reading from slave_addr=[%x] and offset=[%x]\n",
-		 __func__, slave_addr, reg_offset);
-
-	msgs[0].addr = slave_addr >> 1;
-	msgs[0].flags = 0;
-	msgs[0].buf = &reg_offset;
-	msgs[0].len = 1;
-
-	msgs[1].addr = slave_addr >> 1;
-	msgs[1].flags = I2C_M_RD;
-	msgs[1].buf = read_buf;
-	msgs[1].len = 1;
-
-	ret = i2c_transfer(client->adapter, msgs, 2);
-	if (ret < 1) {
-		pr_err("%s: I2C READ FAILED=[%d]\n", __func__, ret);
-		return -EACCES;
-	}
-	pr_debug("%s: i2c buf is [%x]\n", __func__, *read_buf);
-	return 0;
-}
-EXPORT_SYMBOL(dpu_i2c_byte_read);
-
-int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
-			uint8_t reg_offset, uint8_t *value)
-{
-	struct i2c_msg msgs[1];
-	uint8_t data[2];
-	int status = -EACCES;
-
-	pr_debug("%s: writing from slave_addr=[%x] and offset=[%x]\n",
-		 __func__, slave_addr, reg_offset);
-
-	data[0] = reg_offset;
-	data[1] = *value;
-
-	msgs[0].addr = slave_addr >> 1;
-	msgs[0].flags = 0;
-	msgs[0].len = 2;
-	msgs[0].buf = data;
-
-	status = i2c_transfer(client->adapter, msgs, 1);
-	if (status < 1) {
-		pr_err("I2C WRITE FAILED=[%d]\n", status);
-		return -EACCES;
-	}
-	pr_debug("%s: I2C write status=%x\n", __func__, status);
-	return status;
-}
-EXPORT_SYMBOL(dpu_i2c_byte_write);
diff --git a/drivers/gpu/drm/msm/dpu_io_util.h b/drivers/gpu/drm/msm/dpu_io_util.h
new file mode 100644
index 0000000..773b52e
--- /dev/null
+++ b/drivers/gpu/drm/msm/dpu_io_util.h
@@ -0,0 +1,61 @@
+/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __DPU_IO_UTIL_H__
+#define __DPU_IO_UTIL_H__
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/types.h>
+
+#ifdef DEBUG
+#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
+#else
+#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
+#endif
+#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
+#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
+#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
+
+struct dss_gpio {
+	unsigned int gpio;
+	unsigned int value;
+	char gpio_name[32];
+};
+
+enum dss_clk_type {
+	DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
+	DSS_CLK_PCLK,
+};
+
+struct dss_clk {
+	struct clk *clk; /* clk handle */
+	char clk_name[32];
+	enum dss_clk_type type;
+	unsigned long rate;
+	unsigned long max_rate;
+};
+
+struct dss_module_power {
+	unsigned int num_gpio;
+	struct dss_gpio *gpio_config;
+	unsigned int num_clk;
+	struct dss_clk *clk_config;
+};
+
+int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
+void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
+int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
+int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
+int msm_dss_parse_clock(struct platform_device *pdev,
+		struct dss_module_power *mp);
+#endif /* __DPU_IO_UTIL_H__ */
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index d5937ba..811f7d4 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -33,7 +33,6 @@
 #include <linux/types.h>
 #include <linux/of_graph.h>
 #include <linux/of_device.h>
-#include <linux/dpu_io_util.h>
 #include <asm/sizes.h>
 #include <linux/kthread.h>
 
diff --git a/include/linux/dpu_io_util.h b/include/linux/dpu_io_util.h
deleted file mode 100644
index 45e606f..0000000
--- a/include/linux/dpu_io_util.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __DPU_IO_UTIL_H__
-#define __DPU_IO_UTIL_H__
-
-#include <linux/gpio.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/consumer.h>
-#include <linux/i2c.h>
-#include <linux/types.h>
-
-#ifdef DEBUG
-#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
-#else
-#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
-#endif
-#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
-#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
-#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
-
-struct dss_io_data {
-	u32 len;
-	void __iomem *base;
-};
-
-void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug);
-u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug);
-void dss_reg_dump(void __iomem *base, u32 len, const char *prefix, u32 debug);
-
-#define DSS_REG_W_ND(io, offset, val)  dss_reg_w(io, offset, val, false)
-#define DSS_REG_W(io, offset, val)     dss_reg_w(io, offset, val, true)
-#define DSS_REG_R_ND(io, offset)       dss_reg_r(io, offset, false)
-#define DSS_REG_R(io, offset)          dss_reg_r(io, offset, true)
-
-enum dss_vreg_type {
-	DSS_REG_LDO,
-	DSS_REG_VS,
-};
-
-struct dss_vreg {
-	struct regulator *vreg; /* vreg handle */
-	char vreg_name[32];
-	int min_voltage;
-	int max_voltage;
-	int enable_load;
-	int disable_load;
-	int pre_on_sleep;
-	int post_on_sleep;
-	int pre_off_sleep;
-	int post_off_sleep;
-};
-
-struct dss_gpio {
-	unsigned int gpio;
-	unsigned int value;
-	char gpio_name[32];
-};
-
-enum dss_clk_type {
-	DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
-	DSS_CLK_PCLK,
-	DSS_CLK_OTHER,
-};
-
-struct dss_clk {
-	struct clk *clk; /* clk handle */
-	char clk_name[32];
-	enum dss_clk_type type;
-	unsigned long rate;
-	unsigned long max_rate;
-};
-
-struct dss_module_power {
-	unsigned int num_vreg;
-	struct dss_vreg *vreg_config;
-	unsigned int num_gpio;
-	struct dss_gpio *gpio_config;
-	unsigned int num_clk;
-	struct dss_clk *clk_config;
-};
-
-int msm_dss_ioremap_byname(struct platform_device *pdev,
-	struct dss_io_data *io_data, const char *name);
-void msm_dss_iounmap(struct dss_io_data *io_data);
-
-int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable);
-int msm_dss_gpio_enable(struct dss_gpio *in_gpio, int num_gpio, int enable);
-
-int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
-	int num_vreg, int config);
-int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg,	int enable);
-
-int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
-void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
-int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
-int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
-int msm_dss_parse_clock(struct platform_device *pdev,
-		struct dss_module_power *mp);
-
-int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
-		       uint8_t reg_offset, uint8_t *read_buf);
-int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
-			uint8_t reg_offset, uint8_t *value);
-
-#endif /* __DPU_IO_UTIL_H__ */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 10/11] drm/msm/dpu: correct dpu_io_util.h include path
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
                     ` (5 preceding siblings ...)
  2018-05-30 14:49   ` [DPU PATCH 09/11] drm/msm/dpu: Remove unused code and move the header Rajesh Yadav
@ 2018-05-30 14:49   ` Rajesh Yadav
       [not found]     ` <1527691788-9350-11-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  2018-05-30 14:49   ` [DPU PATCH 11/11] drm/msm/dpu: move dpu_io_util to dpu folder Rajesh Yadav
  7 siblings, 1 reply; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

dpu_io_util.h is moved from standard include path
to driver folder, correct the include path in code.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c | 1 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
index 24c3274..f997bd9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
@@ -20,7 +20,6 @@
 #include <linux/slab.h>
 #include <linux/mutex.h>
 #include <linux/of_platform.h>
-#include <linux/dpu_io_util.h>
 
 #include "dpu_power_handle.h"
 #include "dpu_trace.h"
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
index 9a6d4b9..193f468 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
@@ -21,7 +21,7 @@
 #define DPU_POWER_HANDLE_ENABLE_BUS_IB_QUOTA	1600000000
 #define DPU_POWER_HANDLE_DISABLE_BUS_IB_QUOTA	0
 
-#include <linux/dpu_io_util.h>
+#include "dpu_io_util.h"
 
 /* event will be triggered before power handler disable */
 #define DPU_POWER_EVENT_PRE_DISABLE	0x1
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [DPU PATCH 11/11] drm/msm/dpu: move dpu_io_util to dpu folder
       [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
                     ` (6 preceding siblings ...)
  2018-05-30 14:49   ` [DPU PATCH 10/11] drm/msm/dpu: correct dpu_io_util.h include path Rajesh Yadav
@ 2018-05-30 14:49   ` Rajesh Yadav
  7 siblings, 0 replies; 17+ messages in thread
From: Rajesh Yadav @ 2018-05-30 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

dpu_io_util is used only by dpu driver so
move it to dpu folder.

Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
---
 drivers/gpu/drm/msm/Makefile                |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c | 186 ++++++++++++++++++++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h |  61 +++++++++
 drivers/gpu/drm/msm/dpu_io_util.c           | 186 ----------------------------
 drivers/gpu/drm/msm/dpu_io_util.h           |  61 ---------
 5 files changed, 248 insertions(+), 248 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h
 delete mode 100644 drivers/gpu/drm/msm/dpu_io_util.c
 delete mode 100644 drivers/gpu/drm/msm/dpu_io_util.h

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index f4c5951..956c6c4 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -68,6 +68,7 @@ msm-y := \
 	disp/dpu1/dpu_hw_top.o \
 	disp/dpu1/dpu_hw_util.o \
 	disp/dpu1/dpu_hw_vbif.o \
+	disp/dpu1/dpu_io_util.o \
 	disp/dpu1/dpu_irq.o \
 	disp/dpu1/dpu_kms.o \
 	disp/dpu1/dpu_kms_utils.o \
@@ -77,7 +78,6 @@ msm-y := \
 	disp/dpu1/dpu_mdss.o \
 	disp/dpu1/dpu_power_handle.o \
 	dpu_dbg.o \
-	dpu_io_util.o \
 	dpu_dbg_evtlog.o \
 	msm_atomic.o \
 	msm_debugfs.o \
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c
new file mode 100644
index 0000000..f7caec3
--- /dev/null
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c
@@ -0,0 +1,186 @@
+/* Copyright (c) 2012-2015, 2017-2018, The Linux Foundation.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/delay.h>
+
+#include "dpu_io_util.h"
+
+void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
+{
+	int i;
+
+	for (i = num_clk - 1; i >= 0; i--) {
+		if (clk_arry[i].clk)
+			clk_put(clk_arry[i].clk);
+		clk_arry[i].clk = NULL;
+	}
+}
+
+int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
+{
+	int i, rc = 0;
+
+	for (i = 0; i < num_clk; i++) {
+		clk_arry[i].clk = clk_get(dev, clk_arry[i].clk_name);
+		rc = PTR_RET(clk_arry[i].clk);
+		if (rc) {
+			DEV_ERR("%pS->%s: '%s' get failed. rc=%d\n",
+				__builtin_return_address(0), __func__,
+				clk_arry[i].clk_name, rc);
+			goto error;
+		}
+	}
+
+	return rc;
+
+error:
+	for (i--; i >= 0; i--) {
+		if (clk_arry[i].clk)
+			clk_put(clk_arry[i].clk);
+		clk_arry[i].clk = NULL;
+	}
+
+	return rc;
+}
+
+int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
+{
+	int i, rc = 0;
+
+	for (i = 0; i < num_clk; i++) {
+		if (clk_arry[i].clk) {
+			if (clk_arry[i].type != DSS_CLK_AHB) {
+				DEV_DBG("%pS->%s: '%s' rate %ld\n",
+					__builtin_return_address(0), __func__,
+					clk_arry[i].clk_name,
+					clk_arry[i].rate);
+				rc = clk_set_rate(clk_arry[i].clk,
+					clk_arry[i].rate);
+				if (rc) {
+					DEV_ERR("%pS->%s: %s failed. rc=%d\n",
+						__builtin_return_address(0),
+						__func__,
+						clk_arry[i].clk_name, rc);
+					break;
+				}
+			}
+		} else {
+			DEV_ERR("%pS->%s: '%s' is not available\n",
+				__builtin_return_address(0), __func__,
+				clk_arry[i].clk_name);
+			rc = -EPERM;
+			break;
+		}
+	}
+
+	return rc;
+}
+
+int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
+{
+	int i, rc = 0;
+
+	if (enable) {
+		for (i = 0; i < num_clk; i++) {
+			DEV_DBG("%pS->%s: enable '%s'\n",
+				__builtin_return_address(0), __func__,
+				clk_arry[i].clk_name);
+			if (clk_arry[i].clk) {
+				rc = clk_prepare_enable(clk_arry[i].clk);
+				if (rc)
+					DEV_ERR("%pS->%s: %s en fail. rc=%d\n",
+						__builtin_return_address(0),
+						__func__,
+						clk_arry[i].clk_name, rc);
+			} else {
+				DEV_ERR("%pS->%s: '%s' is not available\n",
+					__builtin_return_address(0), __func__,
+					clk_arry[i].clk_name);
+				rc = -EPERM;
+			}
+
+			if (rc) {
+				msm_dss_enable_clk(&clk_arry[i],
+					i, false);
+				break;
+			}
+		}
+	} else {
+		for (i = num_clk - 1; i >= 0; i--) {
+			DEV_DBG("%pS->%s: disable '%s'\n",
+				__builtin_return_address(0), __func__,
+				clk_arry[i].clk_name);
+
+			if (clk_arry[i].clk)
+				clk_disable_unprepare(clk_arry[i].clk);
+			else
+				DEV_ERR("%pS->%s: '%s' is not available\n",
+					__builtin_return_address(0), __func__,
+					clk_arry[i].clk_name);
+		}
+	}
+
+	return rc;
+}
+
+int msm_dss_parse_clock(struct platform_device *pdev,
+		struct dss_module_power *mp)
+{
+	u32 i, rc = 0;
+	const char *clock_name;
+	u32 rate = 0;
+	int num_clk = 0;
+
+	if (!pdev || !mp)
+		return -EINVAL;
+
+	mp->num_clk = 0;
+	num_clk = of_property_count_strings(pdev->dev.of_node, "clock-names");
+	if (num_clk <= 0) {
+		pr_debug("clocks are not defined\n");
+		return 0;
+	}
+
+	mp->clk_config = devm_kzalloc(&pdev->dev,
+				      sizeof(struct dss_clk) * num_clk,
+				      GFP_KERNEL);
+	if (!mp->clk_config)
+		return -ENOMEM;
+
+	for (i = 0; i < num_clk; i++) {
+		rc = of_property_read_string_index(pdev->dev.of_node,
+						   "clock-names", i,
+						   &clock_name);
+		if (rc)
+			break;
+		strlcpy(mp->clk_config[i].clk_name, clock_name,
+			sizeof(mp->clk_config[i].clk_name));
+
+		mp->clk_config[i].type = DSS_CLK_AHB;
+		rc = of_property_read_u32_index(pdev->dev.of_node,
+						"clock-frequency", i,
+						&rate);
+		if (rc)
+			continue;
+		mp->clk_config[i].rate = rate;
+		if (rate)
+			mp->clk_config[i].type = DSS_CLK_PCLK;
+	}
+
+	if (!rc)
+		mp->num_clk = num_clk;
+
+	return rc;
+}
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h
new file mode 100644
index 0000000..773b52e
--- /dev/null
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.h
@@ -0,0 +1,61 @@
+/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __DPU_IO_UTIL_H__
+#define __DPU_IO_UTIL_H__
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/types.h>
+
+#ifdef DEBUG
+#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
+#else
+#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
+#endif
+#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
+#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
+#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
+
+struct dss_gpio {
+	unsigned int gpio;
+	unsigned int value;
+	char gpio_name[32];
+};
+
+enum dss_clk_type {
+	DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
+	DSS_CLK_PCLK,
+};
+
+struct dss_clk {
+	struct clk *clk; /* clk handle */
+	char clk_name[32];
+	enum dss_clk_type type;
+	unsigned long rate;
+	unsigned long max_rate;
+};
+
+struct dss_module_power {
+	unsigned int num_gpio;
+	struct dss_gpio *gpio_config;
+	unsigned int num_clk;
+	struct dss_clk *clk_config;
+};
+
+int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
+void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
+int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
+int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
+int msm_dss_parse_clock(struct platform_device *pdev,
+		struct dss_module_power *mp);
+#endif /* __DPU_IO_UTIL_H__ */
diff --git a/drivers/gpu/drm/msm/dpu_io_util.c b/drivers/gpu/drm/msm/dpu_io_util.c
deleted file mode 100644
index f7caec3..0000000
--- a/drivers/gpu/drm/msm/dpu_io_util.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/* Copyright (c) 2012-2015, 2017-2018, The Linux Foundation.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/delay.h>
-
-#include "dpu_io_util.h"
-
-void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
-{
-	int i;
-
-	for (i = num_clk - 1; i >= 0; i--) {
-		if (clk_arry[i].clk)
-			clk_put(clk_arry[i].clk);
-		clk_arry[i].clk = NULL;
-	}
-}
-
-int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
-{
-	int i, rc = 0;
-
-	for (i = 0; i < num_clk; i++) {
-		clk_arry[i].clk = clk_get(dev, clk_arry[i].clk_name);
-		rc = PTR_RET(clk_arry[i].clk);
-		if (rc) {
-			DEV_ERR("%pS->%s: '%s' get failed. rc=%d\n",
-				__builtin_return_address(0), __func__,
-				clk_arry[i].clk_name, rc);
-			goto error;
-		}
-	}
-
-	return rc;
-
-error:
-	for (i--; i >= 0; i--) {
-		if (clk_arry[i].clk)
-			clk_put(clk_arry[i].clk);
-		clk_arry[i].clk = NULL;
-	}
-
-	return rc;
-}
-
-int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
-{
-	int i, rc = 0;
-
-	for (i = 0; i < num_clk; i++) {
-		if (clk_arry[i].clk) {
-			if (clk_arry[i].type != DSS_CLK_AHB) {
-				DEV_DBG("%pS->%s: '%s' rate %ld\n",
-					__builtin_return_address(0), __func__,
-					clk_arry[i].clk_name,
-					clk_arry[i].rate);
-				rc = clk_set_rate(clk_arry[i].clk,
-					clk_arry[i].rate);
-				if (rc) {
-					DEV_ERR("%pS->%s: %s failed. rc=%d\n",
-						__builtin_return_address(0),
-						__func__,
-						clk_arry[i].clk_name, rc);
-					break;
-				}
-			}
-		} else {
-			DEV_ERR("%pS->%s: '%s' is not available\n",
-				__builtin_return_address(0), __func__,
-				clk_arry[i].clk_name);
-			rc = -EPERM;
-			break;
-		}
-	}
-
-	return rc;
-}
-
-int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
-{
-	int i, rc = 0;
-
-	if (enable) {
-		for (i = 0; i < num_clk; i++) {
-			DEV_DBG("%pS->%s: enable '%s'\n",
-				__builtin_return_address(0), __func__,
-				clk_arry[i].clk_name);
-			if (clk_arry[i].clk) {
-				rc = clk_prepare_enable(clk_arry[i].clk);
-				if (rc)
-					DEV_ERR("%pS->%s: %s en fail. rc=%d\n",
-						__builtin_return_address(0),
-						__func__,
-						clk_arry[i].clk_name, rc);
-			} else {
-				DEV_ERR("%pS->%s: '%s' is not available\n",
-					__builtin_return_address(0), __func__,
-					clk_arry[i].clk_name);
-				rc = -EPERM;
-			}
-
-			if (rc) {
-				msm_dss_enable_clk(&clk_arry[i],
-					i, false);
-				break;
-			}
-		}
-	} else {
-		for (i = num_clk - 1; i >= 0; i--) {
-			DEV_DBG("%pS->%s: disable '%s'\n",
-				__builtin_return_address(0), __func__,
-				clk_arry[i].clk_name);
-
-			if (clk_arry[i].clk)
-				clk_disable_unprepare(clk_arry[i].clk);
-			else
-				DEV_ERR("%pS->%s: '%s' is not available\n",
-					__builtin_return_address(0), __func__,
-					clk_arry[i].clk_name);
-		}
-	}
-
-	return rc;
-}
-
-int msm_dss_parse_clock(struct platform_device *pdev,
-		struct dss_module_power *mp)
-{
-	u32 i, rc = 0;
-	const char *clock_name;
-	u32 rate = 0;
-	int num_clk = 0;
-
-	if (!pdev || !mp)
-		return -EINVAL;
-
-	mp->num_clk = 0;
-	num_clk = of_property_count_strings(pdev->dev.of_node, "clock-names");
-	if (num_clk <= 0) {
-		pr_debug("clocks are not defined\n");
-		return 0;
-	}
-
-	mp->clk_config = devm_kzalloc(&pdev->dev,
-				      sizeof(struct dss_clk) * num_clk,
-				      GFP_KERNEL);
-	if (!mp->clk_config)
-		return -ENOMEM;
-
-	for (i = 0; i < num_clk; i++) {
-		rc = of_property_read_string_index(pdev->dev.of_node,
-						   "clock-names", i,
-						   &clock_name);
-		if (rc)
-			break;
-		strlcpy(mp->clk_config[i].clk_name, clock_name,
-			sizeof(mp->clk_config[i].clk_name));
-
-		mp->clk_config[i].type = DSS_CLK_AHB;
-		rc = of_property_read_u32_index(pdev->dev.of_node,
-						"clock-frequency", i,
-						&rate);
-		if (rc)
-			continue;
-		mp->clk_config[i].rate = rate;
-		if (rate)
-			mp->clk_config[i].type = DSS_CLK_PCLK;
-	}
-
-	if (!rc)
-		mp->num_clk = num_clk;
-
-	return rc;
-}
diff --git a/drivers/gpu/drm/msm/dpu_io_util.h b/drivers/gpu/drm/msm/dpu_io_util.h
deleted file mode 100644
index 773b52e..0000000
--- a/drivers/gpu/drm/msm/dpu_io_util.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __DPU_IO_UTIL_H__
-#define __DPU_IO_UTIL_H__
-
-#include <linux/gpio.h>
-#include <linux/platform_device.h>
-#include <linux/types.h>
-
-#ifdef DEBUG
-#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
-#else
-#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
-#endif
-#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
-#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
-#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
-
-struct dss_gpio {
-	unsigned int gpio;
-	unsigned int value;
-	char gpio_name[32];
-};
-
-enum dss_clk_type {
-	DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
-	DSS_CLK_PCLK,
-};
-
-struct dss_clk {
-	struct clk *clk; /* clk handle */
-	char clk_name[32];
-	enum dss_clk_type type;
-	unsigned long rate;
-	unsigned long max_rate;
-};
-
-struct dss_module_power {
-	unsigned int num_gpio;
-	struct dss_gpio *gpio_config;
-	unsigned int num_clk;
-	struct dss_clk *clk_config;
-};
-
-int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
-void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
-int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
-int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
-int msm_dss_parse_clock(struct platform_device *pdev,
-		struct dss_module_power *mp);
-#endif /* __DPU_IO_UTIL_H__ */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [DPU PATCH 10/11] drm/msm/dpu: correct dpu_io_util.h include path
       [not found]     ` <1527691788-9350-11-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2018-05-30 16:30       ` Jordan Crouse
       [not found]         ` <20180530163005.GC5028-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Jordan Crouse @ 2018-05-30 16:30 UTC (permalink / raw)
  To: Rajesh Yadav
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Wed, May 30, 2018 at 08:19:47PM +0530, Rajesh Yadav wrote:
> dpu_io_util.h is moved from standard include path
> to driver folder, correct the include path in code.
> 
> Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>

If the previous patch doesn't compile without this fix you should squash them.

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c | 1 -
>  drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
> index 24c3274..f997bd9 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
> @@ -20,7 +20,6 @@
>  #include <linux/slab.h>
>  #include <linux/mutex.h>
>  #include <linux/of_platform.h>
> -#include <linux/dpu_io_util.h>
>  
>  #include "dpu_power_handle.h"
>  #include "dpu_trace.h"
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
> index 9a6d4b9..193f468 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
> @@ -21,7 +21,7 @@
>  #define DPU_POWER_HANDLE_ENABLE_BUS_IB_QUOTA	1600000000
>  #define DPU_POWER_HANDLE_DISABLE_BUS_IB_QUOTA	0
>  
> -#include <linux/dpu_io_util.h>
> +#include "dpu_io_util.h"
>  
>  /* event will be triggered before power handler disable */
>  #define DPU_POWER_EVENT_PRE_DISABLE	0x1

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [DPU PATCH 10/11] drm/msm/dpu: correct dpu_io_util.h include path
       [not found]         ` <20180530163005.GC5028-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
@ 2018-05-31 11:41           ` ryadav-sgV2jX0FEOL9JmXXK+q4OQ
  0 siblings, 0 replies; 17+ messages in thread
From: ryadav-sgV2jX0FEOL9JmXXK+q4OQ @ 2018-05-31 11:41 UTC (permalink / raw)
  To: Rajesh Yadav
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-05-30 22:00, Jordan Crouse wrote:
> On Wed, May 30, 2018 at 08:19:47PM +0530, Rajesh Yadav wrote:
>> dpu_io_util.h is moved from standard include path
>> to driver folder, correct the include path in code.
>> 
>> Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
> 
> If the previous patch doesn't compile without this fix you should 
> squash them.
Hi Jordan,
Yeah you are right, will squash it in v2.
We are trying to keep msm core and dpu changes in separate patches for 
better squashing when they are pulled by Sean in dpu-staging tree but 
for this instance can't break compilation so yeah I'll squash it with 
previous one.

Thanks,
Rajesh

> 
>> ---
>>  drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c | 1 -
>>  drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h | 2 +-
>>  2 files changed, 1 insertion(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c 
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
>> index 24c3274..f997bd9 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
>> @@ -20,7 +20,6 @@
>>  #include <linux/slab.h>
>>  #include <linux/mutex.h>
>>  #include <linux/of_platform.h>
>> -#include <linux/dpu_io_util.h>
>> 
>>  #include "dpu_power_handle.h"
>>  #include "dpu_trace.h"
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h 
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
>> index 9a6d4b9..193f468 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
>> @@ -21,7 +21,7 @@
>>  #define DPU_POWER_HANDLE_ENABLE_BUS_IB_QUOTA	1600000000
>>  #define DPU_POWER_HANDLE_DISABLE_BUS_IB_QUOTA	0
>> 
>> -#include <linux/dpu_io_util.h>
>> +#include "dpu_io_util.h"
>> 
>>  /* event will be triggered before power handler disable */
>>  #define DPU_POWER_EVENT_PRE_DISABLE	0x1
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [DPU PATCH 09/11] drm/msm/dpu: Remove unused code and move the header
       [not found]     ` <1527691788-9350-10-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2018-06-22 13:51       ` Sean Paul
       [not found]         ` <CAOw6vbLXWojrjXUQq62+n-BDbtQsyBLq_xYGe0RSqnsxo2Ep5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Sean Paul @ 2018-06-22 13:51 UTC (permalink / raw)
  To: ryadav-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm, Rob Clark,
	dri-devel, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	Kristian H. Kristensen, freedreno

On Wed, May 30, 2018 at 10:50 AM Rajesh Yadav <ryadav@codeaurora.org> wrote:
>
> From: Jordan Crouse <jcrouse@codeaurora.org>
>
> Remove unused code from dpu_io_util.c.  The functions are only
> used inside of the msm driver so remove the EXPORT_SYMBOL
> tags and move the header dpu_io_util.h from include/linux.
>
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> [ryadav@codeaurora.org: rebased and removed some extra unused code]
> Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>

Hi Rajesh and Jordan,
I'm backporting this series for testing, and have found that the
mdss-pll driver uses both dpu_io_util and a bunch of functions/struct
members removed in this patchset. Do we anticipate having to add those
back for mdss-pll?

Sean

> ---
>  drivers/gpu/drm/msm/dpu_io_util.c | 380 +-------------------------------------
>  drivers/gpu/drm/msm/dpu_io_util.h |  61 ++++++
>  drivers/gpu/drm/msm/msm_drv.h     |   1 -
>  include/linux/dpu_io_util.h       | 115 ------------
>  4 files changed, 66 insertions(+), 491 deletions(-)
>  create mode 100644 drivers/gpu/drm/msm/dpu_io_util.h
>  delete mode 100644 include/linux/dpu_io_util.h
>
> diff --git a/drivers/gpu/drm/msm/dpu_io_util.c b/drivers/gpu/drm/msm/dpu_io_util.c
> index ecc297c..f7caec3 100644
> --- a/drivers/gpu/drm/msm/dpu_io_util.c
> +++ b/drivers/gpu/drm/msm/dpu_io_util.c
> @@ -13,318 +13,9 @@
>
>  #include <linux/clk.h>
>  #include <linux/err.h>
> -#include <linux/io.h>
> -#include <linux/regulator/consumer.h>
>  #include <linux/delay.h>
> -#include <linux/dpu_io_util.h>
>
> -#define MAX_I2C_CMDS  16
> -void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
> -{
> -       u32 in_val;
> -
> -       if (!io || !io->base) {
> -               DEV_ERR("%pS->%s: invalid input\n",
> -                       __builtin_return_address(0), __func__);
> -               return;
> -       }
> -
> -       if (offset > io->len) {
> -               DEV_ERR("%pS->%s: offset out of range\n",
> -                       __builtin_return_address(0), __func__);
> -               return;
> -       }
> -
> -       writel_relaxed(value, io->base + offset);
> -       if (debug) {
> -               in_val = readl_relaxed(io->base + offset);
> -               DEV_DBG("[%08x] => %08x [%08x]\n",
> -                       (u32)(unsigned long)(io->base + offset),
> -                       value, in_val);
> -       }
> -} /* dss_reg_w */
> -EXPORT_SYMBOL(dss_reg_w);
> -
> -u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug)
> -{
> -       u32 value;
> -
> -       if (!io || !io->base) {
> -               DEV_ERR("%pS->%s: invalid input\n",
> -                       __builtin_return_address(0), __func__);
> -               return -EINVAL;
> -       }
> -
> -       if (offset > io->len) {
> -               DEV_ERR("%pS->%s: offset out of range\n",
> -                       __builtin_return_address(0), __func__);
> -               return -EINVAL;
> -       }
> -
> -       value = readl_relaxed(io->base + offset);
> -       if (debug)
> -               DEV_DBG("[%08x] <= %08x\n",
> -                       (u32)(unsigned long)(io->base + offset), value);
> -
> -       return value;
> -} /* dss_reg_r */
> -EXPORT_SYMBOL(dss_reg_r);
> -
> -void dss_reg_dump(void __iomem *base, u32 length, const char *prefix,
> -       u32 debug)
> -{
> -       if (debug)
> -               print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 32, 4,
> -                       (void *)base, length, false);
> -} /* dss_reg_dump */
> -EXPORT_SYMBOL(dss_reg_dump);
> -
> -static struct resource *msm_dss_get_res_byname(struct platform_device *pdev,
> -       unsigned int type, const char *name)
> -{
> -       struct resource *res = NULL;
> -
> -       res = platform_get_resource_byname(pdev, type, name);
> -       if (!res)
> -               DEV_ERR("%s: '%s' resource not found\n", __func__, name);
> -
> -       return res;
> -} /* msm_dss_get_res_byname */
> -EXPORT_SYMBOL(msm_dss_get_res_byname);
> -
> -int msm_dss_ioremap_byname(struct platform_device *pdev,
> -       struct dss_io_data *io_data, const char *name)
> -{
> -       struct resource *res = NULL;
> -
> -       if (!pdev || !io_data) {
> -               DEV_ERR("%pS->%s: invalid input\n",
> -                       __builtin_return_address(0), __func__);
> -               return -EINVAL;
> -       }
> -
> -       res = msm_dss_get_res_byname(pdev, IORESOURCE_MEM, name);
> -       if (!res) {
> -               DEV_ERR("%pS->%s: '%s' msm_dss_get_res_byname failed\n",
> -                       __builtin_return_address(0), __func__, name);
> -               return -ENODEV;
> -       }
> -
> -       io_data->len = (u32)resource_size(res);
> -       io_data->base = ioremap(res->start, io_data->len);
> -       if (!io_data->base) {
> -               DEV_ERR("%pS->%s: '%s' ioremap failed\n",
> -                       __builtin_return_address(0), __func__, name);
> -               return -EIO;
> -       }
> -
> -       return 0;
> -} /* msm_dss_ioremap_byname */
> -EXPORT_SYMBOL(msm_dss_ioremap_byname);
> -
> -void msm_dss_iounmap(struct dss_io_data *io_data)
> -{
> -       if (!io_data) {
> -               DEV_ERR("%pS->%s: invalid input\n",
> -                       __builtin_return_address(0), __func__);
> -               return;
> -       }
> -
> -       if (io_data->base) {
> -               iounmap(io_data->base);
> -               io_data->base = NULL;
> -       }
> -       io_data->len = 0;
> -} /* msm_dss_iounmap */
> -EXPORT_SYMBOL(msm_dss_iounmap);
> -
> -int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
> -       int num_vreg, int config)
> -{
> -       int i = 0, rc = 0;
> -       struct dss_vreg *curr_vreg = NULL;
> -       enum dss_vreg_type type;
> -
> -       if (!in_vreg || !num_vreg)
> -               return rc;
> -
> -       if (config) {
> -               for (i = 0; i < num_vreg; i++) {
> -                       curr_vreg = &in_vreg[i];
> -                       curr_vreg->vreg = regulator_get(dev,
> -                               curr_vreg->vreg_name);
> -                       rc = PTR_RET(curr_vreg->vreg);
> -                       if (rc) {
> -                               DEV_ERR("%pS->%s: %s get failed. rc=%d\n",
> -                                        __builtin_return_address(0), __func__,
> -                                        curr_vreg->vreg_name, rc);
> -                               curr_vreg->vreg = NULL;
> -                               goto vreg_get_fail;
> -                       }
> -                       type = (regulator_count_voltages(curr_vreg->vreg) > 0)
> -                                       ? DSS_REG_LDO : DSS_REG_VS;
> -                       if (type == DSS_REG_LDO) {
> -                               rc = regulator_set_voltage(
> -                                       curr_vreg->vreg,
> -                                       curr_vreg->min_voltage,
> -                                       curr_vreg->max_voltage);
> -                               if (rc < 0) {
> -                                       DEV_ERR("%pS->%s: %s set vltg fail\n",
> -                                               __builtin_return_address(0),
> -                                               __func__,
> -                                               curr_vreg->vreg_name);
> -                                       goto vreg_set_voltage_fail;
> -                               }
> -                       }
> -               }
> -       } else {
> -               for (i = num_vreg-1; i >= 0; i--) {
> -                       curr_vreg = &in_vreg[i];
> -                       if (curr_vreg->vreg) {
> -                               type = (regulator_count_voltages(
> -                                       curr_vreg->vreg) > 0)
> -                                       ? DSS_REG_LDO : DSS_REG_VS;
> -                               if (type == DSS_REG_LDO) {
> -                                       regulator_set_voltage(curr_vreg->vreg,
> -                                               0, curr_vreg->max_voltage);
> -                               }
> -                               regulator_put(curr_vreg->vreg);
> -                               curr_vreg->vreg = NULL;
> -                       }
> -               }
> -       }
> -       return 0;
> -
> -vreg_unconfig:
> -if (type == DSS_REG_LDO)
> -       regulator_set_load(curr_vreg->vreg, 0);
> -
> -vreg_set_voltage_fail:
> -       regulator_put(curr_vreg->vreg);
> -       curr_vreg->vreg = NULL;
> -
> -vreg_get_fail:
> -       for (i--; i >= 0; i--) {
> -               curr_vreg = &in_vreg[i];
> -               type = (regulator_count_voltages(curr_vreg->vreg) > 0)
> -                       ? DSS_REG_LDO : DSS_REG_VS;
> -               goto vreg_unconfig;
> -       }
> -       return rc;
> -} /* msm_dss_config_vreg */
> -EXPORT_SYMBOL(msm_dss_config_vreg);
> -
> -int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable)
> -{
> -       int i = 0, rc = 0;
> -       bool need_sleep;
> -
> -       if (enable) {
> -               for (i = 0; i < num_vreg; i++) {
> -                       rc = PTR_RET(in_vreg[i].vreg);
> -                       if (rc) {
> -                               DEV_ERR("%pS->%s: %s regulator error. rc=%d\n",
> -                                       __builtin_return_address(0), __func__,
> -                                       in_vreg[i].vreg_name, rc);
> -                               goto vreg_set_opt_mode_fail;
> -                       }
> -                       need_sleep = !regulator_is_enabled(in_vreg[i].vreg);
> -                       if (in_vreg[i].pre_on_sleep && need_sleep)
> -                               usleep_range(in_vreg[i].pre_on_sleep * 1000,
> -                                       in_vreg[i].pre_on_sleep * 1000);
> -                       rc = regulator_set_load(in_vreg[i].vreg,
> -                               in_vreg[i].enable_load);
> -                       if (rc < 0) {
> -                               DEV_ERR("%pS->%s: %s set opt m fail\n",
> -                                       __builtin_return_address(0), __func__,
> -                                       in_vreg[i].vreg_name);
> -                               goto vreg_set_opt_mode_fail;
> -                       }
> -                       rc = regulator_enable(in_vreg[i].vreg);
> -                       if (in_vreg[i].post_on_sleep && need_sleep)
> -                               usleep_range(in_vreg[i].post_on_sleep * 1000,
> -                                       in_vreg[i].post_on_sleep * 1000);
> -                       if (rc < 0) {
> -                               DEV_ERR("%pS->%s: %s enable failed\n",
> -                                       __builtin_return_address(0), __func__,
> -                                       in_vreg[i].vreg_name);
> -                               goto disable_vreg;
> -                       }
> -               }
> -       } else {
> -               for (i = num_vreg-1; i >= 0; i--) {
> -                       if (in_vreg[i].pre_off_sleep)
> -                               usleep_range(in_vreg[i].pre_off_sleep * 1000,
> -                                       in_vreg[i].pre_off_sleep * 1000);
> -                       regulator_set_load(in_vreg[i].vreg,
> -                               in_vreg[i].disable_load);
> -                       regulator_disable(in_vreg[i].vreg);
> -                       if (in_vreg[i].post_off_sleep)
> -                               usleep_range(in_vreg[i].post_off_sleep * 1000,
> -                                       in_vreg[i].post_off_sleep * 1000);
> -               }
> -       }
> -       return rc;
> -
> -disable_vreg:
> -       regulator_set_load(in_vreg[i].vreg, in_vreg[i].disable_load);
> -
> -vreg_set_opt_mode_fail:
> -       for (i--; i >= 0; i--) {
> -               if (in_vreg[i].pre_off_sleep)
> -                       usleep_range(in_vreg[i].pre_off_sleep * 1000,
> -                               in_vreg[i].pre_off_sleep * 1000);
> -               regulator_set_load(in_vreg[i].vreg,
> -                       in_vreg[i].disable_load);
> -               regulator_disable(in_vreg[i].vreg);
> -               if (in_vreg[i].post_off_sleep)
> -                       usleep_range(in_vreg[i].post_off_sleep * 1000,
> -                               in_vreg[i].post_off_sleep * 1000);
> -       }
> -
> -       return rc;
> -} /* msm_dss_enable_vreg */
> -EXPORT_SYMBOL(msm_dss_enable_vreg);
> -
> -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable)
> -{
> -       int i = 0, rc = 0;
> -
> -       if (enable) {
> -               for (i = 0; i < num_gpio; i++) {
> -                       DEV_DBG("%pS->%s: %s enable\n",
> -                               __builtin_return_address(0), __func__,
> -                               in_gpio[i].gpio_name);
> -
> -                       rc = gpio_request(in_gpio[i].gpio,
> -                               in_gpio[i].gpio_name);
> -                       if (rc < 0) {
> -                               DEV_ERR("%pS->%s: %s enable failed\n",
> -                                       __builtin_return_address(0), __func__,
> -                                       in_gpio[i].gpio_name);
> -                               goto disable_gpio;
> -                       }
> -                       gpio_set_value(in_gpio[i].gpio, in_gpio[i].value);
> -               }
> -       } else {
> -               for (i = num_gpio-1; i >= 0; i--) {
> -                       DEV_DBG("%pS->%s: %s disable\n",
> -                               __builtin_return_address(0), __func__,
> -                               in_gpio[i].gpio_name);
> -                       if (in_gpio[i].gpio)
> -                               gpio_free(in_gpio[i].gpio);
> -               }
> -       }
> -       return rc;
> -
> -disable_gpio:
> -       for (i--; i >= 0; i--)
> -               if (in_gpio[i].gpio)
> -                       gpio_free(in_gpio[i].gpio);
> -
> -       return rc;
> -} /* msm_dss_enable_gpio */
> -EXPORT_SYMBOL(msm_dss_enable_gpio);
> +#include "dpu_io_util.h"
>
>  void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
>  {
> @@ -335,8 +26,7 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
>                         clk_put(clk_arry[i].clk);
>                 clk_arry[i].clk = NULL;
>         }
> -} /* msm_dss_put_clk */
> -EXPORT_SYMBOL(msm_dss_put_clk);
> +}
>
>  int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
>  {
> @@ -363,8 +53,7 @@ int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
>         }
>
>         return rc;
> -} /* msm_dss_get_clk */
> -EXPORT_SYMBOL(msm_dss_get_clk);
> +}
>
>  int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
>  {
> @@ -397,8 +86,7 @@ int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
>         }
>
>         return rc;
> -} /* msm_dss_clk_set_rate */
> -EXPORT_SYMBOL(msm_dss_clk_set_rate);
> +}
>
>  int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
>  {
> @@ -445,8 +133,7 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
>         }
>
>         return rc;
> -} /* msm_dss_enable_clk */
> -EXPORT_SYMBOL(msm_dss_enable_clk);
> +}
>
>  int msm_dss_parse_clock(struct platform_device *pdev,
>                 struct dss_module_power *mp)
> @@ -497,60 +184,3 @@ int msm_dss_parse_clock(struct platform_device *pdev,
>
>         return rc;
>  }
> -
> -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
> -                       uint8_t reg_offset, uint8_t *read_buf)
> -{
> -       struct i2c_msg msgs[2];
> -       int ret = -1;
> -
> -       pr_debug("%s: reading from slave_addr=[%x] and offset=[%x]\n",
> -                __func__, slave_addr, reg_offset);
> -
> -       msgs[0].addr = slave_addr >> 1;
> -       msgs[0].flags = 0;
> -       msgs[0].buf = &reg_offset;
> -       msgs[0].len = 1;
> -
> -       msgs[1].addr = slave_addr >> 1;
> -       msgs[1].flags = I2C_M_RD;
> -       msgs[1].buf = read_buf;
> -       msgs[1].len = 1;
> -
> -       ret = i2c_transfer(client->adapter, msgs, 2);
> -       if (ret < 1) {
> -               pr_err("%s: I2C READ FAILED=[%d]\n", __func__, ret);
> -               return -EACCES;
> -       }
> -       pr_debug("%s: i2c buf is [%x]\n", __func__, *read_buf);
> -       return 0;
> -}
> -EXPORT_SYMBOL(dpu_i2c_byte_read);
> -
> -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
> -                       uint8_t reg_offset, uint8_t *value)
> -{
> -       struct i2c_msg msgs[1];
> -       uint8_t data[2];
> -       int status = -EACCES;
> -
> -       pr_debug("%s: writing from slave_addr=[%x] and offset=[%x]\n",
> -                __func__, slave_addr, reg_offset);
> -
> -       data[0] = reg_offset;
> -       data[1] = *value;
> -
> -       msgs[0].addr = slave_addr >> 1;
> -       msgs[0].flags = 0;
> -       msgs[0].len = 2;
> -       msgs[0].buf = data;
> -
> -       status = i2c_transfer(client->adapter, msgs, 1);
> -       if (status < 1) {
> -               pr_err("I2C WRITE FAILED=[%d]\n", status);
> -               return -EACCES;
> -       }
> -       pr_debug("%s: I2C write status=%x\n", __func__, status);
> -       return status;
> -}
> -EXPORT_SYMBOL(dpu_i2c_byte_write);
> diff --git a/drivers/gpu/drm/msm/dpu_io_util.h b/drivers/gpu/drm/msm/dpu_io_util.h
> new file mode 100644
> index 0000000..773b52e
> --- /dev/null
> +++ b/drivers/gpu/drm/msm/dpu_io_util.h
> @@ -0,0 +1,61 @@
> +/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 and
> + * only version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#ifndef __DPU_IO_UTIL_H__
> +#define __DPU_IO_UTIL_H__
> +
> +#include <linux/gpio.h>
> +#include <linux/platform_device.h>
> +#include <linux/types.h>
> +
> +#ifdef DEBUG
> +#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
> +#else
> +#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
> +#endif
> +#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
> +#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
> +#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
> +
> +struct dss_gpio {
> +       unsigned int gpio;
> +       unsigned int value;
> +       char gpio_name[32];
> +};
> +
> +enum dss_clk_type {
> +       DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
> +       DSS_CLK_PCLK,
> +};
> +
> +struct dss_clk {
> +       struct clk *clk; /* clk handle */
> +       char clk_name[32];
> +       enum dss_clk_type type;
> +       unsigned long rate;
> +       unsigned long max_rate;
> +};
> +
> +struct dss_module_power {
> +       unsigned int num_gpio;
> +       struct dss_gpio *gpio_config;
> +       unsigned int num_clk;
> +       struct dss_clk *clk_config;
> +};
> +
> +int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
> +void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
> +int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
> +int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
> +int msm_dss_parse_clock(struct platform_device *pdev,
> +               struct dss_module_power *mp);
> +#endif /* __DPU_IO_UTIL_H__ */
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index d5937ba..811f7d4 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -33,7 +33,6 @@
>  #include <linux/types.h>
>  #include <linux/of_graph.h>
>  #include <linux/of_device.h>
> -#include <linux/dpu_io_util.h>
>  #include <asm/sizes.h>
>  #include <linux/kthread.h>
>
> diff --git a/include/linux/dpu_io_util.h b/include/linux/dpu_io_util.h
> deleted file mode 100644
> index 45e606f..0000000
> --- a/include/linux/dpu_io_util.h
> +++ /dev/null
> @@ -1,115 +0,0 @@
> -/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 and
> - * only version 2 as published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - */
> -
> -#ifndef __DPU_IO_UTIL_H__
> -#define __DPU_IO_UTIL_H__
> -
> -#include <linux/gpio.h>
> -#include <linux/platform_device.h>
> -#include <linux/regulator/consumer.h>
> -#include <linux/i2c.h>
> -#include <linux/types.h>
> -
> -#ifdef DEBUG
> -#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
> -#else
> -#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
> -#endif
> -#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
> -#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
> -#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
> -
> -struct dss_io_data {
> -       u32 len;
> -       void __iomem *base;
> -};
> -
> -void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug);
> -u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug);
> -void dss_reg_dump(void __iomem *base, u32 len, const char *prefix, u32 debug);
> -
> -#define DSS_REG_W_ND(io, offset, val)  dss_reg_w(io, offset, val, false)
> -#define DSS_REG_W(io, offset, val)     dss_reg_w(io, offset, val, true)
> -#define DSS_REG_R_ND(io, offset)       dss_reg_r(io, offset, false)
> -#define DSS_REG_R(io, offset)          dss_reg_r(io, offset, true)
> -
> -enum dss_vreg_type {
> -       DSS_REG_LDO,
> -       DSS_REG_VS,
> -};
> -
> -struct dss_vreg {
> -       struct regulator *vreg; /* vreg handle */
> -       char vreg_name[32];
> -       int min_voltage;
> -       int max_voltage;
> -       int enable_load;
> -       int disable_load;
> -       int pre_on_sleep;
> -       int post_on_sleep;
> -       int pre_off_sleep;
> -       int post_off_sleep;
> -};
> -
> -struct dss_gpio {
> -       unsigned int gpio;
> -       unsigned int value;
> -       char gpio_name[32];
> -};
> -
> -enum dss_clk_type {
> -       DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
> -       DSS_CLK_PCLK,
> -       DSS_CLK_OTHER,
> -};
> -
> -struct dss_clk {
> -       struct clk *clk; /* clk handle */
> -       char clk_name[32];
> -       enum dss_clk_type type;
> -       unsigned long rate;
> -       unsigned long max_rate;
> -};
> -
> -struct dss_module_power {
> -       unsigned int num_vreg;
> -       struct dss_vreg *vreg_config;
> -       unsigned int num_gpio;
> -       struct dss_gpio *gpio_config;
> -       unsigned int num_clk;
> -       struct dss_clk *clk_config;
> -};
> -
> -int msm_dss_ioremap_byname(struct platform_device *pdev,
> -       struct dss_io_data *io_data, const char *name);
> -void msm_dss_iounmap(struct dss_io_data *io_data);
> -
> -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable);
> -int msm_dss_gpio_enable(struct dss_gpio *in_gpio, int num_gpio, int enable);
> -
> -int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
> -       int num_vreg, int config);
> -int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg,        int enable);
> -
> -int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
> -void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
> -int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
> -int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
> -int msm_dss_parse_clock(struct platform_device *pdev,
> -               struct dss_module_power *mp);
> -
> -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
> -                      uint8_t reg_offset, uint8_t *read_buf);
> -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
> -                       uint8_t reg_offset, uint8_t *value);
> -
> -#endif /* __DPU_IO_UTIL_H__ */
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [DPU PATCH 09/11] drm/msm/dpu: Remove unused code and move the header
       [not found]         ` <CAOw6vbLXWojrjXUQq62+n-BDbtQsyBLq_xYGe0RSqnsxo2Ep5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-06-22 15:33           ` Jordan Crouse
       [not found]             ` <20180622153352.GE24526-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Jordan Crouse @ 2018-06-22 15:33 UTC (permalink / raw)
  To: Sean Paul
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, ryadav-sgV2jX0FEOL9JmXXK+q4OQ,
	linux-arm-msm, dri-devel, Rob Clark, Kristian H. Kristensen,
	freedreno

On Fri, Jun 22, 2018 at 09:51:28AM -0400, Sean Paul wrote:
> On Wed, May 30, 2018 at 10:50 AM Rajesh Yadav <ryadav@codeaurora.org> wrote:
> >
> > From: Jordan Crouse <jcrouse@codeaurora.org>
> >
> > Remove unused code from dpu_io_util.c.  The functions are only
> > used inside of the msm driver so remove the EXPORT_SYMBOL
> > tags and move the header dpu_io_util.h from include/linux.
> >
> > Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> > [ryadav@codeaurora.org: rebased and removed some extra unused code]
> > Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
> 
> Hi Rajesh and Jordan,
> I'm backporting this series for testing, and have found that the
> mdss-pll driver uses both dpu_io_util and a bunch of functions/struct
> members removed in this patchset. Do we anticipate having to add those
> back for mdss-pll?

At some point in the distant past some of the downstream folks discovered that
they were using relatively similar functions so they decided to share the code.
The code originally lived in the display driver so it happened that the exported
code continued to be hosted there.

I'm not sure what the upstream status of the mdss-pll code is but I can't
imagine that sharing this code would be in the long term plan and even if it
was basic module guidelines would dictate that it would live with mdss-pll
which would be more likely to be either be built in or act as a dependency for
DPU.

Jordan

> > ---
> >  drivers/gpu/drm/msm/dpu_io_util.c | 380 +-------------------------------------
> >  drivers/gpu/drm/msm/dpu_io_util.h |  61 ++++++
> >  drivers/gpu/drm/msm/msm_drv.h     |   1 -
> >  include/linux/dpu_io_util.h       | 115 ------------
> >  4 files changed, 66 insertions(+), 491 deletions(-)
> >  create mode 100644 drivers/gpu/drm/msm/dpu_io_util.h
> >  delete mode 100644 include/linux/dpu_io_util.h
> >
> > diff --git a/drivers/gpu/drm/msm/dpu_io_util.c b/drivers/gpu/drm/msm/dpu_io_util.c
> > index ecc297c..f7caec3 100644
> > --- a/drivers/gpu/drm/msm/dpu_io_util.c
> > +++ b/drivers/gpu/drm/msm/dpu_io_util.c
> > @@ -13,318 +13,9 @@
> >
> >  #include <linux/clk.h>
> >  #include <linux/err.h>
> > -#include <linux/io.h>
> > -#include <linux/regulator/consumer.h>
> >  #include <linux/delay.h>
> > -#include <linux/dpu_io_util.h>
> >
> > -#define MAX_I2C_CMDS  16
> > -void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
> > -{
> > -       u32 in_val;
> > -
> > -       if (!io || !io->base) {
> > -               DEV_ERR("%pS->%s: invalid input\n",
> > -                       __builtin_return_address(0), __func__);
> > -               return;
> > -       }
> > -
> > -       if (offset > io->len) {
> > -               DEV_ERR("%pS->%s: offset out of range\n",
> > -                       __builtin_return_address(0), __func__);
> > -               return;
> > -       }
> > -
> > -       writel_relaxed(value, io->base + offset);
> > -       if (debug) {
> > -               in_val = readl_relaxed(io->base + offset);
> > -               DEV_DBG("[%08x] => %08x [%08x]\n",
> > -                       (u32)(unsigned long)(io->base + offset),
> > -                       value, in_val);
> > -       }
> > -} /* dss_reg_w */
> > -EXPORT_SYMBOL(dss_reg_w);
> > -
> > -u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug)
> > -{
> > -       u32 value;
> > -
> > -       if (!io || !io->base) {
> > -               DEV_ERR("%pS->%s: invalid input\n",
> > -                       __builtin_return_address(0), __func__);
> > -               return -EINVAL;
> > -       }
> > -
> > -       if (offset > io->len) {
> > -               DEV_ERR("%pS->%s: offset out of range\n",
> > -                       __builtin_return_address(0), __func__);
> > -               return -EINVAL;
> > -       }
> > -
> > -       value = readl_relaxed(io->base + offset);
> > -       if (debug)
> > -               DEV_DBG("[%08x] <= %08x\n",
> > -                       (u32)(unsigned long)(io->base + offset), value);
> > -
> > -       return value;
> > -} /* dss_reg_r */
> > -EXPORT_SYMBOL(dss_reg_r);
> > -
> > -void dss_reg_dump(void __iomem *base, u32 length, const char *prefix,
> > -       u32 debug)
> > -{
> > -       if (debug)
> > -               print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 32, 4,
> > -                       (void *)base, length, false);
> > -} /* dss_reg_dump */
> > -EXPORT_SYMBOL(dss_reg_dump);
> > -
> > -static struct resource *msm_dss_get_res_byname(struct platform_device *pdev,
> > -       unsigned int type, const char *name)
> > -{
> > -       struct resource *res = NULL;
> > -
> > -       res = platform_get_resource_byname(pdev, type, name);
> > -       if (!res)
> > -               DEV_ERR("%s: '%s' resource not found\n", __func__, name);
> > -
> > -       return res;
> > -} /* msm_dss_get_res_byname */
> > -EXPORT_SYMBOL(msm_dss_get_res_byname);
> > -
> > -int msm_dss_ioremap_byname(struct platform_device *pdev,
> > -       struct dss_io_data *io_data, const char *name)
> > -{
> > -       struct resource *res = NULL;
> > -
> > -       if (!pdev || !io_data) {
> > -               DEV_ERR("%pS->%s: invalid input\n",
> > -                       __builtin_return_address(0), __func__);
> > -               return -EINVAL;
> > -       }
> > -
> > -       res = msm_dss_get_res_byname(pdev, IORESOURCE_MEM, name);
> > -       if (!res) {
> > -               DEV_ERR("%pS->%s: '%s' msm_dss_get_res_byname failed\n",
> > -                       __builtin_return_address(0), __func__, name);
> > -               return -ENODEV;
> > -       }
> > -
> > -       io_data->len = (u32)resource_size(res);
> > -       io_data->base = ioremap(res->start, io_data->len);
> > -       if (!io_data->base) {
> > -               DEV_ERR("%pS->%s: '%s' ioremap failed\n",
> > -                       __builtin_return_address(0), __func__, name);
> > -               return -EIO;
> > -       }
> > -
> > -       return 0;
> > -} /* msm_dss_ioremap_byname */
> > -EXPORT_SYMBOL(msm_dss_ioremap_byname);
> > -
> > -void msm_dss_iounmap(struct dss_io_data *io_data)
> > -{
> > -       if (!io_data) {
> > -               DEV_ERR("%pS->%s: invalid input\n",
> > -                       __builtin_return_address(0), __func__);
> > -               return;
> > -       }
> > -
> > -       if (io_data->base) {
> > -               iounmap(io_data->base);
> > -               io_data->base = NULL;
> > -       }
> > -       io_data->len = 0;
> > -} /* msm_dss_iounmap */
> > -EXPORT_SYMBOL(msm_dss_iounmap);
> > -
> > -int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
> > -       int num_vreg, int config)
> > -{
> > -       int i = 0, rc = 0;
> > -       struct dss_vreg *curr_vreg = NULL;
> > -       enum dss_vreg_type type;
> > -
> > -       if (!in_vreg || !num_vreg)
> > -               return rc;
> > -
> > -       if (config) {
> > -               for (i = 0; i < num_vreg; i++) {
> > -                       curr_vreg = &in_vreg[i];
> > -                       curr_vreg->vreg = regulator_get(dev,
> > -                               curr_vreg->vreg_name);
> > -                       rc = PTR_RET(curr_vreg->vreg);
> > -                       if (rc) {
> > -                               DEV_ERR("%pS->%s: %s get failed. rc=%d\n",
> > -                                        __builtin_return_address(0), __func__,
> > -                                        curr_vreg->vreg_name, rc);
> > -                               curr_vreg->vreg = NULL;
> > -                               goto vreg_get_fail;
> > -                       }
> > -                       type = (regulator_count_voltages(curr_vreg->vreg) > 0)
> > -                                       ? DSS_REG_LDO : DSS_REG_VS;
> > -                       if (type == DSS_REG_LDO) {
> > -                               rc = regulator_set_voltage(
> > -                                       curr_vreg->vreg,
> > -                                       curr_vreg->min_voltage,
> > -                                       curr_vreg->max_voltage);
> > -                               if (rc < 0) {
> > -                                       DEV_ERR("%pS->%s: %s set vltg fail\n",
> > -                                               __builtin_return_address(0),
> > -                                               __func__,
> > -                                               curr_vreg->vreg_name);
> > -                                       goto vreg_set_voltage_fail;
> > -                               }
> > -                       }
> > -               }
> > -       } else {
> > -               for (i = num_vreg-1; i >= 0; i--) {
> > -                       curr_vreg = &in_vreg[i];
> > -                       if (curr_vreg->vreg) {
> > -                               type = (regulator_count_voltages(
> > -                                       curr_vreg->vreg) > 0)
> > -                                       ? DSS_REG_LDO : DSS_REG_VS;
> > -                               if (type == DSS_REG_LDO) {
> > -                                       regulator_set_voltage(curr_vreg->vreg,
> > -                                               0, curr_vreg->max_voltage);
> > -                               }
> > -                               regulator_put(curr_vreg->vreg);
> > -                               curr_vreg->vreg = NULL;
> > -                       }
> > -               }
> > -       }
> > -       return 0;
> > -
> > -vreg_unconfig:
> > -if (type == DSS_REG_LDO)
> > -       regulator_set_load(curr_vreg->vreg, 0);
> > -
> > -vreg_set_voltage_fail:
> > -       regulator_put(curr_vreg->vreg);
> > -       curr_vreg->vreg = NULL;
> > -
> > -vreg_get_fail:
> > -       for (i--; i >= 0; i--) {
> > -               curr_vreg = &in_vreg[i];
> > -               type = (regulator_count_voltages(curr_vreg->vreg) > 0)
> > -                       ? DSS_REG_LDO : DSS_REG_VS;
> > -               goto vreg_unconfig;
> > -       }
> > -       return rc;
> > -} /* msm_dss_config_vreg */
> > -EXPORT_SYMBOL(msm_dss_config_vreg);
> > -
> > -int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable)
> > -{
> > -       int i = 0, rc = 0;
> > -       bool need_sleep;
> > -
> > -       if (enable) {
> > -               for (i = 0; i < num_vreg; i++) {
> > -                       rc = PTR_RET(in_vreg[i].vreg);
> > -                       if (rc) {
> > -                               DEV_ERR("%pS->%s: %s regulator error. rc=%d\n",
> > -                                       __builtin_return_address(0), __func__,
> > -                                       in_vreg[i].vreg_name, rc);
> > -                               goto vreg_set_opt_mode_fail;
> > -                       }
> > -                       need_sleep = !regulator_is_enabled(in_vreg[i].vreg);
> > -                       if (in_vreg[i].pre_on_sleep && need_sleep)
> > -                               usleep_range(in_vreg[i].pre_on_sleep * 1000,
> > -                                       in_vreg[i].pre_on_sleep * 1000);
> > -                       rc = regulator_set_load(in_vreg[i].vreg,
> > -                               in_vreg[i].enable_load);
> > -                       if (rc < 0) {
> > -                               DEV_ERR("%pS->%s: %s set opt m fail\n",
> > -                                       __builtin_return_address(0), __func__,
> > -                                       in_vreg[i].vreg_name);
> > -                               goto vreg_set_opt_mode_fail;
> > -                       }
> > -                       rc = regulator_enable(in_vreg[i].vreg);
> > -                       if (in_vreg[i].post_on_sleep && need_sleep)
> > -                               usleep_range(in_vreg[i].post_on_sleep * 1000,
> > -                                       in_vreg[i].post_on_sleep * 1000);
> > -                       if (rc < 0) {
> > -                               DEV_ERR("%pS->%s: %s enable failed\n",
> > -                                       __builtin_return_address(0), __func__,
> > -                                       in_vreg[i].vreg_name);
> > -                               goto disable_vreg;
> > -                       }
> > -               }
> > -       } else {
> > -               for (i = num_vreg-1; i >= 0; i--) {
> > -                       if (in_vreg[i].pre_off_sleep)
> > -                               usleep_range(in_vreg[i].pre_off_sleep * 1000,
> > -                                       in_vreg[i].pre_off_sleep * 1000);
> > -                       regulator_set_load(in_vreg[i].vreg,
> > -                               in_vreg[i].disable_load);
> > -                       regulator_disable(in_vreg[i].vreg);
> > -                       if (in_vreg[i].post_off_sleep)
> > -                               usleep_range(in_vreg[i].post_off_sleep * 1000,
> > -                                       in_vreg[i].post_off_sleep * 1000);
> > -               }
> > -       }
> > -       return rc;
> > -
> > -disable_vreg:
> > -       regulator_set_load(in_vreg[i].vreg, in_vreg[i].disable_load);
> > -
> > -vreg_set_opt_mode_fail:
> > -       for (i--; i >= 0; i--) {
> > -               if (in_vreg[i].pre_off_sleep)
> > -                       usleep_range(in_vreg[i].pre_off_sleep * 1000,
> > -                               in_vreg[i].pre_off_sleep * 1000);
> > -               regulator_set_load(in_vreg[i].vreg,
> > -                       in_vreg[i].disable_load);
> > -               regulator_disable(in_vreg[i].vreg);
> > -               if (in_vreg[i].post_off_sleep)
> > -                       usleep_range(in_vreg[i].post_off_sleep * 1000,
> > -                               in_vreg[i].post_off_sleep * 1000);
> > -       }
> > -
> > -       return rc;
> > -} /* msm_dss_enable_vreg */
> > -EXPORT_SYMBOL(msm_dss_enable_vreg);
> > -
> > -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable)
> > -{
> > -       int i = 0, rc = 0;
> > -
> > -       if (enable) {
> > -               for (i = 0; i < num_gpio; i++) {
> > -                       DEV_DBG("%pS->%s: %s enable\n",
> > -                               __builtin_return_address(0), __func__,
> > -                               in_gpio[i].gpio_name);
> > -
> > -                       rc = gpio_request(in_gpio[i].gpio,
> > -                               in_gpio[i].gpio_name);
> > -                       if (rc < 0) {
> > -                               DEV_ERR("%pS->%s: %s enable failed\n",
> > -                                       __builtin_return_address(0), __func__,
> > -                                       in_gpio[i].gpio_name);
> > -                               goto disable_gpio;
> > -                       }
> > -                       gpio_set_value(in_gpio[i].gpio, in_gpio[i].value);
> > -               }
> > -       } else {
> > -               for (i = num_gpio-1; i >= 0; i--) {
> > -                       DEV_DBG("%pS->%s: %s disable\n",
> > -                               __builtin_return_address(0), __func__,
> > -                               in_gpio[i].gpio_name);
> > -                       if (in_gpio[i].gpio)
> > -                               gpio_free(in_gpio[i].gpio);
> > -               }
> > -       }
> > -       return rc;
> > -
> > -disable_gpio:
> > -       for (i--; i >= 0; i--)
> > -               if (in_gpio[i].gpio)
> > -                       gpio_free(in_gpio[i].gpio);
> > -
> > -       return rc;
> > -} /* msm_dss_enable_gpio */
> > -EXPORT_SYMBOL(msm_dss_enable_gpio);
> > +#include "dpu_io_util.h"
> >
> >  void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
> >  {
> > @@ -335,8 +26,7 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
> >                         clk_put(clk_arry[i].clk);
> >                 clk_arry[i].clk = NULL;
> >         }
> > -} /* msm_dss_put_clk */
> > -EXPORT_SYMBOL(msm_dss_put_clk);
> > +}
> >
> >  int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
> >  {
> > @@ -363,8 +53,7 @@ int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
> >         }
> >
> >         return rc;
> > -} /* msm_dss_get_clk */
> > -EXPORT_SYMBOL(msm_dss_get_clk);
> > +}
> >
> >  int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
> >  {
> > @@ -397,8 +86,7 @@ int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
> >         }
> >
> >         return rc;
> > -} /* msm_dss_clk_set_rate */
> > -EXPORT_SYMBOL(msm_dss_clk_set_rate);
> > +}
> >
> >  int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
> >  {
> > @@ -445,8 +133,7 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
> >         }
> >
> >         return rc;
> > -} /* msm_dss_enable_clk */
> > -EXPORT_SYMBOL(msm_dss_enable_clk);
> > +}
> >
> >  int msm_dss_parse_clock(struct platform_device *pdev,
> >                 struct dss_module_power *mp)
> > @@ -497,60 +184,3 @@ int msm_dss_parse_clock(struct platform_device *pdev,
> >
> >         return rc;
> >  }
> > -
> > -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
> > -                       uint8_t reg_offset, uint8_t *read_buf)
> > -{
> > -       struct i2c_msg msgs[2];
> > -       int ret = -1;
> > -
> > -       pr_debug("%s: reading from slave_addr=[%x] and offset=[%x]\n",
> > -                __func__, slave_addr, reg_offset);
> > -
> > -       msgs[0].addr = slave_addr >> 1;
> > -       msgs[0].flags = 0;
> > -       msgs[0].buf = &reg_offset;
> > -       msgs[0].len = 1;
> > -
> > -       msgs[1].addr = slave_addr >> 1;
> > -       msgs[1].flags = I2C_M_RD;
> > -       msgs[1].buf = read_buf;
> > -       msgs[1].len = 1;
> > -
> > -       ret = i2c_transfer(client->adapter, msgs, 2);
> > -       if (ret < 1) {
> > -               pr_err("%s: I2C READ FAILED=[%d]\n", __func__, ret);
> > -               return -EACCES;
> > -       }
> > -       pr_debug("%s: i2c buf is [%x]\n", __func__, *read_buf);
> > -       return 0;
> > -}
> > -EXPORT_SYMBOL(dpu_i2c_byte_read);
> > -
> > -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
> > -                       uint8_t reg_offset, uint8_t *value)
> > -{
> > -       struct i2c_msg msgs[1];
> > -       uint8_t data[2];
> > -       int status = -EACCES;
> > -
> > -       pr_debug("%s: writing from slave_addr=[%x] and offset=[%x]\n",
> > -                __func__, slave_addr, reg_offset);
> > -
> > -       data[0] = reg_offset;
> > -       data[1] = *value;
> > -
> > -       msgs[0].addr = slave_addr >> 1;
> > -       msgs[0].flags = 0;
> > -       msgs[0].len = 2;
> > -       msgs[0].buf = data;
> > -
> > -       status = i2c_transfer(client->adapter, msgs, 1);
> > -       if (status < 1) {
> > -               pr_err("I2C WRITE FAILED=[%d]\n", status);
> > -               return -EACCES;
> > -       }
> > -       pr_debug("%s: I2C write status=%x\n", __func__, status);
> > -       return status;
> > -}
> > -EXPORT_SYMBOL(dpu_i2c_byte_write);
> > diff --git a/drivers/gpu/drm/msm/dpu_io_util.h b/drivers/gpu/drm/msm/dpu_io_util.h
> > new file mode 100644
> > index 0000000..773b52e
> > --- /dev/null
> > +++ b/drivers/gpu/drm/msm/dpu_io_util.h
> > @@ -0,0 +1,61 @@
> > +/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 and
> > + * only version 2 as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + */
> > +
> > +#ifndef __DPU_IO_UTIL_H__
> > +#define __DPU_IO_UTIL_H__
> > +
> > +#include <linux/gpio.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/types.h>
> > +
> > +#ifdef DEBUG
> > +#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
> > +#else
> > +#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
> > +#endif
> > +#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
> > +#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
> > +#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
> > +
> > +struct dss_gpio {
> > +       unsigned int gpio;
> > +       unsigned int value;
> > +       char gpio_name[32];
> > +};
> > +
> > +enum dss_clk_type {
> > +       DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
> > +       DSS_CLK_PCLK,
> > +};
> > +
> > +struct dss_clk {
> > +       struct clk *clk; /* clk handle */
> > +       char clk_name[32];
> > +       enum dss_clk_type type;
> > +       unsigned long rate;
> > +       unsigned long max_rate;
> > +};
> > +
> > +struct dss_module_power {
> > +       unsigned int num_gpio;
> > +       struct dss_gpio *gpio_config;
> > +       unsigned int num_clk;
> > +       struct dss_clk *clk_config;
> > +};
> > +
> > +int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
> > +void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
> > +int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
> > +int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
> > +int msm_dss_parse_clock(struct platform_device *pdev,
> > +               struct dss_module_power *mp);
> > +#endif /* __DPU_IO_UTIL_H__ */
> > diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> > index d5937ba..811f7d4 100644
> > --- a/drivers/gpu/drm/msm/msm_drv.h
> > +++ b/drivers/gpu/drm/msm/msm_drv.h
> > @@ -33,7 +33,6 @@
> >  #include <linux/types.h>
> >  #include <linux/of_graph.h>
> >  #include <linux/of_device.h>
> > -#include <linux/dpu_io_util.h>
> >  #include <asm/sizes.h>
> >  #include <linux/kthread.h>
> >
> > diff --git a/include/linux/dpu_io_util.h b/include/linux/dpu_io_util.h
> > deleted file mode 100644
> > index 45e606f..0000000
> > --- a/include/linux/dpu_io_util.h
> > +++ /dev/null
> > @@ -1,115 +0,0 @@
> > -/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
> > - *
> > - * This program is free software; you can redistribute it and/or modify
> > - * it under the terms of the GNU General Public License version 2 and
> > - * only version 2 as published by the Free Software Foundation.
> > - *
> > - * This program is distributed in the hope that it will be useful,
> > - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > - * GNU General Public License for more details.
> > - */
> > -
> > -#ifndef __DPU_IO_UTIL_H__
> > -#define __DPU_IO_UTIL_H__
> > -
> > -#include <linux/gpio.h>
> > -#include <linux/platform_device.h>
> > -#include <linux/regulator/consumer.h>
> > -#include <linux/i2c.h>
> > -#include <linux/types.h>
> > -
> > -#ifdef DEBUG
> > -#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
> > -#else
> > -#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
> > -#endif
> > -#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
> > -#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
> > -#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
> > -
> > -struct dss_io_data {
> > -       u32 len;
> > -       void __iomem *base;
> > -};
> > -
> > -void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug);
> > -u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug);
> > -void dss_reg_dump(void __iomem *base, u32 len, const char *prefix, u32 debug);
> > -
> > -#define DSS_REG_W_ND(io, offset, val)  dss_reg_w(io, offset, val, false)
> > -#define DSS_REG_W(io, offset, val)     dss_reg_w(io, offset, val, true)
> > -#define DSS_REG_R_ND(io, offset)       dss_reg_r(io, offset, false)
> > -#define DSS_REG_R(io, offset)          dss_reg_r(io, offset, true)
> > -
> > -enum dss_vreg_type {
> > -       DSS_REG_LDO,
> > -       DSS_REG_VS,
> > -};
> > -
> > -struct dss_vreg {
> > -       struct regulator *vreg; /* vreg handle */
> > -       char vreg_name[32];
> > -       int min_voltage;
> > -       int max_voltage;
> > -       int enable_load;
> > -       int disable_load;
> > -       int pre_on_sleep;
> > -       int post_on_sleep;
> > -       int pre_off_sleep;
> > -       int post_off_sleep;
> > -};
> > -
> > -struct dss_gpio {
> > -       unsigned int gpio;
> > -       unsigned int value;
> > -       char gpio_name[32];
> > -};
> > -
> > -enum dss_clk_type {
> > -       DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
> > -       DSS_CLK_PCLK,
> > -       DSS_CLK_OTHER,
> > -};
> > -
> > -struct dss_clk {
> > -       struct clk *clk; /* clk handle */
> > -       char clk_name[32];
> > -       enum dss_clk_type type;
> > -       unsigned long rate;
> > -       unsigned long max_rate;
> > -};
> > -
> > -struct dss_module_power {
> > -       unsigned int num_vreg;
> > -       struct dss_vreg *vreg_config;
> > -       unsigned int num_gpio;
> > -       struct dss_gpio *gpio_config;
> > -       unsigned int num_clk;
> > -       struct dss_clk *clk_config;
> > -};
> > -
> > -int msm_dss_ioremap_byname(struct platform_device *pdev,
> > -       struct dss_io_data *io_data, const char *name);
> > -void msm_dss_iounmap(struct dss_io_data *io_data);
> > -
> > -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable);
> > -int msm_dss_gpio_enable(struct dss_gpio *in_gpio, int num_gpio, int enable);
> > -
> > -int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
> > -       int num_vreg, int config);
> > -int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg,        int enable);
> > -
> > -int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
> > -void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
> > -int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
> > -int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
> > -int msm_dss_parse_clock(struct platform_device *pdev,
> > -               struct dss_module_power *mp);
> > -
> > -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
> > -                      uint8_t reg_offset, uint8_t *read_buf);
> > -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
> > -                       uint8_t reg_offset, uint8_t *value);
> > -
> > -#endif /* __DPU_IO_UTIL_H__ */
> > --
> > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> > a Linux Foundation Collaborative Project
> >

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [DPU PATCH 09/11] drm/msm/dpu: Remove unused code and move the header
       [not found]             ` <20180622153352.GE24526-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
@ 2018-06-22 17:39               ` ryadav-sgV2jX0FEOL9JmXXK+q4OQ
  0 siblings, 0 replies; 17+ messages in thread
From: ryadav-sgV2jX0FEOL9JmXXK+q4OQ @ 2018-06-22 17:39 UTC (permalink / raw)
  To: Sean Paul
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm, dri-devel,
	Rob Clark, Kristian H. Kristensen, freedreno

On 2018-06-22 21:03, Jordan Crouse wrote:
> On Fri, Jun 22, 2018 at 09:51:28AM -0400, Sean Paul wrote:
>> On Wed, May 30, 2018 at 10:50 AM Rajesh Yadav <ryadav@codeaurora.org> 
>> wrote:
>> >
>> > From: Jordan Crouse <jcrouse@codeaurora.org>
>> >
>> > Remove unused code from dpu_io_util.c.  The functions are only
>> > used inside of the msm driver so remove the EXPORT_SYMBOL
>> > tags and move the header dpu_io_util.h from include/linux.
>> >
>> > Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
>> > [ryadav@codeaurora.org: rebased and removed some extra unused code]
>> > Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
>> 
>> Hi Rajesh and Jordan,
>> I'm backporting this series for testing, and have found that the
>> mdss-pll driver uses both dpu_io_util and a bunch of functions/struct
>> members removed in this patchset. Do we anticipate having to add those
>> back for mdss-pll?
> 
> At some point in the distant past some of the downstream folks 
> discovered that
> they were using relatively similar functions so they decided to share 
> the code.
> The code originally lived in the display driver so it happened that the 
> exported
> code continued to be hosted there.
> 
> I'm not sure what the upstream status of the mdss-pll code is but I 
> can't
> imagine that sharing this code would be in the long term plan and even 
> if it
> was basic module guidelines would dictate that it would live with 
> mdss-pll
> which would be more likely to be either be built in or act as a 
> dependency for
> DPU.
> 
> Jordan

Hi Sean,
drivers/clk/qcom/mdss was needed for dsi-staging driver and can be 
safely dropped since we switched to upstream DSI driver.
Please drop the following change to address this issue (except for the 
driver/gpu/drm/msm/Kconfig):
https://gitlab.freedesktop.org/seanpaul/dpu-staging/commit/2e433b56489b3e53b9d89ce7bfa15fb4698c8c58
I had tested it on my side.

Thanks,
Rajesh

> 
>> > ---
>> >  drivers/gpu/drm/msm/dpu_io_util.c | 380 +-------------------------------------
>> >  drivers/gpu/drm/msm/dpu_io_util.h |  61 ++++++
>> >  drivers/gpu/drm/msm/msm_drv.h     |   1 -
>> >  include/linux/dpu_io_util.h       | 115 ------------
>> >  4 files changed, 66 insertions(+), 491 deletions(-)
>> >  create mode 100644 drivers/gpu/drm/msm/dpu_io_util.h
>> >  delete mode 100644 include/linux/dpu_io_util.h
>> >
>> > diff --git a/drivers/gpu/drm/msm/dpu_io_util.c b/drivers/gpu/drm/msm/dpu_io_util.c
>> > index ecc297c..f7caec3 100644
>> > --- a/drivers/gpu/drm/msm/dpu_io_util.c
>> > +++ b/drivers/gpu/drm/msm/dpu_io_util.c
>> > @@ -13,318 +13,9 @@
>> >
>> >  #include <linux/clk.h>
>> >  #include <linux/err.h>
>> > -#include <linux/io.h>
>> > -#include <linux/regulator/consumer.h>
>> >  #include <linux/delay.h>
>> > -#include <linux/dpu_io_util.h>
>> >
>> > -#define MAX_I2C_CMDS  16
>> > -void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
>> > -{
>> > -       u32 in_val;
>> > -
>> > -       if (!io || !io->base) {
>> > -               DEV_ERR("%pS->%s: invalid input\n",
>> > -                       __builtin_return_address(0), __func__);
>> > -               return;
>> > -       }
>> > -
>> > -       if (offset > io->len) {
>> > -               DEV_ERR("%pS->%s: offset out of range\n",
>> > -                       __builtin_return_address(0), __func__);
>> > -               return;
>> > -       }
>> > -
>> > -       writel_relaxed(value, io->base + offset);
>> > -       if (debug) {
>> > -               in_val = readl_relaxed(io->base + offset);
>> > -               DEV_DBG("[%08x] => %08x [%08x]\n",
>> > -                       (u32)(unsigned long)(io->base + offset),
>> > -                       value, in_val);
>> > -       }
>> > -} /* dss_reg_w */
>> > -EXPORT_SYMBOL(dss_reg_w);
>> > -
>> > -u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug)
>> > -{
>> > -       u32 value;
>> > -
>> > -       if (!io || !io->base) {
>> > -               DEV_ERR("%pS->%s: invalid input\n",
>> > -                       __builtin_return_address(0), __func__);
>> > -               return -EINVAL;
>> > -       }
>> > -
>> > -       if (offset > io->len) {
>> > -               DEV_ERR("%pS->%s: offset out of range\n",
>> > -                       __builtin_return_address(0), __func__);
>> > -               return -EINVAL;
>> > -       }
>> > -
>> > -       value = readl_relaxed(io->base + offset);
>> > -       if (debug)
>> > -               DEV_DBG("[%08x] <= %08x\n",
>> > -                       (u32)(unsigned long)(io->base + offset), value);
>> > -
>> > -       return value;
>> > -} /* dss_reg_r */
>> > -EXPORT_SYMBOL(dss_reg_r);
>> > -
>> > -void dss_reg_dump(void __iomem *base, u32 length, const char *prefix,
>> > -       u32 debug)
>> > -{
>> > -       if (debug)
>> > -               print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 32, 4,
>> > -                       (void *)base, length, false);
>> > -} /* dss_reg_dump */
>> > -EXPORT_SYMBOL(dss_reg_dump);
>> > -
>> > -static struct resource *msm_dss_get_res_byname(struct platform_device *pdev,
>> > -       unsigned int type, const char *name)
>> > -{
>> > -       struct resource *res = NULL;
>> > -
>> > -       res = platform_get_resource_byname(pdev, type, name);
>> > -       if (!res)
>> > -               DEV_ERR("%s: '%s' resource not found\n", __func__, name);
>> > -
>> > -       return res;
>> > -} /* msm_dss_get_res_byname */
>> > -EXPORT_SYMBOL(msm_dss_get_res_byname);
>> > -
>> > -int msm_dss_ioremap_byname(struct platform_device *pdev,
>> > -       struct dss_io_data *io_data, const char *name)
>> > -{
>> > -       struct resource *res = NULL;
>> > -
>> > -       if (!pdev || !io_data) {
>> > -               DEV_ERR("%pS->%s: invalid input\n",
>> > -                       __builtin_return_address(0), __func__);
>> > -               return -EINVAL;
>> > -       }
>> > -
>> > -       res = msm_dss_get_res_byname(pdev, IORESOURCE_MEM, name);
>> > -       if (!res) {
>> > -               DEV_ERR("%pS->%s: '%s' msm_dss_get_res_byname failed\n",
>> > -                       __builtin_return_address(0), __func__, name);
>> > -               return -ENODEV;
>> > -       }
>> > -
>> > -       io_data->len = (u32)resource_size(res);
>> > -       io_data->base = ioremap(res->start, io_data->len);
>> > -       if (!io_data->base) {
>> > -               DEV_ERR("%pS->%s: '%s' ioremap failed\n",
>> > -                       __builtin_return_address(0), __func__, name);
>> > -               return -EIO;
>> > -       }
>> > -
>> > -       return 0;
>> > -} /* msm_dss_ioremap_byname */
>> > -EXPORT_SYMBOL(msm_dss_ioremap_byname);
>> > -
>> > -void msm_dss_iounmap(struct dss_io_data *io_data)
>> > -{
>> > -       if (!io_data) {
>> > -               DEV_ERR("%pS->%s: invalid input\n",
>> > -                       __builtin_return_address(0), __func__);
>> > -               return;
>> > -       }
>> > -
>> > -       if (io_data->base) {
>> > -               iounmap(io_data->base);
>> > -               io_data->base = NULL;
>> > -       }
>> > -       io_data->len = 0;
>> > -} /* msm_dss_iounmap */
>> > -EXPORT_SYMBOL(msm_dss_iounmap);
>> > -
>> > -int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
>> > -       int num_vreg, int config)
>> > -{
>> > -       int i = 0, rc = 0;
>> > -       struct dss_vreg *curr_vreg = NULL;
>> > -       enum dss_vreg_type type;
>> > -
>> > -       if (!in_vreg || !num_vreg)
>> > -               return rc;
>> > -
>> > -       if (config) {
>> > -               for (i = 0; i < num_vreg; i++) {
>> > -                       curr_vreg = &in_vreg[i];
>> > -                       curr_vreg->vreg = regulator_get(dev,
>> > -                               curr_vreg->vreg_name);
>> > -                       rc = PTR_RET(curr_vreg->vreg);
>> > -                       if (rc) {
>> > -                               DEV_ERR("%pS->%s: %s get failed. rc=%d\n",
>> > -                                        __builtin_return_address(0), __func__,
>> > -                                        curr_vreg->vreg_name, rc);
>> > -                               curr_vreg->vreg = NULL;
>> > -                               goto vreg_get_fail;
>> > -                       }
>> > -                       type = (regulator_count_voltages(curr_vreg->vreg) > 0)
>> > -                                       ? DSS_REG_LDO : DSS_REG_VS;
>> > -                       if (type == DSS_REG_LDO) {
>> > -                               rc = regulator_set_voltage(
>> > -                                       curr_vreg->vreg,
>> > -                                       curr_vreg->min_voltage,
>> > -                                       curr_vreg->max_voltage);
>> > -                               if (rc < 0) {
>> > -                                       DEV_ERR("%pS->%s: %s set vltg fail\n",
>> > -                                               __builtin_return_address(0),
>> > -                                               __func__,
>> > -                                               curr_vreg->vreg_name);
>> > -                                       goto vreg_set_voltage_fail;
>> > -                               }
>> > -                       }
>> > -               }
>> > -       } else {
>> > -               for (i = num_vreg-1; i >= 0; i--) {
>> > -                       curr_vreg = &in_vreg[i];
>> > -                       if (curr_vreg->vreg) {
>> > -                               type = (regulator_count_voltages(
>> > -                                       curr_vreg->vreg) > 0)
>> > -                                       ? DSS_REG_LDO : DSS_REG_VS;
>> > -                               if (type == DSS_REG_LDO) {
>> > -                                       regulator_set_voltage(curr_vreg->vreg,
>> > -                                               0, curr_vreg->max_voltage);
>> > -                               }
>> > -                               regulator_put(curr_vreg->vreg);
>> > -                               curr_vreg->vreg = NULL;
>> > -                       }
>> > -               }
>> > -       }
>> > -       return 0;
>> > -
>> > -vreg_unconfig:
>> > -if (type == DSS_REG_LDO)
>> > -       regulator_set_load(curr_vreg->vreg, 0);
>> > -
>> > -vreg_set_voltage_fail:
>> > -       regulator_put(curr_vreg->vreg);
>> > -       curr_vreg->vreg = NULL;
>> > -
>> > -vreg_get_fail:
>> > -       for (i--; i >= 0; i--) {
>> > -               curr_vreg = &in_vreg[i];
>> > -               type = (regulator_count_voltages(curr_vreg->vreg) > 0)
>> > -                       ? DSS_REG_LDO : DSS_REG_VS;
>> > -               goto vreg_unconfig;
>> > -       }
>> > -       return rc;
>> > -} /* msm_dss_config_vreg */
>> > -EXPORT_SYMBOL(msm_dss_config_vreg);
>> > -
>> > -int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable)
>> > -{
>> > -       int i = 0, rc = 0;
>> > -       bool need_sleep;
>> > -
>> > -       if (enable) {
>> > -               for (i = 0; i < num_vreg; i++) {
>> > -                       rc = PTR_RET(in_vreg[i].vreg);
>> > -                       if (rc) {
>> > -                               DEV_ERR("%pS->%s: %s regulator error. rc=%d\n",
>> > -                                       __builtin_return_address(0), __func__,
>> > -                                       in_vreg[i].vreg_name, rc);
>> > -                               goto vreg_set_opt_mode_fail;
>> > -                       }
>> > -                       need_sleep = !regulator_is_enabled(in_vreg[i].vreg);
>> > -                       if (in_vreg[i].pre_on_sleep && need_sleep)
>> > -                               usleep_range(in_vreg[i].pre_on_sleep * 1000,
>> > -                                       in_vreg[i].pre_on_sleep * 1000);
>> > -                       rc = regulator_set_load(in_vreg[i].vreg,
>> > -                               in_vreg[i].enable_load);
>> > -                       if (rc < 0) {
>> > -                               DEV_ERR("%pS->%s: %s set opt m fail\n",
>> > -                                       __builtin_return_address(0), __func__,
>> > -                                       in_vreg[i].vreg_name);
>> > -                               goto vreg_set_opt_mode_fail;
>> > -                       }
>> > -                       rc = regulator_enable(in_vreg[i].vreg);
>> > -                       if (in_vreg[i].post_on_sleep && need_sleep)
>> > -                               usleep_range(in_vreg[i].post_on_sleep * 1000,
>> > -                                       in_vreg[i].post_on_sleep * 1000);
>> > -                       if (rc < 0) {
>> > -                               DEV_ERR("%pS->%s: %s enable failed\n",
>> > -                                       __builtin_return_address(0), __func__,
>> > -                                       in_vreg[i].vreg_name);
>> > -                               goto disable_vreg;
>> > -                       }
>> > -               }
>> > -       } else {
>> > -               for (i = num_vreg-1; i >= 0; i--) {
>> > -                       if (in_vreg[i].pre_off_sleep)
>> > -                               usleep_range(in_vreg[i].pre_off_sleep * 1000,
>> > -                                       in_vreg[i].pre_off_sleep * 1000);
>> > -                       regulator_set_load(in_vreg[i].vreg,
>> > -                               in_vreg[i].disable_load);
>> > -                       regulator_disable(in_vreg[i].vreg);
>> > -                       if (in_vreg[i].post_off_sleep)
>> > -                               usleep_range(in_vreg[i].post_off_sleep * 1000,
>> > -                                       in_vreg[i].post_off_sleep * 1000);
>> > -               }
>> > -       }
>> > -       return rc;
>> > -
>> > -disable_vreg:
>> > -       regulator_set_load(in_vreg[i].vreg, in_vreg[i].disable_load);
>> > -
>> > -vreg_set_opt_mode_fail:
>> > -       for (i--; i >= 0; i--) {
>> > -               if (in_vreg[i].pre_off_sleep)
>> > -                       usleep_range(in_vreg[i].pre_off_sleep * 1000,
>> > -                               in_vreg[i].pre_off_sleep * 1000);
>> > -               regulator_set_load(in_vreg[i].vreg,
>> > -                       in_vreg[i].disable_load);
>> > -               regulator_disable(in_vreg[i].vreg);
>> > -               if (in_vreg[i].post_off_sleep)
>> > -                       usleep_range(in_vreg[i].post_off_sleep * 1000,
>> > -                               in_vreg[i].post_off_sleep * 1000);
>> > -       }
>> > -
>> > -       return rc;
>> > -} /* msm_dss_enable_vreg */
>> > -EXPORT_SYMBOL(msm_dss_enable_vreg);
>> > -
>> > -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable)
>> > -{
>> > -       int i = 0, rc = 0;
>> > -
>> > -       if (enable) {
>> > -               for (i = 0; i < num_gpio; i++) {
>> > -                       DEV_DBG("%pS->%s: %s enable\n",
>> > -                               __builtin_return_address(0), __func__,
>> > -                               in_gpio[i].gpio_name);
>> > -
>> > -                       rc = gpio_request(in_gpio[i].gpio,
>> > -                               in_gpio[i].gpio_name);
>> > -                       if (rc < 0) {
>> > -                               DEV_ERR("%pS->%s: %s enable failed\n",
>> > -                                       __builtin_return_address(0), __func__,
>> > -                                       in_gpio[i].gpio_name);
>> > -                               goto disable_gpio;
>> > -                       }
>> > -                       gpio_set_value(in_gpio[i].gpio, in_gpio[i].value);
>> > -               }
>> > -       } else {
>> > -               for (i = num_gpio-1; i >= 0; i--) {
>> > -                       DEV_DBG("%pS->%s: %s disable\n",
>> > -                               __builtin_return_address(0), __func__,
>> > -                               in_gpio[i].gpio_name);
>> > -                       if (in_gpio[i].gpio)
>> > -                               gpio_free(in_gpio[i].gpio);
>> > -               }
>> > -       }
>> > -       return rc;
>> > -
>> > -disable_gpio:
>> > -       for (i--; i >= 0; i--)
>> > -               if (in_gpio[i].gpio)
>> > -                       gpio_free(in_gpio[i].gpio);
>> > -
>> > -       return rc;
>> > -} /* msm_dss_enable_gpio */
>> > -EXPORT_SYMBOL(msm_dss_enable_gpio);
>> > +#include "dpu_io_util.h"
>> >
>> >  void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
>> >  {
>> > @@ -335,8 +26,7 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
>> >                         clk_put(clk_arry[i].clk);
>> >                 clk_arry[i].clk = NULL;
>> >         }
>> > -} /* msm_dss_put_clk */
>> > -EXPORT_SYMBOL(msm_dss_put_clk);
>> > +}
>> >
>> >  int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
>> >  {
>> > @@ -363,8 +53,7 @@ int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
>> >         }
>> >
>> >         return rc;
>> > -} /* msm_dss_get_clk */
>> > -EXPORT_SYMBOL(msm_dss_get_clk);
>> > +}
>> >
>> >  int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
>> >  {
>> > @@ -397,8 +86,7 @@ int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
>> >         }
>> >
>> >         return rc;
>> > -} /* msm_dss_clk_set_rate */
>> > -EXPORT_SYMBOL(msm_dss_clk_set_rate);
>> > +}
>> >
>> >  int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
>> >  {
>> > @@ -445,8 +133,7 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
>> >         }
>> >
>> >         return rc;
>> > -} /* msm_dss_enable_clk */
>> > -EXPORT_SYMBOL(msm_dss_enable_clk);
>> > +}
>> >
>> >  int msm_dss_parse_clock(struct platform_device *pdev,
>> >                 struct dss_module_power *mp)
>> > @@ -497,60 +184,3 @@ int msm_dss_parse_clock(struct platform_device *pdev,
>> >
>> >         return rc;
>> >  }
>> > -
>> > -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
>> > -                       uint8_t reg_offset, uint8_t *read_buf)
>> > -{
>> > -       struct i2c_msg msgs[2];
>> > -       int ret = -1;
>> > -
>> > -       pr_debug("%s: reading from slave_addr=[%x] and offset=[%x]\n",
>> > -                __func__, slave_addr, reg_offset);
>> > -
>> > -       msgs[0].addr = slave_addr >> 1;
>> > -       msgs[0].flags = 0;
>> > -       msgs[0].buf = &reg_offset;
>> > -       msgs[0].len = 1;
>> > -
>> > -       msgs[1].addr = slave_addr >> 1;
>> > -       msgs[1].flags = I2C_M_RD;
>> > -       msgs[1].buf = read_buf;
>> > -       msgs[1].len = 1;
>> > -
>> > -       ret = i2c_transfer(client->adapter, msgs, 2);
>> > -       if (ret < 1) {
>> > -               pr_err("%s: I2C READ FAILED=[%d]\n", __func__, ret);
>> > -               return -EACCES;
>> > -       }
>> > -       pr_debug("%s: i2c buf is [%x]\n", __func__, *read_buf);
>> > -       return 0;
>> > -}
>> > -EXPORT_SYMBOL(dpu_i2c_byte_read);
>> > -
>> > -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
>> > -                       uint8_t reg_offset, uint8_t *value)
>> > -{
>> > -       struct i2c_msg msgs[1];
>> > -       uint8_t data[2];
>> > -       int status = -EACCES;
>> > -
>> > -       pr_debug("%s: writing from slave_addr=[%x] and offset=[%x]\n",
>> > -                __func__, slave_addr, reg_offset);
>> > -
>> > -       data[0] = reg_offset;
>> > -       data[1] = *value;
>> > -
>> > -       msgs[0].addr = slave_addr >> 1;
>> > -       msgs[0].flags = 0;
>> > -       msgs[0].len = 2;
>> > -       msgs[0].buf = data;
>> > -
>> > -       status = i2c_transfer(client->adapter, msgs, 1);
>> > -       if (status < 1) {
>> > -               pr_err("I2C WRITE FAILED=[%d]\n", status);
>> > -               return -EACCES;
>> > -       }
>> > -       pr_debug("%s: I2C write status=%x\n", __func__, status);
>> > -       return status;
>> > -}
>> > -EXPORT_SYMBOL(dpu_i2c_byte_write);
>> > diff --git a/drivers/gpu/drm/msm/dpu_io_util.h b/drivers/gpu/drm/msm/dpu_io_util.h
>> > new file mode 100644
>> > index 0000000..773b52e
>> > --- /dev/null
>> > +++ b/drivers/gpu/drm/msm/dpu_io_util.h
>> > @@ -0,0 +1,61 @@
>> > +/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
>> > + *
>> > + * This program is free software; you can redistribute it and/or modify
>> > + * it under the terms of the GNU General Public License version 2 and
>> > + * only version 2 as published by the Free Software Foundation.
>> > + *
>> > + * This program is distributed in the hope that it will be useful,
>> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> > + * GNU General Public License for more details.
>> > + */
>> > +
>> > +#ifndef __DPU_IO_UTIL_H__
>> > +#define __DPU_IO_UTIL_H__
>> > +
>> > +#include <linux/gpio.h>
>> > +#include <linux/platform_device.h>
>> > +#include <linux/types.h>
>> > +
>> > +#ifdef DEBUG
>> > +#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
>> > +#else
>> > +#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
>> > +#endif
>> > +#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
>> > +#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
>> > +#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
>> > +
>> > +struct dss_gpio {
>> > +       unsigned int gpio;
>> > +       unsigned int value;
>> > +       char gpio_name[32];
>> > +};
>> > +
>> > +enum dss_clk_type {
>> > +       DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
>> > +       DSS_CLK_PCLK,
>> > +};
>> > +
>> > +struct dss_clk {
>> > +       struct clk *clk; /* clk handle */
>> > +       char clk_name[32];
>> > +       enum dss_clk_type type;
>> > +       unsigned long rate;
>> > +       unsigned long max_rate;
>> > +};
>> > +
>> > +struct dss_module_power {
>> > +       unsigned int num_gpio;
>> > +       struct dss_gpio *gpio_config;
>> > +       unsigned int num_clk;
>> > +       struct dss_clk *clk_config;
>> > +};
>> > +
>> > +int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
>> > +void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
>> > +int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
>> > +int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
>> > +int msm_dss_parse_clock(struct platform_device *pdev,
>> > +               struct dss_module_power *mp);
>> > +#endif /* __DPU_IO_UTIL_H__ */
>> > diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
>> > index d5937ba..811f7d4 100644
>> > --- a/drivers/gpu/drm/msm/msm_drv.h
>> > +++ b/drivers/gpu/drm/msm/msm_drv.h
>> > @@ -33,7 +33,6 @@
>> >  #include <linux/types.h>
>> >  #include <linux/of_graph.h>
>> >  #include <linux/of_device.h>
>> > -#include <linux/dpu_io_util.h>
>> >  #include <asm/sizes.h>
>> >  #include <linux/kthread.h>
>> >
>> > diff --git a/include/linux/dpu_io_util.h b/include/linux/dpu_io_util.h
>> > deleted file mode 100644
>> > index 45e606f..0000000
>> > --- a/include/linux/dpu_io_util.h
>> > +++ /dev/null
>> > @@ -1,115 +0,0 @@
>> > -/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
>> > - *
>> > - * This program is free software; you can redistribute it and/or modify
>> > - * it under the terms of the GNU General Public License version 2 and
>> > - * only version 2 as published by the Free Software Foundation.
>> > - *
>> > - * This program is distributed in the hope that it will be useful,
>> > - * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> > - * GNU General Public License for more details.
>> > - */
>> > -
>> > -#ifndef __DPU_IO_UTIL_H__
>> > -#define __DPU_IO_UTIL_H__
>> > -
>> > -#include <linux/gpio.h>
>> > -#include <linux/platform_device.h>
>> > -#include <linux/regulator/consumer.h>
>> > -#include <linux/i2c.h>
>> > -#include <linux/types.h>
>> > -
>> > -#ifdef DEBUG
>> > -#define DEV_DBG(fmt, args...)   pr_err(fmt, ##args)
>> > -#else
>> > -#define DEV_DBG(fmt, args...)   pr_debug(fmt, ##args)
>> > -#endif
>> > -#define DEV_INFO(fmt, args...)  pr_info(fmt, ##args)
>> > -#define DEV_WARN(fmt, args...)  pr_warn(fmt, ##args)
>> > -#define DEV_ERR(fmt, args...)   pr_err(fmt, ##args)
>> > -
>> > -struct dss_io_data {
>> > -       u32 len;
>> > -       void __iomem *base;
>> > -};
>> > -
>> > -void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug);
>> > -u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug);
>> > -void dss_reg_dump(void __iomem *base, u32 len, const char *prefix, u32 debug);
>> > -
>> > -#define DSS_REG_W_ND(io, offset, val)  dss_reg_w(io, offset, val, false)
>> > -#define DSS_REG_W(io, offset, val)     dss_reg_w(io, offset, val, true)
>> > -#define DSS_REG_R_ND(io, offset)       dss_reg_r(io, offset, false)
>> > -#define DSS_REG_R(io, offset)          dss_reg_r(io, offset, true)
>> > -
>> > -enum dss_vreg_type {
>> > -       DSS_REG_LDO,
>> > -       DSS_REG_VS,
>> > -};
>> > -
>> > -struct dss_vreg {
>> > -       struct regulator *vreg; /* vreg handle */
>> > -       char vreg_name[32];
>> > -       int min_voltage;
>> > -       int max_voltage;
>> > -       int enable_load;
>> > -       int disable_load;
>> > -       int pre_on_sleep;
>> > -       int post_on_sleep;
>> > -       int pre_off_sleep;
>> > -       int post_off_sleep;
>> > -};
>> > -
>> > -struct dss_gpio {
>> > -       unsigned int gpio;
>> > -       unsigned int value;
>> > -       char gpio_name[32];
>> > -};
>> > -
>> > -enum dss_clk_type {
>> > -       DSS_CLK_AHB, /* no set rate. rate controlled through rpm */
>> > -       DSS_CLK_PCLK,
>> > -       DSS_CLK_OTHER,
>> > -};
>> > -
>> > -struct dss_clk {
>> > -       struct clk *clk; /* clk handle */
>> > -       char clk_name[32];
>> > -       enum dss_clk_type type;
>> > -       unsigned long rate;
>> > -       unsigned long max_rate;
>> > -};
>> > -
>> > -struct dss_module_power {
>> > -       unsigned int num_vreg;
>> > -       struct dss_vreg *vreg_config;
>> > -       unsigned int num_gpio;
>> > -       struct dss_gpio *gpio_config;
>> > -       unsigned int num_clk;
>> > -       struct dss_clk *clk_config;
>> > -};
>> > -
>> > -int msm_dss_ioremap_byname(struct platform_device *pdev,
>> > -       struct dss_io_data *io_data, const char *name);
>> > -void msm_dss_iounmap(struct dss_io_data *io_data);
>> > -
>> > -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable);
>> > -int msm_dss_gpio_enable(struct dss_gpio *in_gpio, int num_gpio, int enable);
>> > -
>> > -int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
>> > -       int num_vreg, int config);
>> > -int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg,        int enable);
>> > -
>> > -int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk);
>> > -void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk);
>> > -int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk);
>> > -int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable);
>> > -int msm_dss_parse_clock(struct platform_device *pdev,
>> > -               struct dss_module_power *mp);
>> > -
>> > -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
>> > -                      uint8_t reg_offset, uint8_t *read_buf);
>> > -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
>> > -                       uint8_t reg_offset, uint8_t *value);
>> > -
>> > -#endif /* __DPU_IO_UTIL_H__ */
>> > --
>> > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> > a Linux Foundation Collaborative Project
>> >
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-06-22 17:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 14:49 [DPU PATCH 00/11] Remove unused code and cleanup devicetree bindings for DPU driver Rajesh Yadav
2018-05-30 14:49 ` [DPU PATCH 05/11] drm/msm/dpu: remove writeback support Rajesh Yadav
2018-05-30 14:49 ` [DPU PATCH 06/11] drm/msm/dpu: remove hdcp support Rajesh Yadav
2018-05-30 14:49 ` [DPU PATCH 08/11] dt-bindings: msm/disp: cleanup bindings for Snapdragon 845 DPU Rajesh Yadav
     [not found] ` <1527691788-9350-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-30 14:49   ` [DPU PATCH 01/11] dt-bindings: msm/disp: remove unused dsi & panel bindings Rajesh Yadav
2018-05-30 14:49   ` [DPU PATCH 02/11] dt-bindings: msm/disp: remove unused display port bindings Rajesh Yadav
2018-05-30 14:49   ` [DPU PATCH 03/11] Revert "drm/msm: Add DisplayPort support" Rajesh Yadav
2018-05-30 14:49   ` [DPU PATCH 04/11] dt-bindings: msm/disp: remove unused writeback bindings Rajesh Yadav
2018-05-30 14:49   ` [DPU PATCH 07/11] drm/msm/dpu: remove dt parsing logic for bus_scale config Rajesh Yadav
2018-05-30 14:49   ` [DPU PATCH 09/11] drm/msm/dpu: Remove unused code and move the header Rajesh Yadav
     [not found]     ` <1527691788-9350-10-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-22 13:51       ` Sean Paul
     [not found]         ` <CAOw6vbLXWojrjXUQq62+n-BDbtQsyBLq_xYGe0RSqnsxo2Ep5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-22 15:33           ` Jordan Crouse
     [not found]             ` <20180622153352.GE24526-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-06-22 17:39               ` ryadav-sgV2jX0FEOL9JmXXK+q4OQ
2018-05-30 14:49   ` [DPU PATCH 10/11] drm/msm/dpu: correct dpu_io_util.h include path Rajesh Yadav
     [not found]     ` <1527691788-9350-11-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-30 16:30       ` Jordan Crouse
     [not found]         ` <20180530163005.GC5028-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-05-31 11:41           ` ryadav-sgV2jX0FEOL9JmXXK+q4OQ
2018-05-30 14:49   ` [DPU PATCH 11/11] drm/msm/dpu: move dpu_io_util to dpu folder Rajesh Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).