From be092e7e98387dfc30775f5a24526a24366c3565 Mon Sep 17 00:00:00 2001 From: litong Date: Fri, 22 May 2020 19:07:57 +0800 Subject: [PATCH] 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 Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../touchscreen/touchscreen_mmi/touchscreen_mmi_class.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c index c36d5274d797..f24149c232bb 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c @@ -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",