From 6c7ed4807c46e72e4a6ca27febb7d9962e94f601 Mon Sep 17 00:00:00 2001 From: zhuwg1 Date: Thu, 3 Mar 2022 09:16:34 +0800 Subject: [PATCH] Add CLI touch factory test cp_panel node Add CLI touch factory test cp_panel node,from this node we can read out self-capcitance raw data and to verify whether calibration data is ok. Change-Id: I5f52fb464ff8ca583e518bd110fad8a86c6669d1 Signed-off-by: zhuwg1 Reviewed-on: https://gerrit.mot.com/2205761 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou Submit-Approved: Jira Key --- .../touchscreen/parade_tma5xx_mmi/cyttsp5_core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/input/touchscreen/parade_tma5xx_mmi/cyttsp5_core.c b/drivers/input/touchscreen/parade_tma5xx_mmi/cyttsp5_core.c index 83a187370c94..eeea21a42904 100644 --- a/drivers/input/touchscreen/parade_tma5xx_mmi/cyttsp5_core.c +++ b/drivers/input/touchscreen/parade_tma5xx_mmi/cyttsp5_core.c @@ -5926,6 +5926,19 @@ static ssize_t cm_panel_show(struct device *dev, return snprintf(buf, CY_MAX_PRBUF_SIZE, "%s", cd->pr_buf); } +static ssize_t cp_panel_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct cyttsp5_core_data *cd = dev_get_drvdata(dev); + + /* Set length to PIP_CMD_MAX_LENGTH to read all */ + cyttsp5_run_and_get_selftest_result( + dev, cd->pr_buf, sizeof(cd->pr_buf), + CY_ST_ID_CP_PANEL, PIP_CMD_MAX_LENGTH, true); + + return snprintf(buf, CY_MAX_PRBUF_SIZE, "%s", cd->pr_buf); +} + /* End MFG test support by sysfs */ static struct device_attribute attributes[] = { @@ -5951,6 +5964,7 @@ static struct device_attribute attributes[] = { __ATTR(calibrate, S_IRUSR | S_IWUSR, cyttsp5_calibrate_show, cyttsp5_calibrate_store), __ATTR(cm_panel, S_IRUGO, cm_panel_show, NULL), + __ATTR(cp_panel, S_IRUGO, cp_panel_show, NULL), __ATTR(auto_shorts, S_IRUGO, auto_shorts_show, NULL), };