disp: msm: dsi: parsing BL setting ESD and panel

After the Boot Loader (BL) detects the panel information, or reading
the ESD UTAG setting, the BL will write these information to the DTS.
The display driver from kernel and parse and save these setting.

Port from: 61c3e44

Change-Id: I3759b73c2e1eff01269a42dfa11d20807affa17a
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1444393
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1509795
Reviewed-by: Hua Tan <tanhua1@motorola.com>
This commit is contained in:
Bang Nguyen authored and Gilberto Gambugge committed 2023-06-01 00:43:20 -03:00
1 parent fb1d5e61d1
commit 8072f67d7d
2 files changed
+54

No files matched your search

+48
View File
@@ -34,6 +34,9 @@
#define DEFAULT_PANEL_PREFILL_LINES 25 #define DEFAULT_PANEL_PREFILL_LINES 25
#define MIN_PREFILL_LINES 35 #define MIN_PREFILL_LINES 35
#define DSI_PANEL_UNKNOWN_PANEL_NAME "unknown"
#define DSI_PANEL_PANEL_DEFAULT_VER 0xffffffffffffffff
enum dsi_dsc_ratio_type { enum dsi_dsc_ratio_type {
DSC_8BPC_8BPP, DSC_8BPC_8BPP,
DSC_10BPC_8BPP, DSC_10BPC_8BPP,
@@ -1500,6 +1503,45 @@ static int dsi_panel_parse_dyn_clk_caps(struct dsi_panel *panel)
return 0; return 0;
} }
static int dsi_panel_parse_panel_cfg(struct dsi_panel *panel)
{
struct device_node *np;
const char *pname;
u32 panel_ver, tmp;
np = of_find_node_by_path("/chosen");
/* Disable ESD only if the prop "mmi,esd" exists and is equal to 0 */
if (!of_property_read_u32(np, "mmi,esd", &tmp) && tmp == 0) {
panel->esd_utag_enable = false;
DSI_WARN("ESD detection is disabled by UTAGS\n");
} else
panel->esd_utag_enable = true;
panel->panel_ver = DSI_PANEL_PANEL_DEFAULT_VER;
of_property_read_u64(np, "mmi,panel_ver", &panel->panel_ver);
pname = of_get_property(np, "mmi,panel_name", NULL);
if (!pname || strlen(pname) == 0) {
DSI_WARN("Failed to get mmi,panel_name\n");
strlcpy(panel->panel_name, DSI_PANEL_UNKNOWN_PANEL_NAME,
sizeof(panel->panel_name));
} else
strlcpy(panel->panel_name, pname, sizeof(panel->panel_name));
DSI_DEBUG("esd_utage_enable=%d\n", panel->esd_utag_enable);
panel_ver = (u32)panel->panel_ver;
DSI_INFO("BL: panel = %s, manufacture_id(0xDA) = 0x%x controller_ver(0xDB) = 0x%x controller_drv_ver(0XDC) = 0x%x, full = 0x%016llx\n",
panel->panel_name,
panel_ver & 0xff, (panel_ver & 0xff00) >> 8,
(panel_ver & 0xff0000) >> 16,
panel->panel_ver);
of_node_put(np);
return 0;
}
static int dsi_panel_parse_dfps_caps(struct dsi_panel *panel) static int dsi_panel_parse_dfps_caps(struct dsi_panel *panel)
{ {
int rc = 0; int rc = 0;
@@ -3434,6 +3476,12 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
goto error; goto error;
} }
rc = dsi_panel_parse_panel_cfg(panel);
if (rc) {
pr_err("failed to parse panel config from dts. rc=%d\n", rc);
goto error;
}
rc = dsi_panel_parse_dfps_caps(panel); rc = dsi_panel_parse_dfps_caps(panel);
if (rc) if (rc)
DSI_ERR("failed to parse dfps configuration, rc=%d\n", rc); DSI_ERR("failed to parse dfps configuration, rc=%d\n", rc);
+6
View File
@@ -28,6 +28,8 @@
#define DSI_MODE_MAX 32 #define DSI_MODE_MAX 32
#define DSI_PANEL_MAX_PANEL_LEN 256
/* /*
* Defining custom dsi msg flag, * Defining custom dsi msg flag,
* continued from drm_mipi_dsi.h * continued from drm_mipi_dsi.h
@@ -227,6 +229,10 @@ struct dsi_panel {
int panel_test_gpio; int panel_test_gpio;
int power_mode; int power_mode;
enum dsi_panel_physical_type panel_type; enum dsi_panel_physical_type panel_type;
bool esd_utag_enable;
u64 panel_ver;
char panel_name[DSI_PANEL_MAX_PANEL_LEN];
}; };
static inline bool dsi_panel_ulps_feature_enabled(struct dsi_panel *panel) static inline bool dsi_panel_ulps_feature_enabled(struct dsi_panel *panel)