summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/elants_i2c.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2021-05-25 11:24:42 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2021-05-25 11:24:42 -0700
commitcbb245239282870bc6f54d5137dfe0f84b48ea72 (patch)
treedcdd8041d7bb5cddacfe086785dd370aa1a7a6ea /drivers/input/touchscreen/elants_i2c.c
parent94a332bd8626f6c32e7ba5835dd17eeddbb76e89 (diff)
parent9f4ad9e425a1d3b6a34617b8ea226d56a119a717 (diff)
downloadlwn-cbb245239282870bc6f54d5137dfe0f84b48ea72.tar.gz
lwn-cbb245239282870bc6f54d5137dfe0f84b48ea72.zip
Merge tag 'v5.12' into next
Sync up with mainline to get the latest device tree bindings and kernel APIs.
Diffstat (limited to 'drivers/input/touchscreen/elants_i2c.c')
-rw-r--r--drivers/input/touchscreen/elants_i2c.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index 36cf5694bfcc..17540bdb1eaf 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -1481,7 +1481,7 @@ static int elants_i2c_probe(struct i2c_client *client,
touchscreen_parse_properties(ts->input, true, &ts->prop);
- if (ts->chip_id == EKTF3624) {
+ if (ts->chip_id == EKTF3624 && ts->phy_x && ts->phy_y) {
/* calculate resolution from size */
ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, ts->phy_x);
ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, ts->phy_y);
@@ -1489,8 +1489,7 @@ static int elants_i2c_probe(struct i2c_client *client,
input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res);
input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
- if (ts->major_res > 0)
- input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res);
+ input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res);
error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM,
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);