Merge tag 'input-for-v6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:

- INPUT_PROP_HAPTIC_TOUCHPAD definition added early in 6.18 cycle has
been renamed to INPUT_PROP_PRESSUREPAD to better reflect the kind of
devices it is supposed to be set for

- a new ID for a touchscreen found in Ayaneo Flip DS in Goodix driver

- Goodix driver no longer tries to set reset pin as "input" as it
causes issues when there is no pull up resistor installed on the
board

- fixes for cros_ec_keyb, imx_sc_key, and pegasus-notetaker drivers to
deal with potential out-of-bounds access and memory corruption issues

* tag 'input-for-v6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: rename INPUT_PROP_HAPTIC_TOUCHPAD to INPUT_PROP_PRESSUREPAD
Input: cros_ec_keyb - fix an invalid memory access
Input: imx_sc_key - fix memory corruption on unload
Input: pegasus-notetaker - fix potential out-of-bounds access
Input: goodix - remove setting of RST pin to input
Input: goodix - add support for ACPI ID GDIX1003

Changed files
+38 -37
Documentation
drivers
include
uapi
+18 -7
Documentation/input/event-codes.rst
··· 400 400 All other axes retain their meaning. A device must not mix 401 401 regular directional axes and accelerometer axes on the same event node. 402 402 403 - INPUT_PROP_HAPTIC_TOUCHPAD 404 - -------------------------- 403 + INPUT_PROP_PRESSUREPAD 404 + ---------------------- 405 405 406 - The INPUT_PROP_HAPTIC_TOUCHPAD property indicates that device: 407 - - supports simple haptic auto and manual triggering 406 + The INPUT_PROP_PRESSUREPAD property indicates that the device provides 407 + simulated haptic feedback (e.g. a vibrator motor situated below the surface) 408 + instead of physical haptic feedback (e.g. a hinge). This property is only set 409 + if the device: 410 + 408 411 - can differentiate between at least 5 fingers 409 412 - uses correct resolution for the X/Y (units and value) 410 - - reports correct force per touch, and correct units for them (newtons or grams) 411 413 - follows the MT protocol type B 412 414 415 + If the simulated haptic feedback is controllable by userspace the device must: 416 + 417 + - support simple haptic auto and manual triggering, and 418 + - report correct force per touch, and correct units for them (newtons or grams), and 419 + - provide the EV_FF FF_HAPTIC force feedback effect. 420 + 413 421 Summing up, such devices follow the MS spec for input devices in 414 - Win8 and Win8.1, and in addition support the Simple haptic controller HID table, 415 - and report correct units for the pressure. 422 + Win8 and Win8.1, and in addition may support the Simple haptic controller HID 423 + table, and report correct units for the pressure. 424 + 425 + Where applicable, this property is set in addition to INPUT_PROP_BUTTONPAD, it 426 + does not replace that property. 416 427 417 428 Guidelines 418 429 ==========
+1 -1
drivers/hid/hid-haptic.c
··· 86 86 if (hi->application == HID_DG_TOUCHPAD) { 87 87 if (haptic->auto_trigger_report && 88 88 haptic->manual_trigger_report) { 89 - __set_bit(INPUT_PROP_HAPTIC_TOUCHPAD, hi->input->propbit); 89 + __set_bit(INPUT_PROP_PRESSUREPAD, hi->input->propbit); 90 90 return 1; 91 91 } 92 92 return 0;
+6
drivers/input/keyboard/cros_ec_keyb.c
··· 261 261 case EC_MKBP_EVENT_KEY_MATRIX: 262 262 pm_wakeup_event(ckdev->dev, 0); 263 263 264 + if (!ckdev->idev) { 265 + dev_warn_once(ckdev->dev, 266 + "Unexpected key matrix event\n"); 267 + return NOTIFY_OK; 268 + } 269 + 264 270 if (ckdev->ec->event_size != ckdev->cols) { 265 271 dev_err(ckdev->dev, 266 272 "Discarded incomplete key matrix event.\n");
+1 -1
drivers/input/keyboard/imx_sc_key.c
··· 158 158 return error; 159 159 } 160 160 161 - error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, &priv); 161 + error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, priv); 162 162 if (error) 163 163 return error; 164 164
+9
drivers/input/tablet/pegasus_notetaker.c
··· 63 63 #define BUTTON_PRESSED 0xb5 64 64 #define COMMAND_VERSION 0xa9 65 65 66 + /* 1 Status + 1 Color + 2 X + 2 Y = 6 bytes */ 67 + #define NOTETAKER_PACKET_SIZE 6 68 + 66 69 /* in xy data packet */ 67 70 #define BATTERY_NO_REPORT 0x40 68 71 #define BATTERY_LOW 0x41 ··· 314 311 } 315 312 316 313 pegasus->data_len = usb_maxpacket(dev, pipe); 314 + if (pegasus->data_len < NOTETAKER_PACKET_SIZE) { 315 + dev_err(&intf->dev, "packet size is too small (%d)\n", 316 + pegasus->data_len); 317 + error = -EINVAL; 318 + goto err_free_mem; 319 + } 317 320 318 321 pegasus->data = usb_alloc_coherent(dev, pegasus->data_len, GFP_KERNEL, 319 322 &pegasus->data_dma);
+2 -26
drivers/input/touchscreen/goodix.c
··· 796 796 797 797 usleep_range(6000, 10000); /* T4: > 5ms */ 798 798 799 - /* 800 - * Put the reset pin back in to input / high-impedance mode to save 801 - * power. Only do this in the non ACPI case since some ACPI boards 802 - * don't have a pull-up, so there the reset pin must stay active-high. 803 - */ 804 - if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO) { 805 - error = gpiod_direction_input(ts->gpiod_rst); 806 - if (error) 807 - goto error; 808 - } 809 - 810 799 return 0; 811 800 812 801 error: ··· 946 957 return -EINVAL; 947 958 } 948 959 949 - /* 950 - * Normally we put the reset pin in input / high-impedance mode to save 951 - * power. But some x86/ACPI boards don't have a pull-up, so for the ACPI 952 - * case, leave the pin as is. This results in the pin not being touched 953 - * at all on x86/ACPI boards, except when needed for error-recover. 954 - */ 955 - ts->gpiod_rst_flags = GPIOD_ASIS; 956 - 957 960 return devm_acpi_dev_add_driver_gpios(dev, gpio_mapping); 958 961 } 959 962 #else ··· 969 988 if (!ts->client) 970 989 return -EINVAL; 971 990 dev = &ts->client->dev; 972 - 973 - /* 974 - * By default we request the reset pin as input, leaving it in 975 - * high-impedance when not resetting the controller to save power. 976 - */ 977 - ts->gpiod_rst_flags = GPIOD_IN; 978 991 979 992 ts->avdd28 = devm_regulator_get(dev, "AVDD28"); 980 993 if (IS_ERR(ts->avdd28)) ··· 994 1019 ts->gpiod_int = gpiod; 995 1020 996 1021 /* Get the reset line GPIO pin number */ 997 - gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, ts->gpiod_rst_flags); 1022 + gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_ASIS); 998 1023 if (IS_ERR(gpiod)) 999 1024 return dev_err_probe(dev, PTR_ERR(gpiod), "Failed to get %s GPIO\n", 1000 1025 GOODIX_GPIO_RST_NAME); ··· 1532 1557 static const struct acpi_device_id goodix_acpi_match[] = { 1533 1558 { "GDIX1001", 0 }, 1534 1559 { "GDIX1002", 0 }, 1560 + { "GDIX1003", 0 }, 1535 1561 { "GDX9110", 0 }, 1536 1562 { } 1537 1563 };
-1
drivers/input/touchscreen/goodix.h
··· 88 88 struct gpio_desc *gpiod_rst; 89 89 int gpio_count; 90 90 int gpio_int_idx; 91 - enum gpiod_flags gpiod_rst_flags; 92 91 char id[GOODIX_ID_MAX_LEN + 1]; 93 92 char cfg_name[64]; 94 93 u16 version;
+1 -1
include/uapi/linux/input-event-codes.h
··· 27 27 #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ 28 28 #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ 29 29 #define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ 30 - #define INPUT_PROP_HAPTIC_TOUCHPAD 0x07 /* is a haptic touchpad */ 30 + #define INPUT_PROP_PRESSUREPAD 0x07 /* pressure triggers clicks */ 31 31 32 32 #define INPUT_PROP_MAX 0x1f 33 33 #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)