Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: goodix - use input_copy_abs() helper

Use the new input_copy_abs() helper and move the 2 input_abs_set_res()
calls up to be directly after the 2 input_copy_abs() calls, so that
the calls initializing the X and Y axis are all together.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220131143539.109142-3-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Hans de Goede and committed by
Dmitry Torokhov
ae8e80c5 cb66b9ba

+9 -17
+9 -17
drivers/input/touchscreen/goodix.c
··· 306 306 if (!input) 307 307 return NULL; 308 308 309 - input_alloc_absinfo(input); 310 - if (!input->absinfo) { 311 - input_free_device(input); 312 - return NULL; 313 - } 314 - 315 - input->absinfo[ABS_X] = ts->input_dev->absinfo[ABS_MT_POSITION_X]; 316 - input->absinfo[ABS_Y] = ts->input_dev->absinfo[ABS_MT_POSITION_Y]; 317 - __set_bit(ABS_X, input->absbit); 318 - __set_bit(ABS_Y, input->absbit); 319 - input_set_abs_params(input, ABS_PRESSURE, 0, 255, 0, 0); 320 - 321 - input_set_capability(input, EV_KEY, BTN_TOUCH); 322 - input_set_capability(input, EV_KEY, BTN_TOOL_PEN); 323 - input_set_capability(input, EV_KEY, BTN_STYLUS); 324 - input_set_capability(input, EV_KEY, BTN_STYLUS2); 325 - __set_bit(INPUT_PROP_DIRECT, input->propbit); 309 + input_copy_abs(input, ABS_X, ts->input_dev, ABS_MT_POSITION_X); 310 + input_copy_abs(input, ABS_Y, ts->input_dev, ABS_MT_POSITION_Y); 326 311 /* 327 312 * The resolution of these touchscreens is about 10 units/mm, the actual 328 313 * resolution does not matter much since we set INPUT_PROP_DIRECT. ··· 315 330 */ 316 331 input_abs_set_res(input, ABS_X, 10); 317 332 input_abs_set_res(input, ABS_Y, 10); 333 + input_set_abs_params(input, ABS_PRESSURE, 0, 255, 0, 0); 334 + 335 + input_set_capability(input, EV_KEY, BTN_TOUCH); 336 + input_set_capability(input, EV_KEY, BTN_TOOL_PEN); 337 + input_set_capability(input, EV_KEY, BTN_STYLUS); 338 + input_set_capability(input, EV_KEY, BTN_STYLUS2); 339 + __set_bit(INPUT_PROP_DIRECT, input->propbit); 318 340 319 341 input->name = "Goodix Active Pen"; 320 342 input->phys = "input/pen";