Set the default value of gs_distance is 0x1e

TP:
When upgrading from a firmware that does not support this function
to a new firmware, reading data will fail, so set the default value.



Change-Id: Ic15b5d227b2d90d86a3d96cd8c21ccb94d69294a
Reviewed-on: https://gerrit.mot.com/1572762
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Jialei Hao <haojl2@motorola.com>
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong 2020-05-22 19:07:57 +08:00 • committed by litong20
commit be092e7e98

View file

@ -417,12 +417,13 @@ static int ts_mmi_sysfs_create_edge_entries(struct ts_mmi_dev *touch_cdev, bool
}
if (touch_cdev->pdata.gs_distance_ctrl) {
TRY_TO_GET(gs_distance, &touch_cdev->gs_distance);
if (ret < 0)
if (ret < 0) {
dev_err(DEV_TS, "%s: failed to read gs_distance info (%d)\n",
__func__, ret);
else
/* Set default gs distance value */
touch_cdev->gs_distance = 0x1E;
}
ret = sysfs_create_file(&DEV_MMI->kobj, &dev_attr_gs_distance.attr);
if (ret < 0) {
dev_err(DEV_TS, "%s: failed to create gs_distance entry (%d)\n",