浏览代码

Merge "disp: msm: dsi: adding prefix for logs"

qctecmdr 6 年之前
父节点
当前提交
a6bfb7fc1e

+ 2 - 3
msm/dsi/dsi_catalog.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "msm-dsi-catalog:[%s] " fmt, __func__
 #include <linux/errno.h>
 
 #include "dsi_catalog.h"
@@ -143,7 +142,7 @@ int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl,
 
 	if (version == DSI_CTRL_VERSION_UNKNOWN ||
 	    version >= DSI_CTRL_VERSION_MAX) {
-		pr_err("Unsupported version: %d\n", version);
+		DSI_ERR("Unsupported version: %d\n", version);
 		return -ENOTSUPP;
 	}
 
@@ -283,7 +282,7 @@ int dsi_catalog_phy_setup(struct dsi_phy_hw *phy,
 
 	if (version == DSI_PHY_VERSION_UNKNOWN ||
 	    version >= DSI_PHY_VERSION_MAX) {
-		pr_err("Unsupported version: %d\n", version);
+		DSI_ERR("Unsupported version: %d\n", version);
 		return -ENOTSUPP;
 	}
 

+ 117 - 115
msm/dsi/dsi_clk_manager.c

@@ -9,6 +9,7 @@
 #include <linux/msm-bus.h>
 #include <linux/pm_runtime.h>
 #include "dsi_clk.h"
+#include "dsi_defs.h"
 
 struct dsi_core_clks {
 	struct dsi_core_clk_info clks;
@@ -86,14 +87,14 @@ int dsi_clk_set_link_frequencies(void *client, struct link_clk_freq freq,
 	struct dsi_clk_mngr *mngr;
 
 	if (!client) {
-		pr_err("invalid params\n");
+		DSI_ERR("invalid params\n");
 		return -EINVAL;
 	}
 
 	mngr = c->mngr;
 	rc = _get_clk_mngr_index(mngr, index, &clk_mngr_index);
 	if (rc) {
-		pr_err("failed to map control index %d\n", index);
+		DSI_ERR("failed to map control index %d\n", index);
 		return -EINVAL;
 	}
 
@@ -120,7 +121,7 @@ int dsi_clk_set_pixel_clk_rate(void *client, u64 pixel_clk, u32 index)
 	mngr = c->mngr;
 	rc = clk_set_rate(mngr->link_clks[index].hs_clks.pixel_clk, pixel_clk);
 	if (rc)
-		pr_err("failed to set clk rate for pixel clk, rc=%d\n", rc);
+		DSI_ERR("failed to set clk rate for pixel clk, rc=%d\n", rc);
 	else
 		mngr->link_clks[index].freq.pix_clk_rate = pixel_clk;
 
@@ -144,7 +145,7 @@ int dsi_clk_set_byte_clk_rate(void *client, u64 byte_clk, u32 index)
 	mngr = c->mngr;
 	rc = clk_set_rate(mngr->link_clks[index].hs_clks.byte_clk, byte_clk);
 	if (rc)
-		pr_err("failed to set clk rate for byte clk, rc=%d\n", rc);
+		DSI_ERR("failed to set clk rate for byte clk, rc=%d\n", rc);
 	else
 		mngr->link_clks[index].freq.byte_clk_rate = byte_clk;
 
@@ -153,7 +154,7 @@ int dsi_clk_set_byte_clk_rate(void *client, u64 byte_clk, u32 index)
 		rc = clk_set_rate(mngr->link_clks[index].hs_clks.byte_intf_clk,
 				  byte_intf_rate);
 		if (rc)
-			pr_err("failed to set clk rate for byte intf clk=%d\n",
+			DSI_ERR("failed to set clk rate for byte intf clk=%d\n",
 			       rc);
 	}
 
@@ -172,13 +173,13 @@ int dsi_clk_update_parent(struct dsi_clk_link_set *parent,
 
 	rc = clk_set_parent(child->byte_clk, parent->byte_clk);
 	if (rc) {
-		pr_err("failed to set byte clk parent\n");
+		DSI_ERR("failed to set byte clk parent\n");
 		goto error;
 	}
 
 	rc = clk_set_parent(child->pixel_clk, parent->pixel_clk);
 	if (rc) {
-		pr_err("failed to set pixel clk parent\n");
+		DSI_ERR("failed to set pixel clk parent\n");
 		goto error;
 	}
 error:
@@ -197,13 +198,13 @@ int dsi_clk_prepare_enable(struct dsi_clk_link_set *clk)
 
 	rc = clk_prepare_enable(clk->byte_clk);
 	if (rc) {
-		pr_err("failed to enable byte src clk %d\n", rc);
+		DSI_ERR("failed to enable byte src clk %d\n", rc);
 		return rc;
 	}
 
 	rc = clk_prepare_enable(clk->pixel_clk);
 	if (rc) {
-		pr_err("failed to enable pixel src clk %d\n", rc);
+		DSI_ERR("failed to enable pixel src clk %d\n", rc);
 		return rc;
 	}
 
@@ -227,7 +228,7 @@ int dsi_core_clk_start(struct dsi_core_clks *c_clks)
 	if (c_clks->clks.mdp_core_clk) {
 		rc = clk_prepare_enable(c_clks->clks.mdp_core_clk);
 		if (rc) {
-			pr_err("failed to enable mdp_core_clk, rc=%d\n", rc);
+			DSI_ERR("failed to enable mdp_core_clk, rc=%d\n", rc);
 			goto error;
 		}
 	}
@@ -235,7 +236,7 @@ int dsi_core_clk_start(struct dsi_core_clks *c_clks)
 	if (c_clks->clks.mnoc_clk) {
 		rc = clk_prepare_enable(c_clks->clks.mnoc_clk);
 		if (rc) {
-			pr_err("failed to enable mnoc_clk, rc=%d\n", rc);
+			DSI_ERR("failed to enable mnoc_clk, rc=%d\n", rc);
 			goto error_disable_core_clk;
 		}
 	}
@@ -243,7 +244,7 @@ int dsi_core_clk_start(struct dsi_core_clks *c_clks)
 	if (c_clks->clks.iface_clk) {
 		rc = clk_prepare_enable(c_clks->clks.iface_clk);
 		if (rc) {
-			pr_err("failed to enable iface_clk, rc=%d\n", rc);
+			DSI_ERR("failed to enable iface_clk, rc=%d\n", rc);
 			goto error_disable_mnoc_clk;
 		}
 	}
@@ -251,7 +252,7 @@ int dsi_core_clk_start(struct dsi_core_clks *c_clks)
 	if (c_clks->clks.bus_clk) {
 		rc = clk_prepare_enable(c_clks->clks.bus_clk);
 		if (rc) {
-			pr_err("failed to enable bus_clk, rc=%d\n", rc);
+			DSI_ERR("failed to enable bus_clk, rc=%d\n", rc);
 			goto error_disable_iface_clk;
 		}
 	}
@@ -259,7 +260,7 @@ int dsi_core_clk_start(struct dsi_core_clks *c_clks)
 	if (c_clks->clks.core_mmss_clk) {
 		rc = clk_prepare_enable(c_clks->clks.core_mmss_clk);
 		if (rc) {
-			pr_err("failed to enable core_mmss_clk, rc=%d\n", rc);
+			DSI_ERR("failed to enable core_mmss_clk, rc=%d\n", rc);
 			goto error_disable_bus_clk;
 		}
 	}
@@ -267,7 +268,7 @@ int dsi_core_clk_start(struct dsi_core_clks *c_clks)
 	if (c_clks->bus_handle) {
 		rc = msm_bus_scale_client_update_request(c_clks->bus_handle, 1);
 		if (rc) {
-			pr_err("bus scale client enable failed, rc=%d\n", rc);
+			DSI_ERR("bus scale client enable failed, rc=%d\n", rc);
 			goto error_disable_mmss_clk;
 		}
 	}
@@ -300,7 +301,7 @@ int dsi_core_clk_stop(struct dsi_core_clks *c_clks)
 	if (c_clks->bus_handle) {
 		rc = msm_bus_scale_client_update_request(c_clks->bus_handle, 0);
 		if (rc) {
-			pr_err("bus scale client disable failed, rc=%d\n", rc);
+			DSI_ERR("bus scale client disable failed, rc=%d\n", rc);
 			return rc;
 		}
 	}
@@ -331,7 +332,7 @@ static int dsi_link_hs_clk_set_rate(struct dsi_link_hs_clk_info *link_hs_clks,
 	struct dsi_link_clks *l_clks;
 
 	if (index >= MAX_DSI_CTRL) {
-		pr_err("Invalid DSI ctrl index\n");
+		DSI_ERR("Invalid DSI ctrl index\n");
 		return -EINVAL;
 	}
 
@@ -350,14 +351,14 @@ static int dsi_link_hs_clk_set_rate(struct dsi_link_hs_clk_info *link_hs_clks,
 	rc = clk_set_rate(link_hs_clks->byte_clk,
 		l_clks->freq.byte_clk_rate);
 	if (rc) {
-		pr_err("clk_set_rate failed for byte_clk rc = %d\n", rc);
+		DSI_ERR("clk_set_rate failed for byte_clk rc = %d\n", rc);
 		goto error;
 	}
 
 	rc = clk_set_rate(link_hs_clks->pixel_clk,
 		l_clks->freq.pix_clk_rate);
 	if (rc) {
-		pr_err("clk_set_rate failed for pixel_clk rc = %d\n", rc);
+		DSI_ERR("clk_set_rate failed for pixel_clk rc = %d\n", rc);
 		goto error;
 	}
 
@@ -370,7 +371,7 @@ static int dsi_link_hs_clk_set_rate(struct dsi_link_hs_clk_info *link_hs_clks,
 		rc = clk_set_rate(link_hs_clks->byte_intf_clk,
 			(l_clks->freq.byte_clk_rate / 2));
 		if (rc) {
-			pr_err("set_rate failed for byte_intf_clk rc = %d\n",
+			DSI_ERR("set_rate failed for byte_intf_clk rc = %d\n",
 				rc);
 			goto error;
 		}
@@ -385,20 +386,20 @@ static int dsi_link_hs_clk_prepare(struct dsi_link_hs_clk_info *link_hs_clks)
 
 	rc = clk_prepare(link_hs_clks->byte_clk);
 	if (rc) {
-		pr_err("Failed to prepare dsi byte clk, rc=%d\n", rc);
+		DSI_ERR("Failed to prepare dsi byte clk, rc=%d\n", rc);
 		goto byte_clk_err;
 	}
 
 	rc = clk_prepare(link_hs_clks->pixel_clk);
 	if (rc) {
-		pr_err("Failed to prepare dsi pixel clk, rc=%d\n", rc);
+		DSI_ERR("Failed to prepare dsi pixel clk, rc=%d\n", rc);
 		goto pixel_clk_err;
 	}
 
 	if (link_hs_clks->byte_intf_clk) {
 		rc = clk_prepare(link_hs_clks->byte_intf_clk);
 		if (rc) {
-			pr_err("Failed to prepare dsi byte intf clk, rc=%d\n",
+			DSI_ERR("Failed to prepare dsi byte intf clk, rc=%d\n",
 				rc);
 			goto byte_intf_clk_err;
 		}
@@ -428,20 +429,20 @@ static int dsi_link_hs_clk_enable(struct dsi_link_hs_clk_info *link_hs_clks)
 
 	rc = clk_enable(link_hs_clks->byte_clk);
 	if (rc) {
-		pr_err("Failed to enable dsi byte clk, rc=%d\n", rc);
+		DSI_ERR("Failed to enable dsi byte clk, rc=%d\n", rc);
 		goto byte_clk_err;
 	}
 
 	rc = clk_enable(link_hs_clks->pixel_clk);
 	if (rc) {
-		pr_err("Failed to enable dsi pixel clk, rc=%d\n", rc);
+		DSI_ERR("Failed to enable dsi pixel clk, rc=%d\n", rc);
 		goto pixel_clk_err;
 	}
 
 	if (link_hs_clks->byte_intf_clk) {
 		rc = clk_enable(link_hs_clks->byte_intf_clk);
 		if (rc) {
-			pr_err("Failed to enable dsi byte intf clk, rc=%d\n",
+			DSI_ERR("Failed to enable dsi byte intf clk, rc=%d\n",
 				rc);
 			goto byte_intf_clk_err;
 		}
@@ -474,14 +475,14 @@ static int dsi_link_hs_clk_start(struct dsi_link_hs_clk_info *link_hs_clks,
 	int rc = 0;
 
 	if (index >= MAX_DSI_CTRL) {
-		pr_err("Invalid DSI ctrl index\n");
+		DSI_ERR("Invalid DSI ctrl index\n");
 		return -EINVAL;
 	}
 
 	if (op_type & DSI_LINK_CLK_SET_RATE) {
 		rc = dsi_link_hs_clk_set_rate(link_hs_clks, index);
 		if (rc) {
-			pr_err("failed to set HS clk rates, rc = %d\n", rc);
+			DSI_ERR("failed to set HS clk rates, rc = %d\n", rc);
 			goto error;
 		}
 	}
@@ -489,7 +490,8 @@ static int dsi_link_hs_clk_start(struct dsi_link_hs_clk_info *link_hs_clks,
 	if (op_type & DSI_LINK_CLK_PREPARE) {
 		rc = dsi_link_hs_clk_prepare(link_hs_clks);
 		if (rc) {
-			pr_err("failed to prepare link HS clks, rc = %d\n", rc);
+			DSI_ERR("failed to prepare link HS clks, rc = %d\n",
+					rc);
 			goto error;
 		}
 	}
@@ -497,12 +499,12 @@ static int dsi_link_hs_clk_start(struct dsi_link_hs_clk_info *link_hs_clks,
 	if (op_type & DSI_LINK_CLK_ENABLE) {
 		rc = dsi_link_hs_clk_enable(link_hs_clks);
 		if (rc) {
-			pr_err("failed to enable link HS clks, rc = %d\n", rc);
+			DSI_ERR("failed to enable link HS clks, rc = %d\n", rc);
 			goto error_unprepare;
 		}
 	}
 
-	pr_debug("HS Link clocks are enabled\n");
+	DSI_DEBUG("HS Link clocks are enabled\n");
 	return rc;
 error_unprepare:
 	dsi_link_hs_clk_unprepare(link_hs_clks);
@@ -522,7 +524,7 @@ static int dsi_link_hs_clk_stop(struct dsi_link_hs_clk_info *link_hs_clks)
 	dsi_link_hs_clk_disable(link_hs_clks);
 	dsi_link_hs_clk_unprepare(link_hs_clks);
 
-	pr_debug("HS Link clocks disabled\n");
+	DSI_DEBUG("HS Link clocks disabled\n");
 
 	return 0;
 }
@@ -535,7 +537,7 @@ static int dsi_link_lp_clk_start(struct dsi_link_lp_clk_info *link_lp_clks,
 	struct dsi_link_clks *l_clks;
 
 	if (index >= MAX_DSI_CTRL) {
-		pr_err("Invalid DSI ctrl index\n");
+		DSI_ERR("Invalid DSI ctrl index\n");
 		return -EINVAL;
 	}
 
@@ -558,18 +560,18 @@ static int dsi_link_lp_clk_start(struct dsi_link_lp_clk_info *link_lp_clks,
 
 	rc = clk_set_rate(link_lp_clks->esc_clk, l_clks->freq.esc_clk_rate);
 	if (rc) {
-		pr_err("clk_set_rate failed for esc_clk rc = %d\n", rc);
+		DSI_ERR("clk_set_rate failed for esc_clk rc = %d\n", rc);
 		goto error;
 	}
 
 prepare:
 	rc = clk_prepare_enable(link_lp_clks->esc_clk);
 	if (rc) {
-		pr_err("Failed to enable dsi esc clk\n");
+		DSI_ERR("Failed to enable dsi esc clk\n");
 		clk_unprepare(l_clks->lp_clks.esc_clk);
 	}
 error:
-	pr_debug("LP Link clocks are enabled\n");
+	DSI_DEBUG("LP Link clocks are enabled\n");
 	return rc;
 }
 
@@ -582,7 +584,7 @@ static int dsi_link_lp_clk_stop(
 
 	clk_disable_unprepare(l_clks->lp_clks.esc_clk);
 
-	pr_debug("LP Link clocks are disabled\n");
+	DSI_DEBUG("LP Link clocks are disabled\n");
 	return 0;
 }
 
@@ -603,13 +605,13 @@ static int dsi_display_core_clk_enable(struct dsi_core_clks *clks,
 
 	rc = pm_runtime_get_sync(m_clks->clks.drm->dev);
 	if (rc < 0) {
-		pr_err("Power resource enable failed, rc=%d\n", rc);
+		DSI_ERR("Power resource enable failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = dsi_core_clk_start(m_clks);
 	if (rc) {
-		pr_err("failed to turn on master clocks, rc=%d\n", rc);
+		DSI_ERR("failed to turn on master clocks, rc=%d\n", rc);
 		goto error_disable_master_resource;
 	}
 
@@ -621,13 +623,13 @@ static int dsi_display_core_clk_enable(struct dsi_core_clks *clks,
 
 		rc = pm_runtime_get_sync(m_clks->clks.drm->dev);
 		if (rc < 0) {
-			pr_err("Power resource enable failed, rc=%d\n", rc);
+			DSI_ERR("Power resource enable failed, rc=%d\n", rc);
 			goto error_disable_master;
 		}
 
 		rc = dsi_core_clk_start(clk);
 		if (rc) {
-			pr_err("failed to turn on clocks, rc=%d\n", rc);
+			DSI_ERR("failed to turn on clocks, rc=%d\n", rc);
 			pm_runtime_put_sync(m_clks->clks.drm->dev);
 			goto error_disable_master;
 		}
@@ -660,8 +662,8 @@ static int dsi_display_link_clk_enable(struct dsi_link_clks *clks,
 	if (l_type & DSI_LINK_LP_CLK) {
 		rc = dsi_link_lp_clk_start(&m_clks->lp_clks, master_ndx);
 		if (rc) {
-			pr_err("failed to turn on master lp link clocks, rc=%d\n",
-				rc);
+			DSI_ERR("failed to turn on master lp link clocks, rc=%d\n",
+					rc);
 			goto error;
 		}
 	}
@@ -670,8 +672,8 @@ static int dsi_display_link_clk_enable(struct dsi_link_clks *clks,
 		rc = dsi_link_hs_clk_start(&m_clks->hs_clks,
 			DSI_LINK_CLK_START, master_ndx);
 		if (rc) {
-			pr_err("failed to turn on master hs link clocks, rc=%d\n",
-				rc);
+			DSI_ERR("failed to turn on master hs link clocks, rc=%d\n",
+					rc);
 			goto error;
 		}
 	}
@@ -684,8 +686,8 @@ static int dsi_display_link_clk_enable(struct dsi_link_clks *clks,
 		if (l_type & DSI_LINK_LP_CLK) {
 			rc = dsi_link_lp_clk_start(&clk->lp_clks, i);
 			if (rc) {
-				pr_err("failed to turn on lp link clocks, rc=%d\n",
-					rc);
+				DSI_ERR("failed to turn on lp link clocks, rc=%d\n",
+						rc);
 				goto error_disable_master;
 			}
 		}
@@ -694,7 +696,7 @@ static int dsi_display_link_clk_enable(struct dsi_link_clks *clks,
 			rc = dsi_link_hs_clk_start(&clk->hs_clks,
 				DSI_LINK_CLK_START, i);
 			if (rc) {
-				pr_err("failed to turn on hs link clocks, rc=%d\n",
+				DSI_ERR("failed to turn on hs link clocks, rc=%d\n",
 					rc);
 				goto error_disable_master;
 			}
@@ -735,7 +737,7 @@ static int dsi_display_core_clk_disable(struct dsi_core_clks *clks,
 
 		rc = dsi_core_clk_stop(clk);
 		if (rc) {
-			pr_debug("failed to turn off clocks, rc=%d\n", rc);
+			DSI_DEBUG("failed to turn off clocks, rc=%d\n", rc);
 			goto error;
 		}
 
@@ -744,7 +746,7 @@ static int dsi_display_core_clk_disable(struct dsi_core_clks *clks,
 
 	rc = dsi_core_clk_stop(m_clks);
 	if (rc) {
-		pr_err("failed to turn off master clocks, rc=%d\n", rc);
+		DSI_ERR("failed to turn off master clocks, rc=%d\n", rc);
 		goto error;
 	}
 
@@ -778,30 +780,30 @@ static int dsi_display_link_clk_disable(struct dsi_link_clks *clks,
 		if (l_type & DSI_LINK_LP_CLK) {
 			rc = dsi_link_lp_clk_stop(&clk->lp_clks);
 			if (rc)
-				pr_err("failed to turn off lp link clocks, rc=%d\n",
-					rc);
+				DSI_ERR("failed to turn off lp link clocks, rc=%d\n",
+						rc);
 		}
 
 		if (l_type & DSI_LINK_HS_CLK) {
 			rc = dsi_link_hs_clk_stop(&clk->hs_clks);
 			if (rc)
-				pr_err("failed to turn off hs link clocks, rc=%d\n",
-					rc);
+				DSI_ERR("failed to turn off hs link clocks, rc=%d\n",
+						rc);
 		}
 	}
 
 	if (l_type & DSI_LINK_LP_CLK) {
 		rc = dsi_link_lp_clk_stop(&m_clks->lp_clks);
 		if (rc)
-			pr_err("failed to turn off master lp link clocks, rc=%d\n",
-				rc);
+			DSI_ERR("failed to turn off master lp link clocks, rc=%d\n",
+					rc);
 	}
 
 	if (l_type & DSI_LINK_HS_CLK) {
 		rc = dsi_link_hs_clk_stop(&m_clks->hs_clks);
 		if (rc)
-			pr_err("failed to turn off master hs link clocks, rc=%d\n",
-				rc);
+			DSI_ERR("failed to turn off master hs link clocks, rc=%d\n",
+					rc);
 	}
 
 	return rc;
@@ -821,16 +823,16 @@ static int dsi_clk_update_link_clk_state(struct dsi_clk_mngr *mngr,
 			rc = mngr->pre_clkon_cb(mngr->priv_data, DSI_LINK_CLK,
 				l_type, l_state);
 			if (rc) {
-				pr_err("pre link clk on cb failed for type %d\n",
-					l_type);
+				DSI_ERR("pre link clk on cb failed for type %d\n",
+						l_type);
 				goto error;
 			}
 		}
 		rc = dsi_display_link_clk_enable(l_clks, l_type,
 				mngr->dsi_ctrl_count, mngr->master_ndx);
 		if (rc) {
-			pr_err("failed to start link clk type %d rc=%d\n",
-				l_type, rc);
+			DSI_ERR("failed to start link clk type %d rc=%d\n",
+					l_type, rc);
 			goto error;
 		}
 
@@ -838,8 +840,8 @@ static int dsi_clk_update_link_clk_state(struct dsi_clk_mngr *mngr,
 			rc = mngr->post_clkon_cb(mngr->priv_data, DSI_LINK_CLK,
 				l_type, l_state);
 			if (rc) {
-				pr_err("post link clk on cb failed for type %d\n",
-					l_type);
+				DSI_ERR("post link clk on cb failed for type %d\n",
+						l_type);
 				goto error;
 			}
 		}
@@ -848,14 +850,14 @@ static int dsi_clk_update_link_clk_state(struct dsi_clk_mngr *mngr,
 			rc = mngr->pre_clkoff_cb(mngr->priv_data,
 				DSI_LINK_CLK, l_type, l_state);
 			if (rc)
-				pr_err("pre link clk off cb failed\n");
+				DSI_ERR("pre link clk off cb failed\n");
 		}
 
 		rc = dsi_display_link_clk_disable(l_clks, l_type,
 			mngr->dsi_ctrl_count, mngr->master_ndx);
 		if (rc) {
-			pr_err("failed to stop link clk type %d, rc = %d\n",
-			       l_type, rc);
+			DSI_ERR("failed to stop link clk type %d, rc = %d\n",
+					l_type, rc);
 			goto error;
 		}
 
@@ -863,7 +865,7 @@ static int dsi_clk_update_link_clk_state(struct dsi_clk_mngr *mngr,
 			rc = mngr->post_clkoff_cb(mngr->priv_data,
 				DSI_LINK_CLK, l_type, l_state);
 			if (rc)
-				pr_err("post link clk off cb failed\n");
+				DSI_ERR("post link clk off cb failed\n");
 		}
 	}
 
@@ -882,14 +884,14 @@ static int dsi_update_core_clks(struct dsi_clk_mngr *mngr,
 					DSI_LINK_NONE,
 					DSI_CLK_ON);
 		if (rc) {
-			pr_err("failed to turn on MDP FS rc= %d\n", rc);
+			DSI_ERR("failed to turn on MDP FS rc= %d\n", rc);
 			goto error;
 		}
 	}
 	rc = dsi_display_core_clk_enable(c_clks, mngr->dsi_ctrl_count,
 			mngr->master_ndx);
 	if (rc) {
-		pr_err("failed to turn on core clks rc = %d\n", rc);
+		DSI_ERR("failed to turn on core clks rc = %d\n", rc);
 		goto error;
 	}
 
@@ -899,7 +901,7 @@ static int dsi_update_core_clks(struct dsi_clk_mngr *mngr,
 					 DSI_LINK_NONE,
 					 DSI_CLK_ON);
 		if (rc)
-			pr_err("post clk on cb failed, rc = %d\n", rc);
+			DSI_ERR("post clk on cb failed, rc = %d\n", rc);
 	}
 	mngr->core_clk_state = DSI_CLK_ON;
 error:
@@ -916,7 +918,7 @@ static int dsi_update_clk_state(struct dsi_clk_mngr *mngr,
 	if (!mngr)
 		return -EINVAL;
 
-	pr_debug("c_state = %d, l_state = %d\n",
+	DSI_DEBUG("c_state = %d, l_state = %d\n",
 		 c_clks ? c_state : -1, l_clks ? l_state : -1);
 	/*
 	 * Below is the sequence to toggle DSI clocks:
@@ -965,7 +967,7 @@ static int dsi_update_clk_state(struct dsi_clk_mngr *mngr,
 					mngr->core_clks, mngr->dsi_ctrl_count,
 					mngr->master_ndx);
 				if (rc) {
-					pr_err("core clks did not start\n");
+					DSI_ERR("core clks did not start\n");
 					goto error;
 				}
 
@@ -973,11 +975,11 @@ static int dsi_update_clk_state(struct dsi_clk_mngr *mngr,
 					(DSI_LINK_LP_CLK & DSI_LINK_HS_CLK),
 					mngr->dsi_ctrl_count, mngr->master_ndx);
 				if (rc) {
-					pr_err("LP Link clks did not start\n");
+					DSI_ERR("LP Link clks did not start\n");
 					goto error;
 				}
 				l_c_on = true;
-				pr_debug("ECG: core and Link_on\n");
+				DSI_DEBUG("ECG: core and Link_on\n");
 			}
 
 			rc = dsi_clk_update_link_clk_state(mngr, l_clks,
@@ -1009,14 +1011,14 @@ static int dsi_update_clk_state(struct dsi_clk_mngr *mngr,
 					mngr->core_clks, mngr->dsi_ctrl_count,
 					mngr->master_ndx);
 				if (rc) {
-					pr_err("core clks did not stop\n");
+					DSI_ERR("core clks did not stop\n");
 					goto error;
 				}
 
 				l_c_on = false;
-				pr_debug("ECG: core off\n");
+				DSI_DEBUG("ECG: core off\n");
 			} else
-				pr_debug("ECG: core off skip\n");
+				DSI_DEBUG("ECG: core off skip\n");
 		}
 
 		mngr->link_clk_state = l_state;
@@ -1038,12 +1040,12 @@ static int dsi_update_clk_state(struct dsi_clk_mngr *mngr,
 			rc = dsi_display_core_clk_enable(mngr->core_clks,
 				mngr->dsi_ctrl_count, mngr->master_ndx);
 			if (rc) {
-				pr_err("core clks did not start\n");
+				DSI_ERR("core clks did not start\n");
 				goto error;
 			}
-			pr_debug("ECG: core on\n");
+			DSI_DEBUG("ECG: core on\n");
 		} else
-			pr_debug("ECG: core on skip\n");
+			DSI_DEBUG("ECG: core on skip\n");
 
 		if (mngr->pre_clkoff_cb) {
 			rc = mngr->pre_clkoff_cb(mngr->priv_data,
@@ -1051,13 +1053,13 @@ static int dsi_update_clk_state(struct dsi_clk_mngr *mngr,
 						 DSI_LINK_NONE,
 						 c_state);
 			if (rc)
-				pr_err("pre core clk off cb failed\n");
+				DSI_ERR("pre core clk off cb failed\n");
 		}
 
 		rc = dsi_display_core_clk_disable(c_clks, mngr->dsi_ctrl_count,
 			mngr->master_ndx);
 		if (rc) {
-			pr_err("failed to turn off core clks rc = %d\n", rc);
+			DSI_ERR("failed to turn off core clks rc = %d\n", rc);
 			goto error;
 		}
 
@@ -1068,7 +1070,7 @@ static int dsi_update_clk_state(struct dsi_clk_mngr *mngr,
 						DSI_LINK_NONE,
 						DSI_CLK_OFF);
 				if (rc)
-					pr_err("post clkoff cb fail, rc = %d\n",
+					DSI_ERR("post clkoff cb fail, rc = %d\n",
 					       rc);
 			}
 		}
@@ -1129,16 +1131,16 @@ static int dsi_recheck_clk_state(struct dsi_clk_mngr *mngr)
 	old_c_clk_state = mngr->core_clk_state;
 	old_l_clk_state = mngr->link_clk_state;
 
-	pr_debug("c_clk_state (%d -> %d)\n",
-		old_c_clk_state, new_core_clk_state);
-	pr_debug("l_clk_state (%d -> %d)\n",
-		old_l_clk_state, new_link_clk_state);
+	DSI_DEBUG("c_clk_state (%d -> %d)\n", old_c_clk_state,
+			new_core_clk_state);
+	DSI_DEBUG("l_clk_state (%d -> %d)\n", old_l_clk_state,
+			new_link_clk_state);
 
 	if (c_clks || l_clks) {
 		rc = dsi_update_clk_state(mngr, c_clks, new_core_clk_state,
 					  l_clks, new_link_clk_state);
 		if (rc) {
-			pr_err("failed to update clock state, rc = %d\n", rc);
+			DSI_ERR("failed to update clock state, rc = %d\n", rc);
 			goto error;
 		}
 	}
@@ -1157,7 +1159,7 @@ int dsi_clk_req_state(void *client, enum dsi_clk_type clk,
 
 	if (!client || !clk || clk > (DSI_CORE_CLK | DSI_LINK_CLK) ||
 	    state > DSI_CLK_EARLY_GATE) {
-		pr_err("Invalid params, client = %pK, clk = 0x%x, state = %d\n",
+		DSI_ERR("Invalid params, client = %pK, clk = 0x%x, state = %d\n",
 		       client, clk, state);
 		return -EINVAL;
 	}
@@ -1165,7 +1167,7 @@ int dsi_clk_req_state(void *client, enum dsi_clk_type clk,
 	mngr = c->mngr;
 	mutex_lock(&mngr->clk_mutex);
 
-	pr_debug("[%s]%s: CLK=%d, new_state=%d, core=%d, linkl=%d\n",
+	DSI_DEBUG("[%s]%s: CLK=%d, new_state=%d, core=%d, linkl=%d\n",
 	       mngr->name, c->name, clk, state, c->core_clk_state,
 	       c->link_clk_state);
 
@@ -1202,8 +1204,8 @@ int dsi_clk_req_state(void *client, enum dsi_clk_type clk,
 					changed = true;
 					c->core_clk_state = DSI_CLK_OFF;
 				} else {
-					pr_warn("Core refcount is zero for %s\n",
-						c->name);
+					DSI_WARN("Core refcount is zero for %s\n",
+							c->name);
 				}
 			} else {
 				c->core_refcount--;
@@ -1221,8 +1223,8 @@ int dsi_clk_req_state(void *client, enum dsi_clk_type clk,
 					changed = true;
 					c->link_clk_state = DSI_CLK_OFF;
 				} else {
-					pr_warn("Link refcount is zero for %s\n",
-						c->name);
+					DSI_WARN("Link refcount is zero for %s\n",
+							c->name);
 				}
 			} else {
 				c->link_refcount--;
@@ -1233,14 +1235,14 @@ int dsi_clk_req_state(void *client, enum dsi_clk_type clk,
 			}
 		}
 	}
-	pr_debug("[%s]%s: change=%d, Core (ref=%d, state=%d), Link (ref=%d, state=%d)\n",
+	DSI_DEBUG("[%s]%s: change=%d, Core (ref=%d, state=%d), Link (ref=%d, state=%d)\n",
 		 mngr->name, c->name, changed, c->core_refcount,
 		 c->core_clk_state, c->link_refcount, c->link_clk_state);
 
 	if (changed) {
 		rc = dsi_recheck_clk_state(mngr);
 		if (rc)
-			pr_err("Failed to adjust clock state rc = %d\n", rc);
+			DSI_ERR("Failed to adjust clock state rc = %d\n", rc);
 	}
 
 	mutex_unlock(&mngr->clk_mutex);
@@ -1293,7 +1295,7 @@ int dsi_display_link_clk_force_update_ctrl(void *handle)
 	int rc = 0;
 
 	if (!handle) {
-		pr_err("%s: Invalid arg\n", __func__);
+		DSI_ERR("Invalid arg\n");
 		return -EINVAL;
 	}
 
@@ -1312,14 +1314,14 @@ int dsi_display_clk_ctrl(void *handle,
 	int rc = 0;
 
 	if (!handle) {
-		pr_err("%s: Invalid arg\n", __func__);
+		DSI_ERR("Invalid arg\n");
 		return -EINVAL;
 	}
 
 	mutex_lock(&dsi_mngr_clk_mutex);
 	rc = dsi_clk_req_state(handle, clk_type, clk_state);
 	if (rc)
-		pr_err("%s: failed set clk state, rc = %d\n", __func__, rc);
+		DSI_ERR("failed set clk state, rc = %d\n", rc);
 	mutex_unlock(&dsi_mngr_clk_mutex);
 
 	return rc;
@@ -1332,7 +1334,7 @@ void *dsi_register_clk_handle(void *clk_mngr, char *client)
 	struct dsi_clk_client_info *c;
 
 	if (!mngr) {
-		pr_err("bad params\n");
+		DSI_ERR("bad params\n");
 		return ERR_PTR(-EINVAL);
 	}
 
@@ -1349,7 +1351,7 @@ void *dsi_register_clk_handle(void *clk_mngr, char *client)
 
 	list_add(&c->list, &mngr->client_list);
 
-	pr_debug("[%s]: Added new client (%s)\n", mngr->name, c->name);
+	DSI_DEBUG("[%s]: Added new client (%s)\n", mngr->name, c->name);
 	handle = c;
 error:
 	mutex_unlock(&mngr->clk_mutex);
@@ -1366,19 +1368,19 @@ int dsi_deregister_clk_handle(void *client)
 	struct dsi_clk_client_info *node = NULL;
 
 	if (!client) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return -EINVAL;
 	}
 
 	mngr = c->mngr;
-	pr_debug("%s: ENTER\n", mngr->name);
+	DSI_DEBUG("%s: ENTER\n", mngr->name);
 	mutex_lock(&mngr->clk_mutex);
 	c->core_clk_state = DSI_CLK_OFF;
 	c->link_clk_state = DSI_CLK_OFF;
 
 	rc = dsi_recheck_clk_state(mngr);
 	if (rc) {
-		pr_err("clock state recheck failed rc = %d\n", rc);
+		DSI_ERR("clock state recheck failed rc = %d\n", rc);
 		goto error;
 	}
 
@@ -1387,7 +1389,7 @@ int dsi_deregister_clk_handle(void *client)
 			  list);
 		if (node == c) {
 			list_del(&node->list);
-			pr_debug("Removed device (%s)\n", node->name);
+			DSI_DEBUG("Removed device (%s)\n", node->name);
 			kfree(node);
 			break;
 		}
@@ -1395,7 +1397,7 @@ int dsi_deregister_clk_handle(void *client)
 
 error:
 	mutex_unlock(&mngr->clk_mutex);
-	pr_debug("%s: EXIT, rc = %d\n", mngr->name, rc);
+	DSI_DEBUG("%s: EXIT, rc = %d\n", mngr->name, rc);
 	return rc;
 }
 
@@ -1404,7 +1406,7 @@ void dsi_display_clk_mngr_update_splash_status(void *clk_mgr, bool status)
 	struct dsi_clk_mngr *mngr;
 
 	if (!clk_mgr) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return;
 	}
 
@@ -1418,7 +1420,7 @@ void *dsi_display_clk_mngr_register(struct dsi_clk_info *info)
 	int i = 0;
 
 	if (!info) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return ERR_PTR(-EINVAL);
 	}
 
@@ -1457,7 +1459,7 @@ void *dsi_display_clk_mngr_register(struct dsi_clk_info *info)
 	memcpy(mngr->name, info->name, MAX_STRING_LEN);
 
 error:
-	pr_debug("EXIT, rc = %ld\n", PTR_ERR(mngr));
+	DSI_DEBUG("EXIT, rc = %ld\n", PTR_ERR(mngr));
 	return mngr;
 }
 
@@ -1470,27 +1472,27 @@ int dsi_display_clk_mngr_deregister(void *clk_mngr)
 	struct dsi_clk_client_info *node = NULL;
 
 	if (!mngr) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return -EINVAL;
 	}
 
-	pr_debug("%s: ENTER\n", mngr->name);
+	DSI_DEBUG("%s: ENTER\n", mngr->name);
 	mutex_lock(&mngr->clk_mutex);
 
 	list_for_each_safe(position, tmp, &mngr->client_list) {
 		node = list_entry(position, struct dsi_clk_client_info,
 			  list);
 		list_del(&node->list);
-		pr_debug("Removed device (%s)\n", node->name);
+		DSI_DEBUG("Removed device (%s)\n", node->name);
 		kfree(node);
 	}
 
 	rc = dsi_recheck_clk_state(mngr);
 	if (rc)
-		pr_err("failed to disable all clocks\n");
+		DSI_ERR("failed to disable all clocks\n");
 
 	mutex_unlock(&mngr->clk_mutex);
-	pr_debug("%s: EXIT, rc = %d\n", mngr->name, rc);
+	DSI_DEBUG("%s: EXIT, rc = %d\n", mngr->name, rc);
 	kfree(mngr);
 	return rc;
 }

文件差异内容过多而无法显示
+ 164 - 144
msm/dsi/dsi_ctrl.c


+ 5 - 0
msm/dsi/dsi_ctrl_hw.h

@@ -13,6 +13,11 @@
 
 #include "dsi_defs.h"
 
+#define DSI_CTRL_HW_DBG(c, fmt, ...)	DRM_DEV_DEBUG(NULL, "[msm-dsi-debug]: DSI_%d: "\
+		fmt, c ? c->index : -1,	##__VA_ARGS__)
+#define DSI_CTRL_HW_ERR(c, fmt, ...)	DRM_DEV_ERROR(NULL, "[msm-dsi-error]: DSI_%d: "\
+		fmt, c ? c->index : -1,	##__VA_ARGS__)
+
 /**
  * Modifier flag for command transmission. If this flag is set, command
  * information is programmed to hardware and transmission is not triggered.

+ 15 - 19
msm/dsi/dsi_ctrl_hw_1_4.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-hw:" fmt
 #include <linux/delay.h>
 #include <linux/iopoll.h>
 
@@ -25,7 +24,7 @@ void dsi_ctrl_hw_14_setup_lane_map(struct dsi_ctrl_hw *ctrl,
 {
 	DSI_W32(ctrl, DSI_LANE_SWAP_CTRL, lane_map->lane_map_v1);
 
-	pr_debug("[DSI_%d] Lane swap setup complete\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Lane swap setup complete\n");
 }
 
 /**
@@ -65,23 +64,23 @@ int dsi_ctrl_hw_14_wait_for_lane_idle(struct dsi_ctrl_hw *ctrl, u32 lanes)
 		fifo_empty_mask |= BIT(28);
 	}
 
-	pr_debug("%s: polling for fifo empty, mask=0x%08x\n", __func__,
-		fifo_empty_mask);
+	DSI_CTRL_HW_DBG(ctrl, "polling for fifo empty, mask=0x%08x\n",
+			fifo_empty_mask);
 	rc = readl_poll_timeout(ctrl->base + DSI_FIFO_STATUS, val,
 			(val & fifo_empty_mask), sleep_us, timeout_us);
 	if (rc) {
-		pr_err("%s: fifo not empty, FIFO_STATUS=0x%08x\n",
-				__func__, val);
+		DSI_CTRL_HW_ERR(ctrl, "fifo not empty, FIFO_STATUS=0x%08x\n",
+				val);
 		goto error;
 	}
 
-	pr_debug("%s: polling for lanes to be in stop state, mask=0x%08x\n",
-		__func__, stop_state_mask);
+	DSI_CTRL_HW_DBG(ctrl, "polling for lanes to be in stop state, mask=0x%08x\n",
+		stop_state_mask);
 	rc = readl_poll_timeout(ctrl->base + DSI_LANE_STATUS, val,
 			(val & stop_state_mask), sleep_us, timeout_us);
 	if (rc) {
-		pr_err("%s: lanes not in stop state, LANE_STATUS=0x%08x\n",
-			__func__, val);
+		DSI_CTRL_HW_ERR(ctrl, "lanes not in stop state, LANE_STATUS=0x%08x\n",
+			val);
 		goto error;
 	}
 
@@ -123,8 +122,7 @@ void dsi_ctrl_hw_cmn_ulps_request(struct dsi_ctrl_hw *ctrl, u32 lanes)
 	DSI_W32(ctrl, DSI_LANE_CTRL, reg);
 	usleep_range(100, 110);
 
-	pr_debug("[DSI_%d] ULPS requested for lanes 0x%x\n", ctrl->index,
-		 lanes);
+	DSI_CTRL_HW_DBG(ctrl, "ULPS requested for lanes 0x%x\n", lanes);
 }
 
 /**
@@ -172,8 +170,7 @@ void dsi_ctrl_hw_cmn_ulps_exit(struct dsi_ctrl_hw *ctrl, u32 lanes)
 	DSI_W32(ctrl, DSI_LANE_CTRL, 0x0 | prev_reg);
 	wmb(); /* ensure lanes are put to stop state */
 
-	pr_debug("[DSI_%d] ULPS exit request for lanes=0x%x\n",
-		 ctrl->index, lanes);
+	DSI_CTRL_HW_DBG(ctrl, "ULPS exit request for lanes=0x%x\n", lanes);
 }
 
 /**
@@ -202,7 +199,7 @@ u32 dsi_ctrl_hw_cmn_get_lanes_in_ulps(struct dsi_ctrl_hw *ctrl)
 	if (!(reg & BIT(12)))
 		lanes |= DSI_CLOCK_LANE;
 
-	pr_debug("[DSI_%d] lanes in ulps = 0x%x\n", ctrl->index, lanes);
+	DSI_CTRL_HW_DBG(ctrl, "lanes in ulps = 0x%x\n", lanes);
 	return lanes;
 }
 
@@ -261,8 +258,7 @@ void dsi_ctrl_hw_14_clamp_enable(struct dsi_ctrl_hw *ctrl,
 	reg |= (BIT(15) << bit_shift);	/* Enable clamp */
 	DSI_MMSS_MISC_W32(ctrl, MMSS_MISC_CLAMP_REG_OFF, reg);
 
-	pr_debug("[DSI_%d] Clamps enabled for lanes=0x%x\n", ctrl->index,
-		 lanes);
+	DSI_CTRL_HW_DBG(ctrl, "Clamps enabled for lanes=0x%x\n", lanes);
 }
 
 /**
@@ -319,7 +315,7 @@ void dsi_ctrl_hw_14_clamp_disable(struct dsi_ctrl_hw *ctrl,
 	reg &= ~(clamp_reg);
 	DSI_MMSS_MISC_W32(ctrl, MMSS_MISC_CLAMP_REG_OFF, reg);
 
-	pr_debug("[DSI_%d] Disable clamps for lanes=%d\n", ctrl->index, lanes);
+	DSI_CTRL_HW_DBG(ctrl, "Disable clamps for lanes=%d\n", lanes);
 }
 
 #define DUMP_REG_VALUE(off) "\t%-30s: 0x%08x\n", #off, DSI_R32(ctrl, off)
@@ -474,6 +470,6 @@ ssize_t dsi_ctrl_hw_14_reg_dump_to_buffer(struct dsi_ctrl_hw *ctrl,
 	len += snprintf((buf + len), (size - len),
 			DUMP_REG_VALUE(DSI_VERSION));
 
-	pr_err("LLENGTH = %d\n", len);
+	DSI_CTRL_HW_ERR(ctrl, "LLENGTH = %d\n", len);
 	return len;
 }

+ 5 - 6
msm/dsi/dsi_ctrl_hw_2_0.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-hw:" fmt
 #include <linux/delay.h>
 #include <linux/iopoll.h>
 
@@ -21,7 +20,7 @@ void dsi_ctrl_hw_20_setup_lane_map(struct dsi_ctrl_hw *ctrl,
 
 	DSI_W32(ctrl, DSI_LANE_SWAP_CTRL, reg_value);
 
-	pr_debug("[DSI_%d] Lane swap setup complete\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Lane swap setup complete\n");
 }
 
 int dsi_ctrl_hw_20_wait_for_lane_idle(struct dsi_ctrl_hw *ctrl,
@@ -44,13 +43,13 @@ int dsi_ctrl_hw_20_wait_for_lane_idle(struct dsi_ctrl_hw *ctrl,
 	if (lanes & DSI_DATA_LANE_3)
 		fifo_empty_mask |= BIT(28);
 
-	pr_debug("%s: polling for fifo empty, mask=0x%08x\n", __func__,
+	DSI_CTRL_HW_DBG(ctrl, "polling for fifo empty, mask=0x%08x\n",
 		fifo_empty_mask);
 	rc = readl_poll_timeout(ctrl->base + DSI_FIFO_STATUS, val,
 			(val & fifo_empty_mask), sleep_us, timeout_us);
 	if (rc) {
-		pr_err("%s: fifo not empty, FIFO_STATUS=0x%08x\n",
-				__func__, val);
+		DSI_CTRL_HW_ERR(ctrl, "fifo not empty, FIFO_STATUS=0x%08x\n",
+				val);
 		goto error;
 	}
 
@@ -220,6 +219,6 @@ ssize_t dsi_ctrl_hw_20_reg_dump_to_buffer(struct dsi_ctrl_hw *ctrl,
 	len += snprintf((buf + len), (size - len),
 			DUMP_REG_VALUE(DSI_VERSION));
 
-	pr_err("LLENGTH = %d\n", len);
+	DSI_CTRL_HW_ERR(ctrl, "LLENGTH = %d\n", len);
 	return len;
 }

+ 0 - 2
msm/dsi/dsi_ctrl_hw_2_2.c

@@ -3,8 +3,6 @@
  * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-hw:" fmt
-
 #include "dsi_ctrl_hw.h"
 #include "dsi_ctrl_reg.h"
 #include "dsi_hw.h"

+ 45 - 52
msm/dsi/dsi_ctrl_hw_cmn.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-hw:" fmt
 #include <linux/delay.h>
 #include <linux/iopoll.h>
 
@@ -120,7 +119,7 @@ void dsi_ctrl_hw_cmn_host_setup(struct dsi_ctrl_hw *ctrl,
 
 	if (ctrl->phy_isolation_enabled)
 		DSI_W32(ctrl, DSI_DEBUG_CTRL, BIT(28));
-	pr_debug("[DSI_%d]Host configuration complete\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Host configuration complete\n");
 }
 
 /**
@@ -136,7 +135,7 @@ void dsi_ctrl_hw_cmn_phy_sw_reset(struct dsi_ctrl_hw *ctrl)
 	wmb(); /* ensure reset is cleared before waiting */
 	udelay(100);
 
-	pr_debug("[DSI_%d] phy sw reset done\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "phy sw reset done\n");
 }
 
 /**
@@ -178,7 +177,7 @@ void dsi_ctrl_hw_cmn_soft_reset(struct dsi_ctrl_hw *ctrl)
 	/* Re-enable DSI controller */
 	DSI_W32(ctrl, DSI_CTRL, reg_ctrl);
 	wmb(); /* make sure DSI controller is enabled again */
-	pr_debug("[DSI_%d] ctrl soft reset done\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "ctrl soft reset done\n");
 }
 
 /**
@@ -209,8 +208,7 @@ void dsi_ctrl_hw_cmn_setup_misr(struct dsi_ctrl_hw *ctrl,
 		config |= frame_count << 8;
 	}
 
-	pr_debug("[DSI_%d] MISR ctrl: 0x%x\n", ctrl->index,
-			config);
+	DSI_CTRL_HW_DBG(ctrl, "MISR ctrl: 0x%x\n", config);
 	DSI_W32(ctrl, addr, config);
 	wmb(); /* make sure MISR is configured */
 }
@@ -240,8 +238,7 @@ u32 dsi_ctrl_hw_cmn_collect_misr(struct dsi_ctrl_hw *ctrl,
 	if (enabled)
 		misr = DSI_R32(ctrl, addr);
 
-	pr_debug("[DSI_%d] MISR enabled %x value: 0x%x\n", ctrl->index,
-			enabled, misr);
+	DSI_CTRL_HW_DBG(ctrl, "MISR enabled %x value: 0x%x\n", enabled, misr);
 	return misr;
 }
 
@@ -261,8 +258,7 @@ void dsi_ctrl_hw_cmn_set_timing_db(struct dsi_ctrl_hw *ctrl,
 		DSI_W32(ctrl, DSI_DSI_TIMING_DB_MODE, 0x0);
 
 	wmb(); /* make sure timing db registers are set */
-	pr_debug("[DSI_%d] ctrl timing DB set:%d\n", ctrl->index,
-				enable);
+	DSI_CTRL_HW_DBG(ctrl, "ctrl timing DB set:%d\n", enable);
 	SDE_EVT32(ctrl->index, enable);
 }
 
@@ -338,7 +334,7 @@ void dsi_ctrl_hw_cmn_set_video_timing(struct dsi_ctrl_hw *ctrl,
 	DSI_W32(ctrl, DSI_HS_TIMER_CTRL, 0x3FD08);
 	DSI_W32(ctrl, DSI_MISR_VIDEO_CTRL, 0x10100);
 	DSI_W32(ctrl, DSI_DSI_TIMING_FLUSH, 0x1);
-	pr_debug("[DSI_%d] ctrl video parameters updated\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "ctrl video parameters updated\n");
 	SDE_EVT32(v_total, h_total);
 }
 
@@ -405,7 +401,7 @@ void dsi_ctrl_hw_cmn_setup_cmd_stream(struct dsi_ctrl_hw *ctrl,
 		reg_ctrl2 &= ~(0xFFFF << offset);
 		reg_ctrl2 |= (dsc.bytes_in_slice << offset);
 
-		pr_debug("ctrl %d reg_ctrl 0x%x reg_ctrl2 0x%x\n", ctrl->index,
+		DSI_CTRL_HW_DBG(ctrl, "reg_ctrl 0x%x reg_ctrl2 0x%x\n",
 				reg_ctrl, reg_ctrl2);
 	} else if (roi) {
 		width_final = roi->w;
@@ -442,7 +438,7 @@ void dsi_ctrl_hw_cmn_setup_cmd_stream(struct dsi_ctrl_hw *ctrl,
 		DSI_W32(ctrl, DSI_COMMAND_MODE_NULL_INSERTION_CTRL, data);
 	}
 
-	pr_debug("ctrl %d stream_ctrl 0x%x stream_total 0x%x\n", ctrl->index,
+	DSI_CTRL_HW_DBG(ctrl, "stream_ctrl 0x%x stream_total 0x%x\n",
 			stream_ctrl, stream_total);
 }
 
@@ -463,8 +459,7 @@ void dsi_ctrl_hw_cmn_setup_avr(struct dsi_ctrl_hw *ctrl, bool enable)
 		reg &= ~BIT(29);
 
 	DSI_W32(ctrl, DSI_VIDEO_MODE_CTRL, reg);
-	pr_debug("ctrl %d AVR %s\n", ctrl->index,
-			enable ? "enabled" : "disabled");
+	DSI_CTRL_HW_DBG(ctrl, "AVR %s\n", enable ? "enabled" : "disabled");
 }
 
 /**
@@ -502,7 +497,7 @@ void dsi_ctrl_hw_cmn_video_engine_setup(struct dsi_ctrl_hw *ctrl,
 	/* Disable Timing double buffering */
 	DSI_W32(ctrl, DSI_DSI_TIMING_DB_MODE, 0x0);
 
-	pr_debug("[DSI_%d] Video engine setup done\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Video engine setup done\n");
 }
 
 void dsi_ctrl_hw_cmn_debug_bus(struct dsi_ctrl_hw *ctrl, u32 *entries, u32 size)
@@ -514,8 +509,8 @@ void dsi_ctrl_hw_cmn_debug_bus(struct dsi_ctrl_hw *ctrl, u32 *entries, u32 size)
 		/* make sure that debug test point is enabled */
 		wmb();
 		reg = DSI_R32(ctrl, DSI_DEBUG_BUS_STATUS);
-		pr_err("[DSI_%d] debug bus ctrl: 0x%x status:0x%x\n",
-				ctrl->index, entries[i], reg);
+		DSI_CTRL_HW_ERR(ctrl, "debug bus ctrl: 0x%x status:0x%x\n",
+				entries[i], reg);
 	}
 }
 
@@ -550,7 +545,7 @@ void dsi_ctrl_hw_cmn_cmd_engine_setup(struct dsi_ctrl_hw *ctrl,
 	reg |= (cfg->insert_dcs_command ? BIT(16) : 0);
 	DSI_W32(ctrl, DSI_COMMAND_MODE_MDP_DCS_CMD_CTRL, reg);
 
-	pr_debug("[DSI_%d] Cmd engine setup done\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Cmd engine setup done\n");
 }
 
 /**
@@ -571,7 +566,7 @@ void dsi_ctrl_hw_cmn_video_engine_en(struct dsi_ctrl_hw *ctrl, bool on)
 
 	DSI_W32(ctrl, DSI_CTRL, reg);
 
-	pr_debug("[DSI_%d] Video engine = %d\n", ctrl->index, on);
+	DSI_CTRL_HW_DBG(ctrl, "Video engine = %d\n", on);
 }
 
 /**
@@ -601,7 +596,7 @@ void dsi_ctrl_hw_cmn_ctrl_en(struct dsi_ctrl_hw *ctrl, bool on)
 	DSI_W32(ctrl, DSI_CLK_CTRL, clk_ctrl);
 	wmb(); /* make sure clocks are restored */
 
-	pr_debug("[DSI_%d] Controller engine = %d\n", ctrl->index, on);
+	DSI_CTRL_HW_DBG(ctrl, "Controller engine = %d\n", on);
 }
 
 /**
@@ -622,7 +617,7 @@ void dsi_ctrl_hw_cmn_cmd_engine_en(struct dsi_ctrl_hw *ctrl, bool on)
 
 	DSI_W32(ctrl, DSI_CTRL, reg);
 
-	pr_debug("[DSI_%d] command engine = %d\n", ctrl->index, on);
+	DSI_CTRL_HW_DBG(ctrl, "command engine = %d\n", on);
 }
 
 /**
@@ -746,8 +741,7 @@ void dsi_ctrl_hw_cmn_kickoff_fifo_command(struct dsi_ctrl_hw *ctrl,
 	if (!(flags & DSI_CTRL_HW_CMD_WAIT_FOR_TRIGGER))
 		DSI_W32(ctrl, DSI_CMD_MODE_DMA_SW_TRIGGER, 0x1);
 
-	pr_debug("[DSI_%d]size=%d, trigger = %d\n",
-		 ctrl->index, cmd->size,
+	DSI_CTRL_HW_DBG(ctrl, "size=%d, trigger = %d\n", cmd->size,
 		 (flags & DSI_CTRL_HW_CMD_WAIT_FOR_TRIGGER) ? false : true);
 }
 
@@ -772,7 +766,7 @@ void dsi_ctrl_hw_cmn_reset_cmd_fifo(struct dsi_ctrl_hw *ctrl)
 void dsi_ctrl_hw_cmn_trigger_command_dma(struct dsi_ctrl_hw *ctrl)
 {
 	DSI_W32(ctrl, DSI_CMD_MODE_DMA_SW_TRIGGER, 0x1);
-	pr_debug("[DSI_%d] CMD DMA triggered\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "CMD DMA triggered\n");
 }
 
 /**
@@ -827,7 +821,7 @@ u32 dsi_ctrl_hw_cmn_get_cmd_read_data(struct dsi_ctrl_hw *ctrl,
 	if (ack_err)
 		read_cnt -= 4;
 	if (!read_cnt) {
-		pr_err("Panel detected error, no data read\n");
+		DSI_CTRL_HW_ERR(ctrl, "Panel detected error, no data read\n");
 		return 0;
 	}
 
@@ -861,7 +855,7 @@ u32 dsi_ctrl_hw_cmn_get_cmd_read_data(struct dsi_ctrl_hw *ctrl,
 	}
 
 	*hw_read_cnt = read_cnt;
-	pr_debug("[DSI_%d] Read %d bytes\n", ctrl->index, rx_byte);
+	DSI_CTRL_HW_DBG(ctrl, "Read %d bytes\n", rx_byte);
 	return rx_byte;
 }
 
@@ -903,8 +897,8 @@ u32 dsi_ctrl_hw_cmn_get_interrupt_status(struct dsi_ctrl_hw *ctrl)
 	if (reg & BIT(24))
 		ints |= DSI_ERROR;
 
-	pr_debug("[DSI_%d] Interrupt status = 0x%x, INT_CTRL=0x%x\n",
-		 ctrl->index, ints, reg);
+	DSI_CTRL_HW_DBG(ctrl, "Interrupt status = 0x%x, INT_CTRL=0x%x\n",
+		 ints, reg);
 	return ints;
 }
 
@@ -946,8 +940,8 @@ void dsi_ctrl_hw_cmn_clear_interrupt_status(struct dsi_ctrl_hw *ctrl, u32 ints)
 	reg &= ~BIT(24);
 	DSI_W32(ctrl, DSI_INT_CTRL, reg);
 
-	pr_debug("[DSI_%d] Clear interrupts, ints = 0x%x, INT_CTRL=0x%x\n",
-		 ctrl->index, ints, reg);
+	DSI_CTRL_HW_DBG(ctrl, "Clear interrupts, ints = 0x%x, INT_CTRL=0x%x\n",
+		 ints, reg);
 }
 
 /**
@@ -988,8 +982,8 @@ void dsi_ctrl_hw_cmn_enable_status_interrupts(
 
 	DSI_W32(ctrl, DSI_INT_CTRL, reg);
 
-	pr_debug("[DSI_%d] Enable interrupts 0x%x, INT_CTRL=0x%x\n",
-		 ctrl->index, ints, reg);
+	DSI_CTRL_HW_DBG(ctrl, "Enable interrupts 0x%x, INT_CTRL=0x%x\n", ints,
+			reg);
 }
 
 /**
@@ -1076,10 +1070,10 @@ u64 dsi_ctrl_hw_cmn_get_error_status(struct dsi_ctrl_hw *ctrl)
 	if (dsi_status & BIT(31))
 		errors |= DSI_INTERLEAVE_OP_CONTENTION;
 
-	pr_debug("[DSI_%d] Error status = 0x%llx, phy=0x%x, fifo=0x%x\n",
-		 ctrl->index, errors, dln0_phy_err, fifo_status);
-	pr_debug("[DSI_%d] ack=0x%x, timeout=0x%x, clk=0x%x, dsi=0x%x\n",
-		 ctrl->index, ack_error, timeout_errors, clk_error, dsi_status);
+	DSI_CTRL_HW_DBG(ctrl, "Error status = 0x%llx, phy=0x%x, fifo=0x%x\n",
+		 errors, dln0_phy_err, fifo_status);
+	DSI_CTRL_HW_DBG(ctrl, "ack=0x%x, timeout=0x%x, clk=0x%x, dsi=0x%x\n",
+		 ack_error, timeout_errors, clk_error, dsi_status);
 	return errors;
 }
 
@@ -1165,10 +1159,10 @@ void dsi_ctrl_hw_cmn_clear_error_status(struct dsi_ctrl_hw *ctrl, u64 errors)
 	DSI_W32(ctrl, DSI_CLK_STATUS, clk_error);
 	DSI_W32(ctrl, DSI_STATUS, dsi_status);
 
-	pr_debug("[DSI_%d] clear errors = 0x%llx, phy=0x%x, fifo=0x%x\n",
-		 ctrl->index, errors, dln0_phy_err, fifo_status);
-	pr_debug("[DSI_%d] ack=0x%x, timeout=0x%x, clk=0x%x, dsi=0x%x\n",
-		 ctrl->index, ack_error, timeout_error, clk_error, dsi_status);
+	DSI_CTRL_HW_DBG(ctrl, "clear errors = 0x%llx, phy=0x%x, fifo=0x%x\n",
+		 errors, dln0_phy_err, fifo_status);
+	DSI_CTRL_HW_DBG(ctrl, "ack=0x%x, timeout=0x%x, clk=0x%x, dsi=0x%x\n",
+		 ack_error, timeout_error, clk_error, dsi_status);
 }
 
 /**
@@ -1252,8 +1246,8 @@ void dsi_ctrl_hw_cmn_enable_error_interrupts(struct dsi_ctrl_hw *ctrl,
 	DSI_W32(ctrl, DSI_INT_CTRL, int_ctrl);
 	DSI_W32(ctrl, DSI_ERR_INT_MASK0, int_mask0);
 
-	pr_debug("[DSI_%d] enable errors = 0x%llx, int_mask0=0x%x\n",
-		 ctrl->index, errors, int_mask0);
+	DSI_CTRL_HW_DBG(ctrl, "[DSI_%d] enable errors = 0x%llx, int_mask0=0x%x\n",
+		 errors, int_mask0);
 }
 
 /**
@@ -1288,7 +1282,7 @@ void dsi_ctrl_hw_cmn_video_test_pattern_setup(struct dsi_ctrl_hw *ctrl,
 	DSI_W32(ctrl, DSI_TPG_VIDEO_CONFIG, 0x5);
 	DSI_W32(ctrl, DSI_TEST_PATTERN_GEN_CTRL, reg);
 
-	pr_debug("[DSI_%d] Video test pattern setup done\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Video test pattern setup done\n");
 }
 
 /**
@@ -1345,7 +1339,7 @@ void dsi_ctrl_hw_cmn_cmd_test_pattern_setup(struct dsi_ctrl_hw *ctrl,
 	}
 
 	DSI_W32(ctrl, DSI_TEST_PATTERN_GEN_CTRL, reg);
-	pr_debug("[DSI_%d] Cmd test pattern setup done\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Cmd test pattern setup done\n");
 }
 
 /**
@@ -1365,7 +1359,7 @@ void dsi_ctrl_hw_cmn_test_pattern_enable(struct dsi_ctrl_hw *ctrl,
 
 	DSI_W32(ctrl, DSI_TEST_PATTERN_GEN_CTRL, reg);
 
-	pr_debug("[DSI_%d] Test pattern enable=%d\n", ctrl->index, enable);
+	DSI_CTRL_HW_DBG(ctrl, "Test pattern enable=%d\n", enable);
 }
 
 /**
@@ -1391,7 +1385,7 @@ void dsi_ctrl_hw_cmn_trigger_cmd_test_pattern(struct dsi_ctrl_hw *ctrl,
 		break;
 	}
 
-	pr_debug("[DSI_%d] Cmd Test pattern trigger\n", ctrl->index);
+	DSI_CTRL_HW_DBG(ctrl, "Cmd Test pattern trigger\n");
 }
 
 void dsi_ctrl_hw_dln0_phy_err(struct dsi_ctrl_hw *ctrl)
@@ -1405,7 +1399,7 @@ void dsi_ctrl_hw_dln0_phy_err(struct dsi_ctrl_hw *ctrl)
 	status = DSI_R32(ctrl, DSI_DLN0_PHY_ERR);
 	if (status & 0x011111) {
 		DSI_W32(ctrl, DSI_DLN0_PHY_ERR, status);
-		pr_err("%s: phy_err_status = %x\n", __func__, status);
+		DSI_CTRL_HW_ERR(ctrl, "phy_err_status = %x\n", status);
 	}
 }
 
@@ -1431,8 +1425,7 @@ int dsi_ctrl_hw_cmn_ctrl_reset(struct dsi_ctrl_hw *ctrl,
 	int rc = 0;
 	u32 data;
 
-	pr_debug("DSI CTRL and PHY reset. ctrl-num = %d %d\n",
-			ctrl->index, mask);
+	DSI_CTRL_HW_DBG(ctrl, "DSI CTRL and PHY reset, mask=%d\n", mask);
 
 	data = DSI_R32(ctrl, 0x0004);
 	/* Disable DSI video mode */
@@ -1563,7 +1556,7 @@ int dsi_ctrl_hw_cmn_wait_for_cmd_mode_mdp_idle(struct dsi_ctrl_hw *ctrl)
 	rc = readl_poll_timeout(ctrl->base + DSI_STATUS, val,
 			!(val & cmd_mode_mdp_busy_mask), sleep_us, timeout_us);
 	if (rc)
-		pr_err("%s: timed out waiting for idle\n", __func__);
+		DSI_CTRL_HW_ERR(ctrl, "timed out waiting for idle\n");
 
 	return rc;
 }
@@ -1604,7 +1597,7 @@ int dsi_ctrl_hw_cmn_wait4dynamic_refresh_done(struct dsi_ctrl_hw *ctrl)
 	rc = readl_poll_timeout(ctrl->base + DSI_INT_CTRL, reg,
 				(reg & dyn_refresh_done), sleep_us, timeout_us);
 	if (rc) {
-		pr_err("wait4dynamic refresh timedout %d\n", rc);
+		DSI_CTRL_HW_ERR(ctrl, "wait4dynamic refresh timedout %d\n", rc);
 		return rc;
 	}
 

+ 8 - 0
msm/dsi/dsi_defs.h

@@ -43,6 +43,14 @@
 #define display_for_each_ctrl(index, display) \
 	for (index = 0; (index < (display)->ctrl_count) &&\
 			(index < MAX_DSI_CTRLS_PER_DISPLAY); index++)
+
+#define DSI_WARN(fmt, ...)	DRM_WARN("[msm-dsi-warn]: "fmt, ##__VA_ARGS__)
+#define DSI_ERR(fmt, ...)	DRM_DEV_ERROR(NULL, "[msm-dsi-error]: " fmt, \
+								##__VA_ARGS__)
+#define DSI_INFO(fmt, ...)	DRM_DEV_INFO(NULL, "[msm-dsi-info]: "fmt, \
+								##__VA_ARGS__)
+#define DSI_DEBUG(fmt, ...)	DRM_DEV_DEBUG(NULL, "[msm-dsi-debug]: "fmt, \
+								##__VA_ARGS__)
 /**
  * enum dsi_pixel_format - DSI pixel formats
  * @DSI_PIXEL_FORMAT_RGB565:

文件差异内容过多而无法显示
+ 121 - 122
msm/dsi/dsi_display.c


+ 7 - 7
msm/dsi/dsi_display_test.c

@@ -26,13 +26,13 @@ static void dsi_display_test_work(struct work_struct *work)
 	display = test->display;
 	rc = dsi_display_get_mode_count(display, &count);
 	if (rc) {
-		pr_err("failed to get modes count, rc=%d\n", rc);
+		DSI_ERR("failed to get modes count, rc=%d\n", rc);
 		goto test_fail;
 	}
 
 	rc = dsi_display_get_modes(display, &modes);
 	if (rc) {
-		pr_err("failed to get modes, rc=%d\n", rc);
+		DSI_ERR("failed to get modes, rc=%d\n", rc);
 		goto test_fail_free_modes;
 	}
 
@@ -40,26 +40,26 @@ static void dsi_display_test_work(struct work_struct *work)
 
 	rc = dsi_display_set_mode(display, &modes[0], 0x0);
 	if (rc) {
-		pr_err("failed to set mode, rc=%d\n", rc);
+		DSI_ERR("failed to set mode, rc=%d\n", rc);
 		goto test_fail_free_modes;
 	}
 
 	rc = dsi_display_prepare(display);
 	if (rc) {
-		pr_err("failed to prepare display, rc=%d\n", rc);
+		DSI_ERR("failed to prepare display, rc=%d\n", rc);
 		goto test_fail_free_modes;
 	}
 
 	rc = dsi_display_enable(display);
 	if (rc) {
-		pr_err("failed to enable display, rc=%d\n", rc);
+		DSI_ERR("failed to enable display, rc=%d\n", rc);
 		goto test_fail_unprep_disp;
 	}
 	return;
 
 test_fail_unprep_disp:
 	if (rc) {
-		pr_err("failed to unprep display, rc=%d\n", rc);
+		DSI_ERR("failed to unprep display, rc=%d\n", rc);
 		goto test_fail_free_modes;
 	}
 
@@ -80,7 +80,7 @@ int dsi_display_test_init(struct dsi_display *display)
 
 	done = 1;
 	if (!display) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return -EINVAL;
 	}
 

+ 41 - 42
msm/dsi/dsi_drm.c

@@ -4,7 +4,6 @@
  */
 
 
-#define pr_fmt(fmt)	"dsi-drm:[%s] " fmt, __func__
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic.h>
 
@@ -151,11 +150,11 @@ static int dsi_bridge_attach(struct drm_bridge *bridge)
 	struct dsi_bridge *c_bridge = to_dsi_bridge(bridge);
 
 	if (!bridge) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return -EINVAL;
 	}
 
-	pr_debug("[%d] attached\n", c_bridge->id);
+	DSI_DEBUG("[%d] attached\n", c_bridge->id);
 
 	return 0;
 
@@ -167,12 +166,12 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
 	struct dsi_bridge *c_bridge = to_dsi_bridge(bridge);
 
 	if (!bridge) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return;
 	}
 
 	if (!c_bridge || !c_bridge->display || !c_bridge->display->panel) {
-		pr_err("Incorrect bridge details\n");
+		DSI_ERR("Incorrect bridge details\n");
 		return;
 	}
 
@@ -182,7 +181,7 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
 	rc = dsi_display_set_mode(c_bridge->display,
 			&(c_bridge->dsi_mode), 0x0);
 	if (rc) {
-		pr_err("[%d] failed to perform a mode set, rc=%d\n",
+		DSI_ERR("[%d] failed to perform a mode set, rc=%d\n",
 		       c_bridge->id, rc);
 		return;
 	}
@@ -190,14 +189,14 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
 	if (c_bridge->dsi_mode.dsi_mode_flags &
 		(DSI_MODE_FLAG_SEAMLESS | DSI_MODE_FLAG_VRR |
 		 DSI_MODE_FLAG_DYN_CLK)) {
-		pr_debug("[%d] seamless pre-enable\n", c_bridge->id);
+		DSI_DEBUG("[%d] seamless pre-enable\n", c_bridge->id);
 		return;
 	}
 
 	SDE_ATRACE_BEGIN("dsi_display_prepare");
 	rc = dsi_display_prepare(c_bridge->display);
 	if (rc) {
-		pr_err("[%d] DSI display prepare failed, rc=%d\n",
+		DSI_ERR("[%d] DSI display prepare failed, rc=%d\n",
 		       c_bridge->id, rc);
 		SDE_ATRACE_END("dsi_display_prepare");
 		return;
@@ -207,7 +206,7 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
 	SDE_ATRACE_BEGIN("dsi_display_enable");
 	rc = dsi_display_enable(c_bridge->display);
 	if (rc) {
-		pr_err("[%d] DSI display enable failed, rc=%d\n",
+		DSI_ERR("[%d] DSI display enable failed, rc=%d\n",
 				c_bridge->id, rc);
 		(void)dsi_display_unprepare(c_bridge->display);
 	}
@@ -215,7 +214,7 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
 
 	rc = dsi_display_splash_res_cleanup(c_bridge->display);
 	if (rc)
-		pr_err("Continuous splash pipeline cleanup failed, rc=%d\n",
+		DSI_ERR("Continuous splash pipeline cleanup failed, rc=%d\n",
 									rc);
 }
 
@@ -226,21 +225,21 @@ static void dsi_bridge_enable(struct drm_bridge *bridge)
 	struct dsi_display *display;
 
 	if (!bridge) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return;
 	}
 
 	if (c_bridge->dsi_mode.dsi_mode_flags &
 			(DSI_MODE_FLAG_SEAMLESS | DSI_MODE_FLAG_VRR |
 			 DSI_MODE_FLAG_DYN_CLK)) {
-		pr_debug("[%d] seamless enable\n", c_bridge->id);
+		DSI_DEBUG("[%d] seamless enable\n", c_bridge->id);
 		return;
 	}
 	display = c_bridge->display;
 
 	rc = dsi_display_post_enable(display);
 	if (rc)
-		pr_err("[%d] DSI display post enabled failed, rc=%d\n",
+		DSI_ERR("[%d] DSI display post enabled failed, rc=%d\n",
 		       c_bridge->id, rc);
 
 	if (display && display->drm_conn)
@@ -254,7 +253,7 @@ static void dsi_bridge_disable(struct drm_bridge *bridge)
 	struct dsi_bridge *c_bridge = to_dsi_bridge(bridge);
 
 	if (!bridge) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return;
 	}
 	display = c_bridge->display;
@@ -274,7 +273,7 @@ static void dsi_bridge_disable(struct drm_bridge *bridge)
 
 	rc = dsi_display_pre_disable(c_bridge->display);
 	if (rc) {
-		pr_err("[%d] DSI display pre disable failed, rc=%d\n",
+		DSI_ERR("[%d] DSI display pre disable failed, rc=%d\n",
 		       c_bridge->id, rc);
 	}
 }
@@ -285,7 +284,7 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
 	struct dsi_bridge *c_bridge = to_dsi_bridge(bridge);
 
 	if (!bridge) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return;
 	}
 
@@ -293,7 +292,7 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
 	SDE_ATRACE_BEGIN("dsi_display_disable");
 	rc = dsi_display_disable(c_bridge->display);
 	if (rc) {
-		pr_err("[%d] DSI display disable failed, rc=%d\n",
+		DSI_ERR("[%d] DSI display disable failed, rc=%d\n",
 		       c_bridge->id, rc);
 		SDE_ATRACE_END("dsi_display_disable");
 		return;
@@ -302,7 +301,7 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
 
 	rc = dsi_display_unprepare(c_bridge->display);
 	if (rc) {
-		pr_err("[%d] DSI display unprepare failed, rc=%d\n",
+		DSI_ERR("[%d] DSI display unprepare failed, rc=%d\n",
 		       c_bridge->id, rc);
 		SDE_ATRACE_END("dsi_bridge_post_disable");
 		return;
@@ -317,7 +316,7 @@ static void dsi_bridge_mode_set(struct drm_bridge *bridge,
 	struct dsi_bridge *c_bridge = to_dsi_bridge(bridge);
 
 	if (!bridge || !mode || !adjusted_mode) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return;
 	}
 
@@ -328,7 +327,7 @@ static void dsi_bridge_mode_set(struct drm_bridge *bridge,
 	c_bridge->dsi_mode.timing.clk_rate_hz =
 		dsi_drm_find_bit_clk_rate(c_bridge->display, adjusted_mode);
 
-	pr_debug("clk_rate: %llu\n", c_bridge->dsi_mode.timing.clk_rate_hz);
+	DSI_DEBUG("clk_rate: %llu\n", c_bridge->dsi_mode.timing.clk_rate_hz);
 }
 
 static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge,
@@ -345,13 +344,13 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge,
 	crtc_state = container_of(mode, struct drm_crtc_state, mode);
 
 	if (!bridge || !mode || !adjusted_mode) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return false;
 	}
 
 	display = c_bridge->display;
 	if (!display) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return false;
 	}
 
@@ -385,7 +384,7 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge,
 	rc = dsi_display_validate_mode(c_bridge->display, &dsi_mode,
 			DSI_VALIDATE_FLAG_ALLOW_ADJUST);
 	if (rc) {
-		pr_err("[%d] mode is not valid, rc=%d\n", c_bridge->id, rc);
+		DSI_ERR("[%d] mode is not valid, rc=%d\n", c_bridge->id, rc);
 		return false;
 	}
 
@@ -400,7 +399,7 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge,
 		rc = dsi_display_validate_mode_change(c_bridge->display,
 					&cur_dsi_mode, &dsi_mode);
 		if (rc) {
-			pr_err("[%s] seamless mode mismatch failure rc=%d\n",
+			DSI_ERR("[%s] seamless mode mismatch failure rc=%d\n",
 				c_bridge->display->name, rc);
 			return false;
 		}
@@ -547,12 +546,12 @@ int dsi_conn_set_info_blob(struct drm_connector *connector,
 					"split ext bridge");
 		break;
 	default:
-		pr_debug("invalid display type:%d\n", dsi_display->type);
+		DSI_DEBUG("invalid display type:%d\n", dsi_display->type);
 		break;
 	}
 
 	if (!dsi_display->panel) {
-		pr_debug("invalid panel data\n");
+		DSI_DEBUG("invalid panel data\n");
 		goto end;
 	}
 
@@ -573,7 +572,7 @@ int dsi_conn_set_info_blob(struct drm_connector *connector,
 				panel->qsync_min_fps ? "true" : "false");
 		break;
 	default:
-		pr_debug("invalid panel type:%d\n", panel->panel_mode);
+		DSI_DEBUG("invalid panel type:%d\n", panel->panel_mode);
 		break;
 	}
 	sde_kms_info_add_keystr(info, "dfps support",
@@ -604,7 +603,7 @@ int dsi_conn_set_info_blob(struct drm_connector *connector,
 							"horz & vert flip");
 		break;
 	default:
-		pr_debug("invalid panel rotation:%d\n",
+		DSI_DEBUG("invalid panel rotation:%d\n",
 						panel->phy_props.rotation);
 		break;
 	}
@@ -620,7 +619,7 @@ int dsi_conn_set_info_blob(struct drm_connector *connector,
 		sde_kms_info_add_keystr(info, "backlight type", "dcs");
 		break;
 	default:
-		pr_debug("invalid panel backlight type:%d\n",
+		DSI_DEBUG("invalid panel backlight type:%d\n",
 						panel->bl_config.type);
 		break;
 	}
@@ -668,7 +667,7 @@ enum drm_connector_status dsi_conn_detect(struct drm_connector *conn,
 	memset(&info, 0x0, sizeof(info));
 	rc = dsi_display_get_info(conn, &info, display);
 	if (rc) {
-		pr_err("failed to get display info, rc=%d\n", rc);
+		DSI_ERR("failed to get display info, rc=%d\n", rc);
 		return connector_status_disconnected;
 	}
 
@@ -814,13 +813,13 @@ int dsi_connector_get_modes(struct drm_connector *connector, void *data,
 
 	rc = dsi_display_get_mode_count(display, &count);
 	if (rc) {
-		pr_err("failed to get num of modes, rc=%d\n", rc);
+		DSI_ERR("failed to get num of modes, rc=%d\n", rc);
 		goto end;
 	}
 
 	rc = dsi_display_get_modes(display, &modes);
 	if (rc) {
-		pr_err("failed to get modes, rc=%d\n", rc);
+		DSI_ERR("failed to get modes, rc=%d\n", rc);
 		count = 0;
 		goto end;
 	}
@@ -832,7 +831,7 @@ int dsi_connector_get_modes(struct drm_connector *connector, void *data,
 		dsi_convert_to_drm_mode(&modes[i], &drm_mode);
 		m = drm_mode_duplicate(connector->dev, &drm_mode);
 		if (!m) {
-			pr_err("failed to add mode %ux%u\n",
+			DSI_ERR("failed to add mode %ux%u\n",
 			       drm_mode.hdisplay,
 			       drm_mode.vdisplay);
 			count = -ENOMEM;
@@ -861,7 +860,7 @@ int dsi_connector_get_modes(struct drm_connector *connector, void *data,
 	if (rc)
 		count = 0;
 end:
-	pr_debug("MODE COUNT =%d\n\n", count);
+	DSI_DEBUG("MODE COUNT =%d\n\n", count);
 	return count;
 }
 
@@ -873,7 +872,7 @@ enum drm_mode_status dsi_conn_mode_valid(struct drm_connector *connector,
 	int rc;
 
 	if (!connector || !mode) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return MODE_ERROR;
 	}
 
@@ -882,7 +881,7 @@ enum drm_mode_status dsi_conn_mode_valid(struct drm_connector *connector,
 	rc = dsi_display_validate_mode(display, &dsi_mode,
 			DSI_VALIDATE_FLAG_ALLOW_ADJUST);
 	if (rc) {
-		pr_err("mode not supported, rc=%d\n", rc);
+		DSI_ERR("mode not supported, rc=%d\n", rc);
 		return MODE_BAD;
 	}
 
@@ -894,7 +893,7 @@ int dsi_conn_pre_kickoff(struct drm_connector *connector,
 		struct msm_display_kickoff_params *params)
 {
 	if (!connector || !display || !params) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return -EINVAL;
 	}
 
@@ -925,13 +924,13 @@ int dsi_conn_post_kickoff(struct drm_connector *connector)
 	int i, rc = 0;
 
 	if (!connector || !connector->state) {
-		pr_err("invalid connector or connector state\n");
+		DSI_ERR("invalid connector or connector state\n");
 		return -EINVAL;
 	}
 
 	encoder = connector->state->best_encoder;
 	if (!encoder) {
-		pr_debug("best encoder is not available\n");
+		DSI_DEBUG("best encoder is not available\n");
 		return 0;
 	}
 
@@ -943,7 +942,7 @@ int dsi_conn_post_kickoff(struct drm_connector *connector)
 		m_ctrl = &display->ctrl[display->clk_master_idx];
 		rc = dsi_ctrl_timing_db_update(m_ctrl->ctrl, false);
 		if (rc) {
-			pr_err("[%s] failed to dfps update  rc=%d\n",
+			DSI_ERR("[%s] failed to dfps update  rc=%d\n",
 				display->name, rc);
 			return -EINVAL;
 		}
@@ -956,7 +955,7 @@ int dsi_conn_post_kickoff(struct drm_connector *connector)
 
 			rc = dsi_ctrl_timing_db_update(ctrl->ctrl, false);
 			if (rc) {
-				pr_err("[%s] failed to dfps update rc=%d\n",
+				DSI_ERR("[%s] failed to dfps update rc=%d\n",
 					display->name,  rc);
 				return -EINVAL;
 			}
@@ -990,7 +989,7 @@ struct dsi_bridge *dsi_drm_bridge_init(struct dsi_display *display,
 
 	rc = drm_bridge_attach(encoder, &bridge->base, NULL);
 	if (rc) {
-		pr_err("failed to attach bridge, rc=%d\n", rc);
+		DSI_ERR("failed to attach bridge, rc=%d\n", rc);
 		goto error_free_bridge;
 	}
 

文件差异内容过多而无法显示
+ 124 - 121
msm/dsi/dsi_panel.c


+ 50 - 51
msm/dsi/dsi_parser.c

@@ -3,8 +3,6 @@
  * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt)	"[dsi-parser] %s: " fmt, __func__
-
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/string.h>
@@ -14,6 +12,7 @@
 #include <linux/device.h>
 
 #include "dsi_parser.h"
+#include "dsi_defs.h"
 
 #define DSI_PARSER_MAX_NODES 20
 
@@ -106,7 +105,7 @@ static bool dsi_parser_get_tuples_data(
 	bool middle_of_tx = false;
 
 	if (!str) {
-		pr_err("Invalid input\n");
+		DSI_ERR("Invalid input\n");
 		return middle_of_tx;
 	}
 
@@ -131,7 +130,7 @@ static bool dsi_parser_get_strings(struct device *dev,
 	int count = 0;
 
 	if (!str) {
-		pr_err("Invalid input\n");
+		DSI_ERR("Invalid input\n");
 		goto end;
 	}
 
@@ -139,7 +138,7 @@ static bool dsi_parser_get_strings(struct device *dev,
 		goto end;
 
 	count = dsi_parser_count(str, ',');
-	pr_debug("count=%d\n", count);
+	DSI_DEBUG("count=%d\n", count);
 
 	if (!count) {
 		prop->value = dsi_parser_get_data("\"", "\"", str);
@@ -179,7 +178,7 @@ static bool dsi_parser_get_tuples(struct device *dev,
 	char *data = NULL;
 
 	if (!str) {
-		pr_err("Invalid input\n");
+		DSI_ERR("Invalid input\n");
 		return middle_of_tx;
 	}
 
@@ -225,7 +224,7 @@ static void dsi_parser_get_int_value(struct dsi_parser_prop *prop,
 		}
 
 		if (kstrtoint(tmp, base, &val)) {
-			pr_err("error converting %s at %d\n",
+			DSI_ERR("error converting %s at %d\n",
 				tmp, i);
 
 			continue;
@@ -253,7 +252,7 @@ static bool dsi_parser_parse_prop(struct device *dev,
 	found = true;
 
 	prop->name = dsi_parser_strim(out);
-	pr_debug("RAW: %s: %s\n", prop->name, prop->raw);
+	DSI_DEBUG("RAW: %s: %s\n", prop->name, prop->raw);
 
 	prop->len = 0;
 
@@ -323,7 +322,7 @@ static char *dsi_parser_clean_name(char *name)
 	char *clean_name = name;
 
 	if (!name) {
-		pr_err("Invalid input\n");
+		DSI_ERR("Invalid input\n");
 		return NULL;
 	}
 
@@ -375,7 +374,7 @@ static struct dsi_parser_node *dsi_parser_find_nodes(struct device *dev,
 
 	data = strpbrk(*buf, "{}");
 	if (!data) {
-		pr_debug("{} not found\n");
+		DSI_DEBUG("{} not found\n");
 		goto end;
 	}
 
@@ -493,7 +492,7 @@ struct property *dsi_parser_find_property(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, name);
 	if (!prop) {
-		pr_debug("%s not found\n", name);
+		DSI_DEBUG("%s not found\n", name);
 		goto end;
 	}
 
@@ -506,7 +505,7 @@ struct property *dsi_parser_find_property(const struct device_node *np,
 		else
 			*lenp = strlen(prop->raw) + 1;
 
-		pr_debug("%s len=%d\n", name, *lenp);
+		DSI_DEBUG("%s len=%d\n", name, *lenp);
 	}
 end:
 	return (struct property *)prop;
@@ -520,7 +519,7 @@ bool dsi_parser_read_bool(const struct device_node *np,
 
 	prop_set = dsi_parser_search_property(node, propname) ? true : false;
 
-	pr_debug("%s=%s\n", propname, prop_set ? "set" : "not set");
+	DSI_DEBUG("%s=%s\n", propname, prop_set ? "set" : "not set");
 
 	return prop_set;
 }
@@ -535,7 +534,7 @@ int dsi_parser_read_string(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, propname);
 	if (!prop) {
-		pr_debug("%s not found\n", propname);
+		DSI_DEBUG("%s not found\n", propname);
 		rc = -EINVAL;
 	} else {
 		property = prop->value;
@@ -543,7 +542,7 @@ int dsi_parser_read_string(const struct device_node *np,
 
 	*out_string = property;
 
-	pr_debug("%s=%s\n", propname, *out_string);
+	DSI_DEBUG("%s=%s\n", propname, *out_string);
 	return rc;
 }
 
@@ -563,7 +562,7 @@ int dsi_parser_read_u32(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, propname);
 	if (!prop) {
-		pr_debug("%s not found\n", propname);
+		DSI_DEBUG("%s not found\n", propname);
 		rc = -EINVAL;
 		goto end;
 	}
@@ -584,12 +583,12 @@ int dsi_parser_read_u32(const struct device_node *np,
 
 	rc = kstrtoint(property, base, out_value);
 	if (rc) {
-		pr_err("prop=%s error(%d) converting %s, base=%d\n",
+		DSI_ERR("prop=%s error(%d) converting %s, base=%d\n",
 			propname, rc, property, base);
 		goto end;
 	}
 
-	pr_debug("%s=%d\n", propname, *out_value);
+	DSI_DEBUG("%s=%d\n", propname, *out_value);
 end:
 	return rc;
 }
@@ -604,7 +603,7 @@ int dsi_parser_read_u32_array(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, propname);
 	if (!prop) {
-		pr_debug("%s not found\n", propname);
+		DSI_DEBUG("%s not found\n", propname);
 		rc = -EINVAL;
 		goto end;
 	}
@@ -629,14 +628,14 @@ int dsi_parser_read_u32_array(const struct device_node *np,
 
 		rc = kstrtoint(tmp, base, &val);
 		if (rc) {
-			pr_err("prop=%s error(%d) converting %s(%d), base=%d\n",
+			DSI_ERR("prop=%s error(%d) converting %s(%d), base=%d\n",
 				propname, rc, tmp, i, base);
 			continue;
 		}
 
 		*out_values++ = val;
 
-		pr_debug("%s: [%d]=%d\n", propname, i, *(out_values - 1));
+		DSI_DEBUG("%s: [%d]=%d\n", propname, i, *(out_values - 1));
 	}
 end:
 	return rc;
@@ -651,14 +650,14 @@ const void *dsi_parser_get_property(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, name);
 	if (!prop) {
-		pr_debug("%s not found\n", name);
+		DSI_DEBUG("%s not found\n", name);
 		goto end;
 	}
 
 	property = prop->value;
 
 	if (prop->type == DSI_PROP_TYPE_STR)
-		pr_debug("%s=%s\n", name, property);
+		DSI_DEBUG("%s=%s\n", name, property);
 
 	if (lenp) {
 		if (prop->type == DSI_PROP_TYPE_INT_ARRAY)
@@ -669,7 +668,7 @@ const void *dsi_parser_get_property(const struct device_node *np,
 		else
 			*lenp = strlen(prop->raw) + 1;
 
-		pr_debug("%s len=%d\n", name, *lenp);
+		DSI_DEBUG("%s len=%d\n", name, *lenp);
 	}
 end:
 	return property;
@@ -697,7 +696,7 @@ struct device_node *dsi_parser_get_child_by_name(const struct device_node *np,
 		}
 	} while (index < node->children_count);
 end:
-	pr_debug("%s: %s\n", name, matched_node ? "found" : "not found");
+	DSI_DEBUG("%s: %s\n", name, matched_node ? "found" : "not found");
 
 	return (struct device_node *)matched_node;
 }
@@ -710,7 +709,7 @@ struct dsi_parser_node *dsi_parser_get_node_by_name(
 	struct dsi_parser_node *matched_node = NULL;
 
 	if (!node) {
-		pr_err("node is null\n");
+		DSI_ERR("node is null\n");
 		goto end;
 	}
 
@@ -726,7 +725,7 @@ struct dsi_parser_node *dsi_parser_get_node_by_name(
 			break;
 	}
 end:
-	pr_debug("%s: %s\n", name, matched_node ? "found" : "not found");
+	DSI_DEBUG("%s: %s\n", name, matched_node ? "found" : "not found");
 
 	return matched_node;
 }
@@ -738,7 +737,7 @@ int dsi_parser_get_child_count(const struct device_node *np)
 
 	if (node) {
 		count = node->children_count;
-		pr_debug("node %s child count=%d\n", node->name, count);
+		DSI_DEBUG("node %s child count=%d\n", node->name, count);
 	}
 
 	return count;
@@ -774,7 +773,7 @@ struct device_node *dsi_parser_get_next_child(const struct device_node *np,
 	} while (index < parent->children_count);
 end:
 	if (matched_node)
-		pr_debug("next child: %s\n", matched_node->name);
+		DSI_DEBUG("next child: %s\n", matched_node->name);
 
 	return (struct device_node *)matched_node;
 }
@@ -788,13 +787,13 @@ int dsi_parser_count_u32_elems(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, propname);
 	if (!prop) {
-		pr_debug("%s not found\n", propname);
+		DSI_DEBUG("%s not found\n", propname);
 		goto end;
 	}
 
 	count = prop->len;
 
-	pr_debug("prop %s has %d items\n", prop->name, count);
+	DSI_DEBUG("prop %s has %d items\n", prop->name, count);
 end:
 	return count;
 }
@@ -808,7 +807,7 @@ int dsi_parser_count_strings(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, propname);
 	if (!prop) {
-		pr_debug("%s not found\n", propname);
+		DSI_DEBUG("%s not found\n", propname);
 		goto end;
 	}
 
@@ -817,7 +816,7 @@ int dsi_parser_count_strings(const struct device_node *np,
 	else if (prop->type == DSI_PROP_TYPE_STR)
 		count = 1;
 
-	pr_debug("prop %s has %d items\n", prop->name, count);
+	DSI_DEBUG("prop %s has %d items\n", prop->name, count);
 end:
 	return count;
 }
@@ -831,17 +830,17 @@ int dsi_parser_read_string_index(const struct device_node *np,
 
 	prop = dsi_parser_search_property(node, propname);
 	if (!prop) {
-		pr_debug("%s not found\n", propname);
+		DSI_DEBUG("%s not found\n", propname);
 		goto end;
 	}
 
 	if (prop->type != DSI_PROP_TYPE_STR_ARRAY) {
-		pr_err("not a string array property\n");
+		DSI_ERR("not a string array property\n");
 		goto end;
 	}
 
 	if (index >= prop->len) {
-		pr_err("out of bond index %d\n", index);
+		DSI_ERR("out of bond index %d\n", index);
 		goto end;
 	}
 
@@ -869,7 +868,7 @@ void *dsi_parser_get_head_node(void *in,
 	char *buf;
 
 	if (!parser || !data || !size) {
-		pr_err("invalid input\n");
+		DSI_ERR("invalid input\n");
 		goto err;
 	}
 
@@ -886,7 +885,7 @@ void *dsi_parser_get_head_node(void *in,
 
 	parser->head_node = dsi_parser_find_nodes(parser->dev, &buf);
 	if (!parser->head_node) {
-		pr_err("could not get head node\n");
+		DSI_ERR("could not get head node\n");
 		devm_kfree(parser->dev, parser->buf);
 		goto err;
 	}
@@ -910,14 +909,14 @@ static int dsi_parser_read_file(struct dsi_parser *parser,
 
 	rc = request_firmware(&parser->fw, parser->file_name, parser->dev);
 	if (rc || !parser->fw) {
-		pr_err("couldn't read firmware\n");
+		DSI_ERR("couldn't read firmware\n");
 		goto end;
 	}
 
 	*buf = parser->fw->data;
 	*size = parser->fw->size;
 
-	pr_debug("file %s: size %zd\n",
+	DSI_DEBUG("file %s: size %zd\n",
 		parser->file_name, parser->fw->size);
 end:
 	return rc;
@@ -931,7 +930,7 @@ static void dsi_parser_free_mem(struct device *dev,
 	if (!node)
 		return;
 
-	pr_debug("node=%s, prop_count=%d\n", node->name, node->prop_count);
+	DSI_DEBUG("node=%s, prop_count=%d\n", node->name, node->prop_count);
 
 	for (i = 0; i < node->prop_count; i++) {
 		struct dsi_parser_prop *prop = &node->prop[i];
@@ -939,7 +938,7 @@ static void dsi_parser_free_mem(struct device *dev,
 		if (!prop)
 			continue;
 
-		pr_debug("deleting prop=%s\n", prop->name);
+		DSI_DEBUG("deleting prop=%s\n", prop->name);
 
 		if (prop->items)
 			devm_kfree(dev, prop->items);
@@ -985,12 +984,12 @@ static ssize_t dsi_parser_write_init(struct file *file,
 	buf[len] = '\0';
 
 	if (sscanf(buf, "%31s", parser->file_name) != 1) {
-		pr_err("failed to get val\n");
+		DSI_ERR("failed to get val\n");
 		goto end;
 	}
 
 	if (dsi_parser_read_file(parser, &data, &size)) {
-		pr_err("failed to read file\n");
+		DSI_ERR("failed to read file\n");
 		goto end;
 	}
 
@@ -1003,7 +1002,7 @@ static ssize_t dsi_parser_write_init(struct file *file,
 
 	parser->head_node = dsi_parser_get_head_node(parser, data, size);
 	if (!parser->head_node) {
-		pr_err("failed to parse data\n");
+		DSI_ERR("failed to parse data\n");
 		goto end;
 	}
 end:
@@ -1169,7 +1168,7 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
 	struct dentry *dir, *file;
 
 	if (!parser || !parent_dir) {
-		pr_err("invalid input\n");
+		DSI_ERR("invalid input\n");
 		goto end;
 	}
 
@@ -1177,7 +1176,7 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
 	if (IS_ERR_OR_NULL(dir)) {
 		rc = PTR_ERR(dir);
 
-		pr_err("failed to create parser debugfs\n");
+		DSI_ERR("failed to create parser debugfs\n");
 		goto end;
 	}
 
@@ -1186,7 +1185,7 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
 	if (IS_ERR_OR_NULL(file)) {
 		rc = PTR_ERR(file);
 
-		pr_err("failed to create init debugfs\n");
+		DSI_ERR("failed to create init debugfs\n");
 		goto dbg;
 	}
 
@@ -1195,11 +1194,11 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
 	if (IS_ERR_OR_NULL(file)) {
 		rc = PTR_ERR(file);
 
-		pr_err("failed to create init debugfs\n");
+		DSI_ERR("failed to create init debugfs\n");
 		goto dbg;
 	}
 
-	pr_debug("success\n");
+	DSI_DEBUG("success\n");
 	return 0;
 dbg:
 	debugfs_remove_recursive(dir);
@@ -1213,7 +1212,7 @@ void *dsi_parser_get(struct device *dev)
 	struct dsi_parser *parser = NULL;
 
 	if (!dev) {
-		pr_err("invalid data\n");
+		DSI_ERR("invalid data\n");
 		rc = -EINVAL;
 		goto end;
 	}

+ 67 - 64
msm/dsi/dsi_phy.c

@@ -3,8 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt)	"msm-dsi-phy:[%s] " fmt, __func__
-
 #include <linux/of_device.h>
 #include <linux/err.h>
 #include <linux/regulator/consumer.h>
@@ -121,8 +119,7 @@ static int dsi_phy_regmap_init(struct platform_device *pdev,
 	ptr = msm_ioremap(pdev, "dyn_refresh_base", phy->name);
 	phy->hw.dyn_pll_base = ptr;
 
-	pr_debug("[%s] map dsi_phy registers to %pK\n",
-		phy->name, phy->hw.base);
+	DSI_PHY_DBG(phy, "map dsi_phy registers to %pK\n", phy->hw.base);
 
 	switch (phy->ver_info->version) {
 	case DSI_PHY_VERSION_2_0:
@@ -141,7 +138,7 @@ static int dsi_phy_regmap_init(struct platform_device *pdev,
 
 static int dsi_phy_regmap_deinit(struct msm_dsi_phy *phy)
 {
-	pr_debug("[%s] unmap registers\n", phy->name);
+	DSI_PHY_DBG(phy, "unmap registers\n");
 	return 0;
 }
 
@@ -168,7 +165,8 @@ static int dsi_phy_supplies_init(struct platform_device *pdev,
 					  &phy->pwr_info.phy_pwr,
 					  "qcom,phy-supply-entries");
 	if (rc) {
-		pr_err("failed to get host power supplies, rc = %d\n", rc);
+		DSI_PHY_ERR(phy, "failed to get host power supplies, rc = %d\n",
+				rc);
 		goto error_digital;
 	}
 
@@ -177,7 +175,7 @@ static int dsi_phy_supplies_init(struct platform_device *pdev,
 		vreg = devm_regulator_get(&pdev->dev, regs->vregs[i].vreg_name);
 		rc = PTR_RET(vreg);
 		if (rc) {
-			pr_err("failed to get %s regulator\n",
+			DSI_PHY_ERR(phy, "failed to get %s regulator\n",
 			       regs->vregs[i].vreg_name);
 			goto error_host_pwr;
 		}
@@ -189,7 +187,7 @@ static int dsi_phy_supplies_init(struct platform_device *pdev,
 		vreg = devm_regulator_get(&pdev->dev, regs->vregs[i].vreg_name);
 		rc = PTR_RET(vreg);
 		if (rc) {
-			pr_err("failed to get %s regulator\n",
+			DSI_PHY_ERR(phy, "failed to get %s regulator\n",
 			       regs->vregs[i].vreg_name);
 			for (--i; i >= 0; i--)
 				devm_regulator_put(regs->vregs[i].vreg);
@@ -225,7 +223,7 @@ static int dsi_phy_supplies_deinit(struct msm_dsi_phy *phy)
 	regs = &phy->pwr_info.digital;
 	for (i = 0; i < regs->count; i++) {
 		if (!regs->vregs[i].vreg)
-			pr_err("vreg is NULL, should not reach here\n");
+			DSI_PHY_ERR(phy, "vreg is NULL, should not reach here\n");
 		else
 			devm_regulator_put(regs->vregs[i].vreg);
 	}
@@ -233,7 +231,7 @@ static int dsi_phy_supplies_deinit(struct msm_dsi_phy *phy)
 	regs = &phy->pwr_info.phy_pwr;
 	for (i = 0; i < regs->count; i++) {
 		if (!regs->vregs[i].vreg)
-			pr_err("vreg is NULL, should not reach here\n");
+			DSI_PHY_ERR(phy, "vreg is NULL, should not reach here\n");
 		else
 			devm_regulator_put(regs->vregs[i].vreg);
 	}
@@ -262,12 +260,12 @@ static int dsi_phy_parse_dt_per_lane_cfgs(struct platform_device *pdev,
 
 	data = of_get_property(pdev->dev.of_node, property, &len);
 	if (!data) {
-		pr_err("Unable to read Phy %s settings\n", property);
+		DSI_ERR("Unable to read Phy %s settings\n", property);
 		return -EINVAL;
 	}
 
 	if (len != DSI_LANE_MAX * cfg->count_per_lane) {
-		pr_err("incorrect phy %s settings, exp=%d, act=%d\n",
+		DSI_ERR("incorrect phy %s settings, exp=%d, act=%d\n",
 		       property, (DSI_LANE_MAX * cfg->count_per_lane), len);
 		return -EINVAL;
 	}
@@ -295,7 +293,7 @@ static int dsi_phy_settings_init(struct platform_device *pdev,
 	rc = dsi_phy_parse_dt_per_lane_cfgs(pdev, lane,
 					    "qcom,platform-lane-config");
 	if (rc) {
-		pr_err("failed to parse lane cfgs, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "failed to parse lane cfgs, rc=%d\n", rc);
 		goto err;
 	}
 
@@ -303,7 +301,7 @@ static int dsi_phy_settings_init(struct platform_device *pdev,
 	rc = dsi_phy_parse_dt_per_lane_cfgs(pdev, strength,
 					    "qcom,platform-strength-ctrl");
 	if (rc) {
-		pr_err("failed to parse lane cfgs, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "failed to parse lane cfgs, rc=%d\n", rc);
 		goto err;
 	}
 
@@ -312,7 +310,8 @@ static int dsi_phy_settings_init(struct platform_device *pdev,
 		rc = dsi_phy_parse_dt_per_lane_cfgs(pdev, regs,
 					    "qcom,platform-regulator-settings");
 		if (rc) {
-			pr_err("failed to parse lane cfgs, rc=%d\n", rc);
+			DSI_PHY_ERR(phy, "failed to parse lane cfgs, rc=%d\n",
+					rc);
 			goto err;
 		}
 	}
@@ -358,7 +357,7 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
 	u32 index = 0;
 
 	if (!pdev || !pdev->dev.of_node) {
-		pr_err("pdev not found\n");
+		DSI_ERR("pdev not found\n");
 		return -ENODEV;
 	}
 
@@ -381,7 +380,7 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
 
 	rc = of_property_read_u32(pdev->dev.of_node, "cell-index", &index);
 	if (rc) {
-		pr_debug("cell index not set, default to 0\n");
+		DSI_PHY_DBG(dsi_phy, "cell index not set, default to 0\n");
 		index = 0;
 	}
 
@@ -391,33 +390,36 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
 	if (!dsi_phy->name)
 		dsi_phy->name = DSI_PHY_DEFAULT_LABEL;
 
-	pr_debug("Probing %s device\n", dsi_phy->name);
+	DSI_PHY_DBG(dsi_phy, "Probing device\n");
 
 	dsi_phy->ver_info = ver_info;
 
 	rc = dsi_phy_regmap_init(pdev, dsi_phy);
 	if (rc) {
-		pr_err("Failed to parse register information, rc=%d\n", rc);
+		DSI_PHY_ERR(dsi_phy, "Failed to parse register information, rc=%d\n",
+				rc);
 		goto fail;
 	}
 
 	rc = dsi_phy_supplies_init(pdev, dsi_phy);
 	if (rc) {
-		pr_err("failed to parse voltage supplies, rc = %d\n", rc);
+		DSI_PHY_ERR(dsi_phy, "failed to parse voltage supplies, rc = %d\n",
+				rc);
 		goto fail_regmap;
 	}
 
 	rc = dsi_catalog_phy_setup(&dsi_phy->hw, ver_info->version,
 				   dsi_phy->index);
 	if (rc) {
-		pr_err("Catalog does not support version (%d)\n",
+		DSI_PHY_ERR(dsi_phy, "Catalog does not support version (%d)\n",
 		       ver_info->version);
 		goto fail_supplies;
 	}
 
 	rc = dsi_phy_settings_init(pdev, dsi_phy);
 	if (rc) {
-		pr_err("Failed to parse phy setting, rc=%d\n", rc);
+		DSI_PHY_ERR(dsi_phy, "Failed to parse phy setting, rc=%d\n",
+				rc);
 		goto fail_supplies;
 	}
 
@@ -431,7 +433,7 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
 	/** TODO: initialize debugfs */
 	dsi_phy->pdev = pdev;
 	platform_set_drvdata(pdev, dsi_phy);
-	pr_info("Probe successful for %s\n", dsi_phy->name);
+	DSI_PHY_INFO(dsi_phy, "Probe successful\n");
 	return 0;
 
 fail_supplies:
@@ -451,7 +453,7 @@ static int dsi_phy_driver_remove(struct platform_device *pdev)
 	struct list_head *pos, *tmp;
 
 	if (!pdev || !phy) {
-		pr_err("Invalid device\n");
+		DSI_PHY_ERR(phy, "Invalid device\n");
 		return -EINVAL;
 	}
 
@@ -471,15 +473,17 @@ static int dsi_phy_driver_remove(struct platform_device *pdev)
 	mutex_lock(&phy->phy_lock);
 	rc = dsi_phy_settings_deinit(phy);
 	if (rc)
-		pr_err("failed to deinitialize phy settings, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "failed to deinitialize phy settings, rc=%d\n",
+				rc);
 
 	rc = dsi_phy_supplies_deinit(phy);
 	if (rc)
-		pr_err("failed to deinitialize voltage supplies, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "failed to deinitialize voltage supplies, rc=%d\n",
+				rc);
 
 	rc = dsi_phy_regmap_deinit(phy);
 	if (rc)
-		pr_err("failed to deinitialize regmap, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "failed to deinitialize regmap, rc=%d\n", rc);
 	mutex_unlock(&phy->phy_lock);
 
 	mutex_destroy(&phy->phy_lock);
@@ -545,14 +549,14 @@ struct msm_dsi_phy *dsi_phy_get(struct device_node *of_node)
 	mutex_unlock(&dsi_phy_list_lock);
 
 	if (!phy) {
-		pr_err("Device with of node not found\n");
+		DSI_PHY_ERR(phy, "Device with of node not found\n");
 		phy = ERR_PTR(-EPROBE_DEFER);
 		return phy;
 	}
 
 	mutex_lock(&phy->phy_lock);
 	if (phy->refcount > 0) {
-		pr_err("[PHY_%d] Device under use\n", phy->index);
+		DSI_PHY_ERR(phy, "Device under use\n");
 		phy = ERR_PTR(-EINVAL);
 	} else {
 		phy->refcount++;
@@ -573,7 +577,7 @@ void dsi_phy_put(struct msm_dsi_phy *dsi_phy)
 	mutex_lock(&dsi_phy->phy_lock);
 
 	if (dsi_phy->refcount == 0)
-		pr_err("Unbalanced %s call\n", __func__);
+		DSI_PHY_ERR(dsi_phy, "Unbalanced %s call\n", __func__);
 	else
 		dsi_phy->refcount--;
 
@@ -615,7 +619,7 @@ int dsi_phy_clk_cb_register(struct msm_dsi_phy *dsi_phy,
 	struct clk_ctrl_cb *clk_cb)
 {
 	if (!dsi_phy || !clk_cb) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(dsi_phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
@@ -640,11 +644,11 @@ int dsi_phy_validate_mode(struct msm_dsi_phy *dsi_phy,
 	int rc = 0;
 
 	if (!dsi_phy || !mode) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(dsi_phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
-	pr_debug("[PHY_%d] Skipping validation\n", dsi_phy->index);
+	DSI_PHY_DBG(dsi_phy, "Skipping validation\n");
 
 	return rc;
 }
@@ -661,21 +665,21 @@ int dsi_phy_set_power_state(struct msm_dsi_phy *dsi_phy, bool enable)
 	int rc = 0;
 
 	if (!dsi_phy) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(dsi_phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
 	mutex_lock(&dsi_phy->phy_lock);
 
 	if (enable == dsi_phy->power_state) {
-		pr_err("[PHY_%d] No state change\n", dsi_phy->index);
+		DSI_PHY_ERR(dsi_phy, "No state change\n");
 		goto error;
 	}
 
 	if (enable) {
 		rc = dsi_pwr_enable_regulator(&dsi_phy->pwr_info.digital, true);
 		if (rc) {
-			pr_err("failed to enable digital regulator\n");
+			DSI_PHY_ERR(dsi_phy, "failed to enable digital regulator\n");
 			goto error;
 		}
 
@@ -684,7 +688,7 @@ int dsi_phy_set_power_state(struct msm_dsi_phy *dsi_phy, bool enable)
 			rc = dsi_pwr_enable_regulator(
 				&dsi_phy->pwr_info.phy_pwr, true);
 			if (rc) {
-				pr_err("failed to enable phy power\n");
+				DSI_PHY_ERR(dsi_phy, "failed to enable phy power\n");
 				(void)dsi_pwr_enable_regulator(
 					&dsi_phy->pwr_info.digital, false);
 				goto error;
@@ -696,7 +700,7 @@ int dsi_phy_set_power_state(struct msm_dsi_phy *dsi_phy, bool enable)
 			rc = dsi_pwr_enable_regulator(
 				&dsi_phy->pwr_info.phy_pwr, false);
 			if (rc) {
-				pr_err("failed to enable digital regulator\n");
+				DSI_PHY_ERR(dsi_phy, "failed to enable digital regulator\n");
 				goto error;
 			}
 		}
@@ -704,7 +708,7 @@ int dsi_phy_set_power_state(struct msm_dsi_phy *dsi_phy, bool enable)
 		rc = dsi_pwr_enable_regulator(&dsi_phy->pwr_info.digital,
 					      false);
 		if (rc) {
-			pr_err("failed to enable phy power\n");
+			DSI_PHY_ERR(dsi_phy, "failed to enable phy power\n");
 			goto error;
 		}
 	}
@@ -734,7 +738,7 @@ static int dsi_phy_enable_ulps(struct msm_dsi_phy *phy,
 	if (!clamp_enabled) {
 		rc = phy->hw.ops.ulps_ops.wait_for_lane_idle(&phy->hw, lanes);
 		if (rc) {
-			pr_err("lanes not entering idle, skip ULPS\n");
+			DSI_PHY_ERR(phy, "lanes not entering idle, skip ULPS\n");
 			return rc;
 		}
 	}
@@ -744,7 +748,7 @@ static int dsi_phy_enable_ulps(struct msm_dsi_phy *phy,
 	ulps_lanes = phy->hw.ops.ulps_ops.get_lanes_in_ulps(&phy->hw);
 
 	if (!phy->hw.ops.ulps_ops.is_lanes_in_ulps(lanes, ulps_lanes)) {
-		pr_err("Failed to enter ULPS, request=0x%x, actual=0x%x\n",
+		DSI_PHY_ERR(phy, "Failed to enter ULPS, request=0x%x, actual=0x%x\n",
 		       lanes, ulps_lanes);
 		rc = -EIO;
 	}
@@ -763,7 +767,7 @@ static int dsi_phy_disable_ulps(struct msm_dsi_phy *phy,
 	ulps_lanes = phy->hw.ops.ulps_ops.get_lanes_in_ulps(&phy->hw);
 
 	if (!phy->hw.ops.ulps_ops.is_lanes_in_ulps(lanes, ulps_lanes)) {
-		pr_err("Mismatch in ULPS: lanes:%d, ulps_lanes:%d\n",
+		DSI_PHY_ERR(phy, "Mismatch in ULPS: lanes:%d, ulps_lanes:%d\n",
 				lanes, ulps_lanes);
 		return -EIO;
 	}
@@ -773,7 +777,7 @@ static int dsi_phy_disable_ulps(struct msm_dsi_phy *phy,
 	ulps_lanes = phy->hw.ops.ulps_ops.get_lanes_in_ulps(&phy->hw);
 
 	if (phy->hw.ops.ulps_ops.is_lanes_in_ulps(lanes, ulps_lanes)) {
-		pr_err("Lanes (0x%x) stuck in ULPS\n", ulps_lanes);
+		DSI_PHY_ERR(phy, "Lanes (0x%x) stuck in ULPS\n", ulps_lanes);
 		return -EIO;
 	}
 
@@ -809,7 +813,7 @@ int dsi_phy_set_ulps(struct msm_dsi_phy *phy, struct dsi_host_config *config,
 	int rc = 0;
 
 	if (!phy) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(phy, "Invalid params\n");
 		return DSI_PHY_ULPS_ERROR;
 	}
 
@@ -818,7 +822,7 @@ int dsi_phy_set_ulps(struct msm_dsi_phy *phy, struct dsi_host_config *config,
 			!phy->hw.ops.ulps_ops.get_lanes_in_ulps ||
 			!phy->hw.ops.ulps_ops.is_lanes_in_ulps ||
 			!phy->hw.ops.ulps_ops.wait_for_lane_idle) {
-		pr_debug("DSI PHY ULPS ops not present\n");
+		DSI_PHY_DBG(phy, "DSI PHY ULPS ops not present\n");
 		return DSI_PHY_ULPS_NOT_HANDLED;
 	}
 
@@ -830,12 +834,12 @@ int dsi_phy_set_ulps(struct msm_dsi_phy *phy, struct dsi_host_config *config,
 		rc = dsi_phy_disable_ulps(phy, config);
 
 	if (rc) {
-		pr_err("[DSI_PHY%d] Ulps state change(%d) failed, rc=%d\n",
-			phy->index, enable, rc);
+		DSI_PHY_ERR(phy, "Ulps state change(%d) failed, rc=%d\n",
+			enable, rc);
 		rc = DSI_PHY_ULPS_ERROR;
 		goto error;
 	}
-	pr_debug("[DSI_PHY%d] ULPS state = %d\n", phy->index, enable);
+	DSI_PHY_DBG(phy, "ULPS state = %d\n", enable);
 
 error:
 	mutex_unlock(&phy->phy_lock);
@@ -863,14 +867,14 @@ int dsi_phy_enable(struct msm_dsi_phy *phy,
 	int rc = 0;
 
 	if (!phy || !config) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
 	mutex_lock(&phy->phy_lock);
 
 	if (!skip_validation)
-		pr_debug("[PHY_%d] TODO: perform validation\n", phy->index);
+		DSI_PHY_DBG(phy, "TODO: perform validation\n");
 
 	memcpy(&phy->mode, &config->video_timing, sizeof(phy->mode));
 	memcpy(&phy->cfg.lane_map, &config->lane_map, sizeof(config->lane_map));
@@ -889,13 +893,13 @@ int dsi_phy_enable(struct msm_dsi_phy *phy,
 						 &config->common_config,
 						 &phy->cfg.timing, false);
 	if (rc) {
-		pr_err("[%s] failed to set timing, rc=%d\n", phy->name, rc);
+		DSI_PHY_ERR(phy, "failed to set timing, rc=%d\n", rc);
 		goto error;
 	}
 
 	if (!is_cont_splash_enabled) {
 		dsi_phy_enable_hw(phy);
-		pr_debug("cont splash not enabled, phy enable required\n");
+		DSI_PHY_DBG(phy, "cont splash not enabled, phy enable required\n");
 	}
 	phy->dsi_phy_state = DSI_PHY_ENGINE_ON;
 
@@ -912,7 +916,7 @@ int dsi_phy_update_phy_timings(struct msm_dsi_phy *phy,
 	int rc = 0;
 
 	if (!phy || !config) {
-		pr_err("invalid argument\n");
+		DSI_PHY_ERR(phy, "invalid argument\n");
 		return -EINVAL;
 	}
 
@@ -921,7 +925,7 @@ int dsi_phy_update_phy_timings(struct msm_dsi_phy *phy,
 						 &config->common_config,
 						 &phy->cfg.timing, true);
 	if (rc)
-		pr_err("failed to calculate phy timings %d\n", rc);
+		DSI_PHY_ERR(phy, "failed to calculate phy timings %d\n", rc);
 
 	return rc;
 }
@@ -952,7 +956,7 @@ int dsi_phy_disable(struct msm_dsi_phy *phy)
 	int rc = 0;
 
 	if (!phy) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
@@ -976,7 +980,7 @@ int dsi_phy_set_clamp_state(struct msm_dsi_phy *phy, bool enable)
 	if (!phy)
 		return -EINVAL;
 
-	pr_debug("[%s] enable=%d\n", phy->name, enable);
+	DSI_PHY_DBG(phy, "enable=%d\n", enable);
 
 	if (phy->hw.ops.clamp_ctrl)
 		phy->hw.ops.clamp_ctrl(&phy->hw, enable);
@@ -995,11 +999,11 @@ int dsi_phy_set_clamp_state(struct msm_dsi_phy *phy, bool enable)
 int dsi_phy_idle_ctrl(struct msm_dsi_phy *phy, bool enable)
 {
 	if (!phy) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
-	pr_debug("[%s] enable=%d\n", phy->name, enable);
+	DSI_PHY_DBG(phy, "enable=%d\n", enable);
 
 	mutex_lock(&phy->phy_lock);
 	if (enable) {
@@ -1039,7 +1043,7 @@ int dsi_phy_set_clk_freq(struct msm_dsi_phy *phy,
 		struct link_clk_freq *clk_freq)
 {
 	if (!phy || !clk_freq) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
@@ -1054,8 +1058,7 @@ int dsi_phy_set_clk_freq(struct msm_dsi_phy *phy,
 	 * votes go through RPM to enable regulators.
 	 */
 	phy->regulator_required = true;
-	pr_debug("[%s] lane_datarate=%u min_datarate=%u required=%d\n",
-			phy->name,
+	DSI_PHY_DBG(phy, "lane_datarate=%u min_datarate=%u required=%d\n",
 			clk_freq->byte_clk_rate * BITS_PER_BYTE,
 			phy->regulator_min_datarate_bps,
 			phy->regulator_required);
@@ -1080,7 +1083,7 @@ int dsi_phy_set_timing_params(struct msm_dsi_phy *phy,
 	int rc = 0;
 
 	if (!phy || !timing || !size) {
-		pr_err("Invalid params\n");
+		DSI_PHY_ERR(phy, "Invalid params\n");
 		return -EINVAL;
 	}
 
@@ -1216,7 +1219,7 @@ int dsi_phy_dyn_refresh_cache_phy_timings(struct msm_dsi_phy *phy, u32 *dst,
 				&phy->cfg.timing, dst, size);
 
 	if (rc)
-		pr_err("failed to cache phy timings %d\n", rc);
+		DSI_PHY_ERR(phy, "failed to cache phy timings %d\n", rc);
 
 	return rc;
 }
@@ -1253,7 +1256,7 @@ void dsi_phy_set_continuous_clk(struct msm_dsi_phy *phy, bool enable)
 	if (phy->hw.ops.set_continuous_clk)
 		phy->hw.ops.set_continuous_clk(&phy->hw, enable);
 	else
-		pr_warn("set_continuous_clk ops not present\n");
+		DSI_PHY_WARN(phy, "set_continuous_clk ops not present\n");
 
 	mutex_unlock(&phy->phy_lock);
 

+ 9 - 0
msm/dsi/dsi_phy_hw.h

@@ -12,6 +12,15 @@
 #define DSI_PHY_TIMING_V3_SIZE 12
 #define DSI_PHY_TIMING_V4_SIZE 14
 
+#define DSI_PHY_DBG(p, fmt, ...)	DRM_DEV_DEBUG(NULL, "[msm-dsi-debug]: DSI_%d: "\
+		fmt, p ? p->index : -1, ##__VA_ARGS__)
+#define DSI_PHY_ERR(p, fmt, ...)	DRM_DEV_ERROR(NULL, "[msm-dsi-error]: DSI_%d: "\
+		fmt, p ? p->index : -1, ##__VA_ARGS__)
+#define DSI_PHY_INFO(p, fmt, ...)	DRM_DEV_INFO(NULL, "[msm-dsi-info]: DSI_%d: "\
+		fmt, p ? p->index : -1, ##__VA_ARGS__)
+#define DSI_PHY_WARN(p, fmt, ...)	DRM_WARN("[msm-dsi-warn]: DSI_%d: " fmt,\
+		p ? p->index : -1, ##__VA_ARGS__)
+
 /**
  * enum dsi_phy_version - DSI PHY version enumeration
  * @DSI_PHY_VERSION_UNKNOWN:    Unknown version.

+ 10 - 11
msm/dsi/dsi_phy_hw_v2_0.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-phy-hw:" fmt
 #include <linux/math64.h>
 #include <linux/delay.h>
 #include "dsi_hw.h"
@@ -86,7 +85,7 @@ void dsi_phy_hw_v2_0_regulator_enable(struct dsi_phy_hw *phy,
 	/* make sure all values are written to hardware */
 	wmb();
 
-	pr_debug("[DSI_%d] Phy regulators enabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy regulators enabled\n");
 }
 
 /**
@@ -95,7 +94,7 @@ void dsi_phy_hw_v2_0_regulator_enable(struct dsi_phy_hw *phy,
  */
 void dsi_phy_hw_v2_0_regulator_disable(struct dsi_phy_hw *phy)
 {
-	pr_debug("[DSI_%d] Phy regulators disabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy regulators disabled\n");
 }
 
 /**
@@ -190,7 +189,7 @@ void dsi_phy_hw_v2_0_enable(struct dsi_phy_hw *phy,
 	if (cfg->pll_source == DSI_PLL_SOURCE_NON_NATIVE)
 		DSI_W32(phy, DSIPHY_PLL_PLL_BANDGAP, 0x3);
 
-	pr_debug("[DSI_%d]Phy enabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy enabled\n");
 }
 
 /**
@@ -203,7 +202,7 @@ void dsi_phy_hw_v2_0_disable(struct dsi_phy_hw *phy,
 	DSI_W32(phy, DSIPHY_PLL_CLKBUFLR_EN, 0);
 	DSI_W32(phy, DSIPHY_CMN_GLBL_TEST_CTRL, 0);
 	DSI_W32(phy, DSIPHY_CMN_CTRL_0, 0);
-	pr_debug("[DSI_%d]Phy disabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy disabled\n");
 }
 
 /**
@@ -228,7 +227,7 @@ void dsi_phy_hw_v2_0_idle_on(struct dsi_phy_hw *phy, struct dsi_phy_cfg *cfg)
 				strength->lane[i][j]);
 	}
 	wmb(); /* make sure write happens */
-	pr_debug("[DSI_%d]Phy enabled out of idle screen\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy enabled out of idle screen\n");
 }
 
 
@@ -257,7 +256,7 @@ void dsi_phy_hw_v2_0_idle_off(struct dsi_phy_hw *phy)
 		DSIPHY_DLNX_STRENGTH_CTRL(DSI_LOGICAL_CLOCK_LANE+1, 1), 0x0);
 
 	wmb(); /* make sure write happens */
-	pr_debug("[DSI_%d]Phy disabled during idle screen\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy disabled during idle screen\n");
 }
 
 int dsi_phy_hw_timing_val_v2_0(struct dsi_phy_per_lane_cfgs *timing_cfg,
@@ -266,7 +265,7 @@ int dsi_phy_hw_timing_val_v2_0(struct dsi_phy_per_lane_cfgs *timing_cfg,
 	int i = 0, j = 0;
 
 	if (size != (DSI_LANE_MAX * DSI_MAX_SETTINGS)) {
-		pr_err("Unexpected timing array size %d\n", size);
+		DSI_ERR("Unexpected timing array size %d\n", size);
 		return -EINVAL;
 	}
 
@@ -284,7 +283,7 @@ void dsi_phy_hw_v2_0_clamp_ctrl(struct dsi_phy_hw *phy, bool enable)
 	u32 clamp_reg = 0;
 
 	if (!phy->phy_clamp_base) {
-		pr_debug("phy_clamp_base NULL\n");
+		DSI_PHY_DBG(phy, "phy_clamp_base NULL\n");
 		return;
 	}
 
@@ -292,11 +291,11 @@ void dsi_phy_hw_v2_0_clamp_ctrl(struct dsi_phy_hw *phy, bool enable)
 		clamp_reg |= BIT(0);
 		DSI_MISC_W32(phy, DSI_MDP_ULPS_CLAMP_ENABLE_OFF,
 				clamp_reg);
-		pr_debug("clamp enabled\n");
+		DSI_PHY_DBG(phy, "clamp enabled\n");
 	} else {
 		clamp_reg &= ~BIT(0);
 		DSI_MISC_W32(phy, DSI_MDP_ULPS_CLAMP_ENABLE_OFF,
 				clamp_reg);
-		pr_debug("clamp disabled\n");
+		DSI_PHY_DBG(phy, "clamp disabled\n");
 	}
 }

+ 18 - 20
msm/dsi/dsi_phy_hw_v3_0.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-phy-hw:" fmt
 #include <linux/math64.h>
 #include <linux/delay.h>
 #include <linux/iopoll.h>
@@ -107,7 +106,7 @@
 void dsi_phy_hw_v3_0_regulator_enable(struct dsi_phy_hw *phy,
 				      struct dsi_phy_per_lane_cfgs *reg_cfg)
 {
-	pr_debug("[DSI_%d] Phy regulators enabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy regulators enabled\n");
 	/* Nothing to be done for DSI PHY regulator enable */
 }
 
@@ -117,7 +116,7 @@ void dsi_phy_hw_v3_0_regulator_enable(struct dsi_phy_hw *phy,
  */
 void dsi_phy_hw_v3_0_regulator_disable(struct dsi_phy_hw *phy)
 {
-	pr_debug("[DSI_%d] Phy regulators disabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy regulators disabled\n");
 	/* Nothing to be done for DSI PHY regulator disable */
 }
 
@@ -205,7 +204,7 @@ void dsi_phy_hw_v3_0_clamp_ctrl(struct dsi_phy_hw *phy, bool enable)
 {
 	u32 reg;
 
-	pr_debug("enable=%s\n", enable ? "true" : "false");
+	DSI_PHY_DBG(phy, "enable=%s\n", enable ? "true" : "false");
 
 	/*
 	 * DSI PHY lane clamps, also referred to as PHY FreezeIO is
@@ -243,13 +242,13 @@ void dsi_phy_hw_v3_0_enable(struct dsi_phy_hw *phy,
 	u32 data;
 
 	if (dsi_phy_hw_v3_0_is_pll_on(phy))
-		pr_warn("PLL turned on before configuring PHY\n");
+		DSI_PHY_WARN(phy, "PLL turned on before configuring PHY\n");
 
 	/* wait for REFGEN READY */
 	rc = readl_poll_timeout_atomic(phy->base + DSIPHY_CMN_PHY_STATUS,
 		status, (status & BIT(0)), delay_us, timeout_us);
 	if (rc) {
-		pr_err("Ref gen not ready. Aborting\n");
+		DSI_PHY_ERR(phy, "Ref gen not ready. Aborting\n");
 		return;
 	}
 
@@ -315,7 +314,7 @@ void dsi_phy_hw_v3_0_enable(struct dsi_phy_hw *phy,
 	/* DSI lane settings */
 	dsi_phy_hw_v3_0_lane_settings(phy, cfg);
 
-	pr_debug("[DSI_%d]Phy enabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy enabled\n");
 }
 
 /**
@@ -328,7 +327,7 @@ void dsi_phy_hw_v3_0_disable(struct dsi_phy_hw *phy,
 	u32 data = 0;
 
 	if (dsi_phy_hw_v3_0_is_pll_on(phy))
-		pr_warn("Turning OFF PHY while PLL is on\n");
+		DSI_PHY_WARN(phy, "Turning OFF PHY while PLL is on\n");
 
 	dsi_phy_hw_v3_0_config_lpcdrx(phy, cfg, false);
 
@@ -342,7 +341,7 @@ void dsi_phy_hw_v3_0_disable(struct dsi_phy_hw *phy,
 	DSI_W32(phy, DSIPHY_CMN_CTRL_0, 0x00);
 	/* make sure phy is turned off */
 	wmb();
-	pr_debug("[DSI_%d]Phy disabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy disabled\n");
 }
 
 int dsi_phy_hw_v3_0_wait_for_lane_idle(
@@ -363,14 +362,14 @@ int dsi_phy_hw_v3_0_wait_for_lane_idle(
 	if (lanes & DSI_DATA_LANE_3)
 		stop_state_mask |= BIT(3);
 
-	pr_debug("%s: polling for lanes to be in stop state, mask=0x%08x\n",
-		__func__, stop_state_mask);
+	DSI_PHY_DBG(phy, "polling for lanes to be in stop state, mask=0x%08x\n",
+		stop_state_mask);
 	rc = readl_poll_timeout(phy->base + DSIPHY_CMN_LANE_STATUS1, val,
 				((val & stop_state_mask) == stop_state_mask),
 				sleep_us, timeout_us);
 	if (rc) {
-		pr_err("%s: lanes not in stop state, LANE_STATUS=0x%08x\n",
-			__func__, val);
+		DSI_PHY_ERR(phy, "lanes not in stop state, LANE_STATUS=0x%08x\n",
+			val);
 		return rc;
 	}
 
@@ -404,8 +403,7 @@ void dsi_phy_hw_v3_0_ulps_request(struct dsi_phy_hw *phy,
 	dsi_phy_hw_v3_0_config_lpcdrx(phy, cfg, false);
 	/* disable lane LDOs */
 	DSI_W32(phy, DSIPHY_CMN_VREG_CTRL, 0x19);
-	pr_debug("[DSI_PHY%d] ULPS requested for lanes 0x%x\n", phy->index,
-		 lanes);
+	DSI_PHY_DBG(phy, "ULPS requested for lanes 0x%x\n", lanes);
 }
 
 int dsi_phy_hw_v3_0_lane_reset(struct dsi_phy_hw *phy)
@@ -419,11 +417,11 @@ int dsi_phy_hw_v3_0_lane_reset(struct dsi_phy_hw *phy)
 		loop--;
 		udelay(u_dly);
 		ln_status = DSI_R32(phy, DSIPHY_CMN_LANE_STATUS1);
-		pr_debug("trial no: %d\n", loop);
+		DSI_PHY_DBG(phy, "trial no: %d\n", loop);
 	}
 
 	if (!loop)
-		pr_debug("could not reset phy lanes\n");
+		DSI_PHY_DBG(phy, "could not reset phy lanes\n");
 
 	DSI_W32(phy, DSIPHY_CMN_LANE_CTRL3, 0x0);
 	wmb(); /* ensure register is committed */
@@ -477,7 +475,7 @@ u32 dsi_phy_hw_v3_0_get_lanes_in_ulps(struct dsi_phy_hw *phy)
 	u32 lanes = 0;
 
 	lanes = DSI_R32(phy, DSIPHY_CMN_LANE_STATUS0);
-	pr_debug("[DSI_PHY%d] lanes in ulps = 0x%x\n", phy->index, lanes);
+	DSI_PHY_DBG(phy, "lanes in ulps = 0x%x\n", lanes);
 	return lanes;
 }
 
@@ -495,7 +493,7 @@ int dsi_phy_hw_timing_val_v3_0(struct dsi_phy_per_lane_cfgs *timing_cfg,
 	int i = 0;
 
 	if (size != DSI_PHY_TIMING_V3_SIZE) {
-		pr_err("Unexpected timing array size %d\n", size);
+		DSI_ERR("Unexpected timing array size %d\n", size);
 		return -EINVAL;
 	}
 
@@ -654,7 +652,7 @@ int dsi_phy_hw_v3_0_cache_phy_timings(struct dsi_phy_per_lane_cfgs *timings,
 		return -EINVAL;
 
 	if (size != DSI_PHY_TIMING_V3_SIZE) {
-		pr_err("size mis-match\n");
+		DSI_ERR("size mis-match\n");
 		return -EINVAL;
 	}
 

+ 15 - 17
msm/dsi/dsi_phy_hw_v4_0.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-phy-hw-v4: %s:" fmt, __func__
 #include <linux/math64.h>
 #include <linux/delay.h>
 #include <linux/iopoll.h>
@@ -208,13 +207,13 @@ void dsi_phy_hw_v4_0_enable(struct dsi_phy_hw *phy,
 	u32 glbl_rescode_bot_ctrl = 0;
 
 	if (dsi_phy_hw_v4_0_is_pll_on(phy))
-		pr_warn("PLL turned on before configuring PHY\n");
+		DSI_PHY_WARN(phy, "PLL turned on before configuring PHY\n");
 
 	/* wait for REFGEN READY */
 	rc = readl_poll_timeout_atomic(phy->base + DSIPHY_CMN_PHY_STATUS,
 		status, (status & BIT(0)), delay_us, timeout_us);
 	if (rc) {
-		pr_err("Ref gen not ready. Aborting\n");
+		DSI_PHY_ERR(phy, "Ref gen not ready. Aborting\n");
 		return;
 	}
 
@@ -309,7 +308,7 @@ void dsi_phy_hw_v4_0_enable(struct dsi_phy_hw *phy,
 	/* DSI lane settings */
 	dsi_phy_hw_v4_0_lane_settings(phy, cfg);
 
-	pr_debug("[DSI_%d]Phy enabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy enabled\n");
 }
 
 /**
@@ -322,7 +321,7 @@ void dsi_phy_hw_v4_0_disable(struct dsi_phy_hw *phy,
 	u32 data = 0;
 
 	if (dsi_phy_hw_v4_0_is_pll_on(phy))
-		pr_warn("Turning OFF PHY while PLL is on\n");
+		DSI_PHY_WARN(phy, "Turning OFF PHY while PLL is on\n");
 
 	dsi_phy_hw_v4_0_config_lpcdrx(phy, cfg, false);
 
@@ -336,7 +335,7 @@ void dsi_phy_hw_v4_0_disable(struct dsi_phy_hw *phy,
 	DSI_W32(phy, DSIPHY_CMN_CTRL_0, 0x00);
 	/* make sure phy is turned off */
 	wmb();
-	pr_debug("[DSI_%d]Phy disabled\n", phy->index);
+	DSI_PHY_DBG(phy, "Phy disabled\n");
 }
 
 void dsi_phy_hw_v4_0_toggle_resync_fifo(struct dsi_phy_hw *phy)
@@ -379,14 +378,14 @@ int dsi_phy_hw_v4_0_wait_for_lane_idle(
 	if (lanes & DSI_DATA_LANE_3)
 		stop_state_mask |= BIT(3);
 
-	pr_debug("%s: polling for lanes to be in stop state, mask=0x%08x\n",
-		__func__, stop_state_mask);
+	DSI_PHY_DBG(phy, "polling for lanes to be in stop state, mask=0x%08x\n",
+		stop_state_mask);
 	rc = readl_poll_timeout(phy->base + DSIPHY_CMN_LANE_STATUS1, val,
 				((val & stop_state_mask) == stop_state_mask),
 				sleep_us, timeout_us);
 	if (rc) {
-		pr_err("%s: lanes not in stop state, LANE_STATUS=0x%08x\n",
-			__func__, val);
+		DSI_PHY_ERR(phy, "lanes not in stop state, LANE_STATUS=0x%08x\n",
+			val);
 		return rc;
 	}
 
@@ -422,8 +421,7 @@ void dsi_phy_hw_v4_0_ulps_request(struct dsi_phy_hw *phy,
 	/* disable LPRX and CDRX */
 	dsi_phy_hw_v4_0_config_lpcdrx(phy, cfg, false);
 
-	pr_debug("[DSI_PHY%d] ULPS requested for lanes 0x%x\n", phy->index,
-		 lanes);
+	DSI_PHY_DBG(phy, "ULPS requested for lanes 0x%x\n", lanes);
 }
 
 int dsi_phy_hw_v4_0_lane_reset(struct dsi_phy_hw *phy)
@@ -437,11 +435,11 @@ int dsi_phy_hw_v4_0_lane_reset(struct dsi_phy_hw *phy)
 		loop--;
 		udelay(u_dly);
 		ln_status = DSI_R32(phy, DSIPHY_CMN_LANE_STATUS1);
-		pr_debug("trial no: %d\n", loop);
+		DSI_PHY_DBG(phy, "trial no: %d\n", loop);
 	}
 
 	if (!loop)
-		pr_debug("could not reset phy lanes\n");
+		DSI_PHY_DBG(phy, "could not reset phy lanes\n");
 
 	DSI_W32(phy, DSIPHY_CMN_LANE_CTRL3, 0x0);
 	wmb(); /* ensure register is committed */
@@ -498,7 +496,7 @@ u32 dsi_phy_hw_v4_0_get_lanes_in_ulps(struct dsi_phy_hw *phy)
 	u32 lanes = 0;
 
 	lanes = DSI_R32(phy, DSIPHY_CMN_LANE_STATUS0);
-	pr_debug("[DSI_PHY%d] lanes in ulps = 0x%x\n", phy->index, lanes);
+	DSI_PHY_DBG(phy, "lanes in ulps = 0x%x\n", lanes);
 	return lanes;
 }
 
@@ -516,7 +514,7 @@ int dsi_phy_hw_timing_val_v4_0(struct dsi_phy_per_lane_cfgs *timing_cfg,
 	int i = 0;
 
 	if (size != DSI_PHY_TIMING_V4_SIZE) {
-		pr_err("Unexpected timing array size %d\n", size);
+		DSI_ERR("Unexpected timing array size %d\n", size);
 		return -EINVAL;
 	}
 
@@ -677,7 +675,7 @@ int dsi_phy_hw_v4_0_cache_phy_timings(struct dsi_phy_per_lane_cfgs *timings,
 		return -EINVAL;
 
 	if (size != DSI_PHY_TIMING_V4_SIZE) {
-		pr_err("size mis-match\n");
+		DSI_ERR("size mis-match\n");
 		return -EINVAL;
 	}
 

+ 30 - 29
msm/dsi/dsi_phy_timing_calc.c

@@ -3,8 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-phy-timing:" fmt
-
 #include "dsi_phy_timing_calc.h"
 
 static const u32 bits_per_pixel[DSI_PIXEL_FORMAT_MAX] = {
@@ -15,7 +13,7 @@ static int dsi_phy_cmn_validate_and_set(struct timing_entry *t,
 {
 	if (t->rec & 0xffffff00) {
 		/* Output value can only be 8 bits */
-		pr_err("Incorrect %s rec value - %d\n", t_name, t->rec);
+		DSI_ERR("Incorrect %s rec value - %d\n", t_name, t->rec);
 		return -EINVAL;
 	}
 	t->reg_value = t->rec;
@@ -56,9 +54,10 @@ static int calc_clk_prepare(struct dsi_phy_hw *phy,
 	div_s64_rem(temp_multiple, clk_params->bitclk_mbps, &frac);
 	clk_prep_actual = div_s64((intermediate + frac), multiplier);
 
-	pr_debug("CLK_PREPARE:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d\n",
+	DSI_PHY_DBG(phy, "CLK_PREPARE:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max);
-	pr_debug(" reg_value=%d, actual=%lld\n", t->reg_value, clk_prep_actual);
+	DSI_PHY_DBG(phy, " reg_value=%d, actual=%lld\n", t->reg_value,
+			clk_prep_actual);
 
 	*actual_frac = frac;
 	*actual_intermediate = intermediate;
@@ -103,7 +102,7 @@ static int calc_clk_zero(struct dsi_phy_hw *phy,
 		goto error;
 
 
-	pr_debug("CLK_ZERO:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "CLK_ZERO:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 error:
@@ -171,7 +170,7 @@ static int calc_clk_trail(struct dsi_phy_hw *phy,
 		goto error;
 
 	*teot_clk_lane = teot_clk_lane1;
-	pr_debug("CLK_TRAIL:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "CLK_TRAIL:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 
@@ -243,7 +242,7 @@ static int calc_hs_prepare(struct dsi_phy_hw *phy,
 			clk_params->bitclk_mbps);
 
 	*temp_mul = temp_multiple;
-	pr_debug("HS_PREP:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "HS_PREP:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 error:
@@ -290,7 +289,7 @@ static int calc_hs_zero(struct dsi_phy_hw *phy,
 	if (rc)
 		goto error;
 
-	pr_debug("HS_ZERO:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "HS_ZERO:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 
@@ -333,7 +332,7 @@ static int calc_hs_trail(struct dsi_phy_hw *phy,
 	if (rc)
 		goto error;
 
-	pr_debug("HS_TRAIL:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "HS_TRAIL:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 
@@ -360,7 +359,7 @@ static int calc_hs_rqst(struct dsi_phy_hw *phy,
 	if (rc)
 		goto error;
 
-	pr_debug("HS_RQST:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "HS_RQST:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 
@@ -391,7 +390,7 @@ static int calc_hs_exit(struct dsi_phy_hw *phy,
 		goto error;
 
 
-	pr_debug("HS_EXIT:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "HS_EXIT:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 
@@ -418,7 +417,7 @@ static int calc_hs_rqst_clk(struct dsi_phy_hw *phy,
 	if (rc)
 		goto error;
 
-	pr_debug("HS_RQST_CLK:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "HS_RQST_CLK:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 
@@ -481,7 +480,7 @@ static int calc_clk_post(struct dsi_phy_hw *phy,
 	if (rc)
 		goto error;
 
-	pr_debug("CLK_POST:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "CLK_POST:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 error:
@@ -531,7 +530,7 @@ static int calc_clk_pre(struct dsi_phy_hw *phy,
 	if (rc)
 		goto error;
 
-	pr_debug("CLK_PRE:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
+	DSI_PHY_DBG(phy, "CLK_PRE:mipi_min=%d, mipi_max=%d, rec_min=%d, rec_max=%d, reg_val=%d\n",
 		 t->mipi_min, t->mipi_max, t->rec_min, t->rec_max,
 		 t->reg_value);
 error:
@@ -553,68 +552,70 @@ static int dsi_phy_cmn_calc_timing_params(struct dsi_phy_hw *phy,
 	rc = calc_clk_prepare(phy, clk_params, desc, &actual_frac,
 			      &actual_intermediate);
 	if (rc) {
-		pr_err("clk_prepare calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "clk_prepare calculations failed, rc=%d\n",
+				rc);
 		goto error;
 	}
 
 	rc = calc_clk_zero(phy, clk_params, desc,
 		actual_frac, actual_intermediate);
 	if (rc) {
-		pr_err("clk_zero calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "clk_zero calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_clk_trail(phy, clk_params, desc, &teot_clk_lane);
 	if (rc) {
-		pr_err("clk_trail calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "clk_trail calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_hs_prepare(phy, clk_params, desc, &temp_multiple);
 	if (rc) {
-		pr_err("hs_prepare calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "hs_prepare calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_hs_zero(phy, clk_params, desc, temp_multiple);
 	if (rc) {
-		pr_err("hs_zero calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "hs_zero calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_hs_trail(phy, clk_params, desc, teot_clk_lane);
 	if (rc) {
-		pr_err("hs_trail calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "hs_trail calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_hs_rqst(phy, clk_params, desc);
 	if (rc) {
-		pr_err("hs_rqst calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "hs_rqst calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_hs_exit(phy, clk_params, desc);
 	if (rc) {
-		pr_err("hs_exit calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "hs_exit calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_hs_rqst_clk(phy, clk_params, desc);
 	if (rc) {
-		pr_err("hs_rqst_clk calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "hs_rqst_clk calculations failed, rc=%d\n",
+				rc);
 		goto error;
 	}
 
 	rc = calc_clk_post(phy, clk_params, desc);
 	if (rc) {
-		pr_err("clk_post calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "clk_post calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 
 	rc = calc_clk_pre(phy, clk_params, desc);
 	if (rc) {
-		pr_err("clk_pre calculations failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "clk_pre calculations failed, rc=%d\n", rc);
 		goto error;
 	}
 error:
@@ -716,12 +717,12 @@ int dsi_phy_hw_calculate_timing_params(struct dsi_phy_hw *phy,
 			  1, (8 * clk_params.tlpx_numer_ns)),
 		1);
 
-	pr_debug("BIT CLOCK = %d, tlpx_numer_ns=%d, treot_ns=%d\n",
+	DSI_PHY_DBG(phy, "BIT CLOCK = %d, tlpx_numer_ns=%d, treot_ns=%d\n",
 	       clk_params.bitclk_mbps, clk_params.tlpx_numer_ns,
 	       clk_params.treot_ns);
 	rc = dsi_phy_cmn_calc_timing_params(phy, &clk_params, &desc);
 	if (rc) {
-		pr_err("Timing calc failed, rc=%d\n", rc);
+		DSI_PHY_ERR(phy, "Timing calc failed, rc=%d\n", rc);
 		goto error;
 	}
 
@@ -743,7 +744,7 @@ int dsi_phy_timing_calc_init(struct dsi_phy_hw *phy,
 
 	if (version == DSI_PHY_VERSION_UNKNOWN ||
 	    version >= DSI_PHY_VERSION_MAX || !phy) {
-		pr_err("Unsupported version: %d\n", version);
+		DSI_PHY_ERR(phy, "Unsupported version: %d\n", version);
 		return -ENOTSUPP;
 	}
 

+ 1 - 2
msm/dsi/dsi_phy_timing_v2_0.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-phy-timing:" fmt
 #include "dsi_phy_timing_calc.h"
 
 void dsi_phy_hw_v2_0_get_default_phy_params(struct phy_clk_params *params)
@@ -108,7 +107,7 @@ void dsi_phy_hw_v2_0_update_timing_params(
 		timing->lane[i][5] = 0x2;
 		timing->lane[i][6] = 0x4;
 		timing->lane[i][7] = 0xA0;
-		pr_debug("[%d][%d %d %d %d %d]\n", i, timing->lane[i][0],
+		DSI_DEBUG("[%d][%d %d %d %d %d]\n", i, timing->lane[i][0],
 						    timing->lane[i][1],
 						    timing->lane[i][2],
 						    timing->lane[i][3],

+ 3 - 4
msm/dsi/dsi_phy_timing_v3_0.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-phy-timing:" fmt
 #include "dsi_phy_timing_calc.h"
 
 void dsi_phy_hw_v3_0_get_default_phy_params(
@@ -88,11 +87,11 @@ void dsi_phy_hw_v3_0_update_timing_params(
 	timing->lane_v3[10] = 0x04;
 	timing->lane_v3[11] = 0x00;
 
-	pr_debug("[%d %d %d %d]\n", timing->lane_v3[0],
+	DSI_DEBUG("[%d %d %d %d]\n", timing->lane_v3[0],
 		timing->lane_v3[1], timing->lane_v3[2], timing->lane_v3[3]);
-	pr_debug("[%d %d %d %d]\n", timing->lane_v3[4],
+	DSI_DEBUG("[%d %d %d %d]\n", timing->lane_v3[4],
 		timing->lane_v3[5], timing->lane_v3[6], timing->lane_v3[7]);
-	pr_debug("[%d %d %d %d]\n", timing->lane_v3[8],
+	DSI_DEBUG("[%d %d %d %d]\n", timing->lane_v3[8],
 		timing->lane_v3[9], timing->lane_v3[10], timing->lane_v3[11]);
 	timing->count_per_lane = 12;
 }

+ 4 - 5
msm/dsi/dsi_phy_timing_v4_0.c

@@ -3,7 +3,6 @@
  * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
  */
 
-#define pr_fmt(fmt) "dsi-phy-timing-v4: %s:" fmt, __func__
 #include "dsi_phy_timing_calc.h"
 
 void dsi_phy_hw_v4_0_get_default_phy_params(
@@ -93,12 +92,12 @@ void dsi_phy_hw_v4_0_update_timing_params(
 	timing->lane_v4[12] = desc->clk_pre.reg_value;
 	timing->lane_v4[13] = desc->clk_post.reg_value;
 
-	pr_debug("[%d %d %d %d]\n", timing->lane_v4[0],
+	DSI_DEBUG("[%d %d %d %d]\n", timing->lane_v4[0],
 		timing->lane_v4[1], timing->lane_v4[2], timing->lane_v4[3]);
-	pr_debug("[%d %d %d %d]\n", timing->lane_v4[4],
+	DSI_DEBUG("[%d %d %d %d]\n", timing->lane_v4[4],
 		timing->lane_v4[5], timing->lane_v4[6], timing->lane_v4[7]);
-	pr_debug("[%d %d %d %d]\n", timing->lane_v4[8],
+	DSI_DEBUG("[%d %d %d %d]\n", timing->lane_v4[8],
 		timing->lane_v4[9], timing->lane_v4[10], timing->lane_v4[11]);
-	pr_debug("[%d %d]\n", timing->lane_v4[12], timing->lane_v4[13]);
+	DSI_DEBUG("[%d %d]\n", timing->lane_v4[12], timing->lane_v4[13]);
 	timing->count_per_lane = 14;
 }

+ 28 - 27
msm/dsi/dsi_pwr.c

@@ -9,6 +9,7 @@
 
 #include "dsi_pwr.h"
 #include "dsi_parser.h"
+#include "dsi_defs.h"
 
 /*
  * dsi_pwr_parse_supply_node() - parse power supply node from root device node
@@ -27,7 +28,7 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
 
 		rc = utils->read_string(node, "qcom,supply-name", &st);
 		if (rc) {
-			pr_err("failed to read name, rc = %d\n", rc);
+			DSI_ERR("failed to read name, rc = %d\n", rc);
 			goto error;
 		}
 
@@ -37,28 +38,28 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
 
 		rc = utils->read_u32(node, "qcom,supply-min-voltage", &tmp);
 		if (rc) {
-			pr_err("failed to read min voltage, rc = %d\n", rc);
+			DSI_ERR("failed to read min voltage, rc = %d\n", rc);
 			goto error;
 		}
 		regs->vregs[i].min_voltage = tmp;
 
 		rc = utils->read_u32(node, "qcom,supply-max-voltage", &tmp);
 		if (rc) {
-			pr_err("failed to read max voltage, rc = %d\n", rc);
+			DSI_ERR("failed to read max voltage, rc = %d\n", rc);
 			goto error;
 		}
 		regs->vregs[i].max_voltage = tmp;
 
 		rc = utils->read_u32(node, "qcom,supply-enable-load", &tmp);
 		if (rc) {
-			pr_err("failed to read enable load, rc = %d\n", rc);
+			DSI_ERR("failed to read enable load, rc = %d\n", rc);
 			goto error;
 		}
 		regs->vregs[i].enable_load = tmp;
 
 		rc = utils->read_u32(node, "qcom,supply-disable-load", &tmp);
 		if (rc) {
-			pr_err("failed to read disable load, rc = %d\n", rc);
+			DSI_ERR("failed to read disable load, rc = %d\n", rc);
 			goto error;
 		}
 		regs->vregs[i].disable_load = tmp;
@@ -66,7 +67,7 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
 		/* Optional values */
 		rc = utils->read_u32(node, "qcom,supply-off-min-voltage", &tmp);
 		if (rc) {
-			pr_debug("off-min-voltage not specified\n");
+			DSI_DEBUG("off-min-voltage not specified\n");
 			rc = 0;
 		} else {
 			regs->vregs[i].off_min_voltage = tmp;
@@ -74,7 +75,7 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
 
 		rc = utils->read_u32(node, "qcom,supply-pre-on-sleep", &tmp);
 		if (rc) {
-			pr_debug("pre-on-sleep not specified\n");
+			DSI_DEBUG("pre-on-sleep not specified\n");
 			rc = 0;
 		} else {
 			regs->vregs[i].pre_on_sleep = tmp;
@@ -82,7 +83,7 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
 
 		rc = utils->read_u32(node, "qcom,supply-pre-off-sleep", &tmp);
 		if (rc) {
-			pr_debug("pre-off-sleep not specified\n");
+			DSI_DEBUG("pre-off-sleep not specified\n");
 			rc = 0;
 		} else {
 			regs->vregs[i].pre_off_sleep = tmp;
@@ -90,7 +91,7 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
 
 		rc = utils->read_u32(node, "qcom,supply-post-on-sleep", &tmp);
 		if (rc) {
-			pr_debug("post-on-sleep not specified\n");
+			DSI_DEBUG("post-on-sleep not specified\n");
 			rc = 0;
 		} else {
 			regs->vregs[i].post_on_sleep = tmp;
@@ -98,13 +99,13 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
 
 		rc = utils->read_u32(node, "qcom,supply-post-off-sleep", &tmp);
 		if (rc) {
-			pr_debug("post-off-sleep not specified\n");
+			DSI_DEBUG("post-off-sleep not specified\n");
 			rc = 0;
 		} else {
 			regs->vregs[i].post_off_sleep = tmp;
 		}
 
-		pr_debug("[%s] minv=%d maxv=%d, en_load=%d, dis_load=%d\n",
+		DSI_DEBUG("[%s] minv=%d maxv=%d, en_load=%d, dis_load=%d\n",
 			 regs->vregs[i].vreg_name,
 			 regs->vregs[i].min_voltage,
 			 regs->vregs[i].max_voltage,
@@ -135,7 +136,7 @@ static int dsi_pwr_enable_vregs(struct dsi_regulator_info *regs, bool enable)
 			rc = regulator_set_load(vreg->vreg,
 						vreg->enable_load);
 			if (rc < 0) {
-				pr_err("Setting optimum mode failed for %s\n",
+				DSI_ERR("Setting optimum mode failed for %s\n",
 				       vreg->vreg_name);
 				goto error;
 			}
@@ -145,7 +146,7 @@ static int dsi_pwr_enable_vregs(struct dsi_regulator_info *regs, bool enable)
 							   vreg->min_voltage,
 							   vreg->max_voltage);
 				if (rc) {
-					pr_err("Set voltage(%s) fail, rc=%d\n",
+					DSI_ERR("Set voltage(%s) fail, rc=%d\n",
 						 vreg->vreg_name, rc);
 					goto error_disable_opt_mode;
 				}
@@ -153,7 +154,7 @@ static int dsi_pwr_enable_vregs(struct dsi_regulator_info *regs, bool enable)
 
 			rc = regulator_enable(vreg->vreg);
 			if (rc) {
-				pr_err("enable failed for %s, rc=%d\n",
+				DSI_ERR("enable failed for %s, rc=%d\n",
 				       vreg->vreg_name, rc);
 				goto error_disable_voltage;
 			}
@@ -227,7 +228,7 @@ int dsi_pwr_of_get_vreg_data(struct dsi_parser_utils *utils,
 	struct device_node *supply_root_node = NULL;
 
 	if (!utils || !regs) {
-		pr_err("Bad params\n");
+		DSI_ERR("Bad params\n");
 		return -EINVAL;
 	}
 
@@ -237,7 +238,7 @@ int dsi_pwr_of_get_vreg_data(struct dsi_parser_utils *utils,
 		supply_root_node = of_parse_phandle(utils->node,
 					supply_name, 0);
 		if (!supply_root_node) {
-			pr_debug("No supply entry present for %s\n",
+			DSI_DEBUG("No supply entry present for %s\n",
 					supply_name);
 			return -EINVAL;
 		}
@@ -245,7 +246,7 @@ int dsi_pwr_of_get_vreg_data(struct dsi_parser_utils *utils,
 
 	regs->count = utils->get_available_child_count(supply_root_node);
 	if (regs->count == 0) {
-		pr_err("No vregs defined for %s\n", supply_name);
+		DSI_ERR("No vregs defined for %s\n", supply_name);
 		return -EINVAL;
 	}
 
@@ -257,7 +258,7 @@ int dsi_pwr_of_get_vreg_data(struct dsi_parser_utils *utils,
 
 	rc = dsi_pwr_parse_supply_node(utils, supply_root_node, regs);
 	if (rc) {
-		pr_err("failed to parse supply node for %s, rc = %d\n",
+		DSI_ERR("failed to parse supply node for %s, rc = %d\n",
 			supply_name, rc);
 
 		kfree(regs->vregs);
@@ -287,7 +288,7 @@ int dsi_pwr_get_dt_vreg_data(struct device *dev,
 	struct dsi_parser_utils utils = *dsi_parser_get_of_utils();
 
 	if (!dev || !regs) {
-		pr_err("Bad params\n");
+		DSI_ERR("Bad params\n");
 		return -EINVAL;
 	}
 
@@ -297,7 +298,7 @@ int dsi_pwr_get_dt_vreg_data(struct device *dev,
 	if (!supply_root_node) {
 		supply_root_node = of_parse_phandle(of_node, supply_name, 0);
 		if (!supply_root_node) {
-			pr_debug("No supply entry present for %s\n",
+			DSI_DEBUG("No supply entry present for %s\n",
 					supply_name);
 			return -EINVAL;
 		}
@@ -307,7 +308,7 @@ int dsi_pwr_get_dt_vreg_data(struct device *dev,
 		regs->count++;
 
 	if (regs->count == 0) {
-		pr_err("No vregs defined for %s\n", supply_name);
+		DSI_ERR("No vregs defined for %s\n", supply_name);
 		return -EINVAL;
 	}
 
@@ -323,7 +324,7 @@ int dsi_pwr_get_dt_vreg_data(struct device *dev,
 
 	rc = dsi_pwr_parse_supply_node(&utils, supply_root_node, regs);
 	if (rc) {
-		pr_err("failed to parse supply node for %s, rc = %d\n",
+		DSI_ERR("failed to parse supply node for %s, rc = %d\n",
 		       supply_name, rc);
 		devm_kfree(dev, regs->vregs);
 		regs->vregs = NULL;
@@ -345,12 +346,12 @@ int dsi_pwr_enable_regulator(struct dsi_regulator_info *regs, bool enable)
 	int rc = 0;
 
 	if (regs->count == 0) {
-		pr_debug("No valid regulators to enable\n");
+		DSI_DEBUG("No valid regulators to enable\n");
 		return 0;
 	}
 
 	if (!regs->vregs) {
-		pr_err("Invalid params\n");
+		DSI_ERR("Invalid params\n");
 		return -EINVAL;
 	}
 
@@ -358,19 +359,19 @@ int dsi_pwr_enable_regulator(struct dsi_regulator_info *regs, bool enable)
 		if (regs->refcount == 0) {
 			rc = dsi_pwr_enable_vregs(regs, true);
 			if (rc)
-				pr_err("failed to enable regulators\n");
+				DSI_ERR("failed to enable regulators\n");
 		}
 		regs->refcount++;
 	} else {
 		if (regs->refcount == 0) {
-			pr_err("Unbalanced regulator off:%s\n",
+			DSI_ERR("Unbalanced regulator off:%s\n",
 					regs->vregs->vreg_name);
 		} else {
 			regs->refcount--;
 			if (regs->refcount == 0) {
 				rc = dsi_pwr_enable_vregs(regs, false);
 				if (rc)
-					pr_err("failed to disable vregs\n");
+					DSI_ERR("failed to disable vregs\n");
 			}
 		}
 	}

部分文件因为文件数量过多而无法显示