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 <zhuwg1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2205761
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
zhuwg1 2022-03-03 09:16:34 +08:00
commit 6c7ed4807c

View file

@ -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),
};