From 1060f5f6e5460d67ebcfcfbed469b8d0a2dfea8b Mon Sep 17 00:00:00 2001 From: Bang Nguyen Date: Fri, 10 Jan 2020 08:25:41 -0600 Subject: [PATCH] disp: msm: Parsing and store panel's 0xDA register info Since ALS sensor's Firmware needs to keep track the PWM duty cycle of each panels' version, therefore the panels' register 0xDA will be used to identify the PWM duty cycle programmed in each panels' version. The new /sys/class/drm/card0-DSI1/panelRegDA sysfs will be created, and it will show the panel's 0XDA reg information. Change-Id: I997fb15040102b784eeb0a7318239bda4f59ac4b Signed-off-by: Bang Nguyen Reviewed-on: https://gerrit.mot.com/1697630 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Guobin Zhang Submit-Approved: Jira Key --- msm/dsi/dsi_display.c | 1 + msm/dsi/dsi_panel.c | 1 + msm/dsi/dsi_panel.h | 1 + msm/msm_drv.h | 2 ++ 4 files changed, 5 insertions(+) diff --git a/msm/dsi/dsi_display.c b/msm/dsi/dsi_display.c index 3b7099c664e5..2a051509c22f 100644 --- a/msm/dsi/dsi_display.c +++ b/msm/dsi/dsi_display.c @@ -7206,6 +7206,7 @@ int dsi_display_get_info(struct drm_connector *connector, info->panel_id = display->panel->panel_id; info->panel_ver = display->panel->panel_ver; + info->panel_regDA = display->panel->panel_regDA; strncpy(info->panel_name, display->panel->panel_name, sizeof(display->panel->panel_name)); diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index 2a25cfadcec3..7fee0b37da15 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -1656,6 +1656,7 @@ int dsi_panel_parse_panel_cfg(struct dsi_panel *panel, bool is_primary) DSI_DEBUG("esd_utage_enable=%d\n", panel->esd_utag_enable); panel_ver = (u32)panel->panel_ver; + panel->panel_regDA = (u32)panel->panel_ver & 0xff; DSI_INFO("BL: panel(%s) =%s, panel_id =0x%016llx panel_ver=0x%016llx\n", is_primary? "primary": "secondary", panel->panel_name, panel->panel_id, panel->panel_ver); diff --git a/msm/dsi/dsi_panel.h b/msm/dsi/dsi_panel.h index ddb0d2aaaddb..0bc4e301f545 100644 --- a/msm/dsi/dsi_panel.h +++ b/msm/dsi/dsi_panel.h @@ -309,6 +309,7 @@ struct dsi_panel { bool esd_utag_enable; u64 panel_id; u64 panel_ver; + u32 panel_regDA; char panel_name[DSI_PANEL_MAX_PANEL_LEN]; u32 disp_on_chk_val; diff --git a/msm/msm_drv.h b/msm/msm_drv.h index cec6d23c6bce..10fe791e267d 100644 --- a/msm/msm_drv.h +++ b/msm/msm_drv.h @@ -753,6 +753,7 @@ struct msm_resource_caps_info { * @is_connected: Set to true if display is connected * @panel_id * @panel_ver + * @panel_regDA * @panel_name[MSM_DISP_NAME_LEN_MAX]; * @width_mm: Physical width * @height_mm: Physical height @@ -785,6 +786,7 @@ struct msm_display_info { uint64_t panel_id; uint64_t panel_ver; + uint32_t panel_regDA; char panel_name[MSM_DISP_NAME_LEN_MAX]; unsigned int width_mm;