summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuper Liu <supercjliu@google.com>2023-03-14 07:17:52 +0000
committerSuper Liu <supercjliu@google.com>2023-03-29 06:30:50 +0000
commit25720bed095d9385d90ed22c59653c138bb7c98d (patch)
treefb4ead784b6e81480be636b262b77a8d463e8fd7
parent901977ca79d2e3292fb33bc9a0729141ff2f2c87 (diff)
downloadgoodix_touch-25720bed095d9385d90ed22c59653c138bb7c98d.tar.gz
touch/goodix: Support custom limits file name
Bug: 272408020 Change-Id: I7dfa0689290378b919afb76db4de5397cd10423f Signed-off-by: Super Liu <supercjliu@google.com>
-rw-r--r--goodix_ts_core.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/goodix_ts_core.c b/goodix_ts_core.c
index 20c317d..494c998 100644
--- a/goodix_ts_core.c
+++ b/goodix_ts_core.c
@@ -1344,10 +1344,20 @@ static int goodix_parse_dt(
}
}
- /* use default test limits name */
- ts_info("use default test limits: %s", TS_DEFAULT_TEST_LIMITS);
- strncpy(board_data->test_limits_name, TS_DEFAULT_TEST_LIMITS,
- sizeof(board_data->test_limits_name));
+ /* get test limits file name */
+ r = of_property_read_string(
+ node, "goodix,test-limits-name", &name_tmp);
+ if (!r) {
+ ts_info("test limits name from dt: %s", name_tmp);
+ strncpy(board_data->test_limits_name, name_tmp,
+ sizeof(board_data->test_limits_name));
+ } else {
+ /* use default test limits name */
+ ts_info("can't find test limits name, use default: %s\n",
+ TS_DEFAULT_TEST_LIMITS);
+ strncpy(board_data->test_limits_name, TS_DEFAULT_TEST_LIMITS,
+ sizeof(board_data->test_limits_name));
+ }
}
/* get xyz resolutions */