projects/linux·commit 1be05c6a

Merge tag 'input-for-v7.3-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

1be05c6a · Linus Torvalds <[email protected]> · 2026-08-19 08:59:24 -07:00

Pull input updates from Dmitry Torokhov:

 - A new driver and device tree binding for Imagis ISA1200 haptic motor
   controller

 - Improvements to input core opening, closing and inhibiting devices,
   ensuring devices are fully ready before delivering events, deferring
   handler start() until the device is opened, resyncing state on
   uninhibit, and rejecting inhibit requests during unregistration

 - Updates to cap11xx capacitive touch driver to support Microchip
   CAP1114, optional hardware reset GPIO handling, and per-chip LED
   constraints

 - Fixes for MELFAS MMS114 touchscreen driver hardening incoming data
   parsing, endianness fixes for I2C packet layout, Y-resolution
   configuration, and refactoring to use chip variant descriptors

 - Updates for psmouse driver resolving a potential UAF during protocol
   disconnect, cleaning up PNP ID matching, and making use of guard()

 - Fix for FocalTech PS/2 protocol to prevent coordinate underflow and
   cursor jumps at boundaries

 - A change to Synaptics driver to enable InterTouch (SMBus) mode on
   Dell Inspiron 3521

 - Refactoring of PA-RISC keyboard support in gscps2 to supply keymaps
   via software node device properties, removing architecture-specific
   tables from the generic atkbd driver

 - Updates to Samsung keypad driver to keep interrupts disabled while
   device is closed, along with wakeup logic cleanups and use of
   pm_runtime_active guards

 - Updates to NXP i.MX SNVS power key driver to report press events
   during resume to avoid lost events, and error handling cleanups

 - Updated TCA8418 keypad driver enabling overflow mode per hardware
   errata

 - Conversion of ROHM BD718x7 and BD71828 PMIC drivers to instantiate
   gpio-keys child devices using software nodes instead of platform data
   (coming from MFD immutable branch)

 - Updates to Synaptics RMI4 driver to use touchscreen dimensions from
   platform data when specified

 - Firmware update speed optimization for IC Type 0x19 in ELAN I2C
   driver

 - A fix to Azoteq IQS5xx driver to validate firmware record spans
   against programmable map size

 - Update to Samsung SUR40 contact count based on PixelSense
   specification

 - A number of updates to device tree bindings, including TI TPS65217
   power button schema conversion and new compatibles for FocalTech
   FT3D81 and Synaptics S3706B

 - Other assorted driver cleanups, style fixes, and conversions to
   modern string and cleanup helpers

* tag 'input-for-v7.3-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (61 commits)
  Input: rmi4 - use platform data instead of query, when available
  Input: elan_i2c - sort include statements
  Input: elan_i2c - optimize update speed for IC Type 0x19.
  Input: elan_i2c - use device-id/acpi.h for ACPI IDs
  Input: reject inhibit and uninhibit requests on unregistering devices
  Input: defer handler's start() until device is opened
  Input: call handler->start() when uninhibiting device
  Input: clear inhibited flag before re-opening device on uninhibit
  Input: ensure device is ready before delivering events
  Input: gscps2 - supply PA-RISC keyboard keymap via device property
  Input: synaptics_i2c - return 0 explicitly on success
  Input: rmi_smbus - remove conditional return with no effect
  Input: pmic8xxx-keypad - remove conditional return with no effect
  Input: focaltech - use signed coordinates to prevent underflow
  Input: psmouse - use guard() for resource management
  Input: psmouse - modernize PNP ID parsing
  Input: psmouse - clean up locking around disable_work_sync()
  Input: psmouse - fix use-after-free during protocol disconnect
  Input: samsung-keypad - use pm_runtime_active guard
  Input: samsung-keypad - keep interrupt disabled while closed
  ...
Commit
1be05c6afbb2c4052d0a13fc91ddcd89aaee9614
Parents
e8bf40d1 · b4d85f86

Merge commit. Changes below are compared with the first parent: e8bf40d1.

Changes

45 files changed · +1901 −762

