Переглянути джерело

disp: msm: dsi: add support to send commands to each sublink

Change adds support for transferring commands to each sublink.

Change-Id: Iefc0dca7343325cdfe0cf48d41d50e6e2a13bc05
Signed-off-by: Vara Reddy <[email protected]>
Vara Reddy 4 роки тому
батько
коміт
142bb24d7c

+ 3 - 0
msm/dsi/dsi_catalog.c

@@ -84,6 +84,7 @@ static void dsi_catalog_cmn_init(struct dsi_ctrl_hw *ctrl,
 		ctrl->ops.configure_cmddma_window = NULL;
 		ctrl->ops.reset_trig_ctrl = NULL;
 		ctrl->ops.log_line_count = NULL;
+		ctrl->ops.splitlink_cmd_setup = NULL;
 		break;
 	case DSI_CTRL_VERSION_2_0:
 		ctrl->ops.setup_lane_map = dsi_ctrl_hw_20_setup_lane_map;
@@ -102,6 +103,7 @@ static void dsi_catalog_cmn_init(struct dsi_ctrl_hw *ctrl,
 		ctrl->ops.configure_cmddma_window = NULL;
 		ctrl->ops.reset_trig_ctrl = NULL;
 		ctrl->ops.log_line_count = NULL;
+		ctrl->ops.splitlink_cmd_setup = NULL;
 		break;
 	case DSI_CTRL_VERSION_2_2:
 	case DSI_CTRL_VERSION_2_3:
@@ -129,6 +131,7 @@ static void dsi_catalog_cmn_init(struct dsi_ctrl_hw *ctrl,
 		ctrl->ops.reset_trig_ctrl =
 			dsi_ctrl_hw_22_reset_trigger_controls;
 		ctrl->ops.log_line_count = dsi_ctrl_hw_22_log_line_count;
+		ctrl->ops.splitlink_cmd_setup = dsi_ctrl_hw_22_configure_splitlink;
 		break;
 	default:
 		break;

+ 2 - 0
msm/dsi/dsi_catalog.h

@@ -290,4 +290,6 @@ int dsi_catalog_phy_pll_setup(struct dsi_phy_hw *phy, u32 pll_ver);
 int dsi_pll_5nm_configure(void *pll, bool commit);
 int dsi_pll_5nm_toggle(void *pll, bool prepare);
 
+void dsi_ctrl_hw_22_configure_splitlink(struct dsi_ctrl_hw *ctrl,
+		struct dsi_host_common_cfg *common_cfg, u32 sublink);
 #endif /* _DSI_CATALOG_H_ */

+ 3 - 0
msm/dsi/dsi_ctrl.c

@@ -1360,6 +1360,9 @@ static void dsi_kickoff_msg_tx(struct dsi_ctrl *dsi_ctrl,
 {
 	u32 hw_flags = 0;
 	struct dsi_ctrl_hw_ops dsi_hw_ops = dsi_ctrl->hw.ops;
+	struct dsi_split_link_config *split_link;
+
+	split_link = &(dsi_ctrl->host_config.common_config.split_link);
 
 	SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_ENTRY, flags,
 		msg->flags);

+ 4 - 0
msm/dsi/dsi_ctrl.h

@@ -33,6 +33,8 @@
  *				   display panel dtsi file instead of default.
  * @DSI_CTRL_CMD_ASYNC_WAIT: Command flag to indicate that the wait for done
  *			for this command is asynchronous and must be queued.
+ * @DSI_CTRL_CMD_SUBLINK0: Send the command in splitlink sublink0 only.
+ * @DSI_CTRL_CMD_SUBLINK1: Send the command in splitlink sublink1 only.
  */
 #define DSI_CTRL_CMD_READ             0x1
 #define DSI_CTRL_CMD_BROADCAST        0x2
@@ -44,6 +46,8 @@
 #define DSI_CTRL_CMD_NON_EMBEDDED_MODE 0x80
 #define DSI_CTRL_CMD_CUSTOM_DMA_SCHED  0x100
 #define DSI_CTRL_CMD_ASYNC_WAIT 0x200
+#define DSI_CTRL_CMD_SUBLINK0 0x400
+#define DSI_CTRL_CMD_SUBLINK1 0x800
 
 /* DSI embedded mode fifo size
  * If the command is greater than 256 bytes it is sent in non-embedded mode.

+ 9 - 0
msm/dsi/dsi_ctrl_hw.h

@@ -869,6 +869,15 @@ struct dsi_ctrl_hw_ops {
 	 * @cmd_mode:	Boolean to indicate command mode operation.
 	 */
 	u32 (*log_line_count)(struct dsi_ctrl_hw *ctrl, bool cmd_mode);
+
+	/**
+	 * hw.ops.splitlink_cmd_setup() - configure the sublink to transfer
+	 * @ctrl:       Pointer to the controller host hardware.
+	 * @common_cfg: Common configuration parameters.
+	 * @sublink:    Which sublink to transfer the command.
+	 */
+	void (*splitlink_cmd_setup)(struct dsi_ctrl_hw *ctrl,
+			struct dsi_host_common_cfg *common_cfg, u32 sublink);
 };
 
 /*

+ 26 - 1
msm/dsi/dsi_ctrl_hw_2_2.c

@@ -1,11 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 #include <linux/iopoll.h>
 #include "dsi_ctrl_hw.h"
 #include "dsi_ctrl_reg.h"
 #include "dsi_hw.h"
+#include "dsi_ctrl.h"
 #include "dsi_catalog.h"
 
 #define DISP_CC_MISC_CMD_REG_OFF 0x00
@@ -280,3 +281,27 @@ u32 dsi_ctrl_hw_22_log_line_count(struct dsi_ctrl_hw *ctrl, bool cmd_mode)
 					+ MDP_INTF_LINE_COUNT_OFFSET);
 	return reg;
 }
+
+void dsi_ctrl_hw_22_configure_splitlink(struct dsi_ctrl_hw *ctrl,
+		struct dsi_host_common_cfg *common_cfg, u32 flags)
+{
+	u32 reg = 0;
+
+	reg = DSI_R32(ctrl, DSI_SPLIT_LINK);
+
+	/* DMA_LINK_SEL */
+	reg &= ~(0x7 << 12);
+
+	/* Send command to both sublinks unless specified */
+	if (flags & DSI_CTRL_CMD_SUBLINK0)
+		reg |= BIT(12);
+	else if (flags & DSI_CTRL_CMD_SUBLINK1)
+		reg |= BIT(13);
+	else
+		reg |= (BIT(12) | BIT(13));
+
+	DSI_W32(ctrl, DSI_SPLIT_LINK, reg);
+
+	/* Make sure the split link config is updated */
+	wmb();
+}