diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-24 19:42:04 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-24 19:42:04 -1000 |
| commit | a32e63a613aa80dfdb9acc0a09efab940e96054f (patch) | |
| tree | 67752eeb602e5fab1777df29b7d23f4191bd4635 /drivers/input | |
| parent | 065af32bd4c4be5907ef45660cde59f13be08246 (diff) | |
| parent | f57202d55333f750a18e21c3b3f35f48ef14a61e (diff) | |
Merge tag 'input-for-v7.4-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:
- Updates to input core to reject parent device overrides on managed
input devices so devres lifetime management is not split across
different devices, along with fixes for da7280, drv2665, drv2667, and
tps6507x-ts that were reparenting managed input devices, and removal
of redundant parent assignments across multiple drivers
- A fix in input core to always accept EV_SYN events in input_event()
and input_inject_event() so events seeded before device registration
are properly flushed by input_sync()
- A fix in matrix-keymap helper to reject keycodes above KEY_MAX and
prevent out-of-bounds bitmap writes
- Fixes and cleanups for HP GSC PS/2 (gscps2) serio driver to resolve
race conditions in port list management, ring buffer access, and
interrupt handling, return IRQ_NONE for unhandled shared interrupts,
and drop busy-waiting on transmit
- Fixes for maple_keyb driver to correct inverted key press detection,
implement open and close methods so polling only runs while the
device is open, and clean up unused driver fields
- Fixes for maplecontrol driver to emit EV_SYN after reporting events,
only enable axes reported by the controller with corrected hat
limits, and stop polling and clear the callback on close
- Updates to maplemouse driver to stop polling and clear the callback
on close and drop redundant driver data cleanup
- Fixes for matrix_keypad driver reverting forced switching of row
GPIOs to input mode that broke row interrupts on platforms with
separate GPIO and interrupt pinmux functions, and propagating the
actual error code from matrix_keypad_build_keymap()
- A fix for st-keyscan driver to keep the interrupt disabled while the
peripheral clock is gated off to prevent bus faults, along with probe
error handling improvements
- A fix for mms114 touchscreen driver to disable interrupts before
synthesizing touch release events during suspend so concurrent
interrupts do not leave stuck active touch slots
- Updates to xpad driver to support GameSir Nova Lite controller
- A number of updates to device tree bindings, including a new schema
for Analog Devices AD7147 CapTouch controller, conversion of SiS 9200
I2C touchscreen binding to DT schema format, and allowing the
wakeup-source property on Dialog DA9062 onkey
- Other assorted driver cleanups, style fixes, and conversions,
including switching to named initializers for acpi_device_id tables
and converting cyttsp5 to DEFINE_SIMPLE_DEV_PM_OPS.
* tag 'input-for-v7.4-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (94 commits)
Revert "Input: matrix_keypad - force switch rows to input mode"
Input: s6sy761 - drop duplicate axis initialization in s6sy761_probe()
Input: always accept EV_SYN in input_event()
dt-bindings: input: dlg,da9062-onkey: Allow wakeup-source property
Input: xpad - add GameSir Nova Lite support
Input: touchscreen - use named initializers for acpi_device_id
Input: mouse - cyapa: use named initializers for acpi_device_id
Input: misc - use named initializers for acpi_device_id
Input: keyboard - use named initializers for acpi_device_id
Input: reject parent overrides on managed input devices
Input: tps6507x-ts - fix input device parent assignment
Input: drv2667 - fix input device parent assignment
Input: drv2665 - fix input device parent assignment
Input: da7280 - fix input device parent assignment
Input: maple_keyb - remove unused mdev->driver assignment
Input: maplecontrol - remove unused mdev->driver assignment
Input: maplemouse - remove unused mdev->driver assignment
Input: maplecontrol - remove redundant drvdata resetting
Input: maple_keyb - remove redundant drvdata resetting
Input: maplemouse - remove redundant drvdata resetting
...
Diffstat (limited to 'drivers/input')
83 files changed, 298 insertions, 331 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index c06e98fbd77c..4fe386fa86af 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -126,9 +126,8 @@ EXPORT_SYMBOL(input_mt_destroy_slots); * * Reports a contact via ABS_MT_TRACKING_ID, and optionally * ABS_MT_TOOL_TYPE. If active is true and the slot is currently - * inactive, or if the tool type is changed, a new tracking id is - * assigned to the slot. The tool type is only reported if the - * corresponding absbit field is set. + * inactive, a new tracking id is assigned to the slot. The tool + * type is only reported if the corresponding absbit field is set. * * Returns true if contact is active. */ diff --git a/drivers/input/input.c b/drivers/input/input.c index 01c91fec9b7e..0859b60ca924 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -391,7 +391,7 @@ void input_handle_event(struct input_dev *dev, void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { - if (is_event_supported(type, dev->evbit, EV_MAX)) { + if (type == EV_SYN || is_event_supported(type, dev->evbit, EV_MAX)) { guard(spinlock_irqsave)(&dev->event_lock); input_handle_event(dev, type, code, value); } @@ -415,7 +415,7 @@ void input_inject_event(struct input_handle *handle, struct input_dev *dev = handle->dev; struct input_handle *grab; - if (is_event_supported(type, dev->evbit, EV_MAX)) { + if (type == EV_SYN || is_event_supported(type, dev->evbit, EV_MAX)) { guard(spinlock_irqsave)(&dev->event_lock); guard(rcu)(); @@ -2396,6 +2396,14 @@ int input_register_device(struct input_dev *dev) } if (dev->devres_managed) { + if (!dev->dev.parent || + !devres_find(dev->dev.parent, devm_input_device_release, + devm_input_device_match, dev)) { + dev_err(&dev->dev, + "Parent of managed input device was overridden, refusing to register\n"); + return -EINVAL; + } + devres = devres_alloc(devm_input_device_unregister, sizeof(*devres), GFP_KERNEL); if (!devres) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index 6293b6e8148b..eb28ff8d7222 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -58,6 +58,8 @@ static void dc_pad_callback(struct mapleq *mq) input_report_abs(dev, ABS_Y, res[13]); input_report_abs(dev, ABS_RX, res[14]); input_report_abs(dev, ABS_RY, res[15]); + + input_sync(dev); } static int dc_pad_open(struct input_dev *dev) @@ -74,8 +76,7 @@ static void dc_pad_close(struct input_dev *dev) { struct dc_pad *pad = dev_get_platdata(&dev->dev); - maple_getcond_callback(pad->mdev, dc_pad_callback, 0, - MAPLE_FUNC_CONTROLLER); + maple_getcond_callback(pad->mdev, NULL, 0, MAPLE_FUNC_CONTROLLER); } /* allow the controller to be used */ @@ -96,7 +97,6 @@ static int probe_maple_controller(struct device *dev) }; struct maple_device *mdev = to_maple_dev(dev); - struct maple_driver *mdrv = to_maple_driver(dev->driver); int i, error; struct dc_pad *pad; struct input_dev *idev; @@ -118,26 +118,19 @@ static int probe_maple_controller(struct device *dev) idev->close = dc_pad_close; for (i = 0; i < 32; i++) { - if (data & (1 << i)) { + if (data & BIT(i)) { if (btn_bit[i] >= 0) __set_bit(btn_bit[i], idev->keybit); - else if (abs_bit[i] >= 0) - __set_bit(abs_bit[i], idev->absbit); + else if (abs_bit[i] >= ABS_X && abs_bit[i] <= ABS_BRAKE) + input_set_abs_params(idev, abs_bit[i], 0, 255, 0, 0); + else if (abs_bit[i] >= ABS_HAT0X && abs_bit[i] <= ABS_HAT3Y) + input_set_abs_params(idev, abs_bit[i], -1, 1, 0, 0); } } if (idev->keybit[BIT_WORD(BTN_JOYSTICK)]) idev->evbit[0] |= BIT_MASK(EV_KEY); - if (idev->absbit[0]) - idev->evbit[0] |= BIT_MASK(EV_ABS); - - for (i = ABS_X; i <= ABS_BRAKE; i++) - input_set_abs_params(idev, i, 0, 255, 0, 0); - - for (i = ABS_HAT0X; i <= ABS_HAT3Y; i++) - input_set_abs_params(idev, i, 1, -1, 0, 0); - idev->dev.platform_data = pad; idev->dev.parent = &mdev->dev; idev->name = mdev->product_name; @@ -146,15 +139,11 @@ static int probe_maple_controller(struct device *dev) error = input_register_device(idev); if (error) goto fail; - - mdev->driver = mdrv; - return 0; fail: input_free_device(idev); kfree(pad); - maple_set_drvdata(mdev, NULL); return error; } @@ -163,9 +152,7 @@ static int remove_maple_controller(struct device *dev) struct maple_device *mdev = to_maple_dev(dev); struct dc_pad *pad = maple_get_drvdata(mdev); - mdev->callback = NULL; input_unregister_device(pad->dev); - maple_set_drvdata(mdev, NULL); kfree(pad); return 0; diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 810e52782ae8..d2eb48d98fea 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -408,6 +408,7 @@ static const struct xpad_device { { 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 }, { 0x3537, 0x100f, "GameSir Nova 2 Lite", 0, XTYPE_XBOX360 }, { 0x3537, 0x1010, "GameSir G7 SE", 0, XTYPE_XBOXONE }, + { 0x3537, 0x1040, "GameSir Nova Lite", 0, XTYPE_XBOX360 }, { 0x3651, 0x1000, "CRKD SG", 0, XTYPE_XBOX360 }, { 0x366c, 0x0005, "ByoWave Proteus Controller", MAP_SHARE_BUTTON, XTYPE_XBOXONE, FLAG_DELAY_INIT }, { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index 980d739e45b8..d778af2750ea 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c @@ -104,7 +104,6 @@ static int adp5520_keys_probe(struct platform_device *pdev) input->name = pdev->name; input->phys = "adp5520-keys/input0"; - input->dev.parent = &pdev->dev; input->id.bustype = BUS_I2C; input->id.vendor = 0x0001; diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c index b5ff71cd5a70..7d5ed45845bc 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -1259,7 +1259,6 @@ applespi_register_touchpad_device(struct applespi_data *applespi, touchpad_input_dev->name = "Apple SPI Touchpad"; touchpad_input_dev->phys = "applespi/input1"; - touchpad_input_dev->dev.parent = &applespi->spi->dev; touchpad_input_dev->id.bustype = BUS_SPI; touchpad_input_dev->id.vendor = SYNAPTICS_VENDOR_ID; touchpad_input_dev->id.product = @@ -1686,7 +1685,6 @@ static int applespi_probe(struct spi_device *spi) applespi->keyboard_input_dev->name = "Apple SPI Keyboard"; applespi->keyboard_input_dev->phys = "applespi/input0"; - applespi->keyboard_input_dev->dev.parent = &spi->dev; applespi->keyboard_input_dev->id.bustype = BUS_SPI; applespi->keyboard_input_dev->evbit[0] = @@ -1904,7 +1902,7 @@ static int applespi_resume(struct device *dev) } static const struct acpi_device_id applespi_acpi_match[] = { - { "APP000D", 0 }, + { .id = "APP000D" }, { } }; MODULE_DEVICE_TABLE(acpi, applespi_acpi_match); diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index b5ee5697a136..019cfa8553f9 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -357,10 +357,7 @@ static void atkbd_calculate_xl_bit(struct atkbd *atkbd, u8 code) for (i = 0; i < ARRAY_SIZE(xl_table); i++) { if (!((code ^ xl_table[i]) & 0x7f)) { - if (code & 0x80) - __clear_bit(i, &atkbd->xl_bit); - else - __set_bit(i, &atkbd->xl_bit); + __assign_bit(i, &atkbd->xl_bit, !(code & 0x80)); break; } } diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c index 6b46f83a9edb..f76cc6e7b787 100644 --- a/drivers/input/keyboard/bcm-keypad.c +++ b/drivers/input/keyboard/bcm-keypad.c @@ -327,7 +327,6 @@ static int bcm_kp_probe(struct platform_device *pdev) input_dev->name = pdev->name; input_dev->phys = "keypad/input0"; - input_dev->dev.parent = &pdev->dev; input_dev->open = bcm_kp_open; input_dev->close = bcm_kp_close; diff --git a/drivers/input/keyboard/clps711x-keypad.c b/drivers/input/keyboard/clps711x-keypad.c index ddabd789861b..6a21ee17e164 100644 --- a/drivers/input/keyboard/clps711x-keypad.c +++ b/drivers/input/keyboard/clps711x-keypad.c @@ -130,7 +130,6 @@ static int clps711x_keypad_probe(struct platform_device *pdev) input_set_drvdata(input, priv); input->name = pdev->name; - input->dev.parent = dev; input->id.bustype = BUS_HOST; input->id.vendor = 0x0001; input->id.product = 0x0001; diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index 177e5d4a3382..0a817680171c 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -602,7 +602,6 @@ static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev, idev->id.bustype = BUS_VIRTUAL; idev->id.version = 1; idev->id.product = 0; - idev->dev.parent = dev; input_set_drvdata(idev, ckdev); ckdev->bs_idev = idev; @@ -776,7 +775,6 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev) idev->id.bustype = BUS_VIRTUAL; idev->id.version = 1; idev->id.product = 0; - idev->dev.parent = dev; idev->setkeycode = cros_ec_keyb_setkeycode; ckdev->ghost_filter = device_property_read_bool(dev, "google,needs-ghost-filter"); @@ -911,7 +909,7 @@ static void cros_ec_keyb_remove(struct platform_device *pdev) #ifdef CONFIG_ACPI static const struct acpi_device_id cros_ec_keyb_acpi_match[] = { - { "GOOG0007", true }, + { .id = "GOOG0007", .driver_data = true }, { } }; MODULE_DEVICE_TABLE(acpi, cros_ec_keyb_acpi_match); diff --git a/drivers/input/keyboard/goldfish_events.c b/drivers/input/keyboard/goldfish_events.c index 57d435fc5c73..d0e387f22faf 100644 --- a/drivers/input/keyboard/goldfish_events.c +++ b/drivers/input/keyboard/goldfish_events.c @@ -179,8 +179,8 |