FileStatusAddDelContent
Documentation/devicetree/bindings/input/focaltech,ft8112.yamlmodified+7−2View file
Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yamlmodified+1−1View file
Documentation/devicetree/bindings/input/imagis,isa1200.yamladded+141−0View file
Documentation/devicetree/bindings/input/microchip,cap11xx.yamlmodified+86−4View file
Documentation/devicetree/bindings/input/syna,rmi4.yamlmodified+8−3View file
Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yamladded+42−0View file
Documentation/devicetree/bindings/input/tps65218-pwrbutton.txtdeleted+0−30View before deletion
drivers/input/input.cmodified+111−61View file
drivers/input/keyboard/Kconfigmodified+0−38View file
drivers/input/keyboard/atkbd.cmodified+0−8View file
drivers/input/keyboard/cap11xx.cmodified+169−106View file
drivers/input/keyboard/charlieplex_keypad.cmodified+3−1View file
drivers/input/keyboard/hpps2atkbd.hdeleted+0−110View before deletion
drivers/input/keyboard/matrix_keypad.cmodified+0−1View file
drivers/input/keyboard/pmic8xxx-keypad.cmodified+1−7View file
drivers/input/keyboard/samsung-keypad.cmodified+17−22View file
drivers/input/keyboard/snvs_pwrkey.cmodified+98−45View file
drivers/input/keyboard/tca8418_keypad.cmodified+2−1View file
drivers/input/misc/Kconfigmodified+12−0View file
drivers/input/misc/Makefilemodified+1−0View file
drivers/input/misc/ims-pcu.cmodified+1−0View file
drivers/input/misc/isa1200.cadded+533−0View file
drivers/input/mouse/elan_i2c.hmodified+2−1View file
drivers/input/mouse/elan_i2c_core.cmodified+23−13View file
drivers/input/mouse/elan_i2c_i2c.cmodified+3−2View file
drivers/input/mouse/elan_i2c_smbus.cmodified+2−1View file
drivers/input/mouse/focaltech.cmodified+8−9View file
drivers/input/mouse/psmouse-base.cmodified+46−44View file
drivers/input/mouse/synaptics.cmodified+1−0View file
drivers/input/mouse/synaptics_i2c.cmodified+1−1View file
drivers/input/rmi4/rmi_f12.cmodified+12−4View file
drivers/input/rmi4/rmi_smbus.cmodified+1−6View file
drivers/input/serio/Kconfigmodified+27−0View file
drivers/input/serio/gscps2.cmodified+145−10View file
drivers/input/serio/i8042-acpipnpio.hmodified+14−13View file
drivers/input/touchscreen/elo.cmodified+2−2View file
drivers/input/touchscreen/inexio.cmodified+3−1View file
drivers/input/touchscreen/iqs5xx.cmodified+2−1View file
drivers/input/touchscreen/mms114.cmodified+165−134View file
drivers/input/touchscreen/sur40.cmodified+2−2View file
drivers/input/touchscreen/wacom_w8001.cmodified+12−5View file
drivers/mfd/rohm-bd71828.cmodified+93−32View file
drivers/mfd/rohm-bd718x7.cmodified+90−33View file
include/linux/input.hmodified+13−7View file
include/linux/input/elan-i2c-ids.hmodified+1−1View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/input/focaltech,ft8112.yaml

View file
diff --git a/Documentation/devicetree/bindings/input/focaltech,ft8112.yaml b/Documentation/devicetree/bindings/input/focaltech,ft8112.yaml
index 197f30b..5ffa124 100644
--- a/Documentation/devicetree/bindings/input/focaltech,ft8112.yaml
+++ b/Documentation/devicetree/bindings/input/focaltech,ft8112.yaml
@@ -18,8 +18,13 @@ allOf:
properties:
compatible:
- enum:
- - focaltech,ft8112
+ oneOf:
+ - items:
+ - enum:
+ - focaltech,ft3d81
+ - const: focaltech,ft8112
+ - enum:
+ - focaltech,ft8112
reg:
maxItems: 1

Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml

