summaryrefslogtreecommitdiff
path: root/touch_apis.c
diff options
context:
space:
mode:
authorWendly Li <wendlyli@google.com>2022-02-24 12:35:55 +0000
committerWendly Li <wendlyli@google.com>2022-02-25 05:57:09 +0000
commit33b3ecc094052f7f3a79a82d048d04e2d7f2fafb (patch)
tree1f4636629b2a45da3938076426e22935fd589586 /touch_apis.c
parentb20b1b7bfcbeb83b99246489a23696a019ceb4e2 (diff)
downloadgoodix_touch-33b3ecc094052f7f3a79a82d048d04e2d7f2fafb.tar.gz
Support normal active/idle mode
Bug: 214118804 Test: Check API works properly Change-Id: Ieab54a2443b0b158442139a75766b064f8171a85 Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'touch_apis.c')
-rw-r--r--touch_apis.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/touch_apis.c b/touch_apis.c
index 96e6fac..2cd38ca 100644
--- a/touch_apis.c
+++ b/touch_apis.c
@@ -198,6 +198,7 @@ static ssize_t scan_mode_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
enum scan_mode mode = 0;
+ int ret = 0;
if (buf == NULL || count < SCAN_MODE_AUTO)
return -EINVAL;
@@ -212,7 +213,11 @@ static ssize_t scan_mode_store(struct device *dev,
}
if (apis->set_scan_mode != NULL) {
- apis->set_scan_mode(dev, mode);
+ ret = apis->set_scan_mode(dev, mode);
+ if (ret != 0) {
+ return ret;
+ }
+ apis->scan_mode = mode;
}
return count;
}