diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-07-16 13:38:15 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-07-16 13:47:31 -0400 |
commit | d98399e688f8c4f42f4270c2dfe1293f69247c5b (patch) | |
tree | 83ee2810da3eb50530d28ccb05179243c86c473e /drivers/input/mouse | |
parent | 7d01cd261c76f95913c81554a751968a1d282d3a (diff) |
Input: elantech - force resolution of 31 u/mm
All Elantech touchpads pre-v4 with dynamic resolution queries have a fixed
resolution of 800dpi -> 31.49 units/mm. Set this statically, so userspace
does not have to guess.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/elantech.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index ce3d40004458..22b9ca901f4e 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -1167,7 +1167,7 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
1167 | struct input_dev *dev = psmouse->dev; | 1167 | struct input_dev *dev = psmouse->dev; |
1168 | struct elantech_data *etd = psmouse->private; | 1168 | struct elantech_data *etd = psmouse->private; |
1169 | unsigned int x_min = 0, y_min = 0, x_max = 0, y_max = 0, width = 0; | 1169 | unsigned int x_min = 0, y_min = 0, x_max = 0, y_max = 0, width = 0; |
1170 | unsigned int x_res = 0, y_res = 0; | 1170 | unsigned int x_res = 31, y_res = 31; |
1171 | 1171 | ||
1172 | if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width)) | 1172 | if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width)) |
1173 | return -1; | 1173 | return -1; |
@@ -1232,8 +1232,6 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
1232 | /* For X to recognize me as touchpad. */ | 1232 | /* For X to recognize me as touchpad. */ |
1233 | input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); | 1233 | input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); |
1234 | input_set_abs_params(dev, ABS_Y, y_min, y_max, 0, 0); | 1234 | input_set_abs_params(dev, ABS_Y, y_min, y_max, 0, 0); |
1235 | input_abs_set_res(dev, ABS_X, x_res); | ||
1236 | input_abs_set_res(dev, ABS_Y, y_res); | ||
1237 | /* | 1235 | /* |
1238 | * range of pressure and width is the same as v2, | 1236 | * range of pressure and width is the same as v2, |
1239 | * report ABS_PRESSURE, ABS_TOOL_WIDTH for compatibility. | 1237 | * report ABS_PRESSURE, ABS_TOOL_WIDTH for compatibility. |
@@ -1246,8 +1244,6 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
1246 | input_mt_init_slots(dev, ETP_MAX_FINGERS, 0); | 1244 | input_mt_init_slots(dev, ETP_MAX_FINGERS, 0); |
1247 | input_set_abs_params(dev, ABS_MT_POSITION_X, x_min, x_max, 0, 0); | 1245 | input_set_abs_params(dev, ABS_MT_POSITION_X, x_min, x_max, 0, 0); |
1248 | input_set_abs_params(dev, ABS_MT_POSITION_Y, y_min, y_max, 0, 0); | 1246 | input_set_abs_params(dev, ABS_MT_POSITION_Y, y_min, y_max, 0, 0); |
1249 | input_abs_set_res(dev, ABS_MT_POSITION_X, x_res); | ||
1250 | input_abs_set_res(dev, ABS_MT_POSITION_Y, y_res); | ||
1251 | input_set_abs_params(dev, ABS_MT_PRESSURE, ETP_PMIN_V2, | 1247 | input_set_abs_params(dev, ABS_MT_PRESSURE, ETP_PMIN_V2, |
1252 | ETP_PMAX_V2, 0, 0); | 1248 | ETP_PMAX_V2, 0, 0); |
1253 | /* | 1249 | /* |
@@ -1259,6 +1255,13 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
1259 | break; | 1255 | break; |
1260 | } | 1256 | } |
1261 | 1257 | ||
1258 | input_abs_set_res(dev, ABS_X, x_res); | ||
1259 | input_abs_set_res(dev, ABS_Y, y_res); | ||
1260 | if (etd->hw_version > 1) { | ||
1261 | input_abs_set_res(dev, ABS_MT_POSITION_X, x_res); | ||
1262 | input_abs_set_res(dev, ABS_MT_POSITION_Y, y_res); | ||
1263 | } | ||
1264 | |||
1262 | etd->y_max = y_max; | 1265 | etd->y_max = y_max; |
1263 | etd->width = width; | 1266 | etd->width = width; |
1264 | 1267 | ||