diff --git a/msm/dsi/dsi_catalog.c b/msm/dsi/dsi_catalog.c index d921c448cd..a43470b14e 100644 --- a/msm/dsi/dsi_catalog.c +++ b/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 #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; } diff --git a/msm/dsi/dsi_clk_manager.c b/msm/dsi/dsi_clk_manager.c index 875b96c5b7..1ce4001752 100644 --- a/msm/dsi/dsi_clk_manager.c +++ b/msm/dsi/dsi_clk_manager.c @@ -9,6 +9,7 @@ #include #include #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; } diff --git a/msm/dsi/dsi_ctrl.c b/msm/dsi/dsi_ctrl.c index 0625fbd236..84133ebc35 100644 --- a/msm/dsi/dsi_ctrl.c +++ b/msm/dsi/dsi_ctrl.c @@ -3,8 +3,6 @@ * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */ -#define pr_fmt(fmt) "dsi-ctrl:[%s] " fmt, __func__ - #include #include #include @@ -34,6 +32,15 @@ #define TICKS_IN_MICRO_SECOND 1000000 +#define DSI_CTRL_DEBUG(c, fmt, ...) DRM_DEV_DEBUG(NULL, "[msm-dsi-debug]: %s: "\ + fmt, c->name, ##__VA_ARGS__) +#define DSI_CTRL_ERR(c, fmt, ...) DRM_DEV_ERROR(NULL, "[msm-dsi-error]: %s: "\ + fmt, c->name, ##__VA_ARGS__) +#define DSI_CTRL_INFO(c, fmt, ...) DRM_DEV_INFO(NULL, "[msm-dsi-info]: %s: "\ + fmt, c->name, ##__VA_ARGS__) +#define DSI_CTRL_WARN(c, fmt, ...) DRM_WARN("[msm-dsi-warn]: %s: " fmt,\ + c->name, ##__VA_ARGS__) + struct dsi_ctrl_list_item { struct dsi_ctrl *ctrl; struct list_head list; @@ -147,7 +154,7 @@ static ssize_t debugfs_reg_dump_read(struct file *file, rc = dsi_ctrl->clk_cb.dsi_clk_cb(dsi_ctrl->clk_cb.priv, clk_info); if (rc) { - pr_err("failed to enable DSI core clocks\n"); + DSI_CTRL_ERR(dsi_ctrl, "failed to enable DSI core clocks\n"); kfree(buf); return rc; } @@ -159,7 +166,7 @@ static ssize_t debugfs_reg_dump_read(struct file *file, clk_info.clk_state = DSI_CLK_OFF; rc = dsi_ctrl->clk_cb.dsi_clk_cb(dsi_ctrl->clk_cb.priv, clk_info); if (rc) { - pr_err("failed to disable DSI core clocks\n"); + DSI_CTRL_ERR(dsi_ctrl, "failed to disable DSI core clocks\n"); kfree(buf); return rc; } @@ -196,8 +203,8 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl, dir = debugfs_create_dir(dsi_ctrl->name, parent); if (IS_ERR_OR_NULL(dir)) { rc = PTR_ERR(dir); - pr_err("[DSI_%d] debugfs create dir failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "debugfs create dir failed, rc=%d\n", + rc); goto error; } @@ -208,8 +215,7 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl, &state_info_fops); if (IS_ERR_OR_NULL(state_file)) { rc = PTR_ERR(state_file); - pr_err("[DSI_%d] state file failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "state file failed, rc=%d\n", rc); goto error_remove_dir; } @@ -220,8 +226,7 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl, ®_dump_fops); if (IS_ERR_OR_NULL(reg_dump)) { rc = PTR_ERR(reg_dump); - pr_err("[DSI_%d] reg dump file failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "reg dump file failed, rc=%d\n", rc); goto error_remove_dir; } @@ -265,13 +270,12 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, switch (op) { case DSI_CTRL_OP_POWER_STATE_CHANGE: if (state->power_state == op_state) { - pr_err("[%d] No change in state, pwr_state=%d\n", - dsi_ctrl->cell_index, op_state); + DSI_CTRL_ERR(dsi_ctrl, "No change in state, pwr_state=%d\n", + op_state); rc = -EINVAL; } else if (state->power_state == DSI_CTRL_POWER_VREG_ON) { if (state->vid_engine_state == DSI_CTRL_ENGINE_ON) { - pr_err("[%d]State error: op=%d: %d\n", - dsi_ctrl->cell_index, + DSI_CTRL_ERR(dsi_ctrl, "State error: op=%d: %d\n", op_state, state->vid_engine_state); rc = -EINVAL; @@ -280,13 +284,12 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, break; case DSI_CTRL_OP_CMD_ENGINE: if (state->cmd_engine_state == op_state) { - pr_err("[%d] No change in state, cmd_state=%d\n", - dsi_ctrl->cell_index, op_state); + DSI_CTRL_ERR(dsi_ctrl, "No change in state, cmd_state=%d\n", + op_state); rc = -EINVAL; } else if ((state->power_state != DSI_CTRL_POWER_VREG_ON) || (state->controller_state != DSI_CTRL_ENGINE_ON)) { - pr_err("[%d]State error: op=%d: %d, %d\n", - dsi_ctrl->cell_index, + DSI_CTRL_ERR(dsi_ctrl, "State error: op=%d: %d, %d\n", op, state->power_state, state->controller_state); @@ -295,13 +298,12 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, break; case DSI_CTRL_OP_VID_ENGINE: if (state->vid_engine_state == op_state) { - pr_err("[%d] No change in state, cmd_state=%d\n", - dsi_ctrl->cell_index, op_state); + DSI_CTRL_ERR(dsi_ctrl, "No change in state, cmd_state=%d\n", + op_state); rc = -EINVAL; } else if ((state->power_state != DSI_CTRL_POWER_VREG_ON) || (state->controller_state != DSI_CTRL_ENGINE_ON)) { - pr_err("[%d]State error: op=%d: %d, %d\n", - dsi_ctrl->cell_index, + DSI_CTRL_ERR(dsi_ctrl, "State error: op=%d: %d, %d\n", op, state->power_state, state->controller_state); @@ -310,20 +312,18 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, break; case DSI_CTRL_OP_HOST_ENGINE: if (state->controller_state == op_state) { - pr_err("[%d] No change in state, ctrl_state=%d\n", - dsi_ctrl->cell_index, op_state); + DSI_CTRL_ERR(dsi_ctrl, "No change in state, ctrl_state=%d\n", + op_state); rc = -EINVAL; } else if (state->power_state != DSI_CTRL_POWER_VREG_ON) { - pr_err("[%d]State error (link is off): op=%d:, %d\n", - dsi_ctrl->cell_index, + DSI_CTRL_ERR(dsi_ctrl, "State error (link is off): op=%d:, %d\n", op_state, state->power_state); rc = -EINVAL; } else if ((op_state == DSI_CTRL_ENGINE_OFF) && ((state->cmd_engine_state != DSI_CTRL_ENGINE_OFF) || (state->vid_engine_state != DSI_CTRL_ENGINE_OFF))) { - pr_err("[%d]State error (eng on): op=%d: %d, %d\n", - dsi_ctrl->cell_index, + DSI_CTRL_ERR(dsi_ctrl, "State error (eng on): op=%d: %d, %d\n", op_state, state->cmd_engine_state, state->vid_engine_state); @@ -334,8 +334,7 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, if ((state->power_state != DSI_CTRL_POWER_VREG_ON) || (!state->host_initialized) || (state->cmd_engine_state != DSI_CTRL_ENGINE_ON)) { - pr_err("[%d]State error: op=%d: %d, %d, %d\n", - dsi_ctrl->cell_index, + DSI_CTRL_ERR(dsi_ctrl, "State error: op=%d: %d, %d, %d\n", op, state->power_state, state->host_initialized, @@ -345,24 +344,23 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, break; case DSI_CTRL_OP_HOST_INIT: if (state->host_initialized == op_state) { - pr_err("[%d] No change in state, host_init=%d\n", - dsi_ctrl->cell_index, op_state); + DSI_CTRL_ERR(dsi_ctrl, "No change in state, host_init=%d\n", + op_state); rc = -EINVAL; } else if (state->power_state != DSI_CTRL_POWER_VREG_ON) { - pr_err("[%d]State error: op=%d: %d\n", - dsi_ctrl->cell_index, op, state->power_state); + DSI_CTRL_ERR(dsi_ctrl, "State error: op=%d: %d\n", + op, state->power_state); rc = -EINVAL; } break; case DSI_CTRL_OP_TPG: if (state->tpg_enabled == op_state) { - pr_err("[%d] No change in state, tpg_enabled=%d\n", - dsi_ctrl->cell_index, op_state); + DSI_CTRL_ERR(dsi_ctrl, "No change in state, tpg_enabled=%d\n", + op_state); rc = -EINVAL; } else if ((state->power_state != DSI_CTRL_POWER_VREG_ON) || (state->controller_state != DSI_CTRL_ENGINE_ON)) { - pr_err("[%d]State error: op=%d: %d, %d\n", - dsi_ctrl->cell_index, + DSI_CTRL_ERR(dsi_ctrl, "State error: op=%d: %d, %d\n", op, state->power_state, state->controller_state); @@ -371,15 +369,15 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, break; case DSI_CTRL_OP_PHY_SW_RESET: if (state->power_state != DSI_CTRL_POWER_VREG_ON) { - pr_err("[%d]State error: op=%d: %d\n", - dsi_ctrl->cell_index, op, state->power_state); + DSI_CTRL_ERR(dsi_ctrl, "State error: op=%d: %d\n", + op, state->power_state); rc = -EINVAL; } break; case DSI_CTRL_OP_ASYNC_TIMING: if (state->vid_engine_state != op_state) { - pr_err("[%d] Unexpected engine state vid_state=%d\n", - dsi_ctrl->cell_index, op_state); + DSI_CTRL_ERR(dsi_ctrl, "Unexpected engine state vid_state=%d\n", + op_state); rc = -EINVAL; } break; @@ -396,7 +394,7 @@ bool dsi_ctrl_validate_host_state(struct dsi_ctrl *dsi_ctrl) struct dsi_ctrl_state_info *state = &dsi_ctrl->current_state; if (!state) { - pr_err("Invalid host state for DSI controller\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid host state for DSI controller\n"); return -EINVAL; } @@ -451,16 +449,14 @@ static int dsi_ctrl_init_regmap(struct platform_device *pdev, } ctrl->hw.base = ptr; - pr_debug("[%s] map dsi_ctrl registers to %pK\n", ctrl->name, - ctrl->hw.base); + DSI_CTRL_DEBUG(ctrl, "map dsi_ctrl registers to %pK\n", ctrl->hw.base); switch (ctrl->version) { case DSI_CTRL_VERSION_1_4: case DSI_CTRL_VERSION_2_0: ptr = msm_ioremap(pdev, "mmss_misc", ctrl->name); if (IS_ERR(ptr)) { - pr_err("mmss_misc base address not found for [%s]\n", - ctrl->name); + DSI_CTRL_ERR(ctrl, "mmss_misc base address not found\n"); rc = PTR_ERR(ptr); return rc; } @@ -472,8 +468,7 @@ static int dsi_ctrl_init_regmap(struct platform_device *pdev, case DSI_CTRL_VERSION_2_4: ptr = msm_ioremap(pdev, "disp_cc_base", ctrl->name); if (IS_ERR(ptr)) { - pr_err("disp_cc base address not found for [%s]\n", - ctrl->name); + DSI_CTRL_ERR(ctrl, "disp_cc base address not found for\n"); rc = PTR_ERR(ptr); return rc; } @@ -541,71 +536,72 @@ static int dsi_ctrl_clocks_init(struct platform_device *pdev, core->mdp_core_clk = devm_clk_get(&pdev->dev, "mdp_core_clk"); if (IS_ERR(core->mdp_core_clk)) { core->mdp_core_clk = NULL; - pr_debug("failed to get mdp_core_clk, rc=%d\n", rc); + DSI_CTRL_DEBUG(ctrl, "failed to get mdp_core_clk, rc=%d\n", rc); } core->iface_clk = devm_clk_get(&pdev->dev, "iface_clk"); if (IS_ERR(core->iface_clk)) { core->iface_clk = NULL; - pr_debug("failed to get iface_clk, rc=%d\n", rc); + DSI_CTRL_DEBUG(ctrl, "failed to get iface_clk, rc=%d\n", rc); } core->core_mmss_clk = devm_clk_get(&pdev->dev, "core_mmss_clk"); if (IS_ERR(core->core_mmss_clk)) { core->core_mmss_clk = NULL; - pr_debug("failed to get core_mmss_clk, rc=%d\n", rc); + DSI_CTRL_DEBUG(ctrl, "failed to get core_mmss_clk, rc=%d\n", + rc); } core->bus_clk = devm_clk_get(&pdev->dev, "bus_clk"); if (IS_ERR(core->bus_clk)) { core->bus_clk = NULL; - pr_debug("failed to get bus_clk, rc=%d\n", rc); + DSI_CTRL_DEBUG(ctrl, "failed to get bus_clk, rc=%d\n", rc); } core->mnoc_clk = devm_clk_get(&pdev->dev, "mnoc_clk"); if (IS_ERR(core->mnoc_clk)) { core->mnoc_clk = NULL; - pr_debug("can't get mnoc clock, rc=%d\n", rc); + DSI_CTRL_DEBUG(ctrl, "can't get mnoc clock, rc=%d\n", rc); } hs_link->byte_clk = devm_clk_get(&pdev->dev, "byte_clk"); if (IS_ERR(hs_link->byte_clk)) { rc = PTR_ERR(hs_link->byte_clk); - pr_err("failed to get byte_clk, rc=%d\n", rc); + DSI_CTRL_ERR(ctrl, "failed to get byte_clk, rc=%d\n", rc); goto fail; } hs_link->pixel_clk = devm_clk_get(&pdev->dev, "pixel_clk"); if (IS_ERR(hs_link->pixel_clk)) { rc = PTR_ERR(hs_link->pixel_clk); - pr_err("failed to get pixel_clk, rc=%d\n", rc); + DSI_CTRL_ERR(ctrl, "failed to get pixel_clk, rc=%d\n", rc); goto fail; } lp_link->esc_clk = devm_clk_get(&pdev->dev, "esc_clk"); if (IS_ERR(lp_link->esc_clk)) { rc = PTR_ERR(lp_link->esc_clk); - pr_err("failed to get esc_clk, rc=%d\n", rc); + DSI_CTRL_ERR(ctrl, "failed to get esc_clk, rc=%d\n", rc); goto fail; } hs_link->byte_intf_clk = devm_clk_get(&pdev->dev, "byte_intf_clk"); if (IS_ERR(hs_link->byte_intf_clk)) { hs_link->byte_intf_clk = NULL; - pr_debug("can't find byte intf clk, rc=%d\n", rc); + DSI_CTRL_DEBUG(ctrl, "can't find byte intf clk, rc=%d\n", rc); } rcg->byte_clk = devm_clk_get(&pdev->dev, "byte_clk_rcg"); if (IS_ERR(rcg->byte_clk)) { rc = PTR_ERR(rcg->byte_clk); - pr_err("failed to get byte_clk_rcg, rc=%d\n", rc); + DSI_CTRL_ERR(ctrl, "failed to get byte_clk_rcg, rc=%d\n", rc); goto fail; } rcg->pixel_clk = devm_clk_get(&pdev->dev, "pixel_clk_rcg"); if (IS_ERR(rcg->pixel_clk)) { rc = PTR_ERR(rcg->pixel_clk); - pr_err("failed to get pixel_clk_rcg, rc=%d\n", rc); + DSI_CTRL_ERR(ctrl, "failed to get pixel_clk_rcg, rc=%d\n", rc); goto fail; } @@ -624,7 +620,8 @@ static int dsi_ctrl_supplies_deinit(struct dsi_ctrl *ctrl) regs = &ctrl->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_CTRL_ERR(ctrl, + "vreg is NULL, should not reach here\n"); else devm_regulator_put(regs->vregs[i].vreg); } @@ -632,7 +629,8 @@ static int dsi_ctrl_supplies_deinit(struct dsi_ctrl *ctrl) regs = &ctrl->pwr_info.host_pwr; for (i = 0; i < regs->count; i++) { if (!regs->vregs[i].vreg) - pr_err("vreg is NULL, should not reach here\n"); + DSI_CTRL_ERR(ctrl, + "vreg is NULL, should not reach here\n"); else devm_regulator_put(regs->vregs[i].vreg); } @@ -664,13 +662,15 @@ static int dsi_ctrl_supplies_init(struct platform_device *pdev, &ctrl->pwr_info.digital, "qcom,core-supply-entries"); if (rc) - pr_debug("failed to get digital supply, rc = %d\n", rc); + DSI_CTRL_DEBUG(ctrl, + "failed to get digital supply, rc = %d\n", rc); rc = dsi_pwr_get_dt_vreg_data(&pdev->dev, &ctrl->pwr_info.host_pwr, "qcom,ctrl-supply-entries"); if (rc) { - pr_err("failed to get host power supplies, rc = %d\n", rc); + DSI_CTRL_ERR(ctrl, + "failed to get host power supplies, rc = %d\n", rc); goto error_digital; } @@ -678,7 +678,7 @@ static int dsi_ctrl_supplies_init(struct platform_device *pdev, for (i = 0; i < regs->count; i++) { vreg = devm_regulator_get(&pdev->dev, regs->vregs[i].vreg_name); if (IS_ERR(vreg)) { - pr_err("failed to get %s regulator\n", + DSI_CTRL_ERR(ctrl, "failed to get %s regulator\n", regs->vregs[i].vreg_name); rc = PTR_ERR(vreg); goto error_host_pwr; @@ -690,7 +690,7 @@ static int dsi_ctrl_supplies_init(struct platform_device *pdev, for (i = 0; i < regs->count; i++) { vreg = devm_regulator_get(&pdev->dev, regs->vregs[i].vreg_name); if (IS_ERR(vreg)) { - pr_err("failed to get %s regulator\n", + DSI_CTRL_ERR(ctrl, "failed to get %s regulator\n", regs->vregs[i].vreg_name); for (--i; i >= 0; i--) devm_regulator_put(regs->vregs[i].vreg); @@ -727,7 +727,8 @@ static int dsi_ctrl_axi_bus_client_init(struct platform_device *pdev, bus->bus_scale_table = msm_bus_cl_get_pdata(pdev); if (IS_ERR_OR_NULL(bus->bus_scale_table)) { rc = PTR_ERR(bus->bus_scale_table); - pr_debug("msm_bus_cl_get_pdata() failed, rc = %d\n", rc); + DSI_CTRL_DEBUG(ctrl, "msm_bus_cl_get_pdata() failed, rc = %d\n", + rc); bus->bus_scale_table = NULL; return rc; } @@ -735,7 +736,7 @@ static int dsi_ctrl_axi_bus_client_init(struct platform_device *pdev, bus->bus_handle = msm_bus_scale_register_client(bus->bus_scale_table); if (!bus->bus_handle) { rc = -EINVAL; - pr_err("failed to register axi bus client\n"); + DSI_CTRL_ERR(ctrl, "failed to register axi bus client\n"); } return rc; @@ -761,13 +762,14 @@ static int dsi_ctrl_validate_panel_info(struct dsi_ctrl *dsi_ctrl, struct dsi_host_common_cfg *host_cfg = &config->common_config; if (config->panel_mode >= DSI_OP_MODE_MAX) { - pr_err("Invalid dsi operation mode (%d)\n", config->panel_mode); + DSI_CTRL_ERR(dsi_ctrl, "Invalid dsi operation mode (%d)\n", + config->panel_mode); rc = -EINVAL; goto err; } if ((host_cfg->data_lanes & (DSI_CLOCK_LANE - 1)) == 0) { - pr_err("No data lanes are enabled\n"); + DSI_CTRL_ERR(dsi_ctrl, "No data lanes are enabled\n"); rc = -EINVAL; goto err; } @@ -860,9 +862,9 @@ static int dsi_ctrl_update_link_freqs(struct dsi_ctrl *dsi_ctrl, do_div(pclk_rate, bpp); byte_clk_rate = bit_rate_per_lane; do_div(byte_clk_rate, 8); - pr_debug("bit_clk_rate = %llu, bit_clk_rate_per_lane = %llu\n", + DSI_CTRL_DEBUG(dsi_ctrl, "bit_clk_rate = %llu, bit_clk_rate_per_lane = %llu\n", bit_rate, bit_rate_per_lane); - pr_debug("byte_clk_rate = %llu, pclk_rate = %llu\n", + DSI_CTRL_DEBUG(dsi_ctrl, "byte_clk_rate = %llu, pclk_rate = %llu\n", byte_clk_rate, pclk_rate); dsi_ctrl->clk_freq.byte_clk_rate = byte_clk_rate; @@ -873,7 +875,7 @@ static int dsi_ctrl_update_link_freqs(struct dsi_ctrl *dsi_ctrl, rc = dsi_clk_set_link_frequencies(clk_handle, dsi_ctrl->clk_freq, dsi_ctrl->cell_index); if (rc) - pr_err("Failed to update link frequencies\n"); + DSI_CTRL_ERR(dsi_ctrl, "Failed to update link frequencies\n"); return rc; } @@ -887,7 +889,7 @@ static int dsi_ctrl_enable_supplies(struct dsi_ctrl *dsi_ctrl, bool enable) rc = dsi_pwr_enable_regulator( &dsi_ctrl->pwr_info.host_pwr, true); if (rc) { - pr_err("failed to enable host power regs\n"); + DSI_CTRL_ERR(dsi_ctrl, "failed to enable host power regs\n"); goto error; } } @@ -895,7 +897,8 @@ static int dsi_ctrl_enable_supplies(struct dsi_ctrl *dsi_ctrl, bool enable) rc = dsi_pwr_enable_regulator(&dsi_ctrl->pwr_info.digital, true); if (rc) { - pr_err("failed to enable gdsc, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to enable gdsc, rc=%d\n", + rc); (void)dsi_pwr_enable_regulator( &dsi_ctrl->pwr_info.host_pwr, false @@ -906,7 +909,8 @@ static int dsi_ctrl_enable_supplies(struct dsi_ctrl *dsi_ctrl, bool enable) rc = dsi_pwr_enable_regulator(&dsi_ctrl->pwr_info.digital, false); if (rc) { - pr_err("failed to disable gdsc, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to disable gdsc, rc=%d\n", + rc); goto error; } @@ -914,7 +918,7 @@ static int dsi_ctrl_enable_supplies(struct dsi_ctrl *dsi_ctrl, bool enable) rc = dsi_pwr_enable_regulator( &dsi_ctrl->pwr_info.host_pwr, false); if (rc) { - pr_err("failed to disable host power regs\n"); + DSI_CTRL_ERR(dsi_ctrl, "failed to disable host power regs\n"); goto error; } } @@ -972,7 +976,7 @@ int dsi_ctrl_wait_for_cmd_mode_mdp_idle(struct dsi_ctrl *dsi_ctrl) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -1014,7 +1018,7 @@ static void dsi_ctrl_wait_for_video_done(struct dsi_ctrl *dsi_ctrl) &dsi_ctrl->irq_info.vid_frame_done, msecs_to_jiffies(DSI_CTRL_TX_TO_MS)); if (ret <= 0) - pr_debug("wait for video done failed\n"); + DSI_CTRL_DEBUG(dsi_ctrl, "wait for video done failed\n"); dsi_ctrl_disable_status_interrupt(dsi_ctrl, DSI_SINT_VIDEO_MODE_FRAME_DONE); @@ -1039,16 +1043,16 @@ void dsi_message_setup_tx_mode(struct dsi_ctrl *dsi_ctrl, if (dsi_ctrl->secure_mode) { *flags &= ~DSI_CTRL_CMD_FETCH_MEMORY; *flags |= DSI_CTRL_CMD_FIFO_STORE; - pr_debug("[%s] override to TPG during secure session\n", - dsi_ctrl->name); + DSI_CTRL_DEBUG(dsi_ctrl, + "override to TPG during secure session\n"); return; } /* Check to see if cmd len plus header is greater than fifo size */ if ((cmd_len + 4) > DSI_EMBEDDED_MODE_DMA_MAX_SIZE_BYTES) { *flags |= DSI_CTRL_CMD_NON_EMBEDDED_MODE; - pr_debug("[%s] override to non-embedded mode,cmd len =%d\n", - dsi_ctrl->name, cmd_len); + DSI_CTRL_DEBUG(dsi_ctrl, "override to non-embedded mode,cmd len =%d\n", + cmd_len); return; } } @@ -1062,33 +1066,33 @@ int dsi_message_validate_tx_mode(struct dsi_ctrl *dsi_ctrl, if (*flags & DSI_CTRL_CMD_FIFO_STORE) { /* if command size plus header is greater than fifo size */ if ((cmd_len + 4) > DSI_CTRL_MAX_CMD_FIFO_STORE_SIZE) { - pr_err("Cannot transfer Cmd in FIFO config\n"); + DSI_CTRL_ERR(dsi_ctrl, "Cannot transfer Cmd in FIFO config\n"); return -ENOTSUPP; } if (!dsi_ctrl->hw.ops.kickoff_fifo_command) { - pr_err("Cannot transfer command,ops not defined\n"); + DSI_CTRL_ERR(dsi_ctrl, "Cannot transfer command,ops not defined\n"); return -ENOTSUPP; } } if (*flags & DSI_CTRL_CMD_NON_EMBEDDED_MODE) { if (*flags & DSI_CTRL_CMD_BROADCAST) { - pr_err("Non embedded not supported with broadcast\n"); + DSI_CTRL_ERR(dsi_ctrl, "Non embedded not supported with broadcast\n"); return -ENOTSUPP; } if (!dsi_ctrl->hw.ops.kickoff_command_non_embedded_mode) { - pr_err(" Cannot transfer command,ops not defined\n"); + DSI_CTRL_ERR(dsi_ctrl, " Cannot transfer command,ops not defined\n"); return -ENOTSUPP; } if ((cmd_len + 4) > SZ_4K) { - pr_err("Cannot transfer,size is greater than 4096\n"); + DSI_CTRL_ERR(dsi_ctrl, "Cannot transfer,size is greater than 4096\n"); return -ENOTSUPP; } } if (*flags & DSI_CTRL_CMD_FETCH_MEMORY) { if ((dsi_ctrl->cmd_len + cmd_len + 4) > SZ_4K) { - pr_err("Cannot transfer,size is greater than 4096\n"); + DSI_CTRL_ERR(dsi_ctrl, "Cannot transfer,size is greater than 4096\n"); return -ENOTSUPP; } } @@ -1195,13 +1199,14 @@ static void dsi_kickoff_msg_tx(struct dsi_ctrl *dsi_ctrl, dsi_ctrl_disable_status_interrupt(dsi_ctrl, DSI_SINT_CMD_MODE_DMA_DONE); complete_all(&dsi_ctrl->irq_info.cmd_dma_done); - pr_warn("dma_tx done but irq not triggered\n"); + DSI_CTRL_WARN(dsi_ctrl, + "dma_tx done but irq not triggered\n"); } else { rc = -ETIMEDOUT; dsi_ctrl_disable_status_interrupt(dsi_ctrl, DSI_SINT_CMD_MODE_DMA_DONE); - pr_err("[DSI_%d]Command transfer failed\n", - dsi_ctrl->cell_index); + DSI_CTRL_ERR(dsi_ctrl, + "Command transfer failed\n"); } } @@ -1241,7 +1246,8 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl, /* Validate the mode before sending the command */ rc = dsi_message_validate_tx_mode(dsi_ctrl, msg->tx_len, &flags); if (rc) { - pr_err(" Cmd tx validation failed, cannot transfer cmd\n"); + DSI_CTRL_ERR(dsi_ctrl, + "Cmd tx validation failed, cannot transfer cmd\n"); rc = -ENOTSUPP; goto error; } @@ -1259,7 +1265,8 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl, dsi_ctrl->cmd_len = msg->tx_len; memcpy(dsi_ctrl->vaddr, msg->tx_buf, msg->tx_len); - pr_debug(" non-embedded mode , size of command =%zd\n", + DSI_CTRL_DEBUG(dsi_ctrl, + "non-embedded mode , size of command =%zd\n", msg->tx_len); goto kickoff; @@ -1267,7 +1274,8 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl, rc = mipi_dsi_create_packet(&packet, msg); if (rc) { - pr_err("Failed to create message packet, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to create message packet, rc=%d\n", + rc); goto error; } @@ -1276,8 +1284,7 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl, &buffer, &length); if (rc) { - pr_err("[%s] failed to copy message, rc=%d\n", - dsi_ctrl->name, rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to copy message, rc=%d\n", rc); goto error; } @@ -1345,7 +1352,8 @@ static int dsi_set_max_return_size(struct dsi_ctrl *dsi_ctrl, rc = dsi_message_tx(dsi_ctrl, &msg, flags); if (rc) - pr_err("failed to send max return size packet, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to send max return size packet, rc=%d\n", + rc); return rc; } @@ -1416,7 +1424,7 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl, char cmd; if (!msg) { - pr_err("Invalid msg\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid msg\n"); rc = -EINVAL; goto error; } @@ -1441,7 +1449,7 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl, while (!read_done) { rc = dsi_set_max_return_size(dsi_ctrl, msg, rd_pkt_size); if (rc) { - pr_err("Failed to set max return packet size, rc=%d\n", + DSI_CTRL_ERR(dsi_ctrl, "Failed to set max return packet size, rc=%d\n", rc); goto error; } @@ -1451,7 +1459,8 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl, rc = dsi_message_tx(dsi_ctrl, msg, flags); if (rc) { - pr_err("Message transmission failed, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Message transmission failed, rc=%d\n", + rc); goto error; } /* @@ -1502,7 +1511,7 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl, cmd = buff[0]; switch (cmd) { case MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT: - pr_err("Rx ACK_ERROR 0x%x\n", cmd); + DSI_CTRL_ERR(dsi_ctrl, "Rx ACK_ERROR 0x%x\n", cmd); rc = 0; break; case MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE: @@ -1518,7 +1527,7 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl, rc = dsi_parse_long_read_resp(msg, buff); break; default: - pr_warn("Invalid response: 0x%x\n", cmd); + DSI_CTRL_WARN(dsi_ctrl, "Invalid response: 0x%x\n", cmd); rc = 0; } @@ -1536,13 +1545,13 @@ static int dsi_enable_ulps(struct dsi_ctrl *dsi_ctrl) rc = dsi_ctrl->hw.ops.wait_for_lane_idle(&dsi_ctrl->hw, lanes); if (rc) { - pr_err("lanes not entering idle, skip ULPS\n"); + DSI_CTRL_ERR(dsi_ctrl, "lanes not entering idle, skip ULPS\n"); return rc; } if (!dsi_ctrl->hw.ops.ulps_ops.ulps_request || !dsi_ctrl->hw.ops.ulps_ops.ulps_exit) { - pr_debug("DSI controller ULPS ops not present\n"); + DSI_CTRL_DEBUG(dsi_ctrl, "DSI controller ULPS ops not present\n"); return 0; } @@ -1552,7 +1561,7 @@ static int dsi_enable_ulps(struct dsi_ctrl *dsi_ctrl) ulps_lanes = dsi_ctrl->hw.ops.ulps_ops.get_lanes_in_ulps(&dsi_ctrl->hw); if ((lanes & ulps_lanes) != lanes) { - pr_err("Failed to enter ULPS, request=0x%x, actual=0x%x\n", + DSI_CTRL_ERR(dsi_ctrl, "Failed to enter ULPS, request=0x%x, actual=0x%x\n", lanes, ulps_lanes); rc = -EIO; } @@ -1569,7 +1578,7 @@ static int dsi_disable_ulps(struct dsi_ctrl *dsi_ctrl) if (!dsi_ctrl->hw.ops.ulps_ops.ulps_request || !dsi_ctrl->hw.ops.ulps_ops.ulps_exit) { - pr_debug("DSI controller ULPS ops not present\n"); + DSI_CTRL_DEBUG(dsi_ctrl, "DSI controller ULPS ops not present\n"); return 0; } @@ -1579,7 +1588,7 @@ static int dsi_disable_ulps(struct dsi_ctrl *dsi_ctrl) ulps_lanes = dsi_ctrl->hw.ops.ulps_ops.get_lanes_in_ulps(&dsi_ctrl->hw); if ((lanes & ulps_lanes) != lanes) - pr_err("Mismatch between lanes in ULPS\n"); + DSI_CTRL_ERR(dsi_ctrl, "Mismatch between lanes in ULPS\n"); lanes &= ulps_lanes; @@ -1587,7 +1596,8 @@ static int dsi_disable_ulps(struct dsi_ctrl *dsi_ctrl) ulps_lanes = dsi_ctrl->hw.ops.ulps_ops.get_lanes_in_ulps(&dsi_ctrl->hw); if (ulps_lanes & lanes) { - pr_err("Lanes (0x%x) stuck in ULPS\n", ulps_lanes); + DSI_CTRL_ERR(dsi_ctrl, "Lanes (0x%x) stuck in ULPS\n", + ulps_lanes); rc = -EIO; } @@ -1629,7 +1639,7 @@ static int dsi_ctrl_buffer_deinit(struct dsi_ctrl *dsi_ctrl) aspace = dsi_ctrl_get_aspace(dsi_ctrl, MSM_SMMU_DOMAIN_UNSECURE); if (!aspace) { - pr_err("failed to get address space\n"); + DSI_CTRL_ERR(dsi_ctrl, "failed to get address space\n"); return -ENOMEM; } @@ -1652,7 +1662,7 @@ int dsi_ctrl_buffer_init(struct dsi_ctrl *dsi_ctrl) aspace = dsi_ctrl_get_aspace(dsi_ctrl, MSM_SMMU_DOMAIN_UNSECURE); if (!aspace) { - pr_err("failed to get address space\n"); + DSI_CTRL_ERR(dsi_ctrl, "failed to get address space\n"); return -ENOMEM; } @@ -1662,7 +1672,7 @@ int dsi_ctrl_buffer_init(struct dsi_ctrl *dsi_ctrl) if (IS_ERR(dsi_ctrl->tx_cmd_buf)) { rc = PTR_ERR(dsi_ctrl->tx_cmd_buf); - pr_err("failed to allocate gem, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to allocate gem, rc=%d\n", rc); dsi_ctrl->tx_cmd_buf = NULL; goto error; } @@ -1671,13 +1681,13 @@ int dsi_ctrl_buffer_init(struct dsi_ctrl *dsi_ctrl) rc = msm_gem_get_iova(dsi_ctrl->tx_cmd_buf, aspace, &iova); if (rc) { - pr_err("failed to get iova, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to get iova, rc=%d\n", rc); (void)dsi_ctrl_buffer_deinit(dsi_ctrl); goto error; } if (iova & 0x07) { - pr_err("Tx command buffer is not 8 byte aligned\n"); + DSI_CTRL_ERR(dsi_ctrl, "Tx command buffer is not 8 byte aligned\n"); rc = -ENOTSUPP; (void)dsi_ctrl_buffer_deinit(dsi_ctrl); goto error; @@ -1713,14 +1723,14 @@ static int dsi_ctrl_dts_parse(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || !of_node) { - pr_err("invalid dsi_ctrl:%d or of_node:%d\n", + DSI_CTRL_ERR(dsi_ctrl, "invalid dsi_ctrl:%d or of_node:%d\n", dsi_ctrl != NULL, of_node != NULL); return -EINVAL; } rc = of_property_read_u32(of_node, "cell-index", &index); if (rc) { - pr_debug("cell index not set, default to 0\n"); + DSI_CTRL_DEBUG(dsi_ctrl, "cell index not set, default to 0\n"); index = 0; } @@ -1741,7 +1751,8 @@ static int dsi_ctrl_dts_parse(struct dsi_ctrl *dsi_ctrl, rc = of_property_read_u32(of_node, "frame-threshold-time-us", &frame_threshold_time_us); if (rc) { - pr_debug("frame-threshold-time not specified, defaulting\n"); + DSI_CTRL_DEBUG(dsi_ctrl, + "frame-threshold-time not specified, defaulting\n"); frame_threshold_time_us = 2666; } @@ -1780,26 +1791,28 @@ static int dsi_ctrl_dev_probe(struct platform_device *pdev) rc = dsi_ctrl_dts_parse(dsi_ctrl, pdev->dev.of_node); if (rc) { - pr_err("ctrl:%d dts parse failed, rc = %d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "dts parse failed, rc = %d\n", rc); goto fail; } rc = dsi_ctrl_init_regmap(pdev, dsi_ctrl); if (rc) { - pr_err("Failed to parse register information, rc = %d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to parse register information, rc = %d\n", + rc); goto fail; } rc = dsi_ctrl_clocks_init(pdev, dsi_ctrl); if (rc) { - pr_err("Failed to parse clock information, rc = %d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to parse clock information, rc = %d\n", + rc); goto fail; } rc = dsi_ctrl_supplies_init(pdev, dsi_ctrl); if (rc) { - pr_err("Failed to parse voltage supplies, rc = %d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to parse voltage supplies, rc = %d\n", + rc); goto fail_clks; } @@ -1807,14 +1820,15 @@ static int dsi_ctrl_dev_probe(struct platform_device *pdev) dsi_ctrl->cell_index, dsi_ctrl->phy_isolation_enabled, dsi_ctrl->null_insertion_enabled); if (rc) { - pr_err("Catalog does not support version (%d)\n", + DSI_CTRL_ERR(dsi_ctrl, "Catalog does not support version (%d)\n", dsi_ctrl->version); goto fail_supplies; } rc = dsi_ctrl_axi_bus_client_init(pdev, dsi_ctrl); if (rc) - pr_debug("failed to init axi bus client, rc = %d\n", rc); + DSI_CTRL_DEBUG(dsi_ctrl, "failed to init axi bus client, rc = %d\n", + rc); item->ctrl = dsi_ctrl; @@ -1827,7 +1841,7 @@ static int dsi_ctrl_dev_probe(struct platform_device *pdev) dsi_ctrl->pdev = pdev; platform_set_drvdata(pdev, dsi_ctrl); - pr_info("Probe successful for %s\n", dsi_ctrl->name); + DSI_CTRL_INFO(dsi_ctrl, "Probe successful\n"); return 0; @@ -1862,15 +1876,19 @@ static int dsi_ctrl_dev_remove(struct platform_device *pdev) mutex_lock(&dsi_ctrl->ctrl_lock); rc = dsi_ctrl_axi_bus_client_deinit(dsi_ctrl); if (rc) - pr_err("failed to deinitialize axi bus client, rc = %d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to deinitialize axi bus client, rc = %d\n", + rc); rc = dsi_ctrl_supplies_deinit(dsi_ctrl); if (rc) - pr_err("failed to deinitialize voltage supplies, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, + "failed to deinitialize voltage supplies, rc=%d\n", + rc); rc = dsi_ctrl_clocks_deinit(dsi_ctrl); if (rc) - pr_err("failed to deinitialize clocks, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, + "failed to deinitialize clocks, rc=%d\n", rc); mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -1907,7 +1925,7 @@ void dsi_ctrl_debug_dump(u32 *entries, u32 size) n = list_entry(pos, struct dsi_ctrl_list_item, list); ctrl = n->ctrl; - pr_err("dsi ctrl:%d\n", ctrl->cell_index); + DSI_ERR("dsi ctrl:%d\n", ctrl->cell_index); ctrl->hw.ops.debug_bus(&ctrl->hw, entries, size); } mutex_unlock(&dsi_ctrl_list_lock); @@ -1942,14 +1960,14 @@ struct dsi_ctrl *dsi_ctrl_get(struct device_node *of_node) mutex_unlock(&dsi_ctrl_list_lock); if (!ctrl) { - pr_err("Device with of node not found\n"); + DSI_CTRL_ERR(ctrl, "Device with of node not found\n"); ctrl = ERR_PTR(-EPROBE_DEFER); return ctrl; } mutex_lock(&ctrl->ctrl_lock); if (ctrl->refcount == 1) { - pr_err("[%s] Device in use\n", ctrl->name); + DSI_CTRL_ERR(ctrl, "Device in use\n"); mutex_unlock(&ctrl->ctrl_lock); ctrl = ERR_PTR(-EBUSY); return ctrl; @@ -1972,7 +1990,7 @@ void dsi_ctrl_put(struct dsi_ctrl *dsi_ctrl) mutex_lock(&dsi_ctrl->ctrl_lock); if (dsi_ctrl->refcount == 0) - pr_err("Unbalanced %s call\n", __func__); + DSI_CTRL_ERR(dsi_ctrl, "Unbalanced %s call\n", __func__); else dsi_ctrl->refcount--; @@ -1994,21 +2012,21 @@ int dsi_ctrl_drv_init(struct dsi_ctrl *dsi_ctrl, struct dentry *parent) int rc = 0; if (!dsi_ctrl || !parent) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } mutex_lock(&dsi_ctrl->ctrl_lock); rc = dsi_ctrl_drv_state_init(dsi_ctrl); if (rc) { - pr_err("Failed to initialize driver state, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to initialize driver state, rc=%d\n", + rc); goto error; } rc = dsi_ctrl_debugfs_init(dsi_ctrl, parent); if (rc) { - pr_err("[DSI_%d] failed to init debug fs, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to init debug fs, rc=%d\n", rc); goto error; } @@ -2030,7 +2048,7 @@ int dsi_ctrl_drv_deinit(struct dsi_ctrl *dsi_ctrl) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2038,11 +2056,13 @@ int dsi_ctrl_drv_deinit(struct dsi_ctrl *dsi_ctrl) rc = dsi_ctrl_debugfs_deinit(dsi_ctrl); if (rc) - pr_err("failed to release debugfs root, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to release debugfs root, rc=%d\n", + rc); rc = dsi_ctrl_buffer_deinit(dsi_ctrl); if (rc) - pr_err("Failed to free cmd buffers, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to free cmd buffers, rc=%d\n", + rc); mutex_unlock(&dsi_ctrl->ctrl_lock); return rc; @@ -2052,7 +2072,7 @@ int dsi_ctrl_clk_cb_register(struct dsi_ctrl *dsi_ctrl, struct clk_ctrl_cb *clk_cb) { if (!dsi_ctrl || !clk_cb) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2078,21 +2098,21 @@ int dsi_ctrl_phy_sw_reset(struct dsi_ctrl *dsi_ctrl) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } mutex_lock(&dsi_ctrl->ctrl_lock); rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_PHY_SW_RESET, 0x0); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } dsi_ctrl->hw.ops.phy_sw_reset(&dsi_ctrl->hw); - pr_debug("[DSI_%d] PHY soft reset done\n", dsi_ctrl->cell_index); + DSI_CTRL_DEBUG(dsi_ctrl, "PHY soft reset done\n"); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_PHY_SW_RESET, 0x0); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -2116,7 +2136,7 @@ int dsi_ctrl_async_timing_update(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || !timing) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2125,8 +2145,8 @@ int dsi_ctrl_async_timing_update(struct dsi_ctrl *dsi_ctrl, rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_ASYNC_TIMING, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto exit; } @@ -2155,7 +2175,7 @@ int dsi_ctrl_timing_db_update(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid dsi_ctrl\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid dsi_ctrl\n"); return -EINVAL; } @@ -2164,8 +2184,8 @@ int dsi_ctrl_timing_db_update(struct dsi_ctrl *dsi_ctrl, rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_ASYNC_TIMING, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto exit; } @@ -2192,7 +2212,7 @@ int dsi_ctrl_setup(struct dsi_ctrl *dsi_ctrl) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2238,7 +2258,7 @@ int dsi_ctrl_set_roi(struct dsi_ctrl *dsi_ctrl, struct dsi_rect *roi, int rc = 0; if (!dsi_ctrl || !roi || !changed) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2267,7 +2287,7 @@ int dsi_ctrl_config_clk_gating(struct dsi_ctrl *dsi_ctrl, bool enable, enum dsi_clk_gate_type clk_selection) { if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2289,7 +2309,7 @@ int dsi_ctrl_config_clk_gating(struct dsi_ctrl *dsi_ctrl, bool enable, int dsi_ctrl_phy_reset_config(struct dsi_ctrl *dsi_ctrl, bool enable) { if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2307,7 +2327,7 @@ static bool dsi_ctrl_check_for_spurious_error_interrupts( unsigned long jiffies_now = jiffies; if (!dsi_ctrl) { - pr_err("Invalid DSI controller structure\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid DSI controller structure\n"); return false; } @@ -2318,7 +2338,7 @@ static bool dsi_ctrl_check_for_spurious_error_interrupts( if ((jiffies_now - dsi_ctrl->jiffies_start) < intr_check_interval) { if (dsi_ctrl->error_interrupt_count > interrupt_threshold) { - pr_warn("Detected spurious interrupts on dsi ctrl\n"); + DSI_CTRL_WARN(dsi_ctrl, "Detected spurious interrupts on dsi ctrl\n"); return true; } } else { @@ -2346,7 +2366,8 @@ static void dsi_ctrl_handle_error_status(struct dsi_ctrl *dsi_ctrl, /* DTLN PHY error */ if (error & 0x3000E00) - pr_err("dsi PHY contention error: 0x%lx\n", error); + DSI_CTRL_ERR(dsi_ctrl, "dsi PHY contention error: 0x%lx\n", + error); /* ignore TX timeout if blpp_lp11 is disabled */ if (dsi_ctrl->host_config.panel_mode == DSI_OP_VIDEO_MODE && @@ -2365,7 +2386,7 @@ static void dsi_ctrl_handle_error_status(struct dsi_ctrl *dsi_ctrl, 0, 0, 0, 0); } } - pr_err("tx timeout error: 0x%lx\n", error); + DSI_CTRL_ERR(dsi_ctrl, "tx timeout error: 0x%lx\n", error); } /* DSI FIFO OVERFLOW error */ @@ -2381,7 +2402,8 @@ static void dsi_ctrl_handle_error_status(struct dsi_ctrl *dsi_ctrl, cb_info.event_idx, dsi_ctrl->cell_index, 0, 0, 0, 0); - pr_err("dsi FIFO OVERFLOW error: 0x%lx\n", error); + DSI_CTRL_ERR(dsi_ctrl, "dsi FIFO OVERFLOW error: 0x%lx\n", + error); } } @@ -2394,16 +2416,17 @@ static void dsi_ctrl_handle_error_status(struct dsi_ctrl *dsi_ctrl, dsi_ctrl->cell_index, 0, 0, 0, 0); } - pr_err("dsi FIFO UNDERFLOW error: 0x%lx\n", error); + DSI_CTRL_ERR(dsi_ctrl, "dsi FIFO UNDERFLOW error: 0x%lx\n", + error); } /* DSI PLL UNLOCK error */ if (error & BIT(8)) - pr_err("dsi PLL unlock error: 0x%lx\n", error); + DSI_CTRL_ERR(dsi_ctrl, "dsi PLL unlock error: 0x%lx\n", error); /* ACK error */ if (error & 0xF) - pr_err("ack error: 0x%lx\n", error); + DSI_CTRL_ERR(dsi_ctrl, "ack error: 0x%lx\n", error); /* * DSI Phy can go into bad state during ESD influence. This can @@ -2530,21 +2553,20 @@ static int _dsi_ctrl_setup_isr(struct dsi_ctrl *dsi_ctrl) irq_num = platform_get_irq(dsi_ctrl->pdev, 0); if (irq_num < 0) { - pr_err("[DSI_%d] Failed to get IRQ number, %d\n", - dsi_ctrl->cell_index, irq_num); + DSI_CTRL_ERR(dsi_ctrl, "Failed to get IRQ number, %d\n", + irq_num); rc = irq_num; } else { rc = devm_request_threaded_irq(&dsi_ctrl->pdev->dev, irq_num, dsi_ctrl_isr, NULL, 0, "dsi_ctrl", dsi_ctrl); if (rc) { - pr_err("[DSI_%d] Failed to request IRQ, %d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to request IRQ, %d\n", + rc); } else { dsi_ctrl->irq_info.irq_num = irq_num; disable_irq_nosync(irq_num); - pr_info("[DSI_%d] IRQ %d registered\n", - dsi_ctrl->cell_index, irq_num); + DSI_CTRL_INFO(dsi_ctrl, "IRQ %d registered\n", irq_num); } } return rc; @@ -2623,7 +2645,7 @@ void dsi_ctrl_disable_status_interrupt(struct dsi_ctrl *dsi_ctrl, int dsi_ctrl_host_timing_update(struct dsi_ctrl *dsi_ctrl) { if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2643,7 +2665,7 @@ int dsi_ctrl_host_timing_update(struct dsi_ctrl *dsi_ctrl) dsi_ctrl->host_config.video_timing.h_active * 3, 0x0, NULL); } else { - pr_err("invalid panel mode for resolution switch\n"); + DSI_CTRL_ERR(dsi_ctrl, "invalid panel mode for resolution switch\n"); return -EINVAL; } @@ -2671,8 +2693,8 @@ int dsi_ctrl_update_host_state(struct dsi_ctrl *dsi_ctrl, mutex_lock(&dsi_ctrl->ctrl_lock); rc = dsi_ctrl_check_state(dsi_ctrl, op, state); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); mutex_unlock(&dsi_ctrl->ctrl_lock); return rc; } @@ -2699,15 +2721,15 @@ int dsi_ctrl_host_init(struct dsi_ctrl *dsi_ctrl, bool is_splash_enabled) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } mutex_lock(&dsi_ctrl->ctrl_lock); rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_HOST_INIT, 0x1); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } @@ -2743,8 +2765,8 @@ int dsi_ctrl_host_init(struct dsi_ctrl *dsi_ctrl, bool is_splash_enabled) dsi_ctrl->hw.ops.enable_status_interrupts(&dsi_ctrl->hw, 0x0); dsi_ctrl_enable_error_interrupts(dsi_ctrl); - pr_debug("[DSI_%d]Host initialization complete, continuous splash status:%d\n", - dsi_ctrl->cell_index, is_splash_enabled); + DSI_CTRL_DEBUG(dsi_ctrl, "Host initialization complete, continuous splash status:%d\n", + is_splash_enabled); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_HOST_INIT, 0x1); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -2799,7 +2821,7 @@ int dsi_ctrl_soft_reset(struct dsi_ctrl *dsi_ctrl) dsi_ctrl->hw.ops.soft_reset(&dsi_ctrl->hw); mutex_unlock(&dsi_ctrl->ctrl_lock); - pr_debug("[DSI_%d]Soft reset complete\n", dsi_ctrl->cell_index); + DSI_CTRL_DEBUG(dsi_ctrl, "Soft reset complete\n"); return 0; } @@ -2873,7 +2895,7 @@ int dsi_ctrl_host_deinit(struct dsi_ctrl *dsi_ctrl) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -2881,14 +2903,14 @@ int dsi_ctrl_host_deinit(struct dsi_ctrl *dsi_ctrl) rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_HOST_INIT, 0x0); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); - pr_err("driver state check failed, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); + DSI_CTRL_ERR(dsi_ctrl, "driver state check failed, rc=%d\n", + rc); goto error; } - pr_debug("[DSI_%d] Host deinitization complete\n", - dsi_ctrl->cell_index); + DSI_CTRL_DEBUG(dsi_ctrl, "Host deinitization complete\n"); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_HOST_INIT, 0x0); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -2915,7 +2937,7 @@ int dsi_ctrl_update_host_config(struct dsi_ctrl *ctrl, int rc = 0; if (!ctrl || !config) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(ctrl, "Invalid params\n"); return -EINVAL; } @@ -2923,7 +2945,7 @@ int dsi_ctrl_update_host_config(struct dsi_ctrl *ctrl, rc = dsi_ctrl_validate_panel_info(ctrl, config); if (rc) { - pr_err("panel validation failed, rc=%d\n", rc); + DSI_CTRL_ERR(ctrl, "panel validation failed, rc=%d\n", rc); goto error; } @@ -2936,13 +2958,13 @@ int dsi_ctrl_update_host_config(struct dsi_ctrl *ctrl, rc = dsi_ctrl_update_link_freqs(ctrl, config, clk_handle, mode); if (rc) { - pr_err("[%s] failed to update link frequency, rc=%d\n", - ctrl->name, rc); + DSI_CTRL_ERR(ctrl, "failed to update link frequency, rc=%d\n", + rc); goto error; } } - pr_debug("[DSI_%d]Host config updated\n", ctrl->cell_index); + DSI_CTRL_DEBUG(ctrl, "Host config updated\n"); memcpy(&ctrl->host_config, config, sizeof(ctrl->host_config)); ctrl->mode_bounds.x = ctrl->host_config.video_timing.h_active * ctrl->horiz_index; @@ -2973,7 +2995,7 @@ int dsi_ctrl_validate_timing(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || !mode) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3001,7 +3023,7 @@ int dsi_ctrl_cmd_transfer(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || !msg) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3009,19 +3031,21 @@ int dsi_ctrl_cmd_transfer(struct dsi_ctrl *dsi_ctrl, rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_CMD_TX, 0x0); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } if (flags & DSI_CTRL_CMD_READ) { rc = dsi_message_rx(dsi_ctrl, msg, flags); if (rc <= 0) - pr_err("read message failed read length, rc=%d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "read message failed read length, rc=%d\n", + rc); } else { rc = dsi_message_tx(dsi_ctrl, msg, flags); if (rc) - pr_err("command msg transfer failed, rc = %d\n", rc); + DSI_CTRL_ERR(dsi_ctrl, "command msg transfer failed, rc = %d\n", + rc); } dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_CMD_TX, 0x0); @@ -3045,7 +3069,7 @@ int dsi_ctrl_cmd_tx_trigger(struct dsi_ctrl *dsi_ctrl, u32 flags) u32 mask = (DSI_CMD_MODE_DMA_DONE); if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3087,13 +3111,12 @@ int dsi_ctrl_cmd_tx_trigger(struct dsi_ctrl *dsi_ctrl, u32 flags) dsi_ctrl_disable_status_interrupt(dsi_ctrl, DSI_SINT_CMD_MODE_DMA_DONE); complete_all(&dsi_ctrl->irq_info.cmd_dma_done); - pr_warn("dma_tx done but irq not triggered\n"); + DSI_CTRL_WARN(dsi_ctrl, "dma_tx done but irq not triggered\n"); } else { rc = -ETIMEDOUT; dsi_ctrl_disable_status_interrupt(dsi_ctrl, DSI_SINT_CMD_MODE_DMA_DONE); - pr_err("[DSI_%d]Command transfer failed\n", - dsi_ctrl->cell_index); + DSI_CTRL_ERR(dsi_ctrl, "Command transfer failed\n"); } } if (dsi_ctrl->hw.ops.mask_error_intr && @@ -3128,8 +3151,7 @@ void dsi_ctrl_cache_misr(struct dsi_ctrl *dsi_ctrl) if (misr) dsi_ctrl->misr_cache = misr; - pr_debug("DSI_%d misr_cache = %x\n", dsi_ctrl->cell_index, - dsi_ctrl->misr_cache); + DSI_CTRL_DEBUG(dsi_ctrl, "misr_cache = %x\n", dsi_ctrl->misr_cache); } /** @@ -3143,7 +3165,7 @@ int dsi_ctrl_get_host_engine_init_state(struct dsi_ctrl *dsi_ctrl, bool *state) { if (!dsi_ctrl || !state) { - pr_err("Invalid Params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid Params\n"); return -EINVAL; } @@ -3170,7 +3192,7 @@ int dsi_ctrl_update_host_engine_state_for_cont_splash(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || (state >= DSI_CTRL_ENGINE_MAX)) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3178,13 +3200,12 @@ int dsi_ctrl_update_host_engine_state_for_cont_splash(struct dsi_ctrl *dsi_ctrl, rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_HOST_ENGINE, state); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } - pr_debug("[DSI_%d] Set host engine state = %d\n", dsi_ctrl->cell_index, - state); + DSI_CTRL_DEBUG(dsi_ctrl, "Set host engine state = %d\n", state); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_HOST_ENGINE, state); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -3207,7 +3228,7 @@ int dsi_ctrl_set_power_state(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || (state >= DSI_CTRL_POWER_MAX)) { - pr_err("Invalid Params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid Params\n"); return -EINVAL; } @@ -3216,29 +3237,28 @@ int dsi_ctrl_set_power_state(struct dsi_ctrl *dsi_ctrl, rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_POWER_STATE_CHANGE, state); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } if (state == DSI_CTRL_POWER_VREG_ON) { rc = dsi_ctrl_enable_supplies(dsi_ctrl, true); if (rc) { - pr_err("[%d]failed to enable voltage supplies, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to enable voltage supplies, rc=%d\n", + rc); goto error; } } else if (state == DSI_CTRL_POWER_VREG_OFF) { rc = dsi_ctrl_enable_supplies(dsi_ctrl, false); if (rc) { - pr_err("[%d]failed to disable vreg supplies, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "failed to disable vreg supplies, rc=%d\n", + rc); goto error; } } - pr_debug("[DSI_%d] Power state updated to %d\n", dsi_ctrl->cell_index, - state); + DSI_CTRL_DEBUG(dsi_ctrl, "Power state updated to %d\n", state); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_POWER_STATE_CHANGE, state); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -3260,7 +3280,7 @@ int dsi_ctrl_set_tpg_state(struct dsi_ctrl *dsi_ctrl, bool on) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3268,8 +3288,8 @@ int dsi_ctrl_set_tpg_state(struct dsi_ctrl *dsi_ctrl, bool on) rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_TPG, on); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } @@ -3288,8 +3308,7 @@ int dsi_ctrl_set_tpg_state(struct dsi_ctrl *dsi_ctrl, bool on) } dsi_ctrl->hw.ops.test_pattern_enable(&dsi_ctrl->hw, on); - pr_debug("[DSI_%d]Set test pattern state=%d\n", - dsi_ctrl->cell_index, on); + DSI_CTRL_DEBUG(dsi_ctrl, "Set test pattern state=%d\n", on); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_TPG, on); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -3312,7 +3331,7 @@ int dsi_ctrl_set_host_engine_state(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || (state >= DSI_CTRL_ENGINE_MAX)) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3320,8 +3339,8 @@ int dsi_ctrl_set_host_engine_state(struct dsi_ctrl *dsi_ctrl, rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_HOST_ENGINE, state); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } @@ -3330,8 +3349,7 @@ int dsi_ctrl_set_host_engine_state(struct dsi_ctrl *dsi_ctrl, else dsi_ctrl->hw.ops.ctrl_en(&dsi_ctrl->hw, false); - pr_debug("[DSI_%d] Set host engine state = %d\n", dsi_ctrl->cell_index, - state); + DSI_CTRL_DEBUG(dsi_ctrl, "Set host engine state = %d\n", state); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_HOST_ENGINE, state); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -3354,14 +3372,14 @@ int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || (state >= DSI_CTRL_ENGINE_MAX)) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_CMD_ENGINE, state); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } @@ -3370,8 +3388,7 @@ int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl, else dsi_ctrl->hw.ops.cmd_engine_en(&dsi_ctrl->hw, false); - pr_debug("[DSI_%d] Set cmd engine state = %d\n", dsi_ctrl->cell_index, - state); + DSI_CTRL_DEBUG(dsi_ctrl, "Set cmd engine state = %d\n", state); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_CMD_ENGINE, state); error: return rc; @@ -3394,7 +3411,7 @@ int dsi_ctrl_set_vid_engine_state(struct dsi_ctrl *dsi_ctrl, bool on; if (!dsi_ctrl || (state >= DSI_CTRL_ENGINE_MAX)) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3402,8 +3419,8 @@ int dsi_ctrl_set_vid_engine_state(struct dsi_ctrl *dsi_ctrl, rc = dsi_ctrl_check_state(dsi_ctrl, DSI_CTRL_OP_VID_ENGINE, state); if (rc) { - pr_err("[DSI_%d] Controller state check failed, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Controller state check failed, rc=%d\n", + rc); goto error; } @@ -3414,8 +3431,7 @@ int dsi_ctrl_set_vid_engine_state(struct dsi_ctrl *dsi_ctrl, if (!on) dsi_ctrl->hw.ops.soft_reset(&dsi_ctrl->hw); - pr_debug("[DSI_%d] Set video engine state = %d\n", dsi_ctrl->cell_index, - state); + DSI_CTRL_DEBUG(dsi_ctrl, "Set video engine state = %d\n", state); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_VID_ENGINE, state); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -3436,7 +3452,7 @@ int dsi_ctrl_set_ulps(struct dsi_ctrl *dsi_ctrl, bool enable) int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3448,11 +3464,11 @@ int dsi_ctrl_set_ulps(struct dsi_ctrl *dsi_ctrl, bool enable) rc = dsi_disable_ulps(dsi_ctrl); if (rc) { - pr_err("[DSI_%d] Ulps state change(%d) failed, rc=%d\n", - dsi_ctrl->cell_index, enable, rc); + DSI_CTRL_ERR(dsi_ctrl, "Ulps state change(%d) failed, rc=%d\n", + enable, rc); goto error; } - pr_debug("[DSI_%d] ULPS state = %d\n", dsi_ctrl->cell_index, enable); + DSI_CTRL_DEBUG(dsi_ctrl, "ULPS state = %d\n", enable); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -3474,13 +3490,13 @@ int dsi_ctrl_set_clamp_state(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } if (!dsi_ctrl->hw.ops.clamp_enable || !dsi_ctrl->hw.ops.clamp_disable) { - pr_debug("No clamp control for DSI controller\n"); + DSI_CTRL_DEBUG(dsi_ctrl, "No clamp control for DSI controller\n"); return 0; } @@ -3488,12 +3504,11 @@ int dsi_ctrl_set_clamp_state(struct dsi_ctrl *dsi_ctrl, rc = dsi_enable_io_clamp(dsi_ctrl, enable, ulps_enabled); if (rc) { - pr_err("[DSI_%d] Failed to enable IO clamp\n", - dsi_ctrl->cell_index); + DSI_CTRL_ERR(dsi_ctrl, "Failed to enable IO clamp\n"); goto error; } - pr_debug("[DSI_%d] Clamp state = %d\n", dsi_ctrl->cell_index, enable); + DSI_CTRL_DEBUG(dsi_ctrl, "Clamp state = %d\n", enable); error: mutex_unlock(&dsi_ctrl->ctrl_lock); return rc; @@ -3514,7 +3529,7 @@ int dsi_ctrl_set_clock_source(struct dsi_ctrl *dsi_ctrl, int rc = 0; if (!dsi_ctrl || !source_clks) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3522,8 +3537,8 @@ int dsi_ctrl_set_clock_source(struct dsi_ctrl *dsi_ctrl, rc = dsi_clk_update_parent(source_clks, &dsi_ctrl->clk_info.rcg_clks); if (rc) { - pr_err("[DSI_%d]Failed to update link clk parent, rc=%d\n", - dsi_ctrl->cell_index, rc); + DSI_CTRL_ERR(dsi_ctrl, "Failed to update link clk parent, rc=%d\n", + rc); (void)dsi_clk_update_parent(&dsi_ctrl->clk_info.pll_op_clks, &dsi_ctrl->clk_info.rcg_clks); goto error; @@ -3532,7 +3547,7 @@ int dsi_ctrl_set_clock_source(struct dsi_ctrl *dsi_ctrl, dsi_ctrl->clk_info.pll_op_clks.byte_clk = source_clks->byte_clk; dsi_ctrl->clk_info.pll_op_clks.pixel_clk = source_clks->pixel_clk; - pr_debug("[DSI_%d] Source clocks are updated\n", dsi_ctrl->cell_index); + DSI_CTRL_DEBUG(dsi_ctrl, "Source clocks are updated\n"); error: mutex_unlock(&dsi_ctrl->ctrl_lock); @@ -3552,7 +3567,7 @@ int dsi_ctrl_setup_misr(struct dsi_ctrl *dsi_ctrl, u32 frame_count) { if (!dsi_ctrl) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return -EINVAL; } @@ -3586,8 +3601,8 @@ u32 dsi_ctrl_collect_misr(struct dsi_ctrl *dsi_ctrl) if (!misr) misr = dsi_ctrl->misr_cache; - pr_debug("DSI_%d cached misr = %x, final = %x\n", - dsi_ctrl->cell_index, dsi_ctrl->misr_cache, misr); + DSI_CTRL_DEBUG(dsi_ctrl, "cached misr = %x, final = %x\n", + dsi_ctrl->misr_cache, misr); return misr; } @@ -3597,7 +3612,7 @@ void dsi_ctrl_mask_error_status_interrupts(struct dsi_ctrl *dsi_ctrl, u32 idx, { if (!dsi_ctrl || !dsi_ctrl->hw.ops.error_intr_ctrl || !dsi_ctrl->hw.ops.clear_error_status) { - pr_err("Invalid params\n"); + DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); return; } diff --git a/msm/dsi/dsi_ctrl_hw.h b/msm/dsi/dsi_ctrl_hw.h index 01ebdc6ccb..853f16d433 100644 --- a/msm/dsi/dsi_ctrl_hw.h +++ b/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. diff --git a/msm/dsi/dsi_ctrl_hw_1_4.c b/msm/dsi/dsi_ctrl_hw_1_4.c index 7420b9bebd..1fa0b51207 100644 --- a/msm/dsi/dsi_ctrl_hw_1_4.c +++ b/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 #include @@ -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; } diff --git a/msm/dsi/dsi_ctrl_hw_2_0.c b/msm/dsi/dsi_ctrl_hw_2_0.c index 5ce62599de..3af3225d77 100644 --- a/msm/dsi/dsi_ctrl_hw_2_0.c +++ b/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 #include @@ -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; } diff --git a/msm/dsi/dsi_ctrl_hw_2_2.c b/msm/dsi/dsi_ctrl_hw_2_2.c index bf2379f8c0..0c6d3404a2 100644 --- a/msm/dsi/dsi_ctrl_hw_2_2.c +++ b/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" diff --git a/msm/dsi/dsi_ctrl_hw_cmn.c b/msm/dsi/dsi_ctrl_hw_cmn.c index c0803a24e9..7856574102 100644 --- a/msm/dsi/dsi_ctrl_hw_cmn.c +++ b/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 #include @@ -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; } diff --git a/msm/dsi/dsi_defs.h b/msm/dsi/dsi_defs.h index 2f30a848f4..8aed1670a1 100644 --- a/msm/dsi/dsi_defs.h +++ b/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: diff --git a/msm/dsi/dsi_display.c b/msm/dsi/dsi_display.c index 60a0ab34fa..9808b2ed72 100644 --- a/msm/dsi/dsi_display.c +++ b/msm/dsi/dsi_display.c @@ -3,8 +3,6 @@ * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */ -#define pr_fmt(fmt) "msm-dsi-display:[%s] " fmt, __func__ - #include #include #include @@ -74,18 +72,18 @@ static int dsi_display_config_clk_gating(struct dsi_display *display, enum dsi_clk_gate_type const default_clk_select = PIXEL_CLK | DSI_PHY; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (display->panel->host_config.force_hs_clk_lane) { - pr_debug("no dsi clock gating for continuous clock mode\n"); + DSI_DEBUG("no dsi clock gating for continuous clock mode\n"); return 0; } mctrl = &display->ctrl[display->clk_master_idx]; if (!mctrl) { - pr_err("Invalid controller\n"); + DSI_ERR("Invalid controller\n"); return -EINVAL; } @@ -101,14 +99,14 @@ static int dsi_display_config_clk_gating(struct dsi_display *display, clk_selection = 0; } - pr_debug("%s clock gating Byte:%s Pixel:%s PHY:%s\n", + DSI_DEBUG("%s clock gating Byte:%s Pixel:%s PHY:%s\n", enable ? "Enabling" : "Disabling", clk_selection & BYTE_CLK ? "yes" : "no", clk_selection & PIXEL_CLK ? "yes" : "no", clk_selection & DSI_PHY ? "yes" : "no"); rc = dsi_ctrl_config_clk_gating(mctrl->ctrl, enable, clk_selection); if (rc) { - pr_err("[%s] failed to %s clk gating for clocks %d, rc=%d\n", + DSI_ERR("[%s] failed to %s clk gating for clocks %d, rc=%d\n", display->name, enable ? "enable" : "disable", clk_selection, rc); return rc; @@ -126,7 +124,7 @@ static int dsi_display_config_clk_gating(struct dsi_display *display, rc = dsi_ctrl_config_clk_gating(ctrl->ctrl, enable, clk_selection); if (rc) { - pr_err("[%s] failed to %s clk gating for clocks %d, rc=%d\n", + DSI_ERR("[%s] failed to %s clk gating for clocks %d, rc=%d\n", display->name, enable ? "enable" : "disable", clk_selection, rc); return rc; @@ -222,24 +220,24 @@ int dsi_display_set_backlight(struct drm_connector *connector, bl_scale_sv = panel->bl_config.bl_scale_sv; bl_temp = (u32)bl_temp * bl_scale_sv / MAX_SV_BL_SCALE_LEVEL; - pr_debug("bl_scale = %u, bl_scale_sv = %u, bl_lvl = %u\n", + DSI_DEBUG("bl_scale = %u, bl_scale_sv = %u, bl_lvl = %u\n", bl_scale, bl_scale_sv, (u32)bl_temp); rc = dsi_display_clk_ctrl(dsi_display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI core clocks, rc=%d\n", dsi_display->name, rc); goto error; } rc = dsi_panel_set_backlight(panel, (u32)bl_temp); if (rc) - pr_err("unable to set backlight\n"); + DSI_ERR("unable to set backlight\n"); rc = dsi_display_clk_ctrl(dsi_display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_OFF); if (rc) { - pr_err("[%s] failed to disable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI core clocks, rc=%d\n", dsi_display->name, rc); goto error; } @@ -265,7 +263,7 @@ static int dsi_display_cmd_engine_enable(struct dsi_display *display) rc = dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[%s] failed to enable cmd engine, rc=%d\n", + DSI_ERR("[%s] failed to enable cmd engine, rc=%d\n", display->name, rc); goto done; } @@ -278,7 +276,7 @@ static int dsi_display_cmd_engine_enable(struct dsi_display *display) rc = dsi_ctrl_set_cmd_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[%s] failed to enable cmd engine, rc=%d\n", + DSI_ERR("[%s] failed to enable cmd engine, rc=%d\n", display->name, rc); goto error_disable_master; } @@ -303,7 +301,7 @@ static int dsi_display_cmd_engine_disable(struct dsi_display *display) mutex_lock(&m_ctrl->ctrl->ctrl_lock); if (display->cmd_engine_refcount == 0) { - pr_err("[%s] Invalid refcount\n", display->name); + DSI_ERR("[%s] Invalid refcount\n", display->name); goto done; } else if (display->cmd_engine_refcount > 1) { display->cmd_engine_refcount--; @@ -318,13 +316,13 @@ static int dsi_display_cmd_engine_disable(struct dsi_display *display) rc = dsi_ctrl_set_cmd_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_OFF); if (rc) - pr_err("[%s] failed to enable cmd engine, rc=%d\n", + DSI_ERR("[%s] failed to enable cmd engine, rc=%d\n", display->name, rc); } rc = dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_OFF); if (rc) { - pr_err("[%s] failed to enable cmd engine, rc=%d\n", + DSI_ERR("[%s] failed to enable cmd engine, rc=%d\n", display->name, rc); goto error; } @@ -343,7 +341,7 @@ static void dsi_display_aspace_cb_locked(void *cb_data, bool is_detach) int rc, cnt; if (!cb_data) { - pr_err("aspace cb called with invalid cb_data\n"); + DSI_ERR("aspace cb called with invalid cb_data\n"); return; } display = (struct dsi_display *)cb_data; @@ -366,7 +364,7 @@ static void dsi_display_aspace_cb_locked(void *cb_data, bool is_detach) rc = msm_gem_get_iova(display->tx_cmd_buf, display->aspace, &(display->cmd_buffer_iova)); if (rc) { - pr_err("failed to get the iova rc %d\n", rc); + DSI_ERR("failed to get the iova rc %d\n", rc); goto end; } @@ -374,7 +372,7 @@ static void dsi_display_aspace_cb_locked(void *cb_data, bool is_detach) (void *) msm_gem_get_vaddr(display->tx_cmd_buf); if (IS_ERR_OR_NULL(display->vaddr)) { - pr_err("failed to get va rc %d\n", rc); + DSI_ERR("failed to get va rc %d\n", rc); goto end; } } @@ -413,7 +411,7 @@ static void dsi_display_change_te_irq_status(struct dsi_display *display, bool enable) { if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return; } @@ -436,13 +434,13 @@ static void dsi_display_register_te_irq(struct dsi_display *display) pdev = display->pdev; if (!pdev) { - pr_err("invalid platform device\n"); + DSI_ERR("invalid platform device\n"); return; } dev = &pdev->dev; if (!dev) { - pr_err("invalid device\n"); + DSI_ERR("invalid device\n"); return; } @@ -461,7 +459,7 @@ static void dsi_display_register_te_irq(struct dsi_display *display) IRQF_TRIGGER_FALLING | IRQF_ONESHOT, "TE_GPIO", display); if (rc) { - pr_err("TE request_irq failed for ESD rc:%d\n", rc); + DSI_ERR("TE request_irq failed for ESD rc:%d\n", rc); irq_clear_status_flags(te_irq, IRQ_DISABLE_UNLAZY); goto error; } @@ -473,7 +471,7 @@ static void dsi_display_register_te_irq(struct dsi_display *display) error: /* disable the TE based ESD check */ - pr_warn("Unable to register for TE IRQ\n"); + DSI_WARN("Unable to register for TE IRQ\n"); if (display->panel->esd_config.status_mode == ESD_MODE_PANEL_TE) display->panel->esd_config.esd_enabled = false; } @@ -483,7 +481,7 @@ static bool dsi_display_is_te_based_esd(struct dsi_display *display) u32 status_mode = 0; if (!display->panel) { - pr_err("Invalid panel data\n"); + DSI_ERR("Invalid panel data\n"); return false; } @@ -506,7 +504,7 @@ static int dsi_host_alloc_cmd_tx_buffer(struct dsi_display *display) MSM_BO_UNCACHED); if ((display->tx_cmd_buf) == NULL) { - pr_err("Failed to allocate cmd tx buf memory\n"); + DSI_ERR("Failed to allocate cmd tx buf memory\n"); rc = -ENOMEM; goto error; } @@ -516,7 +514,7 @@ static int dsi_host_alloc_cmd_tx_buffer(struct dsi_display *display) display->aspace = msm_gem_smmu_address_space_get( display->drm_dev, MSM_SMMU_DOMAIN_UNSECURE); if (!display->aspace) { - pr_err("failed to get aspace\n"); + DSI_ERR("failed to get aspace\n"); rc = -EINVAL; goto free_gem; } @@ -524,21 +522,21 @@ static int dsi_host_alloc_cmd_tx_buffer(struct dsi_display *display) rc = msm_gem_address_space_register_cb(display->aspace, dsi_display_aspace_cb_locked, (void *)display); if (rc) { - pr_err("failed to register callback %d\n", rc); + DSI_ERR("failed to register callback %d\n", rc); goto free_gem; } rc = msm_gem_get_iova(display->tx_cmd_buf, display->aspace, &(display->cmd_buffer_iova)); if (rc) { - pr_err("failed to get the iova rc %d\n", rc); + DSI_ERR("failed to get the iova rc %d\n", rc); goto free_aspace_cb; } display->vaddr = (void *) msm_gem_get_vaddr(display->tx_cmd_buf); if (IS_ERR_OR_NULL(display->vaddr)) { - pr_err("failed to get va rc %d\n", rc); + DSI_ERR("failed to get va rc %d\n", rc); rc = -EINVAL; goto put_iova; } @@ -615,13 +613,13 @@ static void dsi_display_parse_te_data(struct dsi_display *display) pdev = display->pdev; if (!pdev) { - pr_err("Invalid platform device\n"); + DSI_ERR("Invalid platform device\n"); return; } dev = &pdev->dev; if (!dev) { - pr_err("Invalid platform device\n"); + DSI_ERR("Invalid platform device\n"); return; } @@ -636,7 +634,7 @@ static void dsi_display_parse_te_data(struct dsi_display *display) "qcom,panel-te-source", &val); if (rc || (val > MAX_TE_SOURCE_ID)) { - pr_err("invalid vsync source selection\n"); + DSI_ERR("invalid vsync source selection\n"); val = 0; } @@ -681,7 +679,7 @@ static int dsi_display_read_status(struct dsi_display_ctrl *ctrl, cmds[i].msg.rx_len = config->status_cmds_rlen[i]; rc = dsi_ctrl_cmd_transfer(ctrl->ctrl, &cmds[i].msg, flags); if (rc <= 0) { - pr_err("rx cmd transfer failed rc=%d\n", rc); + DSI_ERR("rx cmd transfer failed rc=%d\n", rc); return rc; } @@ -722,27 +720,27 @@ static int dsi_display_status_reg_read(struct dsi_display *display) int rc = 0, i; struct dsi_display_ctrl *m_ctrl, *ctrl; - pr_debug(" ++\n"); + DSI_DEBUG(" ++\n"); m_ctrl = &display->ctrl[display->cmd_master_idx]; if (display->tx_cmd_buf == NULL) { rc = dsi_host_alloc_cmd_tx_buffer(display); if (rc) { - pr_err("failed to allocate cmd tx buffer memory\n"); + DSI_ERR("failed to allocate cmd tx buffer memory\n"); goto done; } } rc = dsi_display_cmd_engine_enable(display); if (rc) { - pr_err("cmd engine enable failed\n"); + DSI_ERR("cmd engine enable failed\n"); return -EPERM; } rc = dsi_display_validate_status(m_ctrl, display->panel); if (rc <= 0) { - pr_err("[%s] read status failed on master,rc=%d\n", + DSI_ERR("[%s] read status failed on master,rc=%d\n", display->name, rc); goto exit; } @@ -757,7 +755,7 @@ static int dsi_display_status_reg_read(struct dsi_display *display) rc = dsi_display_validate_status(ctrl, display->panel); if (rc <= 0) { - pr_err("[%s] read status failed on slave,rc=%d\n", + DSI_ERR("[%s] read status failed on slave,rc=%d\n", display->name, rc); goto exit; } @@ -772,7 +770,7 @@ static int dsi_display_status_bta_request(struct dsi_display *display) { int rc = 0; - pr_debug(" ++\n"); + DSI_DEBUG(" ++\n"); /* TODO: trigger SW BTA and wait for acknowledgment */ return rc; @@ -788,7 +786,7 @@ static int dsi_display_status_check_te(struct dsi_display *display) reinit_completion(&display->esd_te_gate); if (!wait_for_completion_timeout(&display->esd_te_gate, esd_te_timeout)) { - pr_err("TE check failed\n"); + DSI_ERR("TE check failed\n"); rc = -EINVAL; } @@ -814,7 +812,7 @@ int dsi_display_check_status(struct drm_connector *connector, void *display, dsi_panel_acquire_panel_lock(panel); if (!panel->panel_initialized) { - pr_debug("Panel not initialized\n"); + DSI_DEBUG("Panel not initialized\n"); goto release_panel_lock; } @@ -856,7 +854,7 @@ int dsi_display_check_status(struct drm_connector *connector, void *display, } else if (status_mode == ESD_MODE_PANEL_TE) { rc = dsi_display_status_check_te(dsi_display); } else { - pr_warn("Unsupported check status mode: %d\n", status_mode); + DSI_WARN("Unsupported check status mode: %d\n", status_mode); panel->esd_config.esd_enabled = false; } @@ -897,7 +895,7 @@ static int dsi_display_cmd_prepare(const char *cmd_buf, u32 cmd_buf_len, cmd->msg.tx_len = ((cmd_buf[5] << 8) | (cmd_buf[6])); if (cmd->msg.tx_len > payload_len) { - pr_err("Incorrect payload length tx_len %zu, payload_len %d\n", + DSI_ERR("Incorrect payload length tx_len %zu, payload_len %d\n", cmd->msg.tx_len, payload_len); return -EINVAL; } @@ -935,16 +933,16 @@ int dsi_display_cmd_transfer(struct drm_connector *connector, bool state = false; if (!dsi_display || !cmd_buf) { - pr_err("[DSI] invalid params\n"); + DSI_ERR("[DSI] invalid params\n"); return -EINVAL; } - pr_debug("[DSI] Display command transfer\n"); + DSI_DEBUG("[DSI] Display command transfer\n"); rc = dsi_display_cmd_prepare(cmd_buf, cmd_buf_len, &cmd, cmd_payload, MAX_CMD_PAYLOAD_SIZE); if (rc) { - pr_err("[DSI] command prepare failed. rc %d\n", rc); + DSI_ERR("[DSI] command prepare failed. rc %d\n", rc); return rc; } @@ -962,7 +960,7 @@ int dsi_display_cmd_transfer(struct drm_connector *connector, goto end; } if (rc || !state) { - pr_err("[DSI] Invalid host state %d rc %d\n", + DSI_ERR("[DSI] Invalid host state %d rc %d\n", state, rc); rc = -EPERM; goto end; @@ -1006,7 +1004,7 @@ int dsi_display_soft_reset(void *display) ctrl = &dsi_display->ctrl[i]; rc = dsi_ctrl_soft_reset(ctrl->ctrl); if (rc) { - pr_err("[%s] failed to soft reset host_%d, rc=%d\n", + DSI_ERR("[%s] failed to soft reset host_%d, rc=%d\n", dsi_display->name, i, rc); break; } @@ -1023,7 +1021,7 @@ enum dsi_pixel_format dsi_display_get_dst_format( struct dsi_display *dsi_display = (struct dsi_display *)display; if (!dsi_display || !dsi_display->panel) { - pr_err("Invalid params(s) dsi_display %pK, panel %pK\n", + DSI_ERR("Invalid params(s) dsi_display %pK, panel %pK\n", dsi_display, ((dsi_display) ? dsi_display->panel : NULL)); return format; @@ -1051,7 +1049,7 @@ int dsi_display_set_power(struct drm_connector *connector, int rc = 0; if (!display || !display->panel) { - pr_err("invalid display/panel\n"); + DSI_ERR("invalid display/panel\n"); return -EINVAL; } @@ -1165,7 +1163,7 @@ static ssize_t debugfs_misr_setup(struct file *file, rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI core clocks, rc=%d\n", display->name, rc); goto unlock; } @@ -1175,7 +1173,7 @@ static ssize_t debugfs_misr_setup(struct file *file, rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_OFF); if (rc) { - pr_err("[%s] failed to disable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI core clocks, rc=%d\n", display->name, rc); goto unlock; } @@ -1216,7 +1214,7 @@ static ssize_t debugfs_misr_read(struct file *file, rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI core clocks, rc=%d\n", display->name, rc); goto error; } @@ -1235,7 +1233,7 @@ static ssize_t debugfs_misr_read(struct file *file, rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_OFF); if (rc) { - pr_err("[%s] failed to disable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI core clocks, rc=%d\n", display->name, rc); goto error; } @@ -1305,10 +1303,10 @@ static ssize_t debugfs_esd_trigger_check(struct file *file, display->esd_trigger = esd_trigger; if (display->esd_trigger) { - pr_info("ESD attack triggered by user\n"); + DSI_INFO("ESD attack triggered by user\n"); rc = dsi_panel_trigger_esd_attack(display->panel); if (rc) { - pr_err("Failed to trigger ESD attack\n"); + DSI_ERR("Failed to trigger ESD attack\n"); goto error; } } @@ -1354,7 +1352,7 @@ static ssize_t debugfs_alter_esd_check_mode(struct file *file, esd_config = &display->panel->esd_config; if (!esd_config) { - pr_err("Invalid panel esd config\n"); + DSI_ERR("Invalid panel esd config\n"); rc = -EINVAL; goto error; } @@ -1364,19 +1362,19 @@ static ssize_t debugfs_alter_esd_check_mode(struct file *file, if (!strcmp(buf, "te_signal_check\n")) { if (display->panel->panel_mode == DSI_OP_VIDEO_MODE) { - pr_info("TE based ESD check for Video Mode panels is not allowed\n"); + DSI_INFO("TE based ESD check for Video Mode panels is not allowed\n"); goto error; } - pr_info("ESD check is switched to TE mode by user\n"); + DSI_INFO("ESD check is switched to TE mode by user\n"); esd_config->status_mode = ESD_MODE_PANEL_TE; dsi_display_change_te_irq_status(display, true); } if (!strcmp(buf, "reg_read\n")) { - pr_info("ESD check is switched to reg read by user\n"); + DSI_INFO("ESD check is switched to reg read by user\n"); rc = dsi_panel_parse_esd_reg_read_configs(display->panel); if (rc) { - pr_err("failed to alter esd check mode,rc=%d\n", + DSI_ERR("failed to alter esd check mode,rc=%d\n", rc); rc = user_len; goto error; @@ -1416,7 +1414,7 @@ static ssize_t debugfs_read_esd_check_mode(struct file *file, return 0; if (!display->panel) { - pr_err("invalid panel data\n"); + DSI_ERR("invalid panel data\n"); return -EINVAL; } @@ -1426,7 +1424,7 @@ static ssize_t debugfs_read_esd_check_mode(struct file *file, esd_config = &display->panel->esd_config; if (!esd_config) { - pr_err("Invalid panel esd config\n"); + DSI_ERR("Invalid panel esd config\n"); rc = -EINVAL; goto error; } @@ -1505,7 +1503,7 @@ static int dsi_display_debugfs_init(struct dsi_display *display) dir = debugfs_create_dir(display->name, NULL); if (IS_ERR_OR_NULL(dir)) { rc = PTR_ERR(dir); - pr_err("[%s] debugfs create dir failed, rc = %d\n", + DSI_ERR("[%s] debugfs create dir failed, rc = %d\n", display->name, rc); goto error; } @@ -1517,7 +1515,7 @@ static int dsi_display_debugfs_init(struct dsi_display *display) &dump_info_fops); if (IS_ERR_OR_NULL(dump_file)) { rc = PTR_ERR(dump_file); - pr_err("[%s] debugfs create dump info file failed, rc=%d\n", + DSI_ERR("[%s] debugfs create dump info file failed, rc=%d\n", display->name, rc); goto error_remove_dir; } @@ -1529,7 +1527,7 @@ static int dsi_display_debugfs_init(struct dsi_display *display) &esd_trigger_fops); if (IS_ERR_OR_NULL(dump_file)) { rc = PTR_ERR(dump_file); - pr_err("[%s] debugfs for esd trigger file failed, rc=%d\n", + DSI_ERR("[%s] debugfs for esd trigger file failed, rc=%d\n", display->name, rc); goto error_remove_dir; } @@ -1541,7 +1539,7 @@ static int dsi_display_debugfs_init(struct dsi_display *display) &esd_check_mode_fops); if (IS_ERR_OR_NULL(dump_file)) { rc = PTR_ERR(dump_file); - pr_err("[%s] debugfs for esd check mode failed, rc=%d\n", + DSI_ERR("[%s] debugfs for esd check mode failed, rc=%d\n", display->name, rc); goto error_remove_dir; } @@ -1553,7 +1551,7 @@ static int dsi_display_debugfs_init(struct dsi_display *display) &misr_data_fops); if (IS_ERR_OR_NULL(misr_data)) { rc = PTR_ERR(misr_data); - pr_err("[%s] debugfs create misr datafile failed, rc=%d\n", + DSI_ERR("[%s] debugfs create misr datafile failed, rc=%d\n", display->name, rc); goto error_remove_dir; } @@ -1570,7 +1568,7 @@ static int dsi_display_debugfs_init(struct dsi_display *display) &phy->allow_phy_power_off); if (IS_ERR_OR_NULL(dump_file)) { rc = PTR_ERR(dump_file); - pr_err("[%s] debugfs create %s failed, rc=%d\n", + DSI_ERR("[%s] debugfs create %s failed, rc=%d\n", display->name, name, rc); goto error_remove_dir; } @@ -1581,7 +1579,7 @@ static int dsi_display_debugfs_init(struct dsi_display *display) &phy->regulator_min_datarate_bps); if (IS_ERR_OR_NULL(dump_file)) { rc = PTR_ERR(dump_file); - pr_err("[%s] debugfs create %s failed, rc=%d\n", + DSI_ERR("[%s] debugfs create %s failed, rc=%d\n", display->name, name, rc); goto error_remove_dir; } @@ -1589,28 +1587,28 @@ static int dsi_display_debugfs_init(struct dsi_display *display) if (!debugfs_create_bool("ulps_feature_enable", 0600, dir, &display->panel->ulps_feature_enabled)) { - pr_err("[%s] debugfs create ulps feature enable file failed\n", + DSI_ERR("[%s] debugfs create ulps feature enable file failed\n", display->name); goto error_remove_dir; } if (!debugfs_create_bool("ulps_suspend_feature_enable", 0600, dir, &display->panel->ulps_suspend_enabled)) { - pr_err("[%s] debugfs create ulps-suspend feature enable file failed\n", + DSI_ERR("[%s] debugfs create ulps-suspend feature enable file failed\n", display->name); goto error_remove_dir; } if (!debugfs_create_bool("ulps_status", 0400, dir, &display->ulps_enabled)) { - pr_err("[%s] debugfs create ulps status file failed\n", + DSI_ERR("[%s] debugfs create ulps status file failed\n", display->name); goto error_remove_dir; } if (!debugfs_create_u32("clk_gating_config", 0600, dir, &display->clk_gating_config)) { - pr_err("[%s] debugfs create clk gating config failed\n", + DSI_ERR("[%s] debugfs create clk gating config failed\n", display->name); goto error_remove_dir; } @@ -1661,30 +1659,30 @@ static int dsi_display_is_ulps_req_valid(struct dsi_display *display, { /* TODO: make checks based on cont. splash */ - pr_debug("checking ulps req validity\n"); + DSI_DEBUG("checking ulps req validity\n"); if (atomic_read(&display->panel->esd_recovery_pending)) { - pr_debug("%s: ESD recovery sequence underway\n", __func__); + DSI_DEBUG("%s: ESD recovery sequence underway\n", __func__); return false; } if (!dsi_panel_ulps_feature_enabled(display->panel) && !display->panel->ulps_suspend_enabled) { - pr_debug("%s: ULPS feature is not enabled\n", __func__); + DSI_DEBUG("%s: ULPS feature is not enabled\n", __func__); return false; } if (!dsi_panel_initialized(display->panel) && !display->panel->ulps_suspend_enabled) { - pr_debug("%s: panel not yet initialized\n", __func__); + DSI_DEBUG("%s: panel not yet initialized\n", __func__); return false; } if (enable && display->ulps_enabled) { - pr_debug("ULPS already enabled\n"); + DSI_DEBUG("ULPS already enabled\n"); return false; } else if (!enable && !display->ulps_enabled) { - pr_debug("ULPS already disabled\n"); + DSI_DEBUG("ULPS already disabled\n"); return false; } @@ -1717,12 +1715,12 @@ static int dsi_display_set_ulps(struct dsi_display *display, bool enable) if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (!dsi_display_is_ulps_req_valid(display, enable)) { - pr_debug("%s: skipping ULPS config, enable=%d\n", + DSI_DEBUG("%s: skipping ULPS config, enable=%d\n", __func__, enable); return 0; } @@ -1741,7 +1739,7 @@ static int dsi_display_set_ulps(struct dsi_display *display, bool enable) display->clamp_enabled); if (rc == DSI_PHY_ULPS_ERROR) { - pr_err("Ulps PHY state change(%d) failed\n", enable); + DSI_ERR("Ulps PHY state change(%d) failed\n", enable); return -EINVAL; } @@ -1754,7 +1752,7 @@ static int dsi_display_set_ulps(struct dsi_display *display, bool enable) rc = dsi_phy_set_ulps(ctrl->phy, &display->config, enable, display->clamp_enabled); if (rc == DSI_PHY_ULPS_ERROR) { - pr_err("Ulps PHY state change(%d) failed\n", + DSI_ERR("Ulps PHY state change(%d) failed\n", enable); return -EINVAL; } @@ -1764,7 +1762,7 @@ static int dsi_display_set_ulps(struct dsi_display *display, bool enable) else if (rc == DSI_PHY_ULPS_NOT_HANDLED) { rc = dsi_ctrl_set_ulps(m_ctrl->ctrl, enable); if (rc) { - pr_err("Ulps controller state change(%d) failed\n", + DSI_ERR("Ulps controller state change(%d) failed\n", enable); return rc; } @@ -1775,7 +1773,7 @@ static int dsi_display_set_ulps(struct dsi_display *display, bool enable) rc = dsi_ctrl_set_ulps(ctrl->ctrl, enable); if (rc) { - pr_err("Ulps controller state change(%d) failed\n", + DSI_ERR("Ulps controller state change(%d) failed\n", enable); return rc; } @@ -1802,7 +1800,7 @@ static int dsi_display_set_clamp(struct dsi_display *display, bool enable) if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -1815,13 +1813,13 @@ static int dsi_display_set_clamp(struct dsi_display *display, bool enable) */ rc = dsi_ctrl_set_clamp_state(m_ctrl->ctrl, enable, ulps_enabled); if (rc) { - pr_err("DSI ctrl clamp state change(%d) failed\n", enable); + DSI_ERR("DSI ctrl clamp state change(%d) failed\n", enable); return rc; } rc = dsi_phy_set_clamp_state(m_ctrl->phy, enable); if (rc) { - pr_err("DSI phy clamp state change(%d) failed\n", enable); + DSI_ERR("DSI phy clamp state change(%d) failed\n", enable); return rc; } @@ -1832,18 +1830,18 @@ static int dsi_display_set_clamp(struct dsi_display *display, bool enable) rc = dsi_ctrl_set_clamp_state(ctrl->ctrl, enable, ulps_enabled); if (rc) { - pr_err("DSI Clamp state change(%d) failed\n", enable); + DSI_ERR("DSI Clamp state change(%d) failed\n", enable); return rc; } rc = dsi_phy_set_clamp_state(ctrl->phy, enable); if (rc) { - pr_err("DSI phy clamp state change(%d) failed\n", + DSI_ERR("DSI phy clamp state change(%d) failed\n", enable); return rc; } - pr_debug("Clamps %s for ctrl%d\n", + DSI_DEBUG("Clamps %s for ctrl%d\n", enable ? "enabled" : "disabled", i); } @@ -1865,14 +1863,14 @@ static int dsi_display_ctrl_setup(struct dsi_display *display) if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } m_ctrl = &display->ctrl[display->cmd_master_idx]; rc = dsi_ctrl_setup(m_ctrl->ctrl); if (rc) { - pr_err("DSI controller setup failed\n"); + DSI_ERR("DSI controller setup failed\n"); return rc; } @@ -1883,7 +1881,7 @@ static int dsi_display_ctrl_setup(struct dsi_display *display) rc = dsi_ctrl_setup(ctrl->ctrl); if (rc) { - pr_err("DSI controller setup failed\n"); + DSI_ERR("DSI controller setup failed\n"); return rc; } } @@ -1908,7 +1906,7 @@ static int dsi_display_phy_idle_on(struct dsi_display *display, if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -1920,7 +1918,7 @@ static int dsi_display_phy_idle_on(struct dsi_display *display, m_ctrl = &display->ctrl[display->cmd_master_idx]; rc = dsi_phy_idle_ctrl(m_ctrl->phy, true); if (rc) { - pr_err("DSI controller setup failed\n"); + DSI_ERR("DSI controller setup failed\n"); return rc; } @@ -1931,7 +1929,7 @@ static int dsi_display_phy_idle_on(struct dsi_display *display, rc = dsi_phy_idle_ctrl(ctrl->phy, true); if (rc) { - pr_err("DSI controller setup failed\n"); + DSI_ERR("DSI controller setup failed\n"); return rc; } } @@ -1952,7 +1950,7 @@ static int dsi_display_phy_idle_off(struct dsi_display *display) struct dsi_display_ctrl *m_ctrl, *ctrl; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -1963,7 +1961,7 @@ static int dsi_display_phy_idle_off(struct dsi_display *display) continue; if (!phy->allow_phy_power_off) { - pr_debug("phy doesn't support this feature\n"); + DSI_DEBUG("phy doesn't support this feature\n"); return 0; } } @@ -1972,7 +1970,7 @@ static int dsi_display_phy_idle_off(struct dsi_display *display) rc = dsi_phy_idle_ctrl(m_ctrl->phy, false); if (rc) { - pr_err("[%s] failed to enable cmd engine, rc=%d\n", + DSI_ERR("[%s] failed to enable cmd engine, rc=%d\n", display->name, rc); return rc; } @@ -1984,7 +1982,7 @@ static int dsi_display_phy_idle_off(struct dsi_display *display) rc = dsi_phy_idle_ctrl(ctrl->phy, false); if (rc) { - pr_err("DSI controller setup failed\n"); + DSI_ERR("DSI controller setup failed\n"); return rc; } } @@ -2001,7 +1999,7 @@ void dsi_display_enable_event(struct drm_connector *connector, int i; if (!display) { - pr_err("invalid display\n"); + DSI_ERR("invalid display\n"); return; } @@ -2025,7 +2023,7 @@ void dsi_display_enable_event(struct drm_connector *connector, break; default: /* nothing to do */ - pr_debug("[%s] unhandled event %d\n", display->name, event_idx); + DSI_DEBUG("[%s] unhandled event %d\n", display->name, event_idx); return; } @@ -2080,7 +2078,7 @@ static int dsi_display_ctrl_power_on(struct dsi_display *display) rc = dsi_ctrl_set_power_state(ctrl->ctrl, DSI_CTRL_POWER_VREG_ON); if (rc) { - pr_err("[%s] Failed to set power state, rc=%d\n", + DSI_ERR("[%s] Failed to set power state, rc=%d\n", ctrl->ctrl->name, rc); goto error; } @@ -2113,7 +2111,7 @@ static int dsi_display_ctrl_power_off(struct dsi_display *display) rc = dsi_ctrl_set_power_state(ctrl->ctrl, DSI_CTRL_POWER_VREG_OFF); if (rc) { - pr_err("[%s] Failed to power off, rc=%d\n", + DSI_ERR("[%s] Failed to power off, rc=%d\n", ctrl->ctrl->name, rc); goto error; } @@ -2132,7 +2130,7 @@ static void dsi_display_parse_cmdline_topology(struct dsi_display *display, unsigned long cmdline_timing = NO_OVERRIDE; if (display_type >= MAX_DSI_ACTIVE_DISPLAY) { - pr_err("display_type=%d not supported\n", display_type); + DSI_ERR("display_type=%d not supported\n", display_type); goto end; } @@ -2151,7 +2149,7 @@ static void dsi_display_parse_cmdline_topology(struct dsi_display *display, if (kstrtol(str + strlen(":config"), INT_BASE_10, (unsigned long *)&cmdline_topology)) { - pr_err("invalid config index override: %s\n", boot_str); + DSI_ERR("invalid config index override: %s\n", boot_str); goto end; } @@ -2161,12 +2159,12 @@ static void dsi_display_parse_cmdline_topology(struct dsi_display *display, if (kstrtol(str + strlen(":timing"), INT_BASE_10, (unsigned long *)&cmdline_timing)) { - pr_err("invalid timing index override: %s. resetting both timing and config\n", + DSI_ERR("invalid timing index override: %s. resetting both timing and config\n", boot_str); cmdline_topology = NO_OVERRIDE; goto end; } - pr_debug("successfully parsed command line topology and timing\n"); + DSI_DEBUG("successfully parsed command line topology and timing\n"); end: display->cmdline_topology = cmdline_topology; display->cmdline_timing = cmdline_timing; @@ -2191,7 +2189,7 @@ static int dsi_display_parse_boot_display_selection(void) /* Use ':' as a delimiter to retrieve the display name */ if (!pos) { - pr_debug("display name[%s]is not valid\n", disp_buf); + DSI_DEBUG("display name[%s]is not valid\n", disp_buf); continue; } @@ -2220,7 +2218,7 @@ static int dsi_display_phy_power_on(struct dsi_display *display) rc = dsi_phy_set_power_state(ctrl->phy, true); if (rc) { - pr_err("[%s] Failed to set power state, rc=%d\n", + DSI_ERR("[%s] Failed to set power state, rc=%d\n", ctrl->phy->name, rc); goto error; } @@ -2251,7 +2249,7 @@ static int dsi_display_phy_power_off(struct dsi_display *display) rc = dsi_phy_set_power_state(ctrl->phy, false); if (rc) { - pr_err("[%s] Failed to power off, rc=%d\n", + DSI_ERR("[%s] Failed to power off, rc=%d\n", ctrl->ctrl->name, rc); goto error; } @@ -2276,7 +2274,7 @@ static int dsi_display_set_clk_src(struct dsi_display *display) rc = dsi_ctrl_set_clock_source(m_ctrl->ctrl, &display->clock_info.mux_clks); if (rc) { - pr_err("[%s] failed to set source clocks for master, rc=%d\n", + DSI_ERR("[%s] failed to set source clocks for master, rc=%d\n", display->name, rc); return rc; } @@ -2290,7 +2288,7 @@ static int dsi_display_set_clk_src(struct dsi_display *display) rc = dsi_ctrl_set_clock_source(ctrl->ctrl, &display->clock_info.mux_clks); if (rc) { - pr_err("[%s] failed to set source clocks, rc=%d\n", + DSI_ERR("[%s] failed to set source clocks, rc=%d\n", display->name, rc); return rc; } @@ -2309,7 +2307,7 @@ static int dsi_display_phy_reset_config(struct dsi_display *display, ctrl = &display->ctrl[i]; rc = dsi_ctrl_phy_reset_config(ctrl->ctrl, enable); if (rc) { - pr_err("[%s] failed to %s phy reset, rc=%d\n", + DSI_ERR("[%s] failed to %s phy reset, rc=%d\n", display->name, enable ? "mask" : "unmask", rc); return rc; } @@ -2351,7 +2349,7 @@ static int dsi_display_ctrl_update(struct dsi_display *display) ctrl = &display->ctrl[i]; rc = dsi_ctrl_host_timing_update(ctrl->ctrl); if (rc) { - pr_err("[%s] failed to update host_%d, rc=%d\n", + DSI_ERR("[%s] failed to update host_%d, rc=%d\n", display->name, i, rc); goto error_host_deinit; } @@ -2386,7 +2384,7 @@ static int dsi_display_ctrl_init(struct dsi_display *display) rc = dsi_ctrl_host_init(ctrl->ctrl, display->is_cont_splash_enabled); if (rc) { - pr_err("[%s] failed to init host_%d, rc=%d\n", + DSI_ERR("[%s] failed to init host_%d, rc=%d\n", display->name, i, rc); goto error_host_deinit; } @@ -2398,7 +2396,8 @@ static int dsi_display_ctrl_init(struct dsi_display *display) DSI_CTRL_OP_HOST_INIT, true); if (rc) - pr_debug("host init update failed rc=%d\n", rc); + DSI_DEBUG("host init update failed rc=%d\n", + rc); } } @@ -2421,7 +2420,7 @@ static int dsi_display_ctrl_deinit(struct dsi_display *display) ctrl = &display->ctrl[i]; rc = dsi_ctrl_host_deinit(ctrl->ctrl); if (rc) { - pr_err("[%s] failed to deinit host_%d, rc=%d\n", + DSI_ERR("[%s] failed to deinit host_%d, rc=%d\n", display->name, i, rc); } } @@ -2439,7 +2438,7 @@ static int dsi_display_ctrl_host_enable(struct dsi_display *display) * continuous splash case */ if (display->is_cont_splash_enabled) { - pr_debug("cont splash enabled, host enable not required\n"); + DSI_DEBUG("cont splash enabled, host enable not required\n"); return 0; } @@ -2447,7 +2446,7 @@ static int dsi_display_ctrl_host_enable(struct dsi_display *display) rc = dsi_ctrl_set_host_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[%s] failed to enable host engine, rc=%d\n", + DSI_ERR("[%s] failed to enable host engine, rc=%d\n", display->name, rc); goto error; } @@ -2460,7 +2459,7 @@ static int dsi_display_ctrl_host_enable(struct dsi_display *display) rc = dsi_ctrl_set_host_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[%s] failed to enable sl host engine, rc=%d\n", + DSI_ERR("[%s] failed to enable sl host engine, rc=%d\n", display->name, rc); goto error_disable_master; } @@ -2494,7 +2493,7 @@ static int dsi_display_ctrl_host_disable(struct dsi_display *display) DSI_CTRL_OP_HOST_ENGINE, false); if (rc) - pr_debug("host state update failed %d\n", rc); + DSI_DEBUG("host state update failed %d\n", rc); } return rc; } @@ -2507,13 +2506,13 @@ static int dsi_display_ctrl_host_disable(struct dsi_display *display) rc = dsi_ctrl_set_host_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_OFF); if (rc) - pr_err("[%s] failed to disable host engine, rc=%d\n", + DSI_ERR("[%s] failed to disable host engine, rc=%d\n", display->name, rc); } rc = dsi_ctrl_set_host_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_OFF); if (rc) { - pr_err("[%s] failed to disable host engine, rc=%d\n", + DSI_ERR("[%s] failed to disable host engine, rc=%d\n", display->name, rc); goto error; } @@ -2532,7 +2531,7 @@ static int dsi_display_vid_engine_enable(struct dsi_display *display) rc = dsi_ctrl_set_vid_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[%s] failed to enable vid engine, rc=%d\n", + DSI_ERR("[%s] failed to enable vid engine, rc=%d\n", display->name, rc); goto error; } @@ -2545,7 +2544,7 @@ static int dsi_display_vid_engine_enable(struct dsi_display *display) rc = dsi_ctrl_set_vid_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_ON); if (rc) { - pr_err("[%s] failed to enable vid engine, rc=%d\n", + DSI_ERR("[%s] failed to enable vid engine, rc=%d\n", display->name, rc); goto error_disable_master; } @@ -2574,13 +2573,13 @@ static int dsi_display_vid_engine_disable(struct dsi_display *display) rc = dsi_ctrl_set_vid_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_OFF); if (rc) - pr_err("[%s] failed to disable vid engine, rc=%d\n", + DSI_ERR("[%s] failed to disable vid engine, rc=%d\n", display->name, rc); } rc = dsi_ctrl_set_vid_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_OFF); if (rc) - pr_err("[%s] failed to disable mvid engine, rc=%d\n", + DSI_ERR("[%s] failed to disable mvid engine, rc=%d\n", display->name, rc); return rc; @@ -2603,7 +2602,7 @@ static int dsi_display_phy_enable(struct dsi_display *display) true, display->is_cont_splash_enabled); if (rc) { - pr_err("[%s] failed to enable DSI PHY, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI PHY, rc=%d\n", display->name, rc); goto error; } @@ -2619,7 +2618,7 @@ static int dsi_display_phy_enable(struct dsi_display *display) true, display->is_cont_splash_enabled); if (rc) { - pr_err("[%s] failed to enable DSI PHY, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI PHY, rc=%d\n", display->name, rc); goto error_disable_master; } @@ -2648,13 +2647,13 @@ static int dsi_display_phy_disable(struct dsi_display *display) rc = dsi_phy_disable(ctrl->phy); if (rc) - pr_err("[%s] failed to disable DSI PHY, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI PHY, rc=%d\n", display->name, rc); } rc = dsi_phy_disable(m_ctrl->phy); if (rc) - pr_err("[%s] failed to disable DSI PHY, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI PHY, rc=%d\n", display->name, rc); return rc; @@ -2689,7 +2688,7 @@ static int dsi_display_broadcast_cmd(struct dsi_display *display, m_ctrl = &display->ctrl[display->cmd_master_idx]; rc = dsi_ctrl_cmd_transfer(m_ctrl->ctrl, msg, m_flags); if (rc) { - pr_err("[%s] cmd transfer failed on master,rc=%d\n", + DSI_ERR("[%s] cmd transfer failed on master,rc=%d\n", display->name, rc); goto error; } @@ -2701,14 +2700,14 @@ static int dsi_display_broadcast_cmd(struct dsi_display *display, rc = dsi_ctrl_cmd_transfer(ctrl->ctrl, msg, flags); if (rc) { - pr_err("[%s] cmd transfer failed, rc=%d\n", + DSI_ERR("[%s] cmd transfer failed, rc=%d\n", display->name, rc); goto error; } rc = dsi_ctrl_cmd_tx_trigger(ctrl->ctrl, flags); if (rc) { - pr_err("[%s] cmd trigger failed, rc=%d\n", + DSI_ERR("[%s] cmd trigger failed, rc=%d\n", display->name, rc); goto error; } @@ -2716,7 +2715,7 @@ static int dsi_display_broadcast_cmd(struct dsi_display *display, rc = dsi_ctrl_cmd_tx_trigger(m_ctrl->ctrl, m_flags); if (rc) { - pr_err("[%s] cmd trigger failed for master, rc=%d\n", + DSI_ERR("[%s] cmd trigger failed for master, rc=%d\n", display->name, rc); goto error; } @@ -2735,7 +2734,7 @@ static int dsi_display_phy_sw_reset(struct dsi_display *display) * separately and hence we do an early return */ if (display->is_cont_splash_enabled) { - pr_debug("cont splash enabled, phy sw reset not required\n"); + DSI_DEBUG("cont splash enabled, phy sw reset not required\n"); return 0; } @@ -2743,7 +2742,7 @@ static int dsi_display_phy_sw_reset(struct dsi_display *display) rc = dsi_ctrl_phy_sw_reset(m_ctrl->ctrl); if (rc) { - pr_err("[%s] failed to reset phy, rc=%d\n", display->name, rc); + DSI_ERR("[%s] failed to reset phy, rc=%d\n", display->name, rc); goto error; } @@ -2754,7 +2753,7 @@ static int dsi_display_phy_sw_reset(struct dsi_display *display) rc = dsi_ctrl_phy_sw_reset(ctrl->ctrl); if (rc) { - pr_err("[%s] failed to reset phy, rc=%d\n", + DSI_ERR("[%s] failed to reset phy, rc=%d\n", display->name, rc); goto error; } @@ -2783,7 +2782,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host, int rc = 0, ret = 0; if (!host || !msg) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return 0; } @@ -2791,28 +2790,28 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host, /* Avoid sending DCS commands when ESD recovery is pending */ if (atomic_read(&display->panel->esd_recovery_pending)) { - pr_debug("ESD recovery pending\n"); + DSI_DEBUG("ESD recovery pending\n"); return 0; } rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_ALL_CLKS, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable all DSI clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable all DSI clocks, rc=%d\n", display->name, rc); goto error; } rc = dsi_display_wake_up(display); if (rc) { - pr_err("[%s] failed to wake up display, rc=%d\n", + DSI_ERR("[%s] failed to wake up display, rc=%d\n", display->name, rc); goto error_disable_clks; } rc = dsi_display_cmd_engine_enable(display); if (rc) { - pr_err("[%s] failed to enable cmd engine, rc=%d\n", + DSI_ERR("[%s] failed to enable cmd engine, rc=%d\n", display->name, rc); goto error_disable_clks; } @@ -2820,7 +2819,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host, if (display->tx_cmd_buf == NULL) { rc = dsi_host_alloc_cmd_tx_buffer(display); if (rc) { - pr_err("failed to allocate cmd tx buffer memory\n"); + DSI_ERR("failed to allocate cmd tx buffer memory\n"); goto error_disable_cmd_engine; } } @@ -2828,7 +2827,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host, if (display->ctrl_count > 1 && !(msg->flags & MIPI_DSI_MSG_UNICAST)) { rc = dsi_display_broadcast_cmd(display, msg); if (rc) { - pr_err("[%s] cmd broadcast failed, rc=%d\n", + DSI_ERR("[%s] cmd broadcast failed, rc=%d\n", display->name, rc); goto error_disable_cmd_engine; } @@ -2839,7 +2838,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host, rc = dsi_ctrl_cmd_transfer(display->ctrl[ctrl_idx].ctrl, msg, DSI_CTRL_CMD_FETCH_MEMORY); if (rc) { - pr_err("[%s] cmd transfer failed, rc=%d\n", + DSI_ERR("[%s] cmd transfer failed, rc=%d\n", display->name, rc); goto error_disable_cmd_engine; } @@ -2848,14 +2847,14 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host, error_disable_cmd_engine: ret = dsi_display_cmd_engine_disable(display); if (ret) { - pr_err("[%s]failed to disable DSI cmd engine, rc=%d\n", + DSI_ERR("[%s]failed to disable DSI cmd engine, rc=%d\n", display->name, ret); } error_disable_clks: ret = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_ALL_CLKS, DSI_CLK_OFF); if (ret) { - pr_err("[%s] failed to disable all DSI clocks, rc=%d\n", + DSI_ERR("[%s] failed to disable all DSI clocks, rc=%d\n", display->name, ret); } error: @@ -2879,7 +2878,7 @@ static int dsi_display_mipi_host_init(struct dsi_display *display) rc = mipi_dsi_host_register(host); if (rc) { - pr_err("[%s] failed to register mipi dsi host, rc=%d\n", + DSI_ERR("[%s] failed to register mipi dsi host, rc=%d\n", display->name, rc); goto error; } @@ -2990,19 +2989,19 @@ static int dsi_display_clocks_init(struct dsi_display *display) num_clk = dsi_display_get_clocks_count(display, dsi_clock_name); - pr_debug("clk count=%d\n", num_clk); + DSI_DEBUG("clk count=%d\n", num_clk); for (i = 0; i < num_clk; i++) { dsi_display_get_clock_name(display, dsi_clock_name, i, &clk_name); - pr_debug("clock name:%s\n", clk_name); + DSI_DEBUG("clock name:%s\n", clk_name); dsi_clk = devm_clk_get(&display->pdev->dev, clk_name); if (IS_ERR_OR_NULL(dsi_clk)) { rc = PTR_ERR(dsi_clk); - pr_err("failed to get %s, rc=%d\n", clk_name, rc); + DSI_ERR("failed to get %s, rc=%d\n", clk_name, rc); if (dsi_display_check_prefix(mux_byte, clk_name)) { mux->byte_clk = NULL; @@ -3079,7 +3078,7 @@ static int dsi_display_clk_ctrl_cb(void *priv, void *clk_handle = NULL; if (!priv) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -3090,7 +3089,7 @@ static int dsi_display_clk_ctrl_cb(void *priv, } else if (clk_state_info.client == DSI_CLK_REQ_DSI_CLIENT) { clk_handle = display->dsi_clk_handle; } else { - pr_err("invalid clk handle, return error\n"); + DSI_ERR("invalid clk handle, return error\n"); return -EINVAL; } @@ -3101,7 +3100,7 @@ static int dsi_display_clk_ctrl_cb(void *priv, rc = dsi_display_clk_ctrl(clk_handle, clk_state_info.clk_type, clk_state_info.clk_state); if (rc) { - pr_err("[%s] failed to %d DSI %d clocks, rc=%d\n", + DSI_ERR("[%s] failed to %d DSI %d clocks, rc=%d\n", display->name, clk_state_info.clk_state, clk_state_info.clk_type, rc); return rc; @@ -3154,7 +3153,7 @@ int dsi_pre_clkoff_cb(void *priv, rc = dsi_display_set_ulps(display, true); } if (rc) - pr_err("%s: failed enable ulps, rc = %d\n", + DSI_ERR("%s: failed enable ulps, rc = %d\n", __func__, rc); } @@ -3168,7 +3167,7 @@ int dsi_pre_clkoff_cb(void *priv, */ rc = dsi_display_config_clk_gating(display, false); if (rc) - pr_err("[%s] failed to disable clk gating, rc=%d\n", + DSI_ERR("[%s] failed to disable clk gating, rc=%d\n", display->name, rc); } @@ -3182,12 +3181,12 @@ int dsi_pre_clkoff_cb(void *priv, dsi_display_phy_idle_off(display); rc = dsi_display_set_clamp(display, true); if (rc) - pr_err("%s: Failed to enable dsi clamps. rc=%d\n", + DSI_ERR("%s: Failed to enable dsi clamps. rc=%d\n", __func__, rc); rc = dsi_display_phy_reset_config(display, false); if (rc) - pr_err("%s: Failed to reset phy, rc=%d\n", + DSI_ERR("%s: Failed to reset phy, rc=%d\n", __func__, rc); } else { /* Make sure that controller is not in ULPS state when @@ -3195,7 +3194,7 @@ int dsi_pre_clkoff_cb(void *priv, */ rc = dsi_display_set_ulps(display, false); if (rc) - pr_err("%s: failed to disable ulps. rc=%d\n", + DSI_ERR("%s: failed to disable ulps. rc=%d\n", __func__, rc); } /* dsi will not be able to serve irqs from here on */ @@ -3257,7 +3256,7 @@ int dsi_post_clkon_cb(void *priv, display->ulps_enabled = false; rc = dsi_display_set_ulps(display, true); if (rc) { - pr_err("%s: Failed to enter ULPS. rc=%d\n", + DSI_ERR("%s: Failed to enter ULPS. rc=%d\n", __func__, rc); goto error; } @@ -3265,14 +3264,14 @@ int dsi_post_clkon_cb(void *priv, rc = dsi_display_phy_reset_config(display, true); if (rc) { - pr_err("%s: Failed to reset phy, rc=%d\n", + DSI_ERR("%s: Failed to reset phy, rc=%d\n", __func__, rc); goto error; } rc = dsi_display_set_clamp(display, false); if (rc) { - pr_err("%s: Failed to disable dsi clamps. rc=%d\n", + DSI_ERR("%s: Failed to disable dsi clamps. rc=%d\n", __func__, rc); goto error; } @@ -3291,7 +3290,7 @@ int dsi_post_clkon_cb(void *priv, if (display->ulps_enabled) { rc = dsi_display_set_ulps(display, false); if (rc) { - pr_err("%s: failed to disable ulps, rc= %d\n", + DSI_ERR("%s: failed to disable ulps, rc= %d\n", __func__, rc); goto error; } @@ -3302,7 +3301,7 @@ int dsi_post_clkon_cb(void *priv, rc = dsi_display_config_clk_gating(display, true); if (rc) { - pr_err("[%s] failed to enable clk gating %d\n", + DSI_ERR("[%s] failed to enable clk gating %d\n", display->name, rc); goto error; } @@ -3325,7 +3324,7 @@ int dsi_post_clkoff_cb(void *priv, struct dsi_display *display = priv; if (!display) { - pr_err("%s: Invalid arg\n", __func__); + DSI_ERR("%s: Invalid arg\n", __func__); return -EINVAL; } @@ -3333,12 +3332,12 @@ int dsi_post_clkoff_cb(void *priv, (curr_state == DSI_CLK_OFF)) { rc = dsi_display_phy_power_off(display); if (rc) - pr_err("[%s] failed to power off PHY, rc=%d\n", + DSI_ERR("[%s] failed to power off PHY, rc=%d\n", display->name, rc); rc = dsi_display_ctrl_power_off(display); if (rc) - pr_err("[%s] failed to power DSI vregs, rc=%d\n", + DSI_ERR("[%s] failed to power DSI vregs, rc=%d\n", display->name, rc); } return rc; @@ -3353,7 +3352,7 @@ int dsi_pre_clkon_cb(void *priv, struct dsi_display *display = priv; if (!display) { - pr_err("%s: invalid input\n", __func__); + DSI_ERR("%s: invalid input\n", __func__); return -EINVAL; } @@ -3368,22 +3367,22 @@ int dsi_pre_clkon_cb(void *priv, * not be changed during static screen. */ - pr_debug("updating power states for ctrl and phy\n"); + DSI_DEBUG("updating power states for ctrl and phy\n"); rc = dsi_display_ctrl_power_on(display); if (rc) { - pr_err("[%s] failed to power on dsi controllers, rc=%d\n", + DSI_ERR("[%s] failed to power on dsi controllers, rc=%d\n", display->name, rc); return rc; } rc = dsi_display_phy_power_on(display); if (rc) { - pr_err("[%s] failed to power on dsi phy, rc = %d\n", + DSI_ERR("[%s] failed to power on dsi phy, rc = %d\n", display->name, rc); return rc; } - pr_debug("%s: Enable DSI core power\n", __func__); + DSI_DEBUG("%s: Enable DSI core power\n", __func__); } return rc; @@ -3408,7 +3407,7 @@ static int dsi_display_parse_lane_map(struct dsi_display *display) u8 temp[DSI_LANE_MAX - 1]; if (!display) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3420,7 +3419,7 @@ static int dsi_display_parse_lane_map(struct dsi_display *display) display->lane_map.lane_map_v2[i] = BIT(temp[i]); return 0; } else if (rc != EINVAL) { - pr_debug("Incorrect mapping, configure default\n"); + DSI_DEBUG("Incorrect mapping, configure default\n"); goto set_default; } @@ -3480,7 +3479,7 @@ static int dsi_display_parse_lane_map(struct dsi_display *display) DSI_PHYSICAL_LANE_1, DSI_PHYSICAL_LANE_0); } else { - pr_warn("%s: invalid lane map %s specified. defaulting to lane_map0123\n", + DSI_WARN("%s: invalid lane map %s specified. defaulting to lane_map0123\n", __func__, data); goto set_default; } @@ -3522,7 +3521,7 @@ static int dsi_display_get_phandle_index( rc = val[index]; - pr_debug("%s index=%d\n", propname, rc); + DSI_DEBUG("%s index=%d\n", propname, rc); end: kfree(val); return rc; @@ -3558,17 +3557,17 @@ static int dsi_display_parse_dt(struct dsi_display *display) dsi_ctrl_name); phy_count = dsi_display_get_phandle_count(display, dsi_phy_name); - pr_debug("ctrl count=%d, phy count=%d\n", + DSI_DEBUG("ctrl count=%d, phy count=%d\n", display->ctrl_count, phy_count); if (!phy_count || !display->ctrl_count) { - pr_err("no ctrl/phys found\n"); + DSI_ERR("no ctrl/phys found\n"); rc = -ENODEV; goto error; } if (phy_count != display->ctrl_count) { - pr_err("different ctrl and phy counts\n"); + DSI_ERR("different ctrl and phy counts\n"); rc = -ENODEV; goto error; } @@ -3602,7 +3601,7 @@ static int dsi_display_parse_dt(struct dsi_display *display) break; } - pr_debug("success\n"); + DSI_DEBUG("success\n"); error: return rc; } @@ -3618,7 +3617,7 @@ static int dsi_display_res_init(struct dsi_display *display) ctrl->ctrl = dsi_ctrl_get(ctrl->ctrl_of_node); if (IS_ERR_OR_NULL(ctrl->ctrl)) { rc = PTR_ERR(ctrl->ctrl); - pr_err("failed to get dsi controller, rc=%d\n", rc); + DSI_ERR("failed to get dsi controller, rc=%d\n", rc); ctrl->ctrl = NULL; goto error_ctrl_put; } @@ -3626,7 +3625,7 @@ static int dsi_display_res_init(struct dsi_display *display) ctrl->phy = dsi_phy_get(ctrl->phy_of_node); if (IS_ERR_OR_NULL(ctrl->phy)) { rc = PTR_ERR(ctrl->phy); - pr_err("failed to get phy controller, rc=%d\n", rc); + DSI_ERR("failed to get phy controller, rc=%d\n", rc); dsi_ctrl_put(ctrl->ctrl); ctrl->phy = NULL; goto error_ctrl_put; @@ -3640,20 +3639,20 @@ static int dsi_display_res_init(struct dsi_display *display) display->cmdline_topology); if (IS_ERR_OR_NULL(display->panel)) { rc = PTR_ERR(display->panel); - pr_err("failed to get panel, rc=%d\n", rc); + DSI_ERR("failed to get panel, rc=%d\n", rc); display->panel = NULL; goto error_ctrl_put; } rc = dsi_display_parse_lane_map(display); if (rc) { - pr_err("Lane map not found, rc=%d\n", rc); + DSI_ERR("Lane map not found, rc=%d\n", rc); goto error_ctrl_put; } rc = dsi_display_clocks_init(display); if (rc) { - pr_err("Failed to parse clock data, rc=%d\n", rc); + DSI_ERR("Failed to parse clock data, rc=%d\n", rc); goto error_ctrl_put; } @@ -3675,7 +3674,7 @@ static int dsi_display_res_deinit(struct dsi_display *display) rc = dsi_display_clocks_deinit(display); if (rc) - pr_err("clocks deinit failed, rc=%d\n", rc); + DSI_ERR("clocks deinit failed, rc=%d\n", rc); display_for_each_ctrl(i, display) { ctrl = &display->ctrl[i]; @@ -3725,34 +3724,34 @@ static bool dsi_display_is_seamless_dfps_possible( struct dsi_display_mode *cur; if (!display || !tgt || !display->panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return false; } cur = display->panel->cur_mode; if (cur->timing.h_active != tgt->timing.h_active) { - pr_debug("timing.h_active differs %d %d\n", + DSI_DEBUG("timing.h_active differs %d %d\n", cur->timing.h_active, tgt->timing.h_active); return false; } if (cur->timing.h_back_porch != tgt->timing.h_back_porch) { - pr_debug("timing.h_back_porch differs %d %d\n", + DSI_DEBUG("timing.h_back_porch differs %d %d\n", cur->timing.h_back_porch, tgt->timing.h_back_porch); return false; } if (cur->timing.h_sync_width != tgt->timing.h_sync_width) { - pr_debug("timing.h_sync_width differs %d %d\n", + DSI_DEBUG("timing.h_sync_width differs %d %d\n", cur->timing.h_sync_width, tgt->timing.h_sync_width); return false; } if (cur->timing.h_front_porch != tgt->timing.h_front_porch) { - pr_debug("timing.h_front_porch differs %d %d\n", + DSI_DEBUG("timing.h_front_porch differs %d %d\n", cur->timing.h_front_porch, tgt->timing.h_front_porch); if (dfps_type != DSI_DFPS_IMMEDIATE_HFP) @@ -3760,7 +3759,7 @@ static bool dsi_display_is_seamless_dfps_possible( } if (cur->timing.h_skew != tgt->timing.h_skew) { - pr_debug("timing.h_skew differs %d %d\n", + DSI_DEBUG("timing.h_skew differs %d %d\n", cur->timing.h_skew, tgt->timing.h_skew); return false; @@ -3769,28 +3768,28 @@ static bool dsi_display_is_seamless_dfps_possible( /* skip polarity comparison */ if (cur->timing.v_active != tgt->timing.v_active) { - pr_debug("timing.v_active differs %d %d\n", + DSI_DEBUG("timing.v_active differs %d %d\n", cur->timing.v_active, tgt->timing.v_active); return false; } if (cur->timing.v_back_porch != tgt->timing.v_back_porch) { - pr_debug("timing.v_back_porch differs %d %d\n", + DSI_DEBUG("timing.v_back_porch differs %d %d\n", cur->timing.v_back_porch, tgt->timing.v_back_porch); return false; } if (cur->timing.v_sync_width != tgt->timing.v_sync_width) { - pr_debug("timing.v_sync_width differs %d %d\n", + DSI_DEBUG("timing.v_sync_width differs %d %d\n", cur->timing.v_sync_width, tgt->timing.v_sync_width); return false; } if (cur->timing.v_front_porch != tgt->timing.v_front_porch) { - pr_debug("timing.v_front_porch differs %d %d\n", + DSI_DEBUG("timing.v_front_porch differs %d %d\n", cur->timing.v_front_porch, tgt->timing.v_front_porch); if (dfps_type != DSI_DFPS_IMMEDIATE_VFP) @@ -3800,16 +3799,16 @@ static bool dsi_display_is_seamless_dfps_possible( /* skip polarity comparison */ if (cur->timing.refresh_rate == tgt->timing.refresh_rate) - pr_debug("timing.refresh_rate identical %d %d\n", + DSI_DEBUG("timing.refresh_rate identical %d %d\n", cur->timing.refresh_rate, tgt->timing.refresh_rate); if (cur->pixel_clk_khz != tgt->pixel_clk_khz) - pr_debug("pixel_clk_khz differs %d %d\n", + DSI_DEBUG("pixel_clk_khz differs %d %d\n", cur->pixel_clk_khz, tgt->pixel_clk_khz); if (cur->dsi_mode_flags != tgt->dsi_mode_flags) - pr_debug("flags differs %d %d\n", + DSI_DEBUG("flags differs %d %d\n", cur->dsi_mode_flags, tgt->dsi_mode_flags); return true; @@ -3821,14 +3820,14 @@ static int dsi_display_update_dsi_bitrate(struct dsi_display *display, int rc = 0; int i; - pr_debug("%s:bit rate:%d\n", __func__, bit_clk_rate); + DSI_DEBUG("%s:bit rate:%d\n", __func__, bit_clk_rate); if (!display->panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (bit_clk_rate == 0) { - pr_err("Invalid bit clock rate\n"); + DSI_ERR("Invalid bit clock rate\n"); return -EINVAL; } @@ -3854,7 +3853,7 @@ static int dsi_display_update_dsi_bitrate(struct dsi_display *display, num_of_lanes++; if (num_of_lanes == 0) { - pr_err("Invalid lane count\n"); + DSI_ERR("Invalid lane count\n"); rc = -EINVAL; goto error; } @@ -3868,9 +3867,9 @@ static int dsi_display_update_dsi_bitrate(struct dsi_display *display, do_div(pclk_rate, bpp); byte_clk_rate = bit_rate_per_lane; do_div(byte_clk_rate, 8); - pr_debug("bit_clk_rate = %llu, bit_clk_rate_per_lane = %llu\n", + DSI_DEBUG("bit_clk_rate = %llu, bit_clk_rate_per_lane = %llu\n", bit_rate, bit_rate_per_lane); - pr_debug("byte_clk_rate = %llu, pclk_rate = %llu\n", + DSI_DEBUG("byte_clk_rate = %llu, pclk_rate = %llu\n", byte_clk_rate, pclk_rate); ctrl->clk_freq.byte_clk_rate = byte_clk_rate; @@ -3878,7 +3877,7 @@ static int dsi_display_update_dsi_bitrate(struct dsi_display *display, rc = dsi_clk_set_link_frequencies(display->dsi_clk_handle, ctrl->clk_freq, ctrl->cell_index); if (rc) { - pr_err("Failed to update link frequencies\n"); + DSI_ERR("Failed to update link frequencies\n"); goto error; } @@ -3958,7 +3957,7 @@ static int _dsi_display_dyn_update_clks(struct dsi_display *display, rc = dsi_clk_update_parent(&display->clock_info.shadow_clks, &display->clock_info.mux_clks); if (rc) { - pr_err("failed update mux parent to shadow\n"); + DSI_ERR("failed update mux parent to shadow\n"); goto exit; } @@ -3970,13 +3969,13 @@ static int _dsi_display_dyn_update_clks(struct dsi_display *display, rc = dsi_clk_set_byte_clk_rate(display->dsi_clk_handle, ctrl->ctrl->clk_freq.byte_clk_rate, i); if (rc) { - pr_err("failed to set byte rate for index:%d\n", i); + DSI_ERR("failed to set byte rate for index:%d\n", i); goto recover_byte_clk; } rc = dsi_clk_set_pixel_clk_rate(display->dsi_clk_handle, ctrl->ctrl->clk_freq.pix_clk_rate, i); if (rc) { - pr_err("failed to set pix rate for index:%d\n", i); + DSI_ERR("failed to set pix rate for index:%d\n", i); goto recover_pix_clk; } } @@ -3996,10 +3995,10 @@ static int _dsi_display_dyn_update_clks(struct dsi_display *display, ctrl = &display->ctrl[i]; rc = dsi_ctrl_wait4dynamic_refresh_done(ctrl->ctrl); if (rc) { - pr_err("wait4dynamic refresh failed for dsi:%d\n", i); + DSI_ERR("wait4dynamic refresh failed for dsi:%d\n", i); goto recover_pix_clk; } else { - pr_info("dynamic refresh done on dsi: %s\n", + DSI_INFO("dynamic refresh done on dsi: %s\n", i ? "slave" : "master"); } } @@ -4013,7 +4012,7 @@ static int _dsi_display_dyn_update_clks(struct dsi_display *display, rc = dsi_clk_update_parent(&display->clock_info.src_clks, &display->clock_info.mux_clks); if (rc) - pr_err("could not switch back to src clks %d\n", rc); + DSI_ERR("could not switch back to src clks %d\n", rc); dsi_clk_disable_unprepare(&display->clock_info.src_clks); @@ -4077,7 +4076,7 @@ static int dsi_display_dynamic_clk_switch_vid(struct dsi_display *display, rc = dsi_display_update_dsi_bitrate(display, mode->timing.clk_rate_hz); if (rc) { - pr_err("failed set link frequencies %d\n", rc); + DSI_ERR("failed set link frequencies %d\n", rc); goto exit; } @@ -4120,12 +4119,12 @@ static int dsi_display_dynamic_clk_configure_cmd(struct dsi_display *display, int rc = 0; if (clk_rate <= 0) { - pr_err("%s: bitrate should be greater than 0\n", __func__); + DSI_ERR("%s: bitrate should be greater than 0\n", __func__); return -EINVAL; } if (clk_rate == display->cached_clk_rate) { - pr_info("%s: ignore duplicated DSI clk setting\n", __func__); + DSI_INFO("%s: ignore duplicated DSI clk setting\n", __func__); return rc; } @@ -4133,11 +4132,11 @@ static int dsi_display_dynamic_clk_configure_cmd(struct dsi_display *display, rc = dsi_display_update_dsi_bitrate(display, clk_rate); if (!rc) { - pr_info("%s: bit clk is ready to be configured to '%d'\n", + DSI_INFO("%s: bit clk is ready to be configured to '%d'\n", __func__, clk_rate); atomic_set(&display->clkrate_change_pending, 1); } else { - pr_err("%s: Failed to prepare to configure '%d'. rc = %d\n", + DSI_ERR("%s: Failed to prepare to configure '%d'. rc = %d\n", __func__, clk_rate, rc); /* Caching clock failed, so don't go on doing so. */ atomic_set(&display->clkrate_change_pending, 0); @@ -4158,31 +4157,31 @@ static int dsi_display_dfps_update(struct dsi_display *display, int i = 0; if (!display || !dsi_mode || !display->panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } timing = &dsi_mode->timing; dsi_panel_get_dfps_caps(display->panel, &dfps_caps); if (!dfps_caps.dfps_support) { - pr_err("dfps not supported\n"); + DSI_ERR("dfps not supported\n"); return -ENOTSUPP; } if (dfps_caps.type == DSI_DFPS_IMMEDIATE_CLK) { - pr_err("dfps clock method not supported\n"); + DSI_ERR("dfps clock method not supported\n"); return -ENOTSUPP; } /* For split DSI, update the clock master first */ - pr_debug("configuring seamless dynamic fps\n\n"); + DSI_DEBUG("configuring seamless dynamic fps\n\n"); SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY); m_ctrl = &display->ctrl[display->clk_master_idx]; rc = dsi_ctrl_async_timing_update(m_ctrl->ctrl, timing); if (rc) { - pr_err("[%s] failed to dfps update host_%d, rc=%d\n", + DSI_ERR("[%s] failed to dfps update host_%d, rc=%d\n", display->name, i, rc); goto error; } @@ -4195,7 +4194,7 @@ static int dsi_display_dfps_update(struct dsi_display *display, rc = dsi_ctrl_async_timing_update(ctrl->ctrl, timing); if (rc) { - pr_err("[%s] failed to dfps update host_%d, rc=%d\n", + DSI_ERR("[%s] failed to dfps update host_%d, rc=%d\n", display->name, i, rc); goto error; } @@ -4228,12 +4227,12 @@ static int dsi_display_dfps_calc_front_porch( int add_porches, diff; if (!b_fp_out) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (!a_total || !new_fps) { - pr_err("Invalid pixel total or new fps in mode request\n"); + DSI_ERR("Invalid pixel total or new fps in mode request\n"); return -EINVAL; } @@ -4251,11 +4250,11 @@ static int dsi_display_dfps_calc_front_porch( else b_fp_new = b_fp - add_porches; - pr_debug("fps %u a %u b %u b_fp %u new_fp %d\n", + DSI_DEBUG("fps %u a %u b %u b_fp %u new_fp %d\n", new_fps, a_total, b_total, b_fp, b_fp_new); if (b_fp_new < 0) { - pr_err("Invalid new_hfp calcluated%d\n", b_fp_new); + DSI_ERR("Invalid new_hfp calcluated%d\n", b_fp_new); return -EINVAL; } @@ -4291,14 +4290,14 @@ static int dsi_display_get_dfps_timing(struct dsi_display *display, int rc = 0; if (!display || !adj_mode) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } m_ctrl = display->ctrl[display->clk_master_idx].ctrl; dsi_panel_get_dfps_caps(display->panel, &dfps_caps); if (!dfps_caps.dfps_support) { - pr_err("dfps not supported by panel\n"); + DSI_ERR("dfps not supported by panel\n"); return -EINVAL; } @@ -4308,14 +4307,14 @@ static int dsi_display_get_dfps_timing(struct dsi_display *display, if (!curr_refresh_rate) { if (!dsi_display_is_seamless_dfps_possible(display, &per_ctrl_mode, dfps_caps.type)) { - pr_err("seamless dynamic fps not supported for mode\n"); + DSI_ERR("seamless dynamic fps not supported for mode\n"); return -EINVAL; } if (display->panel->cur_mode) { curr_refresh_rate = display->panel->cur_mode->timing.refresh_rate; } else { - pr_err("cur_mode is not initialized\n"); + DSI_ERR("cur_mode is not initialized\n"); return -EINVAL; } } @@ -4346,7 +4345,7 @@ static int dsi_display_get_dfps_timing(struct dsi_display *display, break; default: - pr_err("Unsupported DFPS mode %d\n", dfps_caps.type); + DSI_ERR("Unsupported DFPS mode %d\n", dfps_caps.type); rc = -ENOTSUPP; } @@ -4359,16 +4358,16 @@ static bool dsi_display_validate_mode_seamless(struct dsi_display *display, int rc = 0; if (!display || !adj_mode) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return false; } /* Currently the only seamless transition is dynamic fps */ rc = dsi_display_get_dfps_timing(display, adj_mode, 0); if (rc) { - pr_debug("Dynamic FPS not supported for seamless\n"); + DSI_DEBUG("Dynamic FPS not supported for seamless\n"); } else { - pr_debug("Mode switch is seamless Dynamic FPS\n"); + DSI_DEBUG("Mode switch is seamless Dynamic FPS\n"); adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_DFPS | DSI_MODE_FLAG_VBLANK_PRE_MODESET; } @@ -4387,7 +4386,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, priv_info = mode->priv_info; if (!priv_info) { - pr_err("[%s] failed to get private info of the display mode\n", + DSI_ERR("[%s] failed to get private info of the display mode\n", display->name); return -EINVAL; } @@ -4400,7 +4399,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, mode, &display->config); if (rc) { - pr_err("[%s] failed to get host config for mode, rc=%d\n", + DSI_ERR("[%s] failed to get host config for mode, rc=%d\n", display->name, rc); goto error; } @@ -4412,7 +4411,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, (DSI_MODE_FLAG_DFPS | DSI_MODE_FLAG_VRR)) { rc = dsi_display_dfps_update(display, mode); if (rc) { - pr_err("[%s]DSI dfps update failed, rc=%d\n", + DSI_ERR("[%s]DSI dfps update failed, rc=%d\n", display->name, rc); goto error; } @@ -4420,7 +4419,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, if (display->panel->panel_mode == DSI_OP_VIDEO_MODE) { rc = dsi_display_dynamic_clk_switch_vid(display, mode); if (rc) - pr_err("dynamic clk change failed %d\n", rc); + DSI_ERR("dynamic clk change failed %d\n", rc); /* * skip rest of the opearations since * dsi_display_dynamic_clk_switch_vid() already takes @@ -4432,7 +4431,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, rc = dsi_display_dynamic_clk_configure_cmd(display, clk_rate); if (rc) { - pr_err("Failed to configure dynamic clk\n"); + DSI_ERR("Failed to configure dynamic clk\n"); return rc; } } @@ -4444,7 +4443,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, mode, mode->dsi_mode_flags, display->dsi_clk_handle); if (rc) { - pr_err("[%s] failed to update ctrl config, rc=%d\n", + DSI_ERR("[%s] failed to update ctrl config, rc=%d\n", display->name, rc); goto error; } @@ -4461,7 +4460,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, priv_info->phy_timing_val, priv_info->phy_timing_len); if (rc) - pr_err("failed to add DSI PHY timing params\n"); + DSI_ERR("failed to add DSI PHY timing params\n"); } } error: @@ -4480,7 +4479,7 @@ static int _dsi_display_dev_init(struct dsi_display *display) int rc = 0; if (!display) { - pr_err("invalid display\n"); + DSI_ERR("invalid display\n"); return -EINVAL; } @@ -4497,13 +4496,13 @@ static int _dsi_display_dev_init(struct dsi_display *display) rc = dsi_display_parse_dt(display); if (rc) { - pr_err("[%s] failed to parse dt, rc=%d\n", display->name, rc); + DSI_ERR("[%s] failed to parse dt, rc=%d\n", display->name, rc); goto error; } rc = dsi_display_res_init(display); if (rc) { - pr_err("[%s] failed to initialize resources, rc=%d\n", + DSI_ERR("[%s] failed to initialize resources, rc=%d\n", display->name, rc); goto error; } @@ -4523,7 +4522,7 @@ static int _dsi_display_dev_deinit(struct dsi_display *display) int rc = 0; if (!display) { - pr_err("invalid display\n"); + DSI_ERR("invalid display\n"); return -EINVAL; } @@ -4531,7 +4530,7 @@ static int _dsi_display_dev_deinit(struct dsi_display *display) rc = dsi_display_res_deinit(display); if (rc) - pr_err("[%s] failed to deinitialize resource, rc=%d\n", + DSI_ERR("[%s] failed to deinitialize resource, rc=%d\n", display->name, rc); mutex_unlock(&display->display_lock); @@ -4551,13 +4550,13 @@ int dsi_display_cont_splash_config(void *dsi_display) /* Vote for gdsc required to read register address space */ if (!display) { - pr_err("invalid input display param\n"); + DSI_ERR("invalid input display param\n"); return -EINVAL; } rc = pm_runtime_get_sync(display->drm_dev->dev); if (rc < 0) { - pr_err("failed to vote gdsc for continuous splash, rc=%d\n", + DSI_ERR("failed to vote gdsc for continuous splash, rc=%d\n", rc); return rc; } @@ -4579,7 +4578,7 @@ int dsi_display_cont_splash_config(void *dsi_display) rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_ALL_CLKS, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI link clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI link clocks, rc=%d\n", display->name, rc); goto clk_manager_update; } @@ -4587,7 +4586,7 @@ int dsi_display_cont_splash_config(void *dsi_display) /* Vote on panel regulator will be removed during suspend path */ rc = dsi_pwr_enable_regulator(&display->panel->power_info, true); if (rc) { - pr_err("[%s] failed to enable vregs, rc=%d\n", + DSI_ERR("[%s] failed to enable vregs, rc=%d\n", display->panel->name, rc); goto clks_disabled; } @@ -4630,7 +4629,7 @@ int dsi_display_splash_res_cleanup(struct dsi_display *display) rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_ALL_CLKS, DSI_CLK_OFF); if (rc) - pr_err("[%s] failed to disable DSI link clocks, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI link clocks, rc=%d\n", display->name, rc); pm_runtime_put_sync(display->drm_dev->dev); @@ -4650,12 +4649,12 @@ static int dsi_display_force_update_dsi_clk(struct dsi_display *display) rc = dsi_display_link_clk_force_update_ctrl(display->dsi_clk_handle); if (!rc) { - pr_info("dsi bit clk has been configured to %d\n", + DSI_INFO("dsi bit clk has been configured to %d\n", display->cached_clk_rate); atomic_set(&display->clkrate_change_pending, 0); } else { - pr_err("Failed to configure dsi bit clock '%d'. rc = %d\n", + DSI_ERR("Failed to configure dsi bit clock '%d'. rc = %d\n", display->cached_clk_rate, rc); } @@ -4672,7 +4671,7 @@ static int dsi_display_validate_split_link(struct dsi_display *display) return 0; if (display->panel->panel_mode == DSI_OP_CMD_MODE) { - pr_err("[%s] split link is not supported in command mode\n", + DSI_ERR("[%s] split link is not supported in command mode\n", display->name); rc = -ENOTSUPP; goto error; @@ -4681,7 +4680,7 @@ static int dsi_display_validate_split_link(struct dsi_display *display) display_for_each_ctrl(i, display) { ctrl = &display->ctrl[i]; if (!ctrl->ctrl->split_link_supported) { - pr_err("[%s] split link is not supported by hw\n", + DSI_ERR("[%s] split link is not supported by hw\n", display->name); rc = -ENOTSUPP; goto error; @@ -4690,7 +4689,7 @@ static int dsi_display_validate_split_link(struct dsi_display *display) set_bit(DSI_PHY_SPLIT_LINK, ctrl->phy->hw.feature_map); } - pr_debug("Split link is enabled\n"); + DSI_DEBUG("Split link is enabled\n"); return 0; error: @@ -4721,7 +4720,7 @@ static int dsi_display_bind(struct device *dev, int i, rc = 0; if (!dev || !pdev || !master) { - pr_err("invalid param(s), dev %pK, pdev %pK, master %pK\n", + DSI_ERR("invalid param(s), dev %pK, pdev %pK, master %pK\n", dev, pdev, master); return -EINVAL; } @@ -4729,7 +4728,7 @@ static int dsi_display_bind(struct device *dev, drm = dev_get_drvdata(master); display = platform_get_drvdata(pdev); if (!drm || !display) { - pr_err("invalid param(s), drm %pK, display %pK\n", + DSI_ERR("invalid param(s), drm %pK, display %pK\n", drm, display); return -EINVAL; } @@ -4744,7 +4743,7 @@ static int dsi_display_bind(struct device *dev, for (i = 0; i < display->ext_bridge_cnt; i++) { if (!of_drm_find_bridge( display->ext_bridge[i].node_of)) { - pr_debug("defer for bridge[%d] %s\n", i, + DSI_DEBUG("defer for bridge[%d] %s\n", i, display->ext_bridge[i].node_of->full_name); return -EPROBE_DEFER; } @@ -4755,14 +4754,14 @@ static int dsi_display_bind(struct device *dev, rc = dsi_display_validate_split_link(display); if (rc) { - pr_err("[%s] split link validation failed, rc=%d\n", + DSI_ERR("[%s] split link validation failed, rc=%d\n", display->name, rc); goto error; } rc = dsi_display_debugfs_init(display); if (rc) { - pr_err("[%s] debugfs init failed, rc=%d\n", display->name, rc); + DSI_ERR("[%s] debugfs init failed, rc=%d\n", display->name, rc); goto error; } @@ -4775,7 +4774,7 @@ static int dsi_display_bind(struct device *dev, display_ctrl = &display->ctrl[i]; rc = dsi_ctrl_drv_init(display_ctrl->ctrl, display->root); if (rc) { - pr_err("[%s] failed to initialize ctrl[%d], rc=%d\n", + DSI_ERR("[%s] failed to initialize ctrl[%d], rc=%d\n", display->name, i, rc); goto error_ctrl_deinit; } @@ -4783,7 +4782,7 @@ static int dsi_display_bind(struct device *dev, rc = dsi_phy_drv_init(display_ctrl->phy); if (rc) { - pr_err("[%s] Failed to initialize phy[%d], rc=%d\n", + DSI_ERR("[%s] Failed to initialize phy[%d], rc=%d\n", display->name, i, rc); (void)dsi_ctrl_drv_deinit(display_ctrl->ctrl); goto error_ctrl_deinit; @@ -4819,14 +4818,14 @@ static int dsi_display_bind(struct device *dev, if (IS_ERR_OR_NULL(display->clk_mngr)) { rc = PTR_ERR(display->clk_mngr); display->clk_mngr = NULL; - pr_err("dsi clock registration failed, rc = %d\n", rc); + DSI_ERR("dsi clock registration failed, rc = %d\n", rc); goto error_ctrl_deinit; } handle = dsi_register_clk_handle(display->clk_mngr, client1); if (IS_ERR_OR_NULL(handle)) { rc = PTR_ERR(handle); - pr_err("failed to register %s client, rc = %d\n", + DSI_ERR("failed to register %s client, rc = %d\n", client1, rc); goto error_clk_deinit; } else { @@ -4836,7 +4835,7 @@ static int dsi_display_bind(struct device *dev, handle = dsi_register_clk_handle(display->clk_mngr, client2); if (IS_ERR_OR_NULL(handle)) { rc = PTR_ERR(handle); - pr_err("failed to register %s client, rc = %d\n", + DSI_ERR("failed to register %s client, rc = %d\n", client2, rc); goto error_clk_client_deinit; } else { @@ -4851,14 +4850,14 @@ static int dsi_display_bind(struct device *dev, rc = dsi_ctrl_clk_cb_register(display_ctrl->ctrl, &clk_cb); if (rc) { - pr_err("[%s] failed to register ctrl clk_cb[%d], rc=%d\n", + DSI_ERR("[%s] failed to register ctrl clk_cb[%d], rc=%d\n", display->name, i, rc); goto error_ctrl_deinit; } rc = dsi_phy_clk_cb_register(display_ctrl->phy, &clk_cb); if (rc) { - pr_err("[%s] failed to register phy clk_cb[%d], rc=%d\n", + DSI_ERR("[%s] failed to register phy clk_cb[%d], rc=%d\n", display->name, i, rc); goto error_ctrl_deinit; } @@ -4866,7 +4865,7 @@ static int dsi_display_bind(struct device *dev, rc = dsi_display_mipi_host_init(display); if (rc) { - pr_err("[%s] failed to initialize mipi host, rc=%d\n", + DSI_ERR("[%s] failed to initialize mipi host, rc=%d\n", display->name, rc); goto error_ctrl_deinit; } @@ -4874,12 +4873,12 @@ static int dsi_display_bind(struct device *dev, rc = dsi_panel_drv_init(display->panel, &display->host); if (rc) { if (rc != -EPROBE_DEFER) - pr_err("[%s] failed to initialize panel driver, rc=%d\n", + DSI_ERR("[%s] failed to initialize panel driver, rc=%d\n", display->name, rc); goto error_host_deinit; } - pr_info("Successfully bind display panel '%s'\n", display->name); + DSI_INFO("Successfully bind display panel '%s'\n", display->name); display->drm_dev = drm; display_for_each_ctrl(i, display) { @@ -4891,7 +4890,7 @@ static int dsi_display_bind(struct device *dev, rc = dsi_phy_set_clk_freq(display_ctrl->phy, &display_ctrl->ctrl->clk_freq); if (rc) { - pr_err("[%s] failed to set phy clk freq, rc=%d\n", + DSI_ERR("[%s] failed to set phy clk freq, rc=%d\n", display->name, rc); goto error; } @@ -4935,13 +4934,13 @@ static void dsi_display_unbind(struct device *dev, int i, rc = 0; if (!dev || !pdev) { - pr_err("invalid param(s)\n"); + DSI_ERR("invalid param(s)\n"); return; } display = platform_get_drvdata(pdev); if (!display) { - pr_err("invalid display\n"); + DSI_ERR("invalid display\n"); return; } @@ -4949,12 +4948,12 @@ static void dsi_display_unbind(struct device *dev, rc = dsi_panel_drv_deinit(display->panel); if (rc) - pr_err("[%s] failed to deinit panel driver, rc=%d\n", + DSI_ERR("[%s] failed to deinit panel driver, rc=%d\n", display->name, rc); rc = dsi_display_mipi_host_deinit(display); if (rc) - pr_err("[%s] failed to deinit mipi hosts, rc=%d\n", + DSI_ERR("[%s] failed to deinit mipi hosts, rc=%d\n", display->name, rc); @@ -4963,12 +4962,12 @@ static void dsi_display_unbind(struct device *dev, rc = dsi_phy_drv_deinit(display_ctrl->phy); if (rc) - pr_err("[%s] failed to deinit phy%d driver, rc=%d\n", + DSI_ERR("[%s] failed to deinit phy%d driver, rc=%d\n", display->name, i, rc); rc = dsi_ctrl_drv_deinit(display_ctrl->ctrl); if (rc) - pr_err("[%s] failed to deinit ctrl%d driver, rc=%d\n", + DSI_ERR("[%s] failed to deinit ctrl%d driver, rc=%d\n", display->name, i, rc); } @@ -5002,15 +5001,15 @@ static int dsi_display_init(struct dsi_display *display) rc = _dsi_display_dev_init(display); if (rc) { - pr_err("device init failed, rc=%d\n", rc); + DSI_ERR("device init failed, rc=%d\n", rc); goto end; } rc = component_add(&pdev->dev, &dsi_display_comp_ops); if (rc) - pr_err("component add failed, rc=%d\n", rc); + DSI_ERR("component add failed, rc=%d\n", rc); - pr_debug("component add success: %s\n", display->name); + DSI_DEBUG("component add success: %s\n", display->name); end: return rc; } @@ -5021,7 +5020,7 @@ static void dsi_display_firmware_display(const struct firmware *fw, struct dsi_display *display = context; if (fw) { - pr_debug("reading data from firmware, size=%zd\n", + DSI_DEBUG("reading data from firmware, size=%zd\n", fw->size); display->fw = fw; @@ -5031,7 +5030,7 @@ static void dsi_display_firmware_display(const struct firmware *fw, if (dsi_display_init(display)) return; - pr_debug("success\n"); + DSI_DEBUG("success\n"); } int dsi_display_dev_probe(struct platform_device *pdev) @@ -5043,7 +5042,7 @@ int dsi_display_dev_probe(struct platform_device *pdev) struct dsi_display_boot_param *boot_disp; if (!pdev || !pdev->dev.of_node) { - pr_err("pdev not found\n"); + DSI_ERR("pdev not found\n"); rc = -ENODEV; goto end; } @@ -5067,7 +5066,7 @@ int dsi_display_dev_probe(struct platform_device *pdev) if (boot_disp->boot_disp_en) { mdp_node = of_parse_phandle(node, "qcom,mdp", 0); if (!mdp_node) { - pr_err("mdp_node not found\n"); + DSI_ERR("mdp_node not found\n"); rc = -ENODEV; goto end; } @@ -5075,12 +5074,12 @@ int dsi_display_dev_probe(struct platform_device *pdev) /* The panel name should be same as UEFI name index */ panel_node = of_find_node_by_name(mdp_node, boot_disp->name); if (!panel_node) - pr_warn("panel_node %s not found\n", boot_disp->name); + DSI_WARN("panel_node %s not found\n", boot_disp->name); } else { panel_node = of_parse_phandle(node, "qcom,dsi-default-panel", 0); if (!panel_node) - pr_warn("default panel not found\n"); + DSI_WARN("default panel not found\n"); if (IS_ENABLED(CONFIG_DSI_PARSER)) firm_req = !request_firmware_nowait( @@ -5121,7 +5120,7 @@ int dsi_display_dev_remove(struct platform_device *pdev) struct dsi_display *display; if (!pdev) { - pr_err("Invalid device\n"); + DSI_ERR("Invalid device\n"); return -EINVAL; } @@ -5156,7 +5155,7 @@ int dsi_display_get_active_displays(void **display_array, u32 max_display_count) int index = 0, count = 0; if (!display_array || !max_display_count) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return 0; } @@ -5178,7 +5177,7 @@ int dsi_display_drm_bridge_init(struct dsi_display *display, struct msm_drm_private *priv = NULL; if (!display || !display->drm_dev || !enc) { - pr_err("invalid param(s)\n"); + DSI_ERR("invalid param(s)\n"); return -EINVAL; } @@ -5186,20 +5185,20 @@ int dsi_display_drm_bridge_init(struct dsi_display *display, priv = display->drm_dev->dev_private; if (!priv) { - pr_err("Private data is not present\n"); + DSI_ERR("Private data is not present\n"); rc = -EINVAL; goto error; } if (display->bridge) { - pr_err("display is already initialize\n"); + DSI_ERR("display is already initialize\n"); goto error; } bridge = dsi_drm_bridge_init(display, display->drm_dev, enc); if (IS_ERR_OR_NULL(bridge)) { rc = PTR_ERR(bridge); - pr_err("[%s] brige init failed, %d\n", display->name, rc); + DSI_ERR("[%s] brige init failed, %d\n", display->name, rc); goto error; } @@ -5216,7 +5215,7 @@ int dsi_display_drm_bridge_deinit(struct dsi_display *display) int rc = 0; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -5301,13 +5300,13 @@ static int dsi_display_ext_get_info(struct drm_connector *connector, int i; if (!info || !disp) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } display = disp; if (!display->panel) { - pr_err("invalid display panel\n"); + DSI_ERR("invalid display panel\n"); return -EINVAL; } @@ -5464,11 +5463,11 @@ static int dsi_host_ext_attach(struct mipi_dsi_host *host, struct dsi_panel *panel; if (!host || !dsi || !display->panel) { - pr_err("Invalid param\n"); + DSI_ERR("Invalid param\n"); return -EINVAL; } - pr_debug("DSI[%s]: channel=%d, lanes=%d, format=%d, mode_flags=%lx\n", + DSI_DEBUG("DSI[%s]: channel=%d, lanes=%d, format=%d, mode_flags=%lx\n", dsi->name, dsi->channel, dsi->lanes, dsi->format, dsi->mode_flags); @@ -5526,7 +5525,7 @@ static int dsi_host_ext_attach(struct mipi_dsi_host *host, dsi->mode_flags & MIPI_DSI_MODE_VIDEO_EOF_BLLP; } else { panel->panel_mode = DSI_OP_CMD_MODE; - pr_err("command mode not supported by ext bridge\n"); + DSI_ERR("command mode not supported by ext bridge\n"); return -ENOTSUPP; } @@ -5566,7 +5565,7 @@ int dsi_display_drm_ext_bridge_init(struct dsi_display *display, ext_bridge = of_drm_find_bridge(ext_bridge_info->node_of); if (IS_ERR_OR_NULL(ext_bridge)) { rc = PTR_ERR(ext_bridge); - pr_err("failed to find ext bridge\n"); + DSI_ERR("failed to find ext bridge\n"); goto error; } @@ -5588,7 +5587,7 @@ int dsi_display_drm_ext_bridge_init(struct dsi_display *display, rc = drm_bridge_attach(encoder, ext_bridge, prev_bridge); if (rc) { - pr_err("[%s] ext brige attach failed, %d\n", + DSI_ERR("[%s] ext brige attach failed, %d\n", display->name, rc); goto error; } @@ -5660,20 +5659,20 @@ int dsi_display_get_info(struct drm_connector *connector, int i, rc; if (!info || !disp) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } display = disp; if (!display->panel) { - pr_err("invalid display panel\n"); + DSI_ERR("invalid display panel\n"); return -EINVAL; } mutex_lock(&display->display_lock); rc = dsi_panel_get_phy_props(display->panel, &phy_props); if (rc) { - pr_err("[%s] failed to get panel phy props, rc=%d\n", + DSI_ERR("[%s] failed to get panel phy props, rc=%d\n", display->name, rc); goto error; } @@ -5715,7 +5714,7 @@ int dsi_display_get_info(struct drm_connector *connector, display->sw_te_using_wd; break; default: - pr_err("unknwown dsi panel mode %d\n", + DSI_ERR("unknwown dsi panel mode %d\n", display->panel->panel_mode); break; } @@ -5741,7 +5740,7 @@ static int dsi_display_get_mode_count_no_lock(struct dsi_display *display, int num_dfps_rates, num_bit_clks, rc = 0; if (!display || !display->panel) { - pr_err("invalid display:%d panel:%d\n", display != NULL, + DSI_ERR("invalid display:%d panel:%d\n", display != NULL, display ? display->panel != NULL : 0); return -EINVAL; } @@ -5750,7 +5749,7 @@ static int dsi_display_get_mode_count_no_lock(struct dsi_display *display, rc = dsi_panel_get_dfps_caps(display->panel, &dfps_caps); if (rc) { - pr_err("[%s] failed to get dfps caps from panel\n", + DSI_ERR("[%s] failed to get dfps caps from panel\n", display->name); return rc; } @@ -5775,7 +5774,7 @@ int dsi_display_get_mode_count(struct dsi_display *display, int rc; if (!display || !display->panel) { - pr_err("invalid display:%d panel:%d\n", display != NULL, + DSI_ERR("invalid display:%d panel:%d\n", display != NULL, display ? display->panel != NULL : 0); return -EINVAL; } @@ -5840,7 +5839,7 @@ static void _dsi_display_populate_bit_clks(struct dsi_display *display, dst = &display->modes[*mode_idx]; if (!src || !dst) { - pr_err("invalid mode index\n"); + DSI_ERR("invalid mode index\n"); return; } memcpy(dst, src, sizeof(struct dsi_display_mode)); @@ -5873,7 +5872,7 @@ int dsi_display_get_modes(struct dsi_display *display, int i, start, end, rc = -EINVAL; if (!display || !out_modes) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -5898,7 +5897,7 @@ int dsi_display_get_modes(struct dsi_display *display, rc = dsi_panel_get_dfps_caps(display->panel, &dfps_caps); if (rc) { - pr_err("[%s] failed to get dfps caps from panel\n", + DSI_ERR("[%s] failed to get dfps caps from panel\n", display->name); goto error; } @@ -5923,7 +5922,7 @@ int dsi_display_get_modes(struct dsi_display *display, &panel_mode, topology_override); if (rc) { - pr_err("[%s] failed to get mode idx %d from panel\n", + DSI_ERR("[%s] failed to get mode idx %d from panel\n", display->name, mode_idx); goto error; } @@ -5969,7 +5968,7 @@ int dsi_display_get_modes(struct dsi_display *display, u32 curr_refresh_rate; if (!sub_mode) { - pr_err("invalid mode data\n"); + DSI_ERR("invalid mode data\n"); rc = -EFAULT; goto error; } @@ -6033,7 +6032,7 @@ int dsi_display_get_panel_vfp(void *dsi_display, if (!refresh_rate) { mutex_unlock(&display->display_lock); - pr_err("Null Refresh Rate\n"); + DSI_ERR("Null Refresh Rate\n"); return -EINVAL; } @@ -6130,7 +6129,7 @@ int dsi_display_find_mode(struct dsi_display *display, mutex_unlock(&display->display_lock); if (!*out_mode) { - pr_err("[%s] failed to find mode for v_active %u h_active %u fps %u pclk %u\n", + DSI_ERR("[%s] failed to find mode for v_active %u h_active %u fps %u pclk %u\n", display->name, cmp->timing.v_active, cmp->timing.h_active, cmp->timing.refresh_rate, cmp->pixel_clk_khz); @@ -6160,12 +6159,12 @@ int dsi_display_validate_mode_change(struct dsi_display *display, struct dsi_dyn_clk_caps *dyn_clk_caps; if (!display || !adj_mode) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (!display->panel || !display->panel->cur_mode) { - pr_debug("Current panel mode not set\n"); + DSI_DEBUG("Current panel mode not set\n"); return rc; } @@ -6178,7 +6177,7 @@ int dsi_display_validate_mode_change(struct dsi_display *display, adj_mode->timing.refresh_rate) { dsi_panel_get_dfps_caps(display->panel, &dfps_caps); if (dfps_caps.dfps_support) { - pr_debug("Mode switch is seamless variable refresh\n"); + DSI_DEBUG("Mode switch is seamless variable refresh\n"); adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_VRR; SDE_EVT32(cur_mode->timing.refresh_rate, adj_mode->timing.refresh_rate, @@ -6191,10 +6190,9 @@ int dsi_display_validate_mode_change(struct dsi_display *display, if (cur_mode->pixel_clk_khz != adj_mode->pixel_clk_khz) { dyn_clk_caps = &(display->panel->dyn_clk_caps); if (dyn_clk_caps->dyn_clk_support) { - pr_debug("dynamic clk change detected\n"); - if (adj_mode->dsi_mode_flags - & DSI_MODE_FLAG_VRR) { - pr_err("dfps and dyn clk not supported in same commit\n"); + DSI_DEBUG("dynamic clk change detected\n"); + if (adj_mode->dsi_mode_flags & DSI_MODE_FLAG_VRR) { + DSI_ERR("dfps and dyn clk not supported in same commit\n"); rc = -ENOTSUPP; goto error; } @@ -6222,7 +6220,7 @@ int dsi_display_validate_mode(struct dsi_display *display, struct dsi_display_mode adj_mode; if (!display || !mode) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -6233,7 +6231,7 @@ int dsi_display_validate_mode(struct dsi_display *display, rc = dsi_panel_validate_mode(display->panel, &adj_mode); if (rc) { - pr_err("[%s] panel mode validation failed, rc=%d\n", + DSI_ERR("[%s] panel mode validation failed, rc=%d\n", display->name, rc); goto error; } @@ -6242,14 +6240,14 @@ int dsi_display_validate_mode(struct dsi_display *display, ctrl = &display->ctrl[i]; rc = dsi_ctrl_validate_timing(ctrl->ctrl, &adj_mode.timing); if (rc) { - pr_err("[%s] ctrl mode validation failed, rc=%d\n", + DSI_ERR("[%s] ctrl mode validation failed, rc=%d\n", display->name, rc); goto error; } rc = dsi_phy_validate_mode(ctrl->phy, &adj_mode.timing); if (rc) { - pr_err("[%s] phy mode validation failed, rc=%d\n", + DSI_ERR("[%s] phy mode validation failed, rc=%d\n", display->name, rc); goto error; } @@ -6259,7 +6257,7 @@ int dsi_display_validate_mode(struct dsi_display *display, (mode->dsi_mode_flags & DSI_MODE_FLAG_SEAMLESS)) { rc = dsi_display_validate_mode_seamless(display, mode); if (rc) { - pr_err("[%s] seamless not possible rc=%d\n", + DSI_ERR("[%s] seamless not possible rc=%d\n", display->name, rc); goto error; } @@ -6279,7 +6277,7 @@ int dsi_display_set_mode(struct dsi_display *display, struct dsi_mode_info timing; if (!display || !mode || !display->panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -6295,13 +6293,13 @@ int dsi_display_set_mode(struct dsi_display *display, rc = dsi_display_validate_mode_set(display, &adj_mode, flags); if (rc) { - pr_err("[%s] mode cannot be set\n", display->name); + DSI_ERR("[%s] mode cannot be set\n", display->name); goto error; } rc = dsi_display_set_mode_sub(display, &adj_mode, flags); if (rc) { - pr_err("[%s] failed to set mode\n", display->name); + DSI_ERR("[%s] failed to set mode\n", display->name); goto error; } @@ -6314,10 +6312,11 @@ int dsi_display_set_mode(struct dsi_display *display, } } - pr_info("mdp_transfer_time_us=%d us\n", + DSI_INFO("mdp_transfer_time_us=%d us\n", adj_mode.priv_info->mdp_transfer_time_us); - pr_info("hactive= %d,vactive= %d,fps=%d",timing.h_active, - timing.v_active,timing.refresh_rate); + DSI_INFO("hactive= %d,vactive= %d,fps=%d\n", + timing.h_active, timing.v_active, + timing.refresh_rate); memcpy(display->panel->cur_mode, &adj_mode, sizeof(adj_mode)); error: @@ -6332,7 +6331,7 @@ int dsi_display_set_tpg_state(struct dsi_display *display, bool enable) struct dsi_display_ctrl *ctrl; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -6340,7 +6339,7 @@ int dsi_display_set_tpg_state(struct dsi_display *display, bool enable) ctrl = &display->ctrl[i]; rc = dsi_ctrl_set_tpg_state(ctrl->ctrl, enable); if (rc) { - pr_err("[%s] failed to set tpg state for host_%d\n", + DSI_ERR("[%s] failed to set tpg state for host_%d\n", display->name, i); goto error; } @@ -6358,21 +6357,21 @@ static int dsi_display_pre_switch(struct dsi_display *display) rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI core clocks, rc=%d\n", display->name, rc); goto error; } rc = dsi_display_ctrl_update(display); if (rc) { - pr_err("[%s] failed to update DSI controller, rc=%d\n", + DSI_ERR("[%s] failed to update DSI controller, rc=%d\n", display->name, rc); goto error_ctrl_clk_off; } rc = dsi_display_set_clk_src(display); if (rc) { - pr_err("[%s] failed to set DSI link clock source, rc=%d\n", + DSI_ERR("[%s] failed to set DSI link clock source, rc=%d\n", display->name, rc); goto error_ctrl_deinit; } @@ -6380,7 +6379,7 @@ static int dsi_display_pre_switch(struct dsi_display *display) rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_LINK_CLK, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI link clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI link clocks, rc=%d\n", display->name, rc); goto error_ctrl_deinit; } @@ -6419,7 +6418,7 @@ static void dsi_display_handle_fifo_underflow(struct work_struct *work) display = container_of(work, struct dsi_display, fifo_underflow_work); if (!display || !display->panel || atomic_read(&display->panel->esd_recovery_pending)) { - pr_debug("Invalid recovery use case\n"); + DSI_DEBUG("Invalid recovery use case\n"); return; } @@ -6430,7 +6429,7 @@ static void dsi_display_handle_fifo_underflow(struct work_struct *work) return; } - pr_debug("handle DSI FIFO underflow error\n"); + DSI_DEBUG("handle DSI FIFO underflow error\n"); dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_ALL_CLKS, DSI_CLK_ON); @@ -6458,7 +6457,7 @@ static void dsi_display_handle_fifo_overflow(struct work_struct *work) if (!display || !display->panel || (display->panel->panel_mode != DSI_OP_VIDEO_MODE) || atomic_read(&display->panel->esd_recovery_pending)) { - pr_debug("Invalid recovery use case\n"); + DSI_DEBUG("Invalid recovery use case\n"); return; } @@ -6469,7 +6468,7 @@ static void dsi_display_handle_fifo_overflow(struct work_struct *work) return; } - pr_debug("handle DSI FIFO overflow error\n"); + DSI_DEBUG("handle DSI FIFO overflow error\n"); dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_ALL_CLKS, DSI_CLK_ON); @@ -6497,7 +6496,7 @@ static void dsi_display_handle_fifo_overflow(struct work_struct *work) rc = cb_func(data, SDE_CONN_EVENT_VID_FIFO_OVERFLOW, display->clk_master_idx, 0, 0, 0, 0); if (rc < 0) { - pr_debug("sde callback failed\n"); + DSI_DEBUG("sde callback failed\n"); goto end; } } @@ -6535,7 +6534,7 @@ static void dsi_display_handle_lp_rx_timeout(struct work_struct *work) if (!display || !display->panel || (display->panel->panel_mode != DSI_OP_VIDEO_MODE) || atomic_read(&display->panel->esd_recovery_pending)) { - pr_debug("Invalid recovery use case\n"); + DSI_DEBUG("Invalid recovery use case\n"); return; } @@ -6546,7 +6545,7 @@ static void dsi_display_handle_lp_rx_timeout(struct work_struct *work) return; } - pr_debug("handle DSI LP RX Timeout error\n"); + DSI_DEBUG("handle DSI LP RX Timeout error\n"); dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_ALL_CLKS, DSI_CLK_ON); @@ -6574,7 +6573,7 @@ static void dsi_display_handle_lp_rx_timeout(struct work_struct *work) rc = cb_func(data, SDE_CONN_EVENT_VID_FIFO_OVERFLOW, display->clk_master_idx, 0, 0, 0, 0); if (rc < 0) { - pr_debug("Target is in suspend/shutdown\n"); + DSI_DEBUG("Target is in suspend/shutdown\n"); goto end; } } @@ -6617,7 +6616,7 @@ static int dsi_display_cb_error_handler(void *data, queue_work(display->err_workq, &display->lp_rx_timeout_work); break; default: - pr_warn("unhandled error interrupt: %d\n", event_idx); + DSI_WARN("unhandled error interrupt: %d\n", event_idx); break; } @@ -6635,7 +6634,7 @@ static void dsi_display_register_error_handler(struct dsi_display *display) display->err_workq = create_singlethread_workqueue("dsi_err_workq"); if (!display->err_workq) { - pr_err("failed to create dsi workq!\n"); + DSI_ERR("failed to create dsi workq!\n"); return; } @@ -6683,12 +6682,12 @@ int dsi_display_prepare(struct dsi_display *display) struct dsi_display_mode *mode; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (!display->panel->cur_mode) { - pr_err("no valid mode set for the display\n"); + DSI_ERR("no valid mode set for the display\n"); return -EINVAL; } @@ -6705,7 +6704,7 @@ int dsi_display_prepare(struct dsi_display *display) if (mode->dsi_mode_flags & DSI_MODE_FLAG_DMS) { if (display->is_cont_splash_enabled && display->config.panel_mode == DSI_OP_VIDEO_MODE) { - pr_err("DMS not supported on first frame\n"); + DSI_ERR("DMS not supported on first frame\n"); rc = -EINVAL; goto error; } @@ -6713,7 +6712,7 @@ int dsi_display_prepare(struct dsi_display *display) /* update dsi ctrl for new mode */ rc = dsi_display_pre_switch(display); if (rc) - pr_err("[%s] panel pre-prepare-res-switch failed, rc=%d\n", + DSI_ERR("[%s] panel pre-prepare-res-switch failed, rc=%d\n", display->name, rc); goto error; } @@ -6727,7 +6726,7 @@ int dsi_display_prepare(struct dsi_display *display) */ rc = dsi_panel_pre_prepare(display->panel); if (rc) { - pr_err("[%s] panel pre-prepare failed, rc=%d\n", + DSI_ERR("[%s] panel pre-prepare failed, rc=%d\n", display->name, rc); goto error; } @@ -6736,7 +6735,7 @@ int dsi_display_prepare(struct dsi_display *display) rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI core clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI core clocks, rc=%d\n", display->name, rc); goto error_panel_post_unprep; } @@ -6751,14 +6750,14 @@ int dsi_display_prepare(struct dsi_display *display) if (!display->panel->ulps_suspend_enabled || !display->ulps_enabled) { rc = dsi_display_phy_sw_reset(display); if (rc) { - pr_err("[%s] failed to reset phy, rc=%d\n", + DSI_ERR("[%s] failed to reset phy, rc=%d\n", display->name, rc); goto error_ctrl_clk_off; } rc = dsi_display_phy_enable(display); if (rc) { - pr_err("[%s] failed to enable DSI PHY, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI PHY, rc=%d\n", display->name, rc); goto error_ctrl_clk_off; } @@ -6766,14 +6765,14 @@ int dsi_display_prepare(struct dsi_display *display) rc = dsi_display_set_clk_src(display); if (rc) { - pr_err("[%s] failed to set DSI link clock source, rc=%d\n", + DSI_ERR("[%s] failed to set DSI link clock source, rc=%d\n", display->name, rc); goto error_phy_disable; } rc = dsi_display_ctrl_init(display); if (rc) { - pr_err("[%s] failed to setup DSI controller, rc=%d\n", + DSI_ERR("[%s] failed to setup DSI controller, rc=%d\n", display->name, rc); goto error_phy_disable; } @@ -6782,7 +6781,7 @@ int dsi_display_prepare(struct dsi_display *display) rc = dsi_display_ctrl_host_enable(display); if (rc) { - pr_err("[%s] failed to enable DSI host, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI host, rc=%d\n", display->name, rc); goto error_ctrl_deinit; } @@ -6790,7 +6789,7 @@ int dsi_display_prepare(struct dsi_display *display) rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_LINK_CLK, DSI_CLK_ON); if (rc) { - pr_err("[%s] failed to enable DSI link clocks, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI link clocks, rc=%d\n", display->name, rc); goto error_host_engine_off; } @@ -6803,7 +6802,7 @@ int dsi_display_prepare(struct dsi_display *display) */ rc = dsi_display_soft_reset(display); if (rc) { - pr_err("[%s] failed soft reset, rc=%d\n", + DSI_ERR("[%s] failed soft reset, rc=%d\n", display->name, rc); goto error_ctrl_link_off; } @@ -6811,7 +6810,7 @@ int dsi_display_prepare(struct dsi_display *display) if (!(mode->dsi_mode_flags & DSI_MODE_FLAG_POMS)) { rc = dsi_panel_prepare(display->panel); if (rc) { - pr_err("[%s] panel prepare failed, rc=%d\n", + DSI_ERR("[%s] panel prepare failed, rc=%d\n", display->name, rc); goto error_ctrl_link_off; } @@ -6856,7 +6855,7 @@ static int dsi_display_calc_ctrl_roi(const struct dsi_display *display, roi_caps = &cur_mode->priv_info->roi_caps; if (req_rois->num_rects > roi_caps->num_roi) { - pr_err("request for %d rois greater than max %d\n", + DSI_ERR("request for %d rois greater than max %d\n", req_rois->num_rects, roi_caps->num_roi); rc = -EINVAL; @@ -6883,7 +6882,7 @@ exit: /* adjust the ctrl origin to be top left within the ctrl */ out_roi->x = out_roi->x - bounds->x; - pr_debug("ctrl%d:%d: req (%d,%d,%d,%d) bnd (%d,%d,%d,%d) out (%d,%d,%d,%d)\n", + DSI_DEBUG("ctrl%d:%d: req (%d,%d,%d,%d) bnd (%d,%d,%d,%d) out (%d,%d,%d,%d)\n", ctrl->dsi_ctrl_idx, ctrl->ctrl->cell_index, req_roi.x, req_roi.y, req_roi.w, req_roi.h, bounds->x, bounds->y, bounds->w, bounds->h, @@ -6898,7 +6897,7 @@ static int dsi_display_qsync(struct dsi_display *display, bool enable) int rc = 0; if (!display->panel->qsync_min_fps) { - pr_err("%s:ERROR: qsync set, but no fps\n", __func__); + DSI_ERR("%s:ERROR: qsync set, but no fps\n", __func__); return 0; } @@ -6909,14 +6908,14 @@ static int dsi_display_qsync(struct dsi_display *display, bool enable) /* send the commands to enable qsync */ rc = dsi_panel_send_qsync_on_dcs(display->panel, i); if (rc) { - pr_err("fail qsync ON cmds rc:%d\n", rc); + DSI_ERR("fail qsync ON cmds rc:%d\n", rc); goto exit; } } else { /* send the commands to enable qsync */ rc = dsi_panel_send_qsync_off_dcs(display->panel, i); if (rc) { - pr_err("fail qsync OFF cmds rc:%d\n", rc); + DSI_ERR("fail qsync OFF cmds rc:%d\n", rc); goto exit; } } @@ -6956,13 +6955,13 @@ static int dsi_display_set_roi(struct dsi_display *display, rc = dsi_display_calc_ctrl_roi(display, ctrl, rois, &ctrl_roi); if (rc) { - pr_err("dsi_display_calc_ctrl_roi failed rc %d\n", rc); + DSI_ERR("dsi_display_calc_ctrl_roi failed rc %d\n", rc); return rc; } rc = dsi_ctrl_set_roi(ctrl->ctrl, &ctrl_roi, &changed); if (rc) { - pr_err("dsi_ctrl_set_roi failed rc %d\n", rc); + DSI_ERR("dsi_ctrl_set_roi failed rc %d\n", rc); return rc; } @@ -6972,14 +6971,14 @@ static int dsi_display_set_roi(struct dsi_display *display, /* send the new roi to the panel via dcs commands */ rc = dsi_panel_send_roi_dcs(display->panel, i, &ctrl_roi); if (rc) { - pr_err("dsi_panel_set_roi failed rc %d\n", rc); + DSI_ERR("dsi_panel_set_roi failed rc %d\n", rc); return rc; } /* re-program the ctrl with the timing based on the new roi */ rc = dsi_ctrl_setup(ctrl->ctrl); if (rc) { - pr_err("dsi_ctrl_setup failed rc %d\n", rc); + DSI_ERR("dsi_ctrl_setup failed rc %d\n", rc); return rc; } } @@ -7003,7 +7002,7 @@ int dsi_display_pre_kickoff(struct drm_connector *connector, enable = (params->qsync_mode > 0) ? true : false; rc = dsi_display_qsync(display, enable); if (rc) - pr_err("%s failed to send qsync commands\n", + DSI_ERR("%s failed to send qsync commands\n", __func__); SDE_EVT32(params->qsync_mode, rc); } @@ -7053,12 +7052,12 @@ int dsi_display_config_ctrl_for_cont_splash(struct dsi_display *display) int rc = 0; if (!display || !display->panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (!display->panel->cur_mode) { - pr_err("no valid mode set for the display\n"); + DSI_ERR("no valid mode set for the display\n"); return -EINVAL; } @@ -7068,19 +7067,19 @@ int dsi_display_config_ctrl_for_cont_splash(struct dsi_display *display) if (display->config.panel_mode == DSI_OP_VIDEO_MODE) { rc = dsi_display_vid_engine_enable(display); if (rc) { - pr_err("[%s]failed to enable DSI video engine, rc=%d\n", + DSI_ERR("[%s]failed to enable DSI video engine, rc=%d\n", display->name, rc); goto error_out; } } else if (display->config.panel_mode == DSI_OP_CMD_MODE) { rc = dsi_display_cmd_engine_enable(display); if (rc) { - pr_err("[%s]failed to enable DSI cmd engine, rc=%d\n", + DSI_ERR("[%s]failed to enable DSI cmd engine, rc=%d\n", display->name, rc); goto error_out; } } else { - pr_err("[%s] Invalid configuration\n", display->name); + DSI_ERR("[%s] Invalid configuration\n", display->name); rc = -EINVAL; } @@ -7094,12 +7093,12 @@ int dsi_display_enable(struct dsi_display *display) struct dsi_display_mode *mode; if (!display || !display->panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } if (!display->panel->cur_mode) { - pr_err("no valid mode set for the display\n"); + DSI_ERR("no valid mode set for the display\n"); return -EINVAL; } SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY); @@ -7113,13 +7112,13 @@ int dsi_display_enable(struct dsi_display *display) rc = dsi_display_splash_res_cleanup(display); if (rc) { - pr_err("Continuous splash res cleanup failed, rc=%d\n", + DSI_ERR("Continuous splash res cleanup failed, rc=%d\n", rc); return -EINVAL; } display->panel->panel_initialized = true; - pr_debug("cont splash enabled, display enable not required\n"); + DSI_DEBUG("cont splash enabled, display enable not required\n"); return 0; } @@ -7130,7 +7129,7 @@ int dsi_display_enable(struct dsi_display *display) if (mode->dsi_mode_flags & DSI_MODE_FLAG_DMS) { rc = dsi_panel_post_switch(display->panel); if (rc) { - pr_err("[%s] failed to switch DSI panel mode, rc=%d\n", + DSI_ERR("[%s] failed to switch DSI panel mode, rc=%d\n", display->name, rc); goto error; } @@ -7138,7 +7137,7 @@ int dsi_display_enable(struct dsi_display *display) DSI_MODE_FLAG_POMS)){ rc = dsi_panel_enable(display->panel); if (rc) { - pr_err("[%s] failed to enable DSI panel, rc=%d\n", + DSI_ERR("[%s] failed to enable DSI panel, rc=%d\n", display->name, rc); goto error; } @@ -7148,7 +7147,7 @@ int dsi_display_enable(struct dsi_display *display) mode->priv_info->dsc.pic_width *= display->ctrl_count; rc = dsi_panel_update_pps(display->panel); if (rc) { - pr_err("[%s] panel pps cmd update failed, rc=%d\n", + DSI_ERR("[%s] panel pps cmd update failed, rc=%d\n", display->name, rc); goto error; } @@ -7157,30 +7156,30 @@ int dsi_display_enable(struct dsi_display *display) if (mode->dsi_mode_flags & DSI_MODE_FLAG_DMS) { rc = dsi_panel_switch(display->panel); if (rc) - pr_err("[%s] failed to switch DSI panel mode, rc=%d\n", + DSI_ERR("[%s] failed to switch DSI panel mode, rc=%d\n", display->name, rc); goto error; } if (display->config.panel_mode == DSI_OP_VIDEO_MODE) { - pr_debug("%s:enable video timing eng\n", __func__); + DSI_DEBUG("%s:enable video timing eng\n", __func__); rc = dsi_display_vid_engine_enable(display); if (rc) { - pr_err("[%s]failed to enable DSI video engine, rc=%d\n", + DSI_ERR("[%s]failed to enable DSI video engine, rc=%d\n", display->name, rc); goto error_disable_panel; } } else if (display->config.panel_mode == DSI_OP_CMD_MODE) { - pr_debug("%s:enable command timing eng\n", __func__); + DSI_DEBUG("%s:enable command timing eng\n", __func__); rc = dsi_display_cmd_engine_enable(display); if (rc) { - pr_err("[%s]failed to enable DSI cmd engine, rc=%d\n", + DSI_ERR("[%s]failed to enable DSI cmd engine, rc=%d\n", display->name, rc); goto error_disable_panel; } } else { - pr_err("[%s] Invalid configuration\n", display->name); + DSI_ERR("[%s] Invalid configuration\n", display->name); rc = -EINVAL; goto error_disable_panel; } @@ -7200,7 +7199,7 @@ int dsi_display_post_enable(struct dsi_display *display) int rc = 0; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -7215,7 +7214,7 @@ int dsi_display_post_enable(struct dsi_display *display) } else { rc = dsi_panel_post_enable(display->panel); if (rc) - pr_err("[%s] panel post-enable failed, rc=%d\n", + DSI_ERR("[%s] panel post-enable failed, rc=%d\n", display->name, rc); } @@ -7233,7 +7232,7 @@ int dsi_display_pre_disable(struct dsi_display *display) int rc = 0; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -7252,7 +7251,7 @@ int dsi_display_pre_disable(struct dsi_display *display) } else { rc = dsi_panel_pre_disable(display->panel); if (rc) - pr_err("[%s] panel pre-disable failed, rc=%d\n", + DSI_ERR("[%s] panel pre-disable failed, rc=%d\n", display->name, rc); } mutex_unlock(&display->display_lock); @@ -7264,7 +7263,7 @@ int dsi_display_disable(struct dsi_display *display) int rc = 0; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -7273,28 +7272,28 @@ int dsi_display_disable(struct dsi_display *display) rc = dsi_display_wake_up(display); if (rc) - pr_err("[%s] display wake up failed, rc=%d\n", + DSI_ERR("[%s] display wake up failed, rc=%d\n", display->name, rc); if (display->config.panel_mode == DSI_OP_VIDEO_MODE) { rc = dsi_display_vid_engine_disable(display); if (rc) - pr_err("[%s]failed to disable DSI vid engine, rc=%d\n", + DSI_ERR("[%s]failed to disable DSI vid engine, rc=%d\n", display->name, rc); } else if (display->config.panel_mode == DSI_OP_CMD_MODE) { rc = dsi_display_cmd_engine_disable(display); if (rc) - pr_err("[%s]failed to disable DSI cmd engine, rc=%d\n", + DSI_ERR("[%s]failed to disable DSI cmd engine, rc=%d\n", display->name, rc); } else { - pr_err("[%s] Invalid configuration\n", display->name); + DSI_ERR("[%s] Invalid configuration\n", display->name); rc = -EINVAL; } if (!display->poms_pending) { rc = dsi_panel_disable(display->panel); if (rc) - pr_err("[%s] failed to disable DSI panel, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI panel, rc=%d\n", display->name, rc); } mutex_unlock(&display->display_lock); @@ -7307,7 +7306,7 @@ int dsi_display_update_pps(char *pps_cmd, void *disp) struct dsi_display *display; if (pps_cmd == NULL || disp == NULL) { - pr_err("Invalid parameter\n"); + DSI_ERR("Invalid parameter\n"); return -EINVAL; } @@ -7324,7 +7323,7 @@ int dsi_display_unprepare(struct dsi_display *display) int rc = 0; if (!display) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -7333,41 +7332,41 @@ int dsi_display_unprepare(struct dsi_display *display) rc = dsi_display_wake_up(display); if (rc) - pr_err("[%s] display wake up failed, rc=%d\n", + DSI_ERR("[%s] display wake up failed, rc=%d\n", display->name, rc); if (!display->poms_pending) { rc = dsi_panel_unprepare(display->panel); if (rc) - pr_err("[%s] panel unprepare failed, rc=%d\n", + DSI_ERR("[%s] panel unprepare failed, rc=%d\n", display->name, rc); } rc = dsi_display_ctrl_host_disable(display); if (rc) - pr_err("[%s] failed to disable DSI host, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI host, rc=%d\n", display->name, rc); rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_LINK_CLK, DSI_CLK_OFF); if (rc) - pr_err("[%s] failed to disable Link clocks, rc=%d\n", + DSI_ERR("[%s] failed to disable Link clocks, rc=%d\n", display->name, rc); rc = dsi_display_ctrl_deinit(display); if (rc) - pr_err("[%s] failed to deinit controller, rc=%d\n", + DSI_ERR("[%s] failed to deinit controller, rc=%d\n", display->name, rc); if (!display->panel->ulps_suspend_enabled) { rc = dsi_display_phy_disable(display); if (rc) - pr_err("[%s] failed to disable DSI PHY, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI PHY, rc=%d\n", display->name, rc); } rc = dsi_display_clk_ctrl(display->dsi_clk_handle, DSI_CORE_CLK, DSI_CLK_OFF); if (rc) - pr_err("[%s] failed to disable DSI clocks, rc=%d\n", + DSI_ERR("[%s] failed to disable DSI clocks, rc=%d\n", display->name, rc); /* destrory dsi isr set up */ @@ -7376,7 +7375,7 @@ int dsi_display_unprepare(struct dsi_display *display) if (!display->poms_pending) { rc = dsi_panel_post_unprepare(display->panel); if (rc) - pr_err("[%s] panel post-unprepare failed, rc=%d\n", + DSI_ERR("[%s] panel post-unprepare failed, rc=%d\n", display->name, rc); } diff --git a/msm/dsi/dsi_display_test.c b/msm/dsi/dsi_display_test.c index 01ad40f124..60f83958c8 100644 --- a/msm/dsi/dsi_display_test.c +++ b/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; } diff --git a/msm/dsi/dsi_drm.c b/msm/dsi/dsi_drm.c index 10831757f8..311ba56afa 100644 --- a/msm/dsi/dsi_drm.c +++ b/msm/dsi/dsi_drm.c @@ -4,7 +4,6 @@ */ -#define pr_fmt(fmt) "dsi-drm:[%s] " fmt, __func__ #include #include @@ -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; } diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index 4979ab893f..007bc63f73 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -3,7 +3,6 @@ * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */ -#define pr_fmt(fmt) "msm-dsi-panel:[%s:%d] " fmt, __func__, __LINE__ #include #include #include @@ -219,7 +218,7 @@ static int dsi_panel_vreg_get(struct dsi_panel *panel) panel->power_info.vregs[i].vreg_name); rc = PTR_RET(vreg); if (rc) { - pr_err("failed to get %s regulator\n", + DSI_ERR("failed to get %s regulator\n", panel->power_info.vregs[i].vreg_name); goto error_put; } @@ -254,7 +253,7 @@ static int dsi_panel_gpio_request(struct dsi_panel *panel) if (gpio_is_valid(r_config->reset_gpio)) { rc = gpio_request(r_config->reset_gpio, "reset_gpio"); if (rc) { - pr_err("request for reset_gpio failed, rc=%d\n", rc); + DSI_ERR("request for reset_gpio failed, rc=%d\n", rc); goto error; } } @@ -262,7 +261,7 @@ static int dsi_panel_gpio_request(struct dsi_panel *panel) if (gpio_is_valid(r_config->disp_en_gpio)) { rc = gpio_request(r_config->disp_en_gpio, "disp_en_gpio"); if (rc) { - pr_err("request for disp_en_gpio failed, rc=%d\n", rc); + DSI_ERR("request for disp_en_gpio failed, rc=%d\n", rc); goto error_release_reset; } } @@ -270,7 +269,7 @@ static int dsi_panel_gpio_request(struct dsi_panel *panel) if (gpio_is_valid(panel->bl_config.en_gpio)) { rc = gpio_request(panel->bl_config.en_gpio, "bklt_en_gpio"); if (rc) { - pr_err("request for bklt_en_gpio failed, rc=%d\n", rc); + DSI_ERR("request for bklt_en_gpio failed, rc=%d\n", rc); goto error_release_disp_en; } } @@ -278,7 +277,7 @@ static int dsi_panel_gpio_request(struct dsi_panel *panel) if (gpio_is_valid(r_config->lcd_mode_sel_gpio)) { rc = gpio_request(r_config->lcd_mode_sel_gpio, "mode_gpio"); if (rc) { - pr_err("request for mode_gpio failed, rc=%d\n", rc); + DSI_ERR("request for mode_gpio failed, rc=%d\n", rc); goto error_release_mode_sel; } } @@ -286,7 +285,7 @@ static int dsi_panel_gpio_request(struct dsi_panel *panel) if (gpio_is_valid(panel->panel_test_gpio)) { rc = gpio_request(panel->panel_test_gpio, "panel_test_gpio"); if (rc) { - pr_warn("request for panel_test_gpio failed, rc=%d\n", + DSI_WARN("request for panel_test_gpio failed, rc=%d\n", rc); panel->panel_test_gpio = -1; rc = 0; @@ -335,22 +334,22 @@ int dsi_panel_trigger_esd_attack(struct dsi_panel *panel) struct dsi_panel_reset_config *r_config; if (!panel) { - pr_err("Invalid panel param\n"); + DSI_ERR("Invalid panel param\n"); return -EINVAL; } r_config = &panel->reset_config; if (!r_config) { - pr_err("Invalid panel reset configuration\n"); + DSI_ERR("Invalid panel reset configuration\n"); return -EINVAL; } if (gpio_is_valid(r_config->reset_gpio)) { gpio_set_value(r_config->reset_gpio, 0); - pr_info("GPIO pulled low to simulate ESD\n"); + DSI_INFO("GPIO pulled low to simulate ESD\n"); return 0; } - pr_err("failed to pull down gpio\n"); + DSI_ERR("failed to pull down gpio\n"); return -EINVAL; } @@ -363,7 +362,7 @@ static int dsi_panel_reset(struct dsi_panel *panel) if (gpio_is_valid(panel->reset_config.disp_en_gpio)) { rc = gpio_direction_output(panel->reset_config.disp_en_gpio, 1); if (rc) { - pr_err("unable to set dir for disp gpio rc=%d\n", rc); + DSI_ERR("unable to set dir for disp gpio rc=%d\n", rc); goto exit; } } @@ -372,7 +371,7 @@ static int dsi_panel_reset(struct dsi_panel *panel) rc = gpio_direction_output(r_config->reset_gpio, r_config->sequence[0].level); if (rc) { - pr_err("unable to set dir for rst gpio rc=%d\n", rc); + DSI_ERR("unable to set dir for rst gpio rc=%d\n", rc); goto exit; } } @@ -390,7 +389,7 @@ static int dsi_panel_reset(struct dsi_panel *panel) if (gpio_is_valid(panel->bl_config.en_gpio)) { rc = gpio_direction_output(panel->bl_config.en_gpio, 1); if (rc) - pr_err("unable to set dir for bklt gpio rc=%d\n", rc); + DSI_ERR("unable to set dir for bklt gpio rc=%d\n", rc); } if (gpio_is_valid(panel->reset_config.lcd_mode_sel_gpio)) { @@ -409,14 +408,14 @@ static int dsi_panel_reset(struct dsi_panel *panel) rc = gpio_direction_output( panel->reset_config.lcd_mode_sel_gpio, out); if (rc) - pr_err("unable to set dir for mode gpio rc=%d\n", rc); + DSI_ERR("unable to set dir for mode gpio rc=%d\n", rc); } if (gpio_is_valid(panel->panel_test_gpio)) { rc = gpio_direction_input(panel->panel_test_gpio); if (rc) - pr_warn("unable to set dir for panel test gpio rc=%d\n", - rc); + DSI_WARN("unable to set dir for panel test gpio rc=%d\n", + rc); } exit: @@ -438,8 +437,8 @@ static int dsi_panel_set_pinctrl_state(struct dsi_panel *panel, bool enable) rc = pinctrl_select_state(panel->pinctrl.pinctrl, state); if (rc) - pr_err("[%s] failed to set pin state, rc=%d\n", panel->name, - rc); + DSI_ERR("[%s] failed to set pin state, rc=%d\n", + panel->name, rc); return rc; } @@ -451,19 +450,20 @@ static int dsi_panel_power_on(struct dsi_panel *panel) rc = dsi_pwr_enable_regulator(&panel->power_info, true); if (rc) { - pr_err("[%s] failed to enable vregs, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] failed to enable vregs, rc=%d\n", + panel->name, rc); goto exit; } rc = dsi_panel_set_pinctrl_state(panel, true); if (rc) { - pr_err("[%s] failed to set pinctrl, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] failed to set pinctrl, rc=%d\n", panel->name, rc); goto error_disable_vregs; } rc = dsi_panel_reset(panel); if (rc) { - pr_err("[%s] failed to reset panel, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] failed to reset panel, rc=%d\n", panel->name, rc); goto error_disable_gpio; } @@ -500,13 +500,14 @@ static int dsi_panel_power_off(struct dsi_panel *panel) rc = dsi_panel_set_pinctrl_state(panel, false); if (rc) { - pr_err("[%s] failed set pinctrl state, rc=%d\n", panel->name, + DSI_ERR("[%s] failed set pinctrl state, rc=%d\n", panel->name, rc); } rc = dsi_pwr_enable_regulator(&panel->power_info, false); if (rc) - pr_err("[%s] failed to enable vregs, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] failed to enable vregs, rc=%d\n", + panel->name, rc); return rc; } @@ -531,7 +532,7 @@ static int dsi_panel_tx_cmd_set(struct dsi_panel *panel, state = mode->priv_info->cmd_sets[type].state; if (count == 0) { - pr_debug("[%s] No commands to be sent for state(%d)\n", + DSI_DEBUG("[%s] No commands to be sent for state(%d)\n", panel->name, type); goto error; } @@ -546,7 +547,7 @@ static int dsi_panel_tx_cmd_set(struct dsi_panel *panel, len = ops->transfer(panel->host, &cmds->msg); if (len < 0) { rc = len; - pr_err("failed to set cmds(%d), rc=%d\n", type, rc); + DSI_ERR("failed to set cmds(%d), rc=%d\n", type, rc); goto error; } if (cmds->post_wait_ms) @@ -581,7 +582,7 @@ static int dsi_panel_pinctrl_init(struct dsi_panel *panel) panel->pinctrl.pinctrl = devm_pinctrl_get(panel->parent); if (IS_ERR_OR_NULL(panel->pinctrl.pinctrl)) { rc = PTR_ERR(panel->pinctrl.pinctrl); - pr_err("failed to get pinctrl, rc=%d\n", rc); + DSI_ERR("failed to get pinctrl, rc=%d\n", rc); goto error; } @@ -589,7 +590,7 @@ static int dsi_panel_pinctrl_init(struct dsi_panel *panel) "panel_active"); if (IS_ERR_OR_NULL(panel->pinctrl.active)) { rc = PTR_ERR(panel->pinctrl.active); - pr_err("failed to get pinctrl active state, rc=%d\n", rc); + DSI_ERR("failed to get pinctrl active state, rc=%d\n", rc); goto error; } @@ -598,7 +599,7 @@ static int dsi_panel_pinctrl_init(struct dsi_panel *panel) if (IS_ERR_OR_NULL(panel->pinctrl.suspend)) { rc = PTR_ERR(panel->pinctrl.suspend); - pr_err("failed to get pinctrl suspend state, rc=%d\n", rc); + DSI_ERR("failed to get pinctrl suspend state, rc=%d\n", rc); goto error; } @@ -613,7 +614,7 @@ static int dsi_panel_wled_register(struct dsi_panel *panel, bd = backlight_device_get_by_type(BACKLIGHT_RAW); if (!bd) { - pr_err("[%s] fail raw backlight register\n", panel->name); + DSI_ERR("[%s] fail raw backlight register\n", panel->name); return -EPROBE_DEFER; } @@ -628,7 +629,7 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel, struct mipi_dsi_device *dsi; if (!panel || (bl_lvl > 0xffff)) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -636,7 +637,7 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel, rc = mipi_dsi_dcs_set_display_brightness(dsi, bl_lvl); if (rc < 0) - pr_err("failed to update dcs backlight:%d\n", bl_lvl); + DSI_ERR("failed to update dcs backlight:%d\n", bl_lvl); return rc; } @@ -650,13 +651,13 @@ static int dsi_panel_update_pwm_backlight(struct dsi_panel *panel, struct dsi_backlight_config *bl; if (!panel) { - pr_err("Invalid Params\n"); + DSI_ERR("Invalid Params\n"); return -EINVAL; } bl = &panel->bl_config; if (!bl->pwm_bl) { - pr_err("pwm device not found\n"); + DSI_ERR("pwm device not found\n"); return -EINVAL; } @@ -666,7 +667,7 @@ static int dsi_panel_update_pwm_backlight(struct dsi_panel *panel, rc = pwm_config(bl->pwm_bl, duty, period_ns); if (rc) { - pr_err("[%s] failed to change pwm config, rc=\n", panel->name, + DSI_ERR("[%s] failed to change pwm config, rc=\n", panel->name, rc); goto error; } @@ -680,7 +681,7 @@ static int dsi_panel_update_pwm_backlight(struct dsi_panel *panel, if (!bl->pwm_enabled) { rc = pwm_enable(bl->pwm_bl); if (rc) { - pr_err("[%s] failed to enable pwm, rc=\n", panel->name, + DSI_ERR("[%s] failed to enable pwm, rc=\n", panel->name, rc); goto error; } @@ -700,7 +701,7 @@ int dsi_panel_set_backlight(struct dsi_panel *panel, u32 bl_lvl) if (panel->host_config.ext_bridge_mode) return 0; - pr_debug("backlight type:%d lvl:%d\n", bl->type, bl_lvl); + DSI_DEBUG("backlight type:%d lvl:%d\n", bl->type, bl_lvl); switch (bl->type) { case DSI_BACKLIGHT_WLED: rc = backlight_device_set_brightness(bl->raw_bd, bl_lvl); @@ -714,7 +715,7 @@ int dsi_panel_set_backlight(struct dsi_panel *panel, u32 bl_lvl) rc = dsi_panel_update_pwm_backlight(panel, bl_lvl); break; default: - pr_err("Backlight type(%d) not supported\n", bl->type); + DSI_ERR("Backlight type(%d) not supported\n", bl->type); rc = -ENOTSUPP; } @@ -746,7 +747,7 @@ static u32 dsi_panel_get_brightness(struct dsi_backlight_config *bl) break; } - pr_debug("cur_bl_level=%d\n", cur_bl_level); + DSI_DEBUG("cur_bl_level=%d\n", cur_bl_level); return cur_bl_level; } @@ -765,7 +766,7 @@ static int dsi_panel_pwm_register(struct dsi_panel *panel) bl->pwm_bl = devm_of_pwm_get(panel->parent, panel->panel_of_node, NULL); if (IS_ERR_OR_NULL(bl->pwm_bl)) { rc = PTR_ERR(bl->pwm_bl); - pr_err("[%s] failed to request pwm, rc=%d\n", panel->name, + DSI_ERR("[%s] failed to request pwm, rc=%d\n", panel->name, rc); return rc; } @@ -793,7 +794,7 @@ static int dsi_panel_bl_register(struct dsi_panel *panel) rc = dsi_panel_pwm_register(panel); break; default: - pr_err("Backlight type(%d) not supported\n", bl->type); + DSI_ERR("Backlight type(%d) not supported\n", bl->type); rc = -ENOTSUPP; goto error; } @@ -828,7 +829,7 @@ static int dsi_panel_bl_unregister(struct dsi_panel *panel) dsi_panel_pwm_unregister(panel); break; default: - pr_err("Backlight type(%d) not supported\n", bl->type); + DSI_ERR("Backlight type(%d) not supported\n", bl->type); rc = -ENOTSUPP; goto error; } @@ -872,7 +873,7 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, "qcom,mdss-dsi-panel-framerate", &mode->refresh_rate); if (rc) { - pr_err("failed to read qcom,mdss-dsi-panel-framerate, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-panel-framerate, rc=%d\n", rc); goto error; } @@ -880,7 +881,8 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-panel-width", &mode->h_active); if (rc) { - pr_err("failed to read qcom,mdss-dsi-panel-width, rc=%d\n", rc); + DSI_ERR("failed to read qcom,mdss-dsi-panel-width, rc=%d\n", + rc); goto error; } @@ -888,7 +890,7 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, "qcom,mdss-dsi-h-front-porch", &mode->h_front_porch); if (rc) { - pr_err("failed to read qcom,mdss-dsi-h-front-porch, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-h-front-porch, rc=%d\n", rc); goto error; } @@ -897,7 +899,7 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, "qcom,mdss-dsi-h-back-porch", &mode->h_back_porch); if (rc) { - pr_err("failed to read qcom,mdss-dsi-h-back-porch, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-h-back-porch, rc=%d\n", rc); goto error; } @@ -906,7 +908,7 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, "qcom,mdss-dsi-h-pulse-width", &mode->h_sync_width); if (rc) { - pr_err("failed to read qcom,mdss-dsi-h-pulse-width, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-h-pulse-width, rc=%d\n", rc); goto error; } @@ -914,16 +916,17 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-h-sync-skew", &mode->h_skew); if (rc) - pr_err("qcom,mdss-dsi-h-sync-skew is not defined, rc=%d\n", rc); + DSI_ERR("qcom,mdss-dsi-h-sync-skew is not defined, rc=%d\n", + rc); - pr_debug("panel horz active:%d front_portch:%d back_porch:%d sync_skew:%d\n", + DSI_DEBUG("panel horz active:%d front_portch:%d back_porch:%d sync_skew:%d\n", mode->h_active, mode->h_front_porch, mode->h_back_porch, mode->h_sync_width); rc = utils->read_u32(utils->data, "qcom,mdss-dsi-panel-height", &mode->v_active); if (rc) { - pr_err("failed to read qcom,mdss-dsi-panel-height, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-panel-height, rc=%d\n", rc); goto error; } @@ -931,7 +934,7 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-v-back-porch", &mode->v_back_porch); if (rc) { - pr_err("failed to read qcom,mdss-dsi-v-back-porch, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-v-back-porch, rc=%d\n", rc); goto error; } @@ -939,7 +942,7 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-v-front-porch", &mode->v_front_porch); if (rc) { - pr_err("failed to read qcom,mdss-dsi-v-back-porch, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-v-back-porch, rc=%d\n", rc); goto error; } @@ -947,11 +950,11 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-v-pulse-width", &mode->v_sync_width); if (rc) { - pr_err("failed to read qcom,mdss-dsi-v-pulse-width, rc=%d\n", + DSI_ERR("failed to read qcom,mdss-dsi-v-pulse-width, rc=%d\n", rc); goto error; } - pr_debug("panel vert active:%d front_portch:%d back_porch:%d pulse_width:%d\n", + DSI_DEBUG("panel vert active:%d front_portch:%d back_porch:%d pulse_width:%d\n", mode->v_active, mode->v_front_porch, mode->v_back_porch, mode->v_sync_width); @@ -970,7 +973,7 @@ static int dsi_panel_parse_pixel_format(struct dsi_host_common_cfg *host, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-bpp", &bpp); if (rc) { - pr_err("[%s] failed to read qcom,mdss-dsi-bpp, rc=%d\n", + DSI_ERR("[%s] failed to read qcom,mdss-dsi-bpp, rc=%d\n", name, rc); return rc; } @@ -1047,7 +1050,7 @@ static int dsi_panel_parse_lane_states(struct dsi_host_common_cfg *host, host->num_data_lanes = num_of_lanes; if (host->data_lanes == 0) { - pr_err("[%s] No data lanes are enabled, rc=%d\n", name, rc); + DSI_ERR("[%s] No data lanes are enabled, rc=%d\n", name, rc); rc = -EINVAL; } @@ -1075,12 +1078,12 @@ static int dsi_panel_parse_color_swap(struct dsi_host_common_cfg *host, } else if (!strcmp(swap_mode, "rgb_swap_gbr")) { host->swap_mode = DSI_COLOR_SWAP_GBR; } else { - pr_err("[%s] Unrecognized color order-%s\n", + DSI_ERR("[%s] Unrecognized color order-%s\n", name, swap_mode); rc = -EINVAL; } } else { - pr_debug("[%s] Falling back to default color order\n", name); + DSI_DEBUG("[%s] Falling back to default color order\n", name); host->swap_mode = DSI_COLOR_SWAP_RGB; } @@ -1110,13 +1113,13 @@ static int dsi_panel_parse_triggers(struct dsi_host_common_cfg *host, } else if (!strcmp(trig, "trigger_sw_te")) { host->mdp_cmd_trigger = DSI_TRIGGER_SW_TE; } else { - pr_err("[%s] Unrecognized mdp trigger type (%s)\n", + DSI_ERR("[%s] Unrecognized mdp trigger type (%s)\n", name, trig); rc = -EINVAL; } } else { - pr_debug("[%s] Falling back to default MDP trigger\n", + DSI_DEBUG("[%s] Falling back to default MDP trigger\n", name); host->mdp_cmd_trigger = DSI_TRIGGER_SW; } @@ -1135,20 +1138,20 @@ static int dsi_panel_parse_triggers(struct dsi_host_common_cfg *host, } else if (!strcmp(trig, "trigger_sw_te")) { host->dma_cmd_trigger = DSI_TRIGGER_SW_TE; } else { - pr_err("[%s] Unrecognized mdp trigger type (%s)\n", + DSI_ERR("[%s] Unrecognized mdp trigger type (%s)\n", name, trig); rc = -EINVAL; } } else { - pr_debug("[%s] Falling back to default MDP trigger\n", name); + DSI_DEBUG("[%s] Falling back to default MDP trigger\n", name); host->dma_cmd_trigger = DSI_TRIGGER_SW; } rc = utils->read_u32(utils->data, "qcom,mdss-dsi-te-pin-select", &host->te_mode); if (rc) { - pr_warn("[%s] fallback to default te-pin-select\n", name); + DSI_WARN("[%s] fallback to default te-pin-select\n", name); host->te_mode = 1; rc = 0; } @@ -1166,14 +1169,14 @@ static int dsi_panel_parse_misc_host_config(struct dsi_host_common_cfg *host, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-t-clk-post", &val); if (!rc) { host->t_clk_post = val; - pr_debug("[%s] t_clk_post = %d\n", name, val); + DSI_DEBUG("[%s] t_clk_post = %d\n", name, val); } val = 0; rc = utils->read_u32(utils->data, "qcom,mdss-dsi-t-clk-pre", &val); if (!rc) { host->t_clk_pre = val; - pr_debug("[%s] t_clk_pre = %d\n", name, val); + DSI_DEBUG("[%s] t_clk_pre = %d\n", name, val); } host->ignore_rx_eot = utils->read_bool(utils->data, @@ -1202,14 +1205,14 @@ static void dsi_panel_parse_split_link_config(struct dsi_host_common_cfg *host, supported = utils->read_bool(utils->data, "qcom,split-link-enabled"); if (!supported) { - pr_debug("[%s] Split link is not supported\n", name); + DSI_DEBUG("[%s] Split link is not supported\n", name); split_link->split_link_enabled = false; return; } rc = utils->read_u32(utils->data, "qcom,sublinks-count", &val); if (rc || val < 1) { - pr_debug("[%s] Using default sublinks count\n", name); + DSI_DEBUG("[%s] Using default sublinks count\n", name); split_link->num_sublinks = 2; } else { split_link->num_sublinks = val; @@ -1217,13 +1220,13 @@ static void dsi_panel_parse_split_link_config(struct dsi_host_common_cfg *host, rc = utils->read_u32(utils->data, "qcom,lanes-per-sublink", &val); if (rc || val < 1) { - pr_debug("[%s] Using default lanes per sublink\n", name); + DSI_DEBUG("[%s] Using default lanes per sublink\n", name); split_link->lanes_per_sublink = 2; } else { split_link->lanes_per_sublink = val; } - pr_debug("[%s] Split link is supported %d-%d\n", name, + DSI_DEBUG("[%s] Split link is supported %d-%d\n", name, split_link->num_sublinks, split_link->lanes_per_sublink); split_link->split_link_enabled = true; } @@ -1236,7 +1239,7 @@ static int dsi_panel_parse_host_config(struct dsi_panel *panel) rc = dsi_panel_parse_pixel_format(&panel->host_config, utils, panel->name); if (rc) { - pr_err("[%s] failed to get pixel format, rc=%d\n", + DSI_ERR("[%s] failed to get pixel format, rc=%d\n", panel->name, rc); goto error; } @@ -1244,7 +1247,7 @@ static int dsi_panel_parse_host_config(struct dsi_panel *panel) rc = dsi_panel_parse_lane_states(&panel->host_config, utils, panel->name); if (rc) { - pr_err("[%s] failed to parse lane states, rc=%d\n", + DSI_ERR("[%s] failed to parse lane states, rc=%d\n", panel->name, rc); goto error; } @@ -1252,7 +1255,7 @@ static int dsi_panel_parse_host_config(struct dsi_panel *panel) rc = dsi_panel_parse_color_swap(&panel->host_config, utils, panel->name); if (rc) { - pr_err("[%s] failed to parse color swap config, rc=%d\n", + DSI_ERR("[%s] failed to parse color swap config, rc=%d\n", panel->name, rc); goto error; } @@ -1260,7 +1263,7 @@ static int dsi_panel_parse_host_config(struct dsi_panel *panel) rc = dsi_panel_parse_triggers(&panel->host_config, utils, panel->name); if (rc) { - pr_err("[%s] failed to parse triggers, rc=%d\n", + DSI_ERR("[%s] failed to parse triggers, rc=%d\n", panel->name, rc); goto error; } @@ -1268,7 +1271,7 @@ static int dsi_panel_parse_host_config(struct dsi_panel *panel) rc = dsi_panel_parse_misc_host_config(&panel->host_config, utils, panel->name); if (rc) { - pr_err("[%s] failed to parse misc host config, rc=%d\n", + DSI_ERR("[%s] failed to parse misc host config, rc=%d\n", panel->name, rc); goto error; } @@ -1290,7 +1293,7 @@ static int dsi_panel_parse_qsync_caps(struct dsi_panel *panel, "qcom,mdss-dsi-qsync-min-refresh-rate", &val); if (rc) - pr_err("[%s] qsync min fps not defined rc:%d\n", + DSI_DEBUG("[%s] qsync min fps not defined rc:%d\n", panel->name, rc); panel->qsync_min_fps = val; @@ -1317,7 +1320,7 @@ static int dsi_panel_parse_dyn_clk_caps(struct dsi_panel *panel) "qcom,dsi-dyn-clk-list"); if (dyn_clk_caps->bit_clk_list_len < 1) { - pr_err("[%s] failed to get supported bit clk list\n", name); + DSI_ERR("[%s] failed to get supported bit clk list\n", name); return -EINVAL; } @@ -1331,7 +1334,7 @@ static int dsi_panel_parse_dyn_clk_caps(struct dsi_panel *panel) dyn_clk_caps->bit_clk_list_len); if (rc) { - pr_err("[%s] failed to parse supported bit clk list\n", name); + DSI_ERR("[%s] failed to parse supported bit clk list\n", name); return -EINVAL; } @@ -1354,7 +1357,7 @@ static int dsi_panel_parse_dfps_caps(struct dsi_panel *panel) "qcom,mdss-dsi-pan-enable-dynamic-fps"); if (!supported) { - pr_debug("[%s] DFPS is not supported\n", name); + DSI_DEBUG("[%s] DFPS is not supported\n", name); dfps_caps->dfps_support = false; return rc; } @@ -1362,7 +1365,7 @@ static int dsi_panel_parse_dfps_caps(struct dsi_panel *panel) type = utils->get_property(utils->data, "qcom,mdss-dsi-pan-fps-update", NULL); if (!type) { - pr_err("[%s] dfps type not defined\n", name); + DSI_ERR("[%s] dfps type not defined\n", name); rc = -EINVAL; goto error; } else if (!strcmp(type, "dfps_suspend_resume_mode")) { @@ -1374,7 +1377,7 @@ static int dsi_panel_parse_dfps_caps(struct dsi_panel *panel) } else if (!strcmp(type, "dfps_immediate_porch_mode_vfp")) { dfps_caps->type = DSI_DFPS_IMMEDIATE_VFP; } else { - pr_err("[%s] dfps type is not recognized\n", name); + DSI_ERR("[%s] dfps type is not recognized\n", name); rc = -EINVAL; goto error; } @@ -1382,7 +1385,7 @@ static int dsi_panel_parse_dfps_caps(struct dsi_panel *panel) dfps_caps->dfps_list_len = utils->count_u32_elems(utils->data, "qcom,dsi-supported-dfps-list"); if (dfps_caps->dfps_list_len < 1) { - pr_err("[%s] dfps refresh list not present\n", name); + DSI_ERR("[%s] dfps refresh list not present\n", name); rc = -EINVAL; goto error; } @@ -1399,7 +1402,7 @@ static int dsi_panel_parse_dfps_caps(struct dsi_panel *panel) dfps_caps->dfps_list, dfps_caps->dfps_list_len); if (rc) { - pr_err("[%s] dfps refresh rate list parse failed\n", name); + DSI_ERR("[%s] dfps refresh rate list parse failed\n", name); rc = -EINVAL; goto error; } @@ -1432,14 +1435,14 @@ static int dsi_panel_parse_video_host_config(struct dsi_video_engine_cfg *cfg, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-h-sync-pulse", &val); if (rc) { - pr_debug("[%s] fallback to default h-sync-pulse\n", name); + DSI_DEBUG("[%s] fallback to default h-sync-pulse\n", name); cfg->pulse_mode_hsa_he = false; } else if (val == 1) { cfg->pulse_mode_hsa_he = true; } else if (val == 0) { cfg->pulse_mode_hsa_he = false; } else { - pr_err("[%s] Unrecognized value for mdss-dsi-h-sync-pulse\n", + DSI_ERR("[%s] Unrecognized value for mdss-dsi-h-sync-pulse\n", name); rc = -EINVAL; goto error; @@ -1470,7 +1473,7 @@ static int dsi_panel_parse_video_host_config(struct dsi_video_engine_cfg *cfg, "qcom,mdss-dsi-traffic-mode", NULL); if (!traffic_mode) { - pr_debug("[%s] Falling back to default traffic mode\n", name); + DSI_DEBUG("[%s] Falling back to default traffic mode\n", name); cfg->traffic_mode = DSI_VIDEO_TRAFFIC_SYNC_PULSES; } else if (!strcmp(traffic_mode, "non_burst_sync_pulse")) { cfg->traffic_mode = DSI_VIDEO_TRAFFIC_SYNC_PULSES; @@ -1479,7 +1482,7 @@ static int dsi_panel_parse_video_host_config(struct dsi_video_engine_cfg *cfg, } else if (!strcmp(traffic_mode, "burst_mode")) { cfg->traffic_mode = DSI_VIDEO_TRAFFIC_BURST_MODE; } else { - pr_err("[%s] Unrecognized traffic mode-%s\n", name, + DSI_ERR("[%s] Unrecognized traffic mode-%s\n", name, traffic_mode); rc = -EINVAL; goto error; @@ -1488,7 +1491,7 @@ static int dsi_panel_parse_video_host_config(struct dsi_video_engine_cfg *cfg, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-virtual-channel-id", &vc_id); if (rc) { - pr_debug("[%s] Fallback to default vc id\n", name); + DSI_DEBUG("[%s] Fallback to default vc id\n", name); cfg->vc_id = 0; } else { cfg->vc_id = vc_id; @@ -1497,7 +1500,7 @@ static int dsi_panel_parse_video_host_config(struct dsi_video_engine_cfg *cfg, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-dma-schedule-line", &line_no); if (rc) { - pr_debug("[%s] set default dma scheduling line no\n", name); + DSI_DEBUG("[%s] set default dma scheduling line no\n", name); cfg->dma_sched_line = 0x1; /* do not fail since we have default value */ rc = 0; @@ -1518,7 +1521,7 @@ static int dsi_panel_parse_cmd_host_config(struct dsi_cmd_engine_cfg *cfg, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-wr-mem-start", &val); if (rc) { - pr_debug("[%s] Fallback to default wr-mem-start\n", name); + DSI_DEBUG("[%s] Fallback to default wr-mem-start\n", name); cfg->wr_mem_start = 0x2C; } else { cfg->wr_mem_start = val; @@ -1528,7 +1531,7 @@ static int dsi_panel_parse_cmd_host_config(struct dsi_cmd_engine_cfg *cfg, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-wr-mem-continue", &val); if (rc) { - pr_debug("[%s] Fallback to default wr-mem-continue\n", name); + DSI_DEBUG("[%s] Fallback to default wr-mem-continue\n", name); cfg->wr_mem_continue = 0x3C; } else { cfg->wr_mem_continue = val; @@ -1541,14 +1544,14 @@ static int dsi_panel_parse_cmd_host_config(struct dsi_cmd_engine_cfg *cfg, rc = utils->read_u32(utils->data, "qcom,mdss-dsi-te-dcs-command", &val); if (rc) { - pr_debug("[%s] fallback to default te-dcs-cmd\n", name); + DSI_DEBUG("[%s] fallback to default te-dcs-cmd\n", name); cfg->insert_dcs_command = true; } else if (val == 1) { cfg->insert_dcs_command = true; } else if (val == 0) { cfg->insert_dcs_command = false; } else { - pr_err("[%s] Unrecognized value for mdss-dsi-te-dcs-command\n", + DSI_ERR("[%s] Unrecognized value for mdss-dsi-te-dcs-command\n", name); rc = -EINVAL; goto error; @@ -1569,14 +1572,14 @@ static int dsi_panel_parse_panel_mode(struct dsi_panel *panel) mode = utils->get_property(utils->data, "qcom,mdss-dsi-panel-type", NULL); if (!mode) { - pr_debug("[%s] Fallback to default panel mode\n", panel->name); + DSI_DEBUG("[%s] Fallback to default panel mode\n", panel->name); panel_mode = DSI_OP_VIDEO_MODE; } else if (!strcmp(mode, "dsi_video_mode")) { panel_mode = DSI_OP_VIDEO_MODE; } else if (!strcmp(mode, "dsi_cmd_mode")) { panel_mode = DSI_OP_CMD_MODE; } else { - pr_err("[%s] Unrecognized panel type-%s\n", panel->name, mode); + DSI_ERR("[%s] Unrecognized panel type-%s\n", panel->name, mode); rc = -EINVAL; goto error; } @@ -1584,7 +1587,7 @@ static int dsi_panel_parse_panel_mode(struct dsi_panel *panel) panel_mode_switch_enabled = utils->read_bool(utils->data, "qcom,mdss-dsi-panel-mode-switch"); - pr_info("%s: panel operating mode switch feature %s\n", __func__, + DSI_DEBUG("%s: panel operating mode switch feature %s\n", __func__, (panel_mode_switch_enabled ? "enabled" : "disabled")); if (panel_mode == DSI_OP_VIDEO_MODE || panel_mode_switch_enabled) { @@ -1592,7 +1595,7 @@ static int dsi_panel_parse_panel_mode(struct dsi_panel *panel) utils, panel->name); if (rc) { - pr_err("[%s] Failed to parse video host cfg, rc=%d\n", + DSI_ERR("[%s] Failed to parse video host cfg, rc=%d\n", panel->name, rc); goto error; } @@ -1603,7 +1606,7 @@ static int dsi_panel_parse_panel_mode(struct dsi_panel *panel) utils, panel->name); if (rc) { - pr_err("[%s] Failed to parse cmd host config, rc=%d\n", + DSI_ERR("[%s] Failed to parse cmd host config, rc=%d\n", panel->name, rc); goto error; } @@ -1627,7 +1630,7 @@ static int dsi_panel_parse_phy_props(struct dsi_panel *panel) rc = utils->read_u32(utils->data, "qcom,mdss-pan-physical-width-dimension", &val); if (rc) { - pr_debug("[%s] Physical panel width is not defined\n", name); + DSI_DEBUG("[%s] Physical panel width is not defined\n", name); props->panel_width_mm = 0; rc = 0; } else { @@ -1638,7 +1641,7 @@ static int dsi_panel_parse_phy_props(struct dsi_panel *panel) "qcom,mdss-pan-physical-height-dimension", &val); if (rc) { - pr_debug("[%s] Physical panel height is not defined\n", name); + DSI_DEBUG("[%s] Physical panel height is not defined\n", name); props->panel_height_mm = 0; rc = 0; } else { @@ -1656,7 +1659,7 @@ static int dsi_panel_parse_phy_props(struct dsi_panel *panel) } else if (!strcmp(str, "vflip")) { props->rotation = DSI_PANEL_ROTATE_V_FLIP; } else { - pr_err("[%s] Unrecognized panel rotation-%s\n", name, str); + DSI_ERR("[%s] Unrecognized panel rotation-%s\n", name, str); rc = -EINVAL; goto error; } @@ -1727,7 +1730,7 @@ static int dsi_panel_get_cmd_pkt_count(const char *data, u32 length, u32 *cnt) tmp = ((data[5] << 8) | (data[6])); packet_length += tmp; if (packet_length > length) { - pr_err("format error\n"); + DSI_ERR("format error\n"); return -EINVAL; } length -= packet_length; @@ -1827,12 +1830,12 @@ static int dsi_panel_parse_cmd_sets_sub(struct dsi_panel_cmd_set *cmd, data = utils->get_property(utils->data, cmd_set_prop_map[type], &length); if (!data) { - pr_debug("%s commands not defined\n", cmd_set_prop_map[type]); + DSI_DEBUG("%s commands not defined\n", cmd_set_prop_map[type]); rc = -ENOTSUPP; goto error; } - pr_debug("type=%d, name=%s, length=%d\n", type, + DSI_DEBUG("type=%d, name=%s, length=%d\n", type, cmd_set_prop_map[type], length); print_hex_dump_debug("", DUMP_PREFIX_NONE, @@ -1840,22 +1843,22 @@ static int dsi_panel_parse_cmd_sets_sub(struct dsi_panel_cmd_set *cmd, rc = dsi_panel_get_cmd_pkt_count(data, length, &packet_count); if (rc) { - pr_err("commands failed, rc=%d\n", rc); + DSI_ERR("commands failed, rc=%d\n", rc); goto error; } - pr_debug("[%s] packet-count=%d, %d\n", cmd_set_prop_map[type], + DSI_DEBUG("[%s] packet-count=%d, %d\n", cmd_set_prop_map[type], packet_count, length); rc = dsi_panel_alloc_cmd_packets(cmd, packet_count); if (rc) { - pr_err("failed to allocate cmd packets, rc=%d\n", rc); + DSI_ERR("failed to allocate cmd packets, rc=%d\n", rc); goto error; } rc = dsi_panel_create_cmd_packets(data, length, packet_count, cmd->cmds); if (rc) { - pr_err("failed to create cmd packets, rc=%d\n", rc); + DSI_ERR("failed to create cmd packets, rc=%d\n", rc); goto error_free_mem; } @@ -1865,7 +1868,7 @@ static int dsi_panel_parse_cmd_sets_sub(struct dsi_panel_cmd_set *cmd, } else if (!strcmp(state, "dsi_hs_mode")) { cmd->state = DSI_CMD_SET_STATE_HS; } else { - pr_err("[%s] command state unrecognized-%s\n", + DSI_ERR("[%s] command state unrecognized-%s\n", cmd_set_state_map[type], state); goto error_free_mem; } @@ -1888,7 +1891,7 @@ static int dsi_panel_parse_cmd_sets( u32 i; if (!priv_info) { - pr_err("invalid mode priv info\n"); + DSI_ERR("invalid mode priv info\n"); return -EINVAL; } @@ -1900,13 +1903,13 @@ static int dsi_panel_parse_cmd_sets( if (i == DSI_CMD_SET_PPS) { rc = dsi_panel_alloc_cmd_packets(set, 1); if (rc) - pr_err("failed to allocate cmd set %d, rc = %d\n", + DSI_ERR("failed to allocate cmd set %d, rc = %d\n", i, rc); set->state = DSI_CMD_SET_STATE_LP; } else { rc = dsi_panel_parse_cmd_sets_sub(set, i, utils); if (rc) - pr_debug("failed to parse set %d\n", i); + DSI_DEBUG("failed to parse set %d\n", i); } } @@ -1932,18 +1935,18 @@ static int dsi_panel_parse_reset_sequence(struct dsi_panel *panel) arr = utils->get_property(utils->data, "qcom,mdss-dsi-reset-sequence", &length); if (!arr) { - pr_err("[%s] dsi-reset-sequence not found\n", panel->name); + DSI_ERR("[%s] dsi-reset-sequence not found\n", panel->name); rc = -EINVAL; goto error; } if (length & 0x1) { - pr_err("[%s] syntax error for dsi-reset-sequence\n", + DSI_ERR("[%s] syntax error for dsi-reset-sequence\n", panel->name); rc = -EINVAL; goto error; } - pr_err("RESET SEQ LENGTH = %d\n", length); + DSI_DEBUG("RESET SEQ LENGTH = %d\n", length); length = length / sizeof(u32); size = length * sizeof(u32); @@ -1957,7 +1960,7 @@ static int dsi_panel_parse_reset_sequence(struct dsi_panel *panel) rc = utils->read_u32_array(utils->data, "qcom,mdss-dsi-reset-sequence", arr_32, length); if (rc) { - pr_err("[%s] cannot read dso-reset-seqience\n", panel->name); + DSI_ERR("[%s] cannot read dso-reset-seqience\n", panel->name); goto error_free_arr_32; } @@ -1992,13 +1995,13 @@ static int dsi_panel_parse_misc_features(struct dsi_panel *panel) panel->ulps_feature_enabled = utils->read_bool(utils->data, "qcom,ulps-enabled"); - pr_info("%s: ulps feature %s\n", __func__, + DSI_DEBUG("%s: ulps feature %s\n", __func__, (panel->ulps_feature_enabled ? "enabled" : "disabled")); panel->ulps_suspend_enabled = utils->read_bool(utils->data, "qcom,suspend-ulps-enabled"); - pr_info("%s: ulps during suspend feature %s\n", __func__, + DSI_DEBUG("%s: ulps during suspend feature %s\n", __func__, (panel->ulps_suspend_enabled ? "enabled" : "disabled")); panel->te_using_watchdog_timer = utils->read_bool(utils->data, @@ -2026,7 +2029,7 @@ static int dsi_panel_parse_jitter_config( rc = utils->read_u32_array(utils->data, "qcom,mdss-dsi-panel-jitter", jitter, DEFAULT_PANEL_JITTER_ARRAY_SIZE); if (rc) { - pr_debug("panel jitter not defined rc=%d\n", rc); + DSI_DEBUG("panel jitter not defined rc=%d\n", rc); } else { jitter_val = jitter[0]; jitter_val = div_u64(jitter_val, jitter[1]); @@ -2044,12 +2047,12 @@ static int dsi_panel_parse_jitter_config( rc = utils->read_u32(utils->data, "qcom,mdss-dsi-panel-prefill-lines", &priv_info->panel_prefill_lines); if (rc) { - pr_debug("panel prefill lines are not defined rc=%d\n", rc); + DSI_DEBUG("panel prefill lines are not defined rc=%d\n", rc); priv_info->panel_prefill_lines = mode->timing.v_back_porch + mode->timing.v_sync_width + mode->timing.v_front_porch; } else if (priv_info->panel_prefill_lines >= DSI_V_TOTAL(&mode->timing)) { - pr_debug("invalid prefill lines config=%d setting to:%d\n", + DSI_DEBUG("invalid prefill lines config=%d setting to:%d\n", priv_info->panel_prefill_lines, DEFAULT_PANEL_PREFILL_LINES); priv_info->panel_prefill_lines = DEFAULT_PANEL_PREFILL_LINES; @@ -2074,7 +2077,7 @@ static int dsi_panel_parse_power_cfg(struct dsi_panel *panel) rc = dsi_pwr_of_get_vreg_data(&panel->utils, &panel->power_info, supply_name); if (rc) { - pr_err("[%s] failed to parse vregs\n", panel->name); + DSI_ERR("[%s] failed to parse vregs\n", panel->name); goto error; } @@ -2102,7 +2105,7 @@ static int dsi_panel_parse_gpios(struct dsi_panel *panel) if (!gpio_is_valid(panel->reset_config.reset_gpio) && !panel->host_config.ext_bridge_mode) { rc = panel->reset_config.reset_gpio; - pr_err("[%s] failed get reset gpio, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] failed get reset gpio, rc=%d\n", panel->name, rc); goto error; } @@ -2110,13 +2113,13 @@ static int dsi_panel_parse_gpios(struct dsi_panel *panel) "qcom,5v-boost-gpio", 0); if (!gpio_is_valid(panel->reset_config.disp_en_gpio)) { - pr_debug("[%s] 5v-boot-gpio is not set, rc=%d\n", + DSI_DEBUG("[%s] 5v-boot-gpio is not set, rc=%d\n", panel->name, rc); panel->reset_config.disp_en_gpio = utils->get_named_gpio(utils->data, "qcom,platform-en-gpio", 0); if (!gpio_is_valid(panel->reset_config.disp_en_gpio)) { - pr_debug("[%s] platform-en-gpio is not set, rc=%d\n", + DSI_DEBUG("[%s] platform-en-gpio is not set, rc=%d\n", panel->name, rc); } } @@ -2124,9 +2127,9 @@ static int dsi_panel_parse_gpios(struct dsi_panel *panel) panel->reset_config.lcd_mode_sel_gpio = utils->get_named_gpio( utils->data, mode_set_gpio_name, 0); if (!gpio_is_valid(panel->reset_config.lcd_mode_sel_gpio)) - pr_debug("%s:%d mode gpio not specified\n", __func__, __LINE__); + DSI_DEBUG("mode gpio not specified\n"); - pr_debug("mode gpio=%d\n", panel->reset_config.lcd_mode_sel_gpio); + DSI_DEBUG("mode gpio=%d\n", panel->reset_config.lcd_mode_sel_gpio); data = utils->get_property(utils->data, "qcom,mdss-dsi-mode-sel-gpio-state", NULL); @@ -2151,7 +2154,7 @@ static int dsi_panel_parse_gpios(struct dsi_panel *panel) /* TODO: release memory */ rc = dsi_panel_parse_reset_sequence(panel); if (rc) { - pr_err("[%s] failed to parse reset sequence, rc=%d\n", + DSI_ERR("[%s] failed to parse reset sequence, rc=%d\n", panel->name, rc); goto error; } @@ -2160,7 +2163,7 @@ static int dsi_panel_parse_gpios(struct dsi_panel *panel) "qcom,mdss-dsi-panel-test-pin", 0); if (!gpio_is_valid(panel->panel_test_gpio)) - pr_debug("%s:%d panel test gpio not specified\n", __func__, + DSI_DEBUG("%s:%d panel test gpio not specified\n", __func__, __LINE__); error: @@ -2177,7 +2180,7 @@ static int dsi_panel_parse_bl_pwm_config(struct dsi_panel *panel) rc = utils->read_u32(utils->data, "qcom,bl-pmic-pwm-period-usecs", &val); if (rc) { - pr_err("bl-pmic-pwm-period-usecs is not defined, rc=%d\n", rc); + DSI_ERR("bl-pmic-pwm-period-usecs is not defined, rc=%d\n", rc); goto error; } config->pwm_period_usecs = val; @@ -2212,7 +2215,7 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) } else if (!strcmp(bl_type, "bl_ctrl_external")) { panel->bl_config.type = DSI_BACKLIGHT_EXTERNAL; } else { - pr_debug("[%s] bl-pmic-control-type unknown-%s\n", + DSI_DEBUG("[%s] bl-pmic-control-type unknown-%s\n", panel->name, bl_type); panel->bl_config.type = DSI_BACKLIGHT_UNKNOWN; } @@ -2223,7 +2226,7 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) } else if (!strcmp(data, "delay_until_first_frame")) { panel->bl_config.bl_update = BL_UPDATE_DELAY_UNTIL_FIRST_FRAME; } else { - pr_debug("[%s] No valid bl-update-flag: %s\n", + DSI_DEBUG("[%s] No valid bl-update-flag: %s\n", panel->name, data); panel->bl_config.bl_update = BL_UPDATE_NONE; } @@ -2233,7 +2236,7 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) rc = utils->read_u32(utils->data, "qcom,mdss-dsi-bl-min-level", &val); if (rc) { - pr_debug("[%s] bl-min-level unspecified, defaulting to zero\n", + DSI_DEBUG("[%s] bl-min-level unspecified, defaulting to zero\n", panel->name); panel->bl_config.bl_min_level = 0; } else { @@ -2242,7 +2245,7 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) rc = utils->read_u32(utils->data, "qcom,mdss-dsi-bl-max-level", &val); if (rc) { - pr_debug("[%s] bl-max-level unspecified, defaulting to max level\n", + DSI_DEBUG("[%s] bl-max-level unspecified, defaulting to max level\n", panel->name); panel->bl_config.bl_max_level = MAX_BL_LEVEL; } else { @@ -2252,7 +2255,7 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) rc = utils->read_u32(utils->data, "qcom,mdss-brightness-max-level", &val); if (rc) { - pr_debug("[%s] brigheness-max-level unspecified, defaulting to 255\n", + DSI_DEBUG("[%s] brigheness-max-level unspecified, defaulting to 255\n", panel->name); panel->bl_config.brightness_max_level = 255; } else { @@ -2262,7 +2265,7 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) if (panel->bl_config.type == DSI_BACKLIGHT_PWM) { rc = dsi_panel_parse_bl_pwm_config(panel); if (rc) { - pr_err("[%s] failed to parse pwm config, rc=%d\n", + DSI_ERR("[%s] failed to parse pwm config, rc=%d\n", panel->name, rc); goto error; } @@ -2273,12 +2276,12 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) 0); if (!gpio_is_valid(panel->bl_config.en_gpio)) { if (panel->bl_config.en_gpio == -EPROBE_DEFER) { - pr_debug("[%s] failed to get bklt gpio, rc=%d\n", + DSI_DEBUG("[%s] failed to get bklt gpio, rc=%d\n", panel->name, rc); rc = -EPROBE_DEFER; goto error; } else { - pr_debug("[%s] failed to get bklt gpio, rc=%d\n", + DSI_DEBUG("[%s] failed to get bklt gpio, rc=%d\n", panel->name, rc); rc = 0; goto error; @@ -2296,7 +2299,7 @@ void dsi_dsc_pclk_param_calc(struct msm_display_dsc_info *dsc, int intf_width) if (!dsc || !dsc->slice_width || !dsc->slice_per_pkt || (intf_width < dsc->slice_width)) { - pr_err("invalid input, intf_width=%d slice_width=%d\n", + DSI_ERR("invalid input, intf_width=%d slice_width=%d\n", intf_width, dsc ? dsc->slice_width : -1); return; } @@ -2497,7 +2500,7 @@ static int dsi_panel_parse_phy_timing(struct dsi_display_mode *mode, data = utils->get_property(utils->data, "qcom,mdss-dsi-panel-phy-timings", &len); if (!data) { - pr_debug("Unable to read Phy timing settings\n"); + DSI_DEBUG("Unable to read Phy timing settings\n"); } else { priv_info->phy_timing_val = kzalloc((sizeof(u32) * len), GFP_KERNEL); @@ -2545,7 +2548,7 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, priv_info->dsc_enabled = true; if (!priv_info->dsc_enabled) { - pr_debug("dsc compression is not enabled for the mode\n"); + DSI_DEBUG("dsc compression is not enabled for the mode\n"); return 0; } @@ -2557,7 +2560,7 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, priv_info->dsc.version = data & 0xff; /* only support DSC 1.1 rev */ if (priv_info->dsc.version != 0x11) { - pr_err("%s: DSC version:%d not supported\n", __func__, + DSI_ERR("%s: DSC version:%d not supported\n", __func__, priv_info->dsc.version); rc = -EINVAL; goto error; @@ -2572,7 +2575,7 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, priv_info->dsc.scr_rev = data & 0xff; /* only one scr rev supported */ if (priv_info->dsc.scr_rev > 0x1) { - pr_err("%s: DSC scr version:%d not supported\n", + DSI_ERR("%s: DSC scr version:%d not supported\n", __func__, priv_info->dsc.scr_rev); rc = -EINVAL; goto error; @@ -2581,21 +2584,21 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsc-slice-height", &data); if (rc) { - pr_err("failed to parse qcom,mdss-dsc-slice-height\n"); + DSI_ERR("failed to parse qcom,mdss-dsc-slice-height\n"); goto error; } priv_info->dsc.slice_height = data; rc = utils->read_u32(utils->data, "qcom,mdss-dsc-slice-width", &data); if (rc) { - pr_err("failed to parse qcom,mdss-dsc-slice-width\n"); + DSI_ERR("failed to parse qcom,mdss-dsc-slice-width\n"); goto error; } priv_info->dsc.slice_width = data; intf_width = mode->timing.h_active; if (intf_width % priv_info->dsc.slice_width) { - pr_err("invalid slice width for the intf width:%d slice width:%d\n", + DSI_ERR("invalid slice width for the intf width:%d slice width:%d\n", intf_width, priv_info->dsc.slice_width); rc = -EINVAL; goto error; @@ -2606,10 +2609,10 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsc-slice-per-pkt", &data); if (rc) { - pr_err("failed to parse qcom,mdss-dsc-slice-per-pkt\n"); + DSI_ERR("failed to parse qcom,mdss-dsc-slice-per-pkt\n"); goto error; } else if (!data || (data > 2)) { - pr_err("invalid dsc slice-per-pkt:%d\n", data); + DSI_ERR("invalid dsc slice-per-pkt:%d\n", data); goto error; } priv_info->dsc.slice_per_pkt = data; @@ -2617,7 +2620,7 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsc-bit-per-component", &data); if (rc) { - pr_err("failed to parse qcom,mdss-dsc-bit-per-component\n"); + DSI_ERR("failed to parse qcom,mdss-dsc-bit-per-component\n"); goto error; } priv_info->dsc.bpc = data; @@ -2625,7 +2628,7 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, rc = utils->read_u32(utils->data, "qcom,mdss-dsc-bit-per-pixel", &data); if (rc) { - pr_err("failed to parse qcom,mdss-dsc-bit-per-pixel\n"); + DSI_ERR("failed to parse qcom,mdss-dsc-bit-per-pixel\n"); goto error; } priv_info->dsc.bpp = data; @@ -2662,7 +2665,7 @@ static int dsi_panel_parse_hdr_config(struct dsi_panel *panel) hdr_prop->display_primaries, DISPLAY_PRIMARIES_MAX); if (rc) { - pr_err("%s:%d, Unable to read color primaries,rc:%u\n", + DSI_ERR("%s:%d, Unable to read color primaries,rc:%u\n", __func__, __LINE__, rc); hdr_prop->hdr_enabled = false; return rc; @@ -2672,7 +2675,7 @@ static int dsi_panel_parse_hdr_config(struct dsi_panel *panel) "qcom,mdss-dsi-panel-peak-brightness", &(hdr_prop->peak_brightness)); if (rc) { - pr_err("%s:%d, Unable to read hdr brightness, rc:%u\n", + DSI_ERR("%s:%d, Unable to read hdr brightness, rc:%u\n", __func__, __LINE__, rc); hdr_prop->hdr_enabled = false; return rc; @@ -2682,7 +2685,7 @@ static int dsi_panel_parse_hdr_config(struct dsi_panel *panel) "qcom,mdss-dsi-panel-blackness-level", &(hdr_prop->blackness_level)); if (rc) { - pr_err("%s:%d, Unable to read hdr brightness, rc:%u\n", + DSI_ERR("%s:%d, Unable to read hdr brightness, rc:%u\n", __func__, __LINE__, rc); hdr_prop->hdr_enabled = false; return rc; @@ -2704,7 +2707,7 @@ static int dsi_panel_parse_topology( len = utils->count_u32_elems(utils->data, "qcom,display-topology"); if (len <= 0 || len % TOPOLOGY_SET_LEN || len > (TOPOLOGY_SET_LEN * MAX_TOPOLOGY)) { - pr_err("invalid topology list for the panel, rc = %d\n", rc); + DSI_ERR("invalid topology list for the panel, rc = %d\n", rc); return rc; } @@ -2717,7 +2720,7 @@ static int dsi_panel_parse_topology( rc = utils->read_u32_array(utils->data, "qcom,display-topology", array, len); if (rc) { - pr_err("unable to read the display topologies, rc = %d\n", rc); + DSI_ERR("unable to read the display topologies, rc = %d\n", rc); goto read_fail; } @@ -2736,7 +2739,7 @@ static int dsi_panel_parse_topology( } if (topology_override >= 0 && topology_override < top_count) { - pr_info("override topology: cfg:%d lm:%d comp_enc:%d intf:%d\n", + DSI_INFO("override topology: cfg:%d lm:%d comp_enc:%d intf:%d\n", topology_override, topology[topology_override].num_lm, topology[topology_override].num_enc, @@ -2748,18 +2751,18 @@ static int dsi_panel_parse_topology( rc = utils->read_u32(utils->data, "qcom,default-topology-index", &top_sel); if (rc) { - pr_err("no default topology selected, rc = %d\n", rc); + DSI_ERR("no default topology selected, rc = %d\n", rc); goto parse_fail; } if (top_sel >= top_count) { rc = -EINVAL; - pr_err("default topology is specified is not valid, rc = %d\n", + DSI_ERR("default topology is specified is not valid, rc = %d\n", rc); goto parse_fail; } - pr_info("default topology: lm: %d comp_enc:%d intf: %d\n", + DSI_INFO("default topology: lm: %d comp_enc:%d intf: %d\n", topology[top_sel].num_lm, topology[top_sel].num_enc, topology[top_sel].num_intf); @@ -2791,16 +2794,16 @@ static int dsi_panel_parse_roi_alignment(struct dsi_parser_utils *utils, "qcom,panel-roi-alignment", &len); len /= sizeof(u32); if (!data) { - pr_err("panel roi alignment not found\n"); + DSI_ERR("panel roi alignment not found\n"); rc = -EINVAL; } else if (len != 6) { - pr_err("incorrect roi alignment len %d\n", len); + DSI_ERR("incorrect roi alignment len %d\n", len); rc = -EINVAL; } else { rc = utils->read_u32_array(utils->data, "qcom,panel-roi-alignment", value, len); if (rc) - pr_debug("error reading panel roi alignment values\n"); + DSI_DEBUG("error reading panel roi alignment values\n"); else { align->xstart_pix_align = value[0]; align->ystart_pix_align = value[1]; @@ -2810,7 +2813,7 @@ static int dsi_panel_parse_roi_alignment(struct dsi_parser_utils *utils, align->min_height = value[5]; } - pr_info("roi alignment: [%d, %d, %d, %d, %d, %d]\n", + DSI_INFO("roi alignment: [%d, %d, %d, %d, %d, %d]\n", align->xstart_pix_align, align->width_pix_align, align->ystart_pix_align, @@ -2830,7 +2833,7 @@ static int dsi_panel_parse_partial_update_caps(struct dsi_display_mode *mode, int rc = 0; if (!mode || !mode->priv_info) { - pr_err("invalid arguments\n"); + DSI_ERR("invalid arguments\n"); return -EINVAL; } @@ -2846,13 +2849,13 @@ static int dsi_panel_parse_partial_update_caps(struct dsi_display_mode *mode, else if (!strcmp(data, "single_roi")) roi_caps->num_roi = 1; else { - pr_info( + DSI_INFO( "invalid value for qcom,partial-update-enabled: %s\n", data); return 0; } } else { - pr_info("partial update disabled as the property is not set\n"); + DSI_DEBUG("partial update disabled as the property is not set\n"); return 0; } @@ -2861,7 +2864,7 @@ static int dsi_panel_parse_partial_update_caps(struct dsi_display_mode *mode, roi_caps->enabled = roi_caps->num_roi > 0; - pr_info("partial update num_rois=%d enabled=%d\n", roi_caps->num_roi, + DSI_DEBUG("partial update num_rois=%d enabled=%d\n", roi_caps->num_roi, roi_caps->enabled); if (roi_caps->enabled) @@ -2880,7 +2883,7 @@ static int dsi_panel_parse_panel_mode_caps(struct dsi_display_mode *mode, bool vid_mode_support, cmd_mode_support; if (!mode || !mode->priv_info) { - pr_err("invalid arguments\n"); + DSI_ERR("invalid arguments\n"); return -EINVAL; } @@ -2918,7 +2921,7 @@ static int dsi_panel_parse_dms_info(struct dsi_panel *panel) if (data && !strcmp(data, "dynamic-resolution-switch-immediate")) { panel->dms_mode = DSI_DMS_MODE_RES_SWITCH_IMMEDIATE; } else { - pr_err("[%s] unsupported dynamic switch mode: %s\n", + DSI_ERR("[%s] unsupported dynamic switch mode: %s\n", panel->name, data); return -EINVAL; } @@ -2939,7 +2942,7 @@ dsi_panel_parse_esd_check_valid_params(struct dsi_panel *panel, u32 count) for (i = 0; i < count; ++i) { if (config->status_valid_params[i] > config->status_cmds_rlen[i]) { - pr_debug("ignore valid params\n"); + DSI_DEBUG("ignore valid params\n"); return false; } } @@ -2957,19 +2960,19 @@ static bool dsi_panel_parse_esd_status_len(struct dsi_parser_utils *utils, tmp /= sizeof(u32); if (tmp != cmd_cnt) { - pr_err("request property(%d) do not match cmd count(%d)\n", + DSI_ERR("request property(%d) do not match cmd count(%d)\n", tmp, cmd_cnt); return false; } *target = kcalloc(tmp, sizeof(u32), GFP_KERNEL); if (IS_ERR_OR_NULL(*target)) { - pr_err("Error allocating memory for property\n"); + DSI_ERR("Error allocating memory for property\n"); return false; } if (utils->read_u32_array(utils->data, prop_key, *target, tmp)) { - pr_err("cannot get values from dts\n"); + DSI_ERR("cannot get values from dts\n"); kfree(*target); *target = NULL; return false; @@ -2998,7 +3001,7 @@ int dsi_panel_parse_esd_reg_read_configs(struct dsi_panel *panel) struct dsi_parser_utils *utils = &panel->utils; if (!panel) { - pr_err("Invalid Params\n"); + DSI_ERR("Invalid Params\n"); return -EINVAL; } @@ -3009,7 +3012,7 @@ int dsi_panel_parse_esd_reg_read_configs(struct dsi_panel *panel) dsi_panel_parse_cmd_sets_sub(&esd_config->status_cmd, DSI_CMD_SET_PANEL_STATUS, utils); if (!esd_config->status_cmd.count) { - pr_err("panel status command parsing failed\n"); + DSI_ERR("panel status command parsing failed\n"); rc = -EINVAL; goto error; } @@ -3018,7 +3021,7 @@ int dsi_panel_parse_esd_reg_read_configs(struct dsi_panel *panel) "qcom,mdss-dsi-panel-status-read-length", &panel->esd_config.status_cmds_rlen, esd_config->status_cmd.count)) { - pr_err("Invalid status read length\n"); + DSI_ERR("Invalid status read length\n"); rc = -EINVAL; goto error1; } @@ -3058,7 +3061,7 @@ int dsi_panel_parse_esd_reg_read_configs(struct dsi_panel *panel) if (!IS_ERR_OR_NULL(data) && tmp != 0 && (tmp % status_len) == 0) { esd_config->groups = tmp / status_len; } else { - pr_err("error parse panel-status-value\n"); + DSI_ERR("error parse panel-status-value\n"); rc = -EINVAL; goto error2; } @@ -3088,7 +3091,7 @@ int dsi_panel_parse_esd_reg_read_configs(struct dsi_panel *panel) "qcom,mdss-dsi-panel-status-value", esd_config->status_value, esd_config->groups * status_len); if (rc) { - pr_debug("error reading panel status values\n"); + DSI_DEBUG("error reading panel status values\n"); memset(esd_config->status_value, 0, esd_config->groups * status_len); } @@ -3135,17 +3138,17 @@ static int dsi_panel_parse_esd_config(struct dsi_panel *panel) if (panel->panel_mode == DSI_OP_CMD_MODE) { esd_config->status_mode = ESD_MODE_PANEL_TE; } else { - pr_err("TE-ESD not valid for video mode\n"); + DSI_ERR("TE-ESD not valid for video mode\n"); rc = -EINVAL; goto error; } } else { - pr_err("No valid panel-status-check-mode string\n"); + DSI_ERR("No valid panel-status-check-mode string\n"); rc = -EINVAL; goto error; } } else { - pr_debug("status check method not defined!\n"); + DSI_DEBUG("status check method not defined!\n"); rc = -EINVAL; goto error; } @@ -3153,7 +3156,7 @@ static int dsi_panel_parse_esd_config(struct dsi_panel *panel) if (panel->esd_config.status_mode == ESD_MODE_REG_READ) { rc = dsi_panel_parse_esd_reg_read_configs(panel); if (rc) { - pr_err("failed to parse esd reg read mode params, rc=%d\n", + DSI_ERR("failed to parse esd reg read mode params, rc=%d\n", rc); goto error; } @@ -3164,7 +3167,7 @@ static int dsi_panel_parse_esd_config(struct dsi_panel *panel) esd_mode = "te_check"; } - pr_info("ESD enabled with mode: %s\n", esd_mode); + DSI_DEBUG("ESD enabled with mode: %s\n", esd_mode); return 0; @@ -3182,7 +3185,7 @@ static void dsi_panel_update_util(struct dsi_panel *panel, *utils = *dsi_parser_get_parser_utils(); utils->data = parser_node; - pr_debug("switching to parser APIs\n"); + DSI_DEBUG("switching to parser APIs\n"); goto end; } @@ -3221,75 +3224,79 @@ struct dsi_panel *dsi_panel_get(struct device *parent, rc = dsi_panel_parse_host_config(panel); if (rc) { - pr_err("failed to parse host configuration, rc=%d\n", rc); + DSI_ERR("failed to parse host configuration, rc=%d\n", + rc); goto error; } rc = dsi_panel_parse_panel_mode(panel); if (rc) { - pr_err("failed to parse panel mode configuration, rc=%d\n", rc); + DSI_ERR("failed to parse panel mode configuration, rc=%d\n", + rc); goto error; } rc = dsi_panel_parse_dfps_caps(panel); if (rc) - pr_err("failed to parse dfps configuration, rc=%d\n", rc); + DSI_ERR("failed to parse dfps configuration, rc=%d\n", rc); if (!(panel->dfps_caps.dfps_support)) { /* qsync and dfps are mutually exclusive features */ rc = dsi_panel_parse_qsync_caps(panel, of_node); if (rc) - pr_err("failed to parse qsync features, rc=%d\n", rc); + DSI_DEBUG("failed to parse qsync features, rc=%d\n", + rc); } rc = dsi_panel_parse_dyn_clk_caps(panel); if (rc) - pr_err("failed to parse dynamic clk config, rc=%d\n", rc); + DSI_ERR("failed to parse dynamic clk config, rc=%d\n", rc); rc = dsi_panel_parse_phy_props(panel); if (rc) { - pr_err("failed to parse panel physical dimension, rc=%d\n", rc); + DSI_ERR("failed to parse panel physical dimension, rc=%d\n", + rc); goto error; } rc = dsi_panel_parse_gpios(panel); if (rc) { - pr_err("failed to parse panel gpios, rc=%d\n", rc); + DSI_ERR("failed to parse panel gpios, rc=%d\n", rc); goto error; } rc = dsi_panel_parse_power_cfg(panel); if (rc) - pr_err("failed to parse power config, rc=%d\n", rc); + DSI_ERR("failed to parse power config, rc=%d\n", rc); rc = dsi_panel_parse_bl_config(panel); if (rc) { - pr_err("failed to parse backlight config, rc=%d\n", rc); + DSI_ERR("failed to parse backlight config, rc=%d\n", rc); if (rc == -EPROBE_DEFER) goto error; } rc = dsi_panel_parse_misc_features(panel); if (rc) - pr_err("failed to parse misc features, rc=%d\n", rc); + DSI_ERR("failed to parse misc features, rc=%d\n", rc); rc = dsi_panel_parse_hdr_config(panel); if (rc) - pr_err("failed to parse hdr config, rc=%d\n", rc); + DSI_ERR("failed to parse hdr config, rc=%d\n", rc); rc = dsi_panel_get_mode_count(panel); if (rc) { - pr_err("failed to get mode count, rc=%d\n", rc); + DSI_ERR("failed to get mode count, rc=%d\n", rc); goto error; } rc = dsi_panel_parse_dms_info(panel); if (rc) - pr_debug("failed to get dms info, rc=%d\n", rc); + DSI_DEBUG("failed to get dms info, rc=%d\n", rc); rc = dsi_panel_parse_esd_config(panel); if (rc) - pr_debug("failed to parse esd config, rc=%d\n", rc); + DSI_DEBUG("failed to parse esd config, rc=%d\n", rc); drm_panel_init(&panel->drm_panel); panel->drm_panel.dev = &panel->mipi_device.dev; @@ -3324,7 +3331,7 @@ int dsi_panel_drv_init(struct dsi_panel *panel, struct mipi_dsi_device *dev; if (!panel || !host) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3344,20 +3351,21 @@ int dsi_panel_drv_init(struct dsi_panel *panel, panel->host = host; rc = dsi_panel_vreg_get(panel); if (rc) { - pr_err("[%s] failed to get panel regulators, rc=%d\n", + DSI_ERR("[%s] failed to get panel regulators, rc=%d\n", panel->name, rc); goto exit; } rc = dsi_panel_pinctrl_init(panel); if (rc) { - pr_err("[%s] failed to init pinctrl, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] failed to init pinctrl, rc=%d\n", + panel->name, rc); goto error_vreg_put; } rc = dsi_panel_gpio_request(panel); if (rc) { - pr_err("[%s] failed to request gpios, rc=%d\n", panel->name, + DSI_ERR("[%s] failed to request gpios, rc=%d\n", panel->name, rc); goto error_pinctrl_deinit; } @@ -3365,7 +3373,7 @@ int dsi_panel_drv_init(struct dsi_panel *panel, rc = dsi_panel_bl_register(panel); if (rc) { if (rc != -EPROBE_DEFER) - pr_err("[%s] failed to register backlight, rc=%d\n", + DSI_ERR("[%s] failed to register backlight, rc=%d\n", panel->name, rc); goto error_gpio_release; } @@ -3388,7 +3396,7 @@ int dsi_panel_drv_deinit(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3396,22 +3404,22 @@ int dsi_panel_drv_deinit(struct dsi_panel *panel) rc = dsi_panel_bl_unregister(panel); if (rc) - pr_err("[%s] failed to unregister backlight, rc=%d\n", + DSI_ERR("[%s] failed to unregister backlight, rc=%d\n", panel->name, rc); rc = dsi_panel_gpio_release(panel); if (rc) - pr_err("[%s] failed to release gpios, rc=%d\n", panel->name, + DSI_ERR("[%s] failed to release gpios, rc=%d\n", panel->name, rc); rc = dsi_panel_pinctrl_deinit(panel); if (rc) - pr_err("[%s] failed to deinit gpios, rc=%d\n", panel->name, + DSI_ERR("[%s] failed to deinit gpios, rc=%d\n", panel->name, rc); rc = dsi_panel_vreg_put(panel); if (rc) - pr_err("[%s] failed to put regs, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] failed to put regs, rc=%d\n", panel->name, rc); panel->host = NULL; memset(&panel->mipi_device, 0x0, sizeof(panel->mipi_device)); @@ -3434,7 +3442,7 @@ int dsi_panel_get_mode_count(struct dsi_panel *panel) int count, rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3445,7 +3453,7 @@ int dsi_panel_get_mode_count(struct dsi_panel *panel) timings_np = utils->get_child_by_name(utils->data, "qcom,mdss-dsi-display-timings"); if (!timings_np && !panel->host_config.ext_bridge_mode) { - pr_err("no display timing nodes defined\n"); + DSI_ERR("no display timing nodes defined\n"); rc = -EINVAL; goto error; } @@ -3453,7 +3461,7 @@ int dsi_panel_get_mode_count(struct dsi_panel *panel) count = utils->get_child_count(timings_np); if ((!count && !panel->host_config.ext_bridge_mode) || count > DSI_MODE_MAX) { - pr_err("invalid count of timing nodes: %d\n", count); + DSI_ERR("invalid count of timing nodes: %d\n", count); rc = -EINVAL; goto error; } @@ -3475,7 +3483,7 @@ int dsi_panel_get_phy_props(struct dsi_panel *panel, int rc = 0; if (!panel || !phy_props) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3489,7 +3497,7 @@ int dsi_panel_get_dfps_caps(struct dsi_panel *panel, int rc = 0; if (!panel || !dfps_caps) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3586,7 +3594,7 @@ int dsi_panel_get_mode(struct dsi_panel *panel, void *utils_data = NULL; if (!panel || !mode) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3604,14 +3612,14 @@ int dsi_panel_get_mode(struct dsi_panel *panel, timings_np = utils->get_child_by_name(utils->data, "qcom,mdss-dsi-display-timings"); if (!timings_np) { - pr_err("no display timing nodes defined\n"); + DSI_ERR("no display timing nodes defined\n"); rc = -EINVAL; goto parse_fail; } num_timings = utils->get_child_count(timings_np); if (!num_timings || num_timings > DSI_MODE_MAX) { - pr_err("invalid count of timing nodes: %d\n", num_timings); + DSI_ERR("invalid count of timing nodes: %d\n", num_timings); rc = -EINVAL; goto parse_fail; } @@ -3626,49 +3634,49 @@ int dsi_panel_get_mode(struct dsi_panel *panel, rc = dsi_panel_parse_timing(&mode->timing, utils); if (rc) { - pr_err("failed to parse panel timing, rc=%d\n", rc); + DSI_ERR("failed to parse panel timing, rc=%d\n", rc); goto parse_fail; } rc = dsi_panel_parse_dsc_params(mode, utils); if (rc) { - pr_err("failed to parse dsc params, rc=%d\n", rc); + DSI_ERR("failed to parse dsc params, rc=%d\n", rc); goto parse_fail; } rc = dsi_panel_parse_topology(prv_info, utils, topology_override); if (rc) { - pr_err("failed to parse panel topology, rc=%d\n", rc); + DSI_ERR("failed to parse panel topology, rc=%d\n", rc); goto parse_fail; } rc = dsi_panel_parse_cmd_sets(prv_info, utils); if (rc) { - pr_err("failed to parse command sets, rc=%d\n", rc); + DSI_ERR("failed to parse command sets, rc=%d\n", rc); goto parse_fail; } rc = dsi_panel_parse_jitter_config(mode, utils); if (rc) - pr_err( + DSI_ERR( "failed to parse panel jitter config, rc=%d\n", rc); rc = dsi_panel_parse_phy_timing(mode, utils); if (rc) { - pr_err( + DSI_ERR( "failed to parse panel phy timings, rc=%d\n", rc); goto parse_fail; } rc = dsi_panel_parse_partial_update_caps(mode, utils); if (rc) - pr_err("failed to partial update caps, rc=%d\n", rc); + DSI_ERR("failed to partial update caps, rc=%d\n", rc); if (panel->panel_mode_switch_enabled) { rc = dsi_panel_parse_panel_mode_caps(mode, utils); if (rc) { - pr_err("PMS: failed to parse panel mode\n"); + DSI_ERR("PMS: failed to parse panel mode\n"); rc = 0; mode->panel_mode = panel->panel_mode; } @@ -3695,7 +3703,7 @@ int dsi_panel_get_host_cfg_for_mode(struct dsi_panel *panel, struct dsi_dyn_clk_caps *dyn_clk_caps = &panel->dyn_clk_caps; if (!panel || !mode || !config) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3735,7 +3743,7 @@ int dsi_panel_pre_prepare(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3747,7 +3755,7 @@ int dsi_panel_pre_prepare(struct dsi_panel *panel) rc = dsi_panel_power_on(panel); if (rc) { - pr_err("[%s] panel power on failed, rc=%d\n", panel->name, rc); + DSI_ERR("[%s] panel power on failed, rc=%d\n", panel->name, rc); goto error; } @@ -3763,7 +3771,7 @@ int dsi_panel_update_pps(struct dsi_panel *panel) struct dsi_display_mode_priv_info *priv_info = NULL; if (!panel || !panel->cur_mode) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3777,13 +3785,13 @@ int dsi_panel_update_pps(struct dsi_panel *panel) rc = dsi_panel_create_cmd_packets(panel->dsc_pps_cmd, DSI_CMD_PPS_SIZE, 1, set->cmds); if (rc) { - pr_err("failed to create cmd packets, rc=%d\n", rc); + DSI_ERR("failed to create cmd packets, rc=%d\n", rc); goto error; } rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_PPS); if (rc) { - pr_err("[%s] failed to send DSI_CMD_SET_PPS cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_PPS cmds, rc=%d\n", panel->name, rc); } @@ -3798,7 +3806,7 @@ int dsi_panel_set_lp1(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3808,7 +3816,7 @@ int dsi_panel_set_lp1(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_LP1); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_LP1 cmd, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_LP1 cmd, rc=%d\n", panel->name, rc); exit: mutex_unlock(&panel->panel_lock); @@ -3820,7 +3828,7 @@ int dsi_panel_set_lp2(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3830,7 +3838,7 @@ int dsi_panel_set_lp2(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_LP2); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_LP2 cmd, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_LP2 cmd, rc=%d\n", panel->name, rc); exit: mutex_unlock(&panel->panel_lock); @@ -3842,7 +3850,7 @@ int dsi_panel_set_nolp(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3852,7 +3860,7 @@ int dsi_panel_set_nolp(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_NOLP); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_NOLP cmd, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_NOLP cmd, rc=%d\n", panel->name, rc); exit: mutex_unlock(&panel->panel_lock); @@ -3864,7 +3872,7 @@ int dsi_panel_prepare(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -3873,7 +3881,7 @@ int dsi_panel_prepare(struct dsi_panel *panel) if (panel->lp11_init) { rc = dsi_panel_power_on(panel); if (rc) { - pr_err("[%s] panel power on failed, rc=%d\n", + DSI_ERR("[%s] panel power on failed, rc=%d\n", panel->name, rc); goto error; } @@ -3881,7 +3889,7 @@ int dsi_panel_prepare(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_PRE_ON); if (rc) { - pr_err("[%s] failed to send DSI_CMD_SET_PRE_ON cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_PRE_ON cmds, rc=%d\n", panel->name, rc); goto error; } @@ -3974,16 +3982,16 @@ int dsi_panel_send_qsync_on_dcs(struct dsi_panel *panel, int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } mutex_lock(&panel->panel_lock); - pr_debug("ctrl:%d qsync on\n", ctrl_idx); + DSI_DEBUG("ctrl:%d qsync on\n", ctrl_idx); rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_QSYNC_ON); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_QSYNC_ON cmds rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_QSYNC_ON cmds rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -3996,16 +4004,16 @@ int dsi_panel_send_qsync_off_dcs(struct dsi_panel *panel, int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } mutex_lock(&panel->panel_lock); - pr_debug("ctrl:%d qsync off\n", ctrl_idx); + DSI_DEBUG("ctrl:%d qsync off\n", ctrl_idx); rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_QSYNC_OFF); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_QSYNC_OFF cmds rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_QSYNC_OFF cmds rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4020,7 +4028,7 @@ int dsi_panel_send_roi_dcs(struct dsi_panel *panel, int ctrl_idx, struct dsi_display_mode_priv_info *priv_info; if (!panel || !panel->cur_mode) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4029,18 +4037,18 @@ int dsi_panel_send_roi_dcs(struct dsi_panel *panel, int ctrl_idx, rc = dsi_panel_roi_prepare_dcs_cmds(set, roi, ctrl_idx, true); if (rc) { - pr_err("[%s] failed to prepare DSI_CMD_SET_ROI cmds, rc=%d\n", + DSI_ERR("[%s] failed to prepare DSI_CMD_SET_ROI cmds, rc=%d\n", panel->name, rc); return rc; } - pr_debug("[%s] send roi x %d y %d w %d h %d\n", panel->name, + DSI_DEBUG("[%s] send roi x %d y %d w %d h %d\n", panel->name, roi->x, roi->y, roi->w, roi->h); mutex_lock(&panel->panel_lock); rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_ROI); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_ROI cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_ROI cmds, rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4056,7 +4064,7 @@ int dsi_panel_pre_mode_switch_to_video(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4064,7 +4072,7 @@ int dsi_panel_pre_mode_switch_to_video(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_CMD_TO_VID_SWITCH); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4076,7 +4084,7 @@ int dsi_panel_pre_mode_switch_to_cmd(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4084,7 +4092,7 @@ int dsi_panel_pre_mode_switch_to_cmd(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_VID_TO_CMD_SWITCH); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4096,7 +4104,7 @@ int dsi_panel_mode_switch_to_cmd(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4104,7 +4112,7 @@ int dsi_panel_mode_switch_to_cmd(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_POST_VID_TO_CMD_SWITCH); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4116,7 +4124,7 @@ int dsi_panel_mode_switch_to_vid(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4124,7 +4132,7 @@ int dsi_panel_mode_switch_to_vid(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_POST_CMD_TO_VID_SWITCH); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4136,7 +4144,7 @@ int dsi_panel_switch(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4144,7 +4152,7 @@ int dsi_panel_switch(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_TIMING_SWITCH); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_TIMING_SWITCH cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_TIMING_SWITCH cmds, rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4156,7 +4164,7 @@ int dsi_panel_post_switch(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4164,7 +4172,7 @@ int dsi_panel_post_switch(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_POST_TIMING_SWITCH); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_POST_TIMING_SWITCH cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_POST_TIMING_SWITCH cmds, rc=%d\n", panel->name, rc); mutex_unlock(&panel->panel_lock); @@ -4176,7 +4184,7 @@ int dsi_panel_enable(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("Invalid params\n"); + DSI_ERR("Invalid params\n"); return -EINVAL; } @@ -4184,7 +4192,7 @@ int dsi_panel_enable(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_ON); if (rc) - pr_err("[%s] failed to send DSI_CMD_SET_ON cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_ON cmds, rc=%d\n", panel->name, rc); else panel->panel_initialized = true; @@ -4197,7 +4205,7 @@ int dsi_panel_post_enable(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -4205,7 +4213,7 @@ int dsi_panel_post_enable(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_POST_ON); if (rc) { - pr_err("[%s] failed to send DSI_CMD_SET_POST_ON cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_POST_ON cmds, rc=%d\n", panel->name, rc); goto error; } @@ -4219,7 +4227,7 @@ int dsi_panel_pre_disable(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -4227,7 +4235,7 @@ int dsi_panel_pre_disable(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_PRE_OFF); if (rc) { - pr_err("[%s] failed to send DSI_CMD_SET_PRE_OFF cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_PRE_OFF cmds, rc=%d\n", panel->name, rc); goto error; } @@ -4242,7 +4250,7 @@ int dsi_panel_disable(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -4274,7 +4282,7 @@ int dsi_panel_unprepare(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -4282,7 +4290,7 @@ int dsi_panel_unprepare(struct dsi_panel *panel) rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_POST_OFF); if (rc) { - pr_err("[%s] failed to send DSI_CMD_SET_POST_OFF cmds, rc=%d\n", + DSI_ERR("[%s] failed to send DSI_CMD_SET_POST_OFF cmds, rc=%d\n", panel->name, rc); goto error; } @@ -4297,7 +4305,7 @@ int dsi_panel_post_unprepare(struct dsi_panel *panel) int rc = 0; if (!panel) { - pr_err("invalid params\n"); + DSI_ERR("invalid params\n"); return -EINVAL; } @@ -4305,7 +4313,7 @@ int dsi_panel_post_unprepare(struct dsi_panel *panel) rc = dsi_panel_power_off(panel); if (rc) { - pr_err("[%s] panel power_Off failed, rc=%d\n", + DSI_ERR("[%s] panel power_Off failed, rc=%d\n", panel->name, rc); goto error; } diff --git a/msm/dsi/dsi_parser.c b/msm/dsi/dsi_parser.c index 83669c65b7..fb587c3c36 100644 --- a/msm/dsi/dsi_parser.c +++ b/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 #include #include @@ -14,6 +12,7 @@ #include #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; } diff --git a/msm/dsi/dsi_phy.c b/msm/dsi/dsi_phy.c index e5f8bc53c5..a682f2c6e9 100644 --- a/msm/dsi/dsi_phy.c +++ b/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 #include #include @@ -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); diff --git a/msm/dsi/dsi_phy_hw.h b/msm/dsi/dsi_phy_hw.h index d0295afeba..5f4d4bce61 100644 --- a/msm/dsi/dsi_phy_hw.h +++ b/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. diff --git a/msm/dsi/dsi_phy_hw_v2_0.c b/msm/dsi/dsi_phy_hw_v2_0.c index ff7a27a763..5206469234 100644 --- a/msm/dsi/dsi_phy_hw_v2_0.c +++ b/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 #include #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"); } } diff --git a/msm/dsi/dsi_phy_hw_v3_0.c b/msm/dsi/dsi_phy_hw_v3_0.c index 29c6bb33e3..a863827050 100644 --- a/msm/dsi/dsi_phy_hw_v3_0.c +++ b/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 #include #include @@ -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; } diff --git a/msm/dsi/dsi_phy_hw_v4_0.c b/msm/dsi/dsi_phy_hw_v4_0.c index f8cb9684d6..c3cb9776a1 100644 --- a/msm/dsi/dsi_phy_hw_v4_0.c +++ b/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 #include #include @@ -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; } diff --git a/msm/dsi/dsi_phy_timing_calc.c b/msm/dsi/dsi_phy_timing_calc.c index 909c4162ba..948e2038de 100644 --- a/msm/dsi/dsi_phy_timing_calc.c +++ b/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; } diff --git a/msm/dsi/dsi_phy_timing_v2_0.c b/msm/dsi/dsi_phy_timing_v2_0.c index 0303039ad8..d3c1cb1090 100644 --- a/msm/dsi/dsi_phy_timing_v2_0.c +++ b/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], diff --git a/msm/dsi/dsi_phy_timing_v3_0.c b/msm/dsi/dsi_phy_timing_v3_0.c index a4b967ba00..562d296253 100644 --- a/msm/dsi/dsi_phy_timing_v3_0.c +++ b/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; } diff --git a/msm/dsi/dsi_phy_timing_v4_0.c b/msm/dsi/dsi_phy_timing_v4_0.c index 5a1c89b55e..8e8927adc8 100644 --- a/msm/dsi/dsi_phy_timing_v4_0.c +++ b/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; } diff --git a/msm/dsi/dsi_pwr.c b/msm/dsi/dsi_pwr.c index 3a8918f699..ed1d532578 100644 --- a/msm/dsi/dsi_pwr.c +++ b/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"); } } }