disp: msm: expose qsync avr step as part of conn mode caps

Add capability to read avr step for each timing mode. This will
be in addition to the existing avr-step-list which is defined
when dfps is enabled. Expose the avr-step as part of each
mode in connector caps to user-mode.
Additionally, change the avr_step connector property to enum
to give usermode just the capability to enable/disable avr-step
and not alter the step value as its fixed from the device tree.

Change-Id: I6d7f8e9fcf03f98abef7640fc741e5e1be8597a1
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
This commit is contained in:
Veera Sundaram Sankaran
2023-01-20 15:20:10 -08:00
والد 95e583e413
کامیت 2e3ba9430c
13فایلهای تغییر یافته به همراه155 افزوده شده و 141 حذف شده

مشاهده پرونده

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
*/
@@ -925,6 +925,12 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode,
rc = 0;
}
rc = utils->read_u32(utils->data, "qcom,dsi-qsync-mode-avr-step-fps", &mode->avr_step_fps);
if (rc) {
DSI_DEBUG("avr step fps not defined in timing node\n");
rc = 0;
}
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);
@@ -1292,14 +1298,22 @@ static int dsi_panel_parse_avr_caps(struct dsi_panel *panel,
struct dsi_parser_utils *utils = &panel->utils;
int val, rc = 0;
rc = of_property_read_u32(of_node, "qcom,dsi-qsync-avr-step-fps", &val);
if (rc)
DSI_DEBUG("[%s] avr step fps not defined rc:%d\n", panel->name, rc);
avr_caps->avr_step_fps = rc ? 0 : val;
val = utils->count_u32_elems(utils->data, "qcom,dsi-qsync-avr-step-list");
if (val <= 0) {
DSI_DEBUG("[%s] optional avr step list not defined, val:%d\n", panel->name, val);
return rc;
return 0;
} else if (val > 1 && val != panel->dfps_caps.dfps_list_len) {
DSI_ERR("[%s] avr step list size %d not same as dfps list %d\n",
panel->name, val, panel->dfps_caps.dfps_list_len);
return -EINVAL;
} else if ((val > 0) && (avr_caps->avr_step_fps)) {
DSI_ERR("[%s] both modes of avr-steps are defined\n", panel->name);
return -EINVAL;
}
avr_caps->avr_step_fps_list = kcalloc(val, sizeof(u32), GFP_KERNEL);