disp: msm: dp: enhance dpcd debugfs to parse extended capability information

Add support to pass extended capability information to the DPCD
debugfs node. This will help to validate features like VSC support
using debugfs node.

Usage will be the same as before and the change will automatically
detect the presence of extended capability field and expect
additional bytes of information.

Change-Id: If541fd8837aac4794c3db0fa3badeab4143ff9c3
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
此提交包含在:
Abhinav Kumar
2019-06-19 19:46:48 -07:00
父節點 aacd9e9585
當前提交 1286b854ae
共有 3 個檔案被更改,包括 30 行新增7 行删除

查看文件

@@ -178,6 +178,7 @@ static ssize_t dp_debug_write_dpcd(struct file *file,
ssize_t rc = count;
char offset_ch[5];
u32 offset, data_len;
u32 extended_capability_bytes = 0;
const u32 dp_receiver_cap_size = 16;
if (!debug)
@@ -249,11 +250,23 @@ static ssize_t dp_debug_write_dpcd(struct file *file,
bail:
kfree(buf);
/*
* If extension bit is set then increase the length
* of user input to account for the extra bytes
*/
if (dpcd && (dpcd_buf_index > DP_RECEIVER_CAP_SIZE) &&
(dpcd[DP_TRAINING_AUX_RD_INTERVAL] &
DP_EXT_REC_CAP_FIELD))
extended_capability_bytes = 4;
/*
* Reset panel's dpcd in case of any failure. Also, set the
* panel's dpcd only if a full dpcd is provided with offset as 0.
*/
if (!dpcd || (!offset && (data_len == dp_receiver_cap_size))) {
if (!dpcd || (!offset &&
(data_len == (dp_receiver_cap_size +
extended_capability_bytes))) ||
(offset == 0xffff)) {
debug->panel->set_dpcd(debug->panel, dpcd);
/*
@@ -261,7 +274,10 @@ bail:
* only while running in debug mode which is manually
* triggered by a tester or a script.
*/
DP_INFO("[%s]\n", dpcd ? "SET" : "CLEAR");
if (!dpcd || (offset == 0xffff))
DP_INFO("[%s]\n", "CLEAR");
else
DP_INFO("[%s]\n", "SET");
} else
debug->aux->dpcd_updated(debug->aux);