View file
diff --git a/Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml b/Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml
index c085de6..c6842c0 100644
--- a/Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml
@@ -11,7 +11,7 @@ maintainers:
- Hugo Villeneuve <[email protected]>
description: |
- The charlieplex keypad supports N^2)-N different key combinations (where N is
+ The charlieplex keypad supports (N^2)-N different key combinations (where N is
the number of I/O lines). Key presses and releases are detected by configuring
only one line as output at a time, and reading other line states. This process
is repeated for each line. Diodes are required to ensure current flows in only

Documentation/devicetree/bindings/input/imagis,isa1200.yaml

View file
diff --git a/Documentation/devicetree/bindings/input/imagis,isa1200.yaml b/Documentation/devicetree/bindings/input/imagis,isa1200.yaml
new file mode 100644
index 0000000..4bc8630
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/imagis,isa1200.yaml
@@ -0,0 +1,141 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/imagis,isa1200.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Imagis ISA1200 haptic motor driver
+
+maintainers:
+ - Svyatoslav Ryhel <[email protected]>
+ - Linus Walleij <[email protected]>
+
+description:
+ The ISA1200 is a high-performance enhanced haptic motor driver designed
+ for mobile hand-held devices. It supports various voltages for both ERM
+ (Eccentric Rotating Mass) and LRA (Linear Resonant Actuator) type
+ actuators. Thanks to an embedded LDO, battery power can be used directly
+ in handheld applications.
+
+properties:
+ compatible:
+ const: imagis,isa1200
+
+ reg:
+ maxItems: 1
+
+ control-gpios:
+ description:
+ One or two GPIOs flagged as active high linked to HEN and LEN pins
+ minItems: 1
+ maxItems: 2
+
+ clocks:
+ maxItems: 1
+
+ pwms:
+ maxItems: 1
+
+ vdd-supply:
+ description:
+ Regulator for 2.4V - 5.5V power supply
+
+ vddp-supply:
+ description:
+ Regulator for 2.4V - 3.6V IO power supply
+
+ imagis,clk-div:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Divider for the external input clock/PWM
+ enum: [128, 256, 512, 1024]
+ default: 128
+
+ imagis,pll-div:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Divider for the internal PLL clock
+ minimum: 1
+ maximum: 15
+ default: 1
+
+ imagis,mode:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Defines the motor type isa1200 drives
+ 0 - LRA (Linear Resonant Actuator)
+ 1 - ERM (Eccentric Rotating Mass)
+ enum: [0, 1]
+ default: 0
+
+ imagis,period-ns:
+ description:
+ Period of the internal PWM channel in nanoseconds.
+ minimum: 10000
+ maximum: 30000
+
+ imagis,duty-cycle-ns:
+ description:
+ Duty cycle of the external/internal PWM channel in nanoseconds,
+ defaults to 50% of the channel's period
+
+ ldo:
+ $ref: /schemas/regulator/regulator.yaml#
+ type: object
+ description:
+ Embedded LDO regulator with voltage range 2.3V - 3.8V
+ unevaluatedProperties: false
+
+ required:
+ - regulator-min-microvolt
+ - regulator-max-microvolt
+
+required:
+ - compatible
+ - reg
+ - ldo
+
+oneOf:
+ - required:
+ - clocks
+ - imagis,period-ns
+ - required:
+ - pwms
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ haptic-engine@49 {
+ compatible = "imagis,isa1200";
+ reg = <0x49>;
+
+ clocks = <&isa1200_refclk>;
+
+ control-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>,
+ <&gpio 23 GPIO_ACTIVE_HIGH>;
+
+ vdd-supply = <&vdd_3v3_vbat>;
+ vddp-supply = <&vdd_2v8_vvib>;
+
+ imagis,clk-div = <256>;
+ imagis,pll-div = <2>;
+
+ imagis,mode = <0>; /* LRA_MODE */
+
+ imagis,period-ns = <13400>;
+ imagis,duty-cycle-ns = <100>;
+
+ ldo {
+ regulator-name = "vdd_vib";
+ regulator-min-microvolt = <2300000>;
+ regulator-max-microvolt = <2300000>;
+ };
+ };
+ };

Documentation/devicetree/bindings/input/microchip,cap11xx.yaml

