Skip to content

Commit b61d43e

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
HID: asus: Add T100TA touchpad resolution info
The touchpad code is only used with the T100TA touchpad which measures 75.5 x 41.5 mm, add corresponding resolution info. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 25cc261 commit b61d43e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/hid/hid-asus.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ struct asus_kbd_leds {
8686
struct asus_touchpad_info {
8787
int max_x;
8888
int max_y;
89+
int res_x;
90+
int res_y;
8991
int contact_size;
9092
int max_contacts;
9193
};
@@ -108,6 +110,8 @@ static const struct asus_touchpad_info asus_i2c_tp = {
108110
static const struct asus_touchpad_info asus_t100ta_tp = {
109111
.max_x = 2240,
110112
.max_y = 1120,
113+
.res_x = 30, /* units/mm */
114+
.res_y = 27, /* units/mm */
111115
.contact_size = 5,
112116
.max_contacts = 5,
113117
};
@@ -361,6 +365,8 @@ static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi)
361365
drvdata->tp->max_x, 0, 0);
362366
input_set_abs_params(input, ABS_MT_POSITION_Y, 0,
363367
drvdata->tp->max_y, 0, 0);
368+
input_abs_set_res(input, ABS_MT_POSITION_X, drvdata->tp->res_x);
369+
input_abs_set_res(input, ABS_MT_POSITION_Y, drvdata->tp->res_y);
364370
input_set_abs_params(input, ABS_TOOL_WIDTH, 0, MAX_TOUCH_MAJOR, 0, 0);
365371
input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, MAX_TOUCH_MAJOR, 0, 0);
366372
input_set_abs_params(input, ABS_MT_PRESSURE, 0, MAX_PRESSURE, 0, 0);

0 commit comments

Comments
 (0)