View file
diff --git a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
index 2d76219..983f470 100644
--- a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
+++ b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
@@ -10,6 +10,16 @@ description: |
The Microchip CAP1xxx Family of RightTouchTM multiple-channel capacitive
touch controllers and LED drivers. The device communication via I2C only.
+ For more product information please see the links below:
+ CAP1106: https://ww1.microchip.com/downloads/en/DeviceDoc/00001624B.pdf
+ CAP1114: https://ww1.microchip.com/downloads/en/DeviceDoc/00002444A.pdf
+ CAP1126: https://ww1.microchip.com/downloads/en/DeviceDoc/00001623B.pdf
+ CAP1188: https://ww1.microchip.com/downloads/en/DeviceDoc/00001620C.pdf
+ CAP1203: https://ww1.microchip.com/downloads/en/DeviceDoc/00001572B.pdf
+ CAP1206: https://ww1.microchip.com/downloads/en/DeviceDoc/00001567B.pdf
+ CAP1293: https://ww1.microchip.com/downloads/en/DeviceDoc/00001566B.pdf
+ CAP1298: https://ww1.microchip.com/downloads/en/DeviceDoc/00001571B.pdf
+
maintainers:
- Rob Herring <[email protected]>
@@ -17,6 +27,7 @@ properties:
compatible:
enum:
- microchip,cap1106
+ - microchip,cap1114
- microchip,cap1126
- microchip,cap1188
- microchip,cap1203
@@ -40,13 +51,20 @@ properties:
device's ALERT#/CM_IRQ# pin is connected to.
The device only has one interrupt source.
+ reset-gpios:
+ description: |
+ GPIO connected to the active-high RESET pin of the chip;
+ driving it high asserts reset and deep sleep, while driving
+ it low releases reset for normal operation.
+ maxItems: 1
+
autorepeat:
description: |
Enables the Linux input system's autorepeat feature on the input device.
linux,keycodes:
minItems: 3
- maxItems: 8
+ maxItems: 14
description: |
Specifies an array of numeric keycode values to
be used for the channels. If this property is
@@ -106,6 +124,8 @@ properties:
is required for a touch to be registered, making the touch sensor less
sensitive.
The number of entries must correspond to the number of channels.
+ CAP1114 is an exception where channels 8~14 reuse the eighth entry's
+ threshold, so counts differ.
microchip,calib-sensitivity:
$ref: /schemas/types.yaml#/definitions/uint32-array
@@ -124,14 +144,16 @@ properties:
The number of entries must correspond to the number of channels.
patternProperties:
- "^led@[0-7]$":
+ "^led@[0-9a]$":
type: object
description: CAP11xx LEDs
$ref: /schemas/leds/common.yaml#
properties:
reg:
- enum: [0, 1, 2, 3, 4, 5, 6, 7]
+ description: LED channel number
+ minimum: 0
+ maximum: 10
label: true
@@ -157,8 +179,63 @@ allOf:
- microchip,cap1293
- microchip,cap1298
then:
+ properties:
+ reset-gpios: false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - microchip,cap1114
+ then:
+ properties:
+ linux,keycodes:
+ minItems: 14
+ else:
+ properties:
+ linux,keycodes:
+ maxItems: 8
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - microchip,cap1106
+ - microchip,cap1203
+ - microchip,cap1206
+ - microchip,cap1293
+ - microchip,cap1298
+ then:
+ patternProperties:
+ "^led@": false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - microchip,cap1126
+ then:
patternProperties:
- "^led@[0-7]$": false
+ "^led@":
+ properties:
+ reg:
+ maximum: 1
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - microchip,cap1188
+ then:
+ patternProperties:
+ "^led@":
+ properties:
+ reg:
+ maximum: 7
- if:
properties:
@@ -166,6 +243,7 @@ allOf:
contains:
enum:
- microchip,cap1106
+ - microchip,cap1114
- microchip,cap1126
- microchip,cap1188
- microchip,cap1203
@@ -183,6 +261,8 @@ additionalProperties: false
examples:
- |
+ #include <dt-bindings/gpio/gpio.h>
+
i2c {
#address-cells = <1>;
#size-cells = <0>;
@@ -204,6 +284,8 @@ examples:
<109>, /* KEY_PAGEDOWN */
<104>; /* KEY_PAGEUP */
+ reset-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+
#address-cells = <1>;
#size-cells = <0>;

Documentation/devicetree/bindings/input/syna,rmi4.yaml

View file
diff --git a/Documentation/devicetree/bindings/input/syna,rmi4.yaml b/Documentation/devicetree/bindings/input/syna,rmi4.yaml
index 8685ef4..fb4804a 100644
--- a/Documentation/devicetree/bindings/input/syna,rmi4.yaml
+++ b/Documentation/devicetree/bindings/input/syna,rmi4.yaml
@@ -18,9 +18,14 @@ description: |
properties:
compatible:
- enum:
- - syna,rmi4-i2c
- - syna,rmi4-spi
+ oneOf:
+ - enum:
+ - syna,rmi4-i2c
+ - syna,rmi4-spi
+ - items:
+ - enum:
+ - syna,rmi4-s3706b # OnePlus 6/6T
+ - const: syna,rmi4-i2c
reg:
maxItems: 1

Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml

View file
diff --git a/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml b/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml
new file mode 100644
index 0000000..3526d8b
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/ti,tps65217-pwrbutton.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TPS65217 and TPS65218 Power Button
+
+maintainers:
+ - Eduard Bostina <[email protected]>
+
+description:
+ This module is part of the TPS65217/TPS65218 PMIC. It provides a simple
+ power button event via an interrupt.
+
+properties:
+ compatible:
+ enum:
+ - ti,tps65217-pwrbutton
+ - ti,tps65218-pwrbutton
+
+ interrupts:
+ maxItems: 1
+
+required:
+ - compatible
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ pmic {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ power-button {
+ compatible = "ti,tps65218-pwrbutton";
+ interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
+ };
+ };

Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt

View before deletion
diff --git a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
deleted file mode 100644
index 8682ab6..0000000
--- a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Texas Instruments TPS65217 and TPS65218 power button
-
-This module is part of the TPS65217/TPS65218. For more details about the whole
-TPS65217 chip see Documentation/devicetree/bindings/regulator/tps65217.txt.
-
-This driver provides a simple power button event via an Interrupt.
-
-Required properties:
-- compatible: should be "ti,tps65217-pwrbutton" or "ti,tps65218-pwrbutton"
-
-Required properties:
-- interrupts: should be one of the following
- - <2>: For controllers compatible with tps65217
- - <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218
-
-Examples:
-
-&tps {
- tps65217-pwrbutton {
- compatible = "ti,tps65217-pwrbutton";
- interrupts = <2>;
- };
-};
-
-&tps {
- power-button {
- compatible = "ti,tps65218-pwrbutton";
- interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
- };
-};

drivers/input/input.c

View file
diff --git a/drivers/input/input.c b/drivers/input/input.c
index cf6fece..78c10ee 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -318,7 +318,7 @@ static int input_get_disposition(struct input_dev *dev,
static void input_event_dispose(struct input_dev *dev, int disposition,
unsigned int type, unsigned int code, int value)
{
- if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event)
+ if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event && dev->ready)
dev->event(dev, type, code, value);
if (disposition & INPUT_PASS_TO_HANDLERS) {
@@ -568,6 +568,75 @@ void input_release_device(struct input_handle *handle)
}
EXPORT_SYMBOL(input_release_device);
+#define INPUT_DO_TOGGLE(dev, type, bits, on) \
+ do { \
+ int i; \
+ bool active; \
+ \
+ if (!test_bit(EV_##type, dev->evbit)) \
+ break; \
+ \
+ for_each_set_bit(i, dev->bits##bit, type##_CNT) { \
+ active = test_bit(i, dev->bits); \
+ if (!active && !on) \
+ continue; \
+ \
+ dev->event(dev, EV_##type, i, on ? active : 0); \
+ } \
+ } while (0)
+
+/*
+ * Iterate through the logical state of the input device (LEDs, sounds,
+ * auto-repeat) and explicitly push that state down to the hardware
+ * via dev->event() to match the current logical state (if activate is true),
+ * or forcibly turn off all feedback like LEDs and sounds during teardown
+ * or suspend (if activate is false).
+ *
+ * Primarily used as a state-replay mechanism after a device is opened
+ * or uninhibited, as events might have been dropped by the core while the
+ * hardware was not marked as ready.
+ */
+static void input_dev_toggle(struct input_dev *dev, bool activate)
+{
+ if (!dev->event || !dev->ready)
+ return;
+
+ INPUT_DO_TOGGLE(dev, LED, led, activate);
+ INPUT_DO_TOGGLE(dev, SND, snd, activate);
+
+ if (activate && test_bit(EV_REP, dev->evbit)) {
+ dev->event(dev, EV_REP, REP_PERIOD, dev->rep[REP_PERIOD]);
+ dev->event(dev, EV_REP, REP_DELAY, dev->rep[REP_DELAY]);
+ }
+}
+
+static int input_start_device(struct input_dev *dev)
+{
+ int error;
+
+ lockdep_assert_held(&dev->mutex);
+
+ if (dev->users++ == 0 && !dev->inhibited) {
+ if (dev->open) {
+ error = dev->open(dev);
+ if (error) {
+ dev->users--;
+ return error;
+ }
+ }
+
+ scoped_guard(spinlock_irq, &dev->event_lock) {
+ dev->ready = true;
+ input_dev_toggle(dev, true);
+ }
+
+ if (dev->poller)
+ input_dev_poller_start(dev->poller);
+ }
+
+ return 0;
+}
+
/**
* input_open_device - open input device
* @handle: handle through which device is being accessed
@@ -586,21 +655,9 @@ int input_open_device(struct input_handle *handle)
handle->open++;
- if (handle->handler->passive_observer)
- return 0;
-
- if (dev->users++ || dev->inhibited) {
- /*
- * Device is already opened and/or inhibited,
- * so we can exit immediately and report success.
- */
- return 0;
- }
-
- if (dev->open) {
- error = dev->open(dev);
+ if (!handle->handler->passive_observer) {
+ error = input_start_device(dev);
if (error) {
- dev->users--;
handle->open--;
/*
* Make sure we are not delivering any more
@@ -611,8 +668,8 @@ int input_open_device(struct input_handle *handle)
}
}
- if (dev->poller)
- input_dev_poller_start(dev->poller);
+ if (handle->open == 1 && handle->handler->start)
+ handle->handler->start(handle);
}
return 0;
@@ -651,6 +708,12 @@ void input_close_device(struct input_handle *handle)
if (!--dev->users && !dev->inhibited) {
if (dev->poller)
input_dev_poller_stop(dev->poller);
+
+ scoped_guard(spinlock_irq, &dev->event_lock) {
+ input_dev_toggle(dev, false);
+ dev->ready = false;
+ }
+
if (dev->close)
dev->close(dev);
}
@@ -1702,37 +1765,6 @@ static int input_dev_uevent(const struct device *device, struct kobj_uevent_env
return 0;
}
-#define INPUT_DO_TOGGLE(dev, type, bits, on) \
- do { \
- int i; \

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/atkbd.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/cap11xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/charlieplex_keypad.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/hpps2atkbd.h

View before deletion

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/matrix_keypad.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/pmic8xxx-keypad.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/samsung-keypad.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/snvs_pwrkey.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/keyboard/tca8418_keypad.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/misc/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/input/misc/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/input/misc/ims-pcu.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/misc/isa1200.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/elan_i2c.h

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/elan_i2c_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/elan_i2c_i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/elan_i2c_smbus.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/focaltech.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/psmouse-base.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/synaptics.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/mouse/synaptics_i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/rmi4/rmi_f12.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/rmi4/rmi_smbus.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/serio/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/input/serio/gscps2.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/serio/i8042-acpipnpio.h

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/elo.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/inexio.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/iqs5xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/mms114.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/sur40.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/wacom_w8001.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/rohm-bd71828.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/rohm-bd718x7.c

View file

This diff is incomplete. Download the complete patch.

include/linux/input.h

View file

This diff is incomplete. Download the complete patch.

include/linux/input/elan-i2c-ids.h

View file

This diff is incomplete. Download the complete patch.