Skip to content

Commit e161101

Browse files
committed
Merge tag 'input-for-v7.2-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - A new driver for Wacom W9000-series penabled touchscreens - Updates to STM FTS driver adding support for reset line and preparing the driver for STMFTS5 support - Updates to RMI4 and IMS PCU drivers hardening the code - Support for half-duplex mode restored in ADS7846 driver - Updates to driver's device_id tables to use named initializers - Removal of no longer used PCAP keys and touchscreen drivers (support for the ezx series of phones was removed in 2022) - Removal of xilinx_ps2 driver which is no longer used either - Updates to userio to allow setting up additional serio port characteristics (such as id, extra and proto) - Assorted hardening and cleanup fixes for other drivers * tag 'input-for-v7.2-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (72 commits) Input: mms114 - fix touch indexing for MMS134S and MMS136 Input: elan_i2c - prevent division by zero and arithmetic underflow Input: stop force-feedback timer when unregistering input devices Input: iforce - bound the device-reported force-feedback effect index Input: goodix - clamp the device-reported contact count Input: mms114 - reject an oversized device packet size Input: touchwin - reset the packet index on every complete packet Input: rmi4 - update formatting in F12 Input: rmi4 - propagate proper error code in F12 sensor tuning Input: rmi4 - simplify size calculations in F12 Input: rmi4 - use sizeof(*ptr) and idiomatic checks in f12 allocators Input: rmi4 - use devm_kmalloc for F12 data packet buffer Input: rmi4 - use flexible array member for IRQ masks in F12 Input: rmi4 - use unaligned access helpers in F12 Input: rmi4 - change reg_size type to u32 Input: rmi4 - refactor F12 probe function Input: rmi4 - use kzalloc_flex() for struct rmi_function Input: rmi4 - refactor function allocation and registration Input: rmi4 - use local presence map in rmi_read_register_desc() Input: rmi4 - fix limit in rmi_register_desc_has_subpacket() ...
2 parents f0e6f20 + 7a0e692 commit e161101

110 files changed

Lines changed: 1673 additions & 1501 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/input/touchscreen/st,stmfts.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ properties:
4040
vdd-supply:
4141
description: Power supply
4242

43+
reset-gpios:
44+
description: Reset GPIO (active-low)
45+
maxItems: 1
46+
4347
required:
4448
- compatible
4549
- reg
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/input/touchscreen/wacom,w9007a-lt03.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Wacom W9000-series penabled I2C touchscreen
8+
9+
maintainers:
10+
- Hendrik Noack <hendrik-noack@gmx.de>
11+
12+
description: |
13+
The W9000-series are penabled touchscreen controllers by Wacom.
14+
15+
The firmware of controllers in different devices may differ. This can also
16+
affect the controller's behavior.
17+
18+
allOf:
19+
- $ref: touchscreen.yaml#
20+
21+
properties:
22+
compatible:
23+
enum:
24+
- wacom,w9002
25+
- wacom,w9007a-lt03
26+
- wacom,w9007a-v1
27+
28+
reg:
29+
maxItems: 1
30+
31+
interrupts:
32+
maxItems: 1
33+
34+
vdd-supply: true
35+
36+
flash-mode-gpios:
37+
maxItems: 1
38+
39+
reset-gpios:
40+
maxItems: 1
41+
42+
required:
43+
- compatible
44+
- reg
45+
- interrupts
46+
47+
unevaluatedProperties: false
48+
49+
examples:
50+
- |
51+
#include <dt-bindings/gpio/gpio.h>
52+
#include <dt-bindings/interrupt-controller/irq.h>
53+
54+
i2c {
55+
#address-cells = <1>;
56+
#size-cells = <0>;
57+
58+
digitizer@56 {
59+
compatible = "wacom,w9007a-lt03";
60+
reg = <0x56>;
61+
interrupt-parent = <&gpd1>;
62+
interrupts = <1 IRQ_TYPE_EDGE_RISING>;
63+
64+
vdd-supply = <&stylus_reg>;
65+
66+
flash-mode-gpios = <&gpd1 3 GPIO_ACTIVE_HIGH>;
67+
reset-gpios = <&gpx0 1 GPIO_ACTIVE_LOW>;
68+
69+
touchscreen-x-mm = <216>;
70+
touchscreen-y-mm = <135>;
71+
touchscreen-inverted-x;
72+
};
73+
};

Documentation/input/userio.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The userio Protocol
55
===================
66

77

8-
:Copyright: |copy| 2015 Stephen Chandler Paul <thatslyude@gmail.com>
8+
:Copyright: |copy| 2015 Lyude Paul <thatslyude@gmail.com>
99

1010
Sponsored by Red Hat
1111

@@ -66,8 +66,27 @@ USERIO_CMD_SET_PORT_TYPE
6666
~~~~~~~~~~~~~~~~~~~~~~~~
6767

6868
Sets the type of port we're emulating, where ``data`` is the port type being
69-
set. Can be any of the macros from <linux/serio.h>. For example: SERIO_8042
70-
would set the port type to be a normal PS/2 port.
69+
set. Can be any of the serio type macros from <linux/serio.h>. For example:
70+
SERIO_8042 would set the port type to be a normal PS/2 port.
71+
72+
USERIO_CMD_SET_PORT_PROTO
73+
~~~~~~~~~~~~~~~~~~~~~~~~~
74+
75+
Sets the protocol of port we're emulating, where ``data`` is the protocol being
76+
set. Can be any of the serio proto macros from <linux/serio.h>. For example:
77+
SERIO_IFORCE would set the port type to be an I-Force serial joystick.
78+
79+
USERIO_CMD_SET_PORT_ID
80+
~~~~~~~~~~~~~~~~~~~~~~
81+
82+
Sets the ``id`` value on the identification of port we're emulating, where
83+
``data`` is the value being set.
84+
85+
USERIO_CMD_SET_PORT_EXTRA
86+
~~~~~~~~~~~~~~~~~~~~~~~~~
87+
88+
Sets the ``extra`` value on the identification of port we're emulating, where
89+
``data`` is the value being set.
7190

7291
USERIO_CMD_SEND_INTERRUPT
7392
~~~~~~~~~~~~~~~~~~~~~~~~~

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28731,7 +28731,7 @@ F: sound/drivers/pcmtest.c
2873128731
F: tools/testing/selftests/alsa/test-pcmtest-driver.c
2873228732

2873328733
VIRTUAL SERIO DEVICE DRIVER
28734-
M: Stephen Chandler Paul <thatslyude@gmail.com>
28734+
M: Lyude Paul <thatslyude@gmail.com>
2873528735
S: Maintained
2873628736
F: drivers/input/serio/userio.c
2873728737
F: include/uapi/linux/userio.h

drivers/input/ff-memless.c

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,17 +484,31 @@ static void ml_ff_destroy(struct ff_device *ff)
484484
struct ml_device *ml = ff->private;
485485

486486
/*
487-
* Even though we stop all playing effects when tearing down
488-
* an input device (via input_device_flush() that calls into
489-
* input_ff_flush() that stops and erases all effects), we
490-
* do not actually stop the timer, and therefore we should
491-
* do it here.
487+
* The timer is normally shut down in ml_ff_stop() when the device
488+
* is unregistered. However, we still shut it down here as a safety
489+
* net and for cases where the device was never registered (e.g.
490+
* error paths during probe).
492491
*/
493-
timer_delete_sync(&ml->timer);
492+
timer_shutdown_sync(&ml->timer);
494493

495494
kfree(ml->private);
496495
}
497496

497+
static void ml_ff_stop(struct ff_device *ff)
498+
{
499+
struct ml_device *ml = ff->private;
500+
501+
/*
502+
* Even though we stop all playing effects when tearing down an
503+
* input device (by the way of evdev calling input_flush_device()
504+
* that calls into input_ff_flush() that stops and erases all
505+
* effects), we do not actually shutdown the timer, and therefore
506+
* we should do it here to prevent it firing after the input
507+
* device is unregistered and its associated resources are freed.
508+
*/
509+
timer_shutdown_sync(&ml->timer);
510+
}
511+
498512
/**
499513
* input_ff_create_memless() - create memoryless force-feedback device
500514
* @dev: input device supporting force-feedback
@@ -529,6 +543,7 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
529543
ff->playback = ml_ff_playback;
530544
ff->set_gain = ml_ff_set_gain;
531545
ff->destroy = ml_ff_destroy;
546+
ff->stop = ml_ff_stop;
532547

533548
/* we can emulate periodic effects with RUMBLE */
534549
if (test_bit(FF_RUMBLE, ff->ffbit)) {

drivers/input/gameport/ns558.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -148,29 +148,29 @@ static int ns558_isa_probe(int io)
148148
#ifdef CONFIG_PNP
149149

150150
static const struct pnp_device_id pnp_devids[] = {
151-
{ .id = "@P@0001", .driver_data = 0 }, /* ALS 100 */
152-
{ .id = "@P@0020", .driver_data = 0 }, /* ALS 200 */
153-
{ .id = "@P@1001", .driver_data = 0 }, /* ALS 100+ */
154-
{ .id = "@P@2001", .driver_data = 0 }, /* ALS 120 */
155-
{ .id = "ASB16fd", .driver_data = 0 }, /* AdLib NSC16 */
156-
{ .id = "AZT3001", .driver_data = 0 }, /* AZT1008 */
157-
{ .id = "CDC0001", .driver_data = 0 }, /* Opl3-SAx */
158-
{ .id = "CSC0001", .driver_data = 0 }, /* CS4232 */
159-
{ .id = "CSC000f", .driver_data = 0 }, /* CS4236 */
160-
{ .id = "CSC0101", .driver_data = 0 }, /* CS4327 */
161-
{ .id = "CTL7001", .driver_data = 0 }, /* SB16 */
162-
{ .id = "CTL7002", .driver_data = 0 }, /* AWE64 */
163-
{ .id = "CTL7005", .driver_data = 0 }, /* Vibra16 */
164-
{ .id = "ENS2020", .driver_data = 0 }, /* SoundscapeVIVO */
165-
{ .id = "ESS0001", .driver_data = 0 }, /* ES1869 */
166-
{ .id = "ESS0005", .driver_data = 0 }, /* ES1878 */
167-
{ .id = "ESS6880", .driver_data = 0 }, /* ES688 */
168-
{ .id = "IBM0012", .driver_data = 0 }, /* CS4232 */
169-
{ .id = "OPT0001", .driver_data = 0 }, /* OPTi Audio16 */
170-
{ .id = "YMH0006", .driver_data = 0 }, /* Opl3-SA */
171-
{ .id = "YMH0022", .driver_data = 0 }, /* Opl3-SAx */
172-
{ .id = "PNPb02f", .driver_data = 0 }, /* Generic */
173-
{ .id = "", },
151+
{ .id = "@P@0001" }, /* ALS 100 */
152+
{ .id = "@P@0020" }, /* ALS 200 */
153+
{ .id = "@P@1001" }, /* ALS 100+ */
154+
{ .id = "@P@2001" }, /* ALS 120 */
155+
{ .id = "ASB16fd" }, /* AdLib NSC16 */
156+
{ .id = "AZT3001" }, /* AZT1008 */
157+
{ .id = "CDC0001" }, /* Opl3-SAx */
158+
{ .id = "CSC0001" }, /* CS4232 */
159+
{ .id = "CSC000f" }, /* CS4236 */
160+
{ .id = "CSC0101" }, /* CS4327 */
161+
{ .id = "CTL7001" }, /* SB16 */
162+
{ .id = "CTL7002" }, /* AWE64 */
163+
{ .id = "CTL7005" }, /* Vibra16 */
164+
{ .id = "ENS2020" }, /* SoundscapeVIVO */
165+
{ .id = "ESS0001" }, /* ES1869 */
166+
{ .id = "ESS0005" }, /* ES1878 */
167+
{ .id = "ESS6880" }, /* ES688 */
168+
{ .id = "IBM0012" }, /* CS4232 */
169+
{ .id = "OPT0001" }, /* OPTi Audio16 */
170+
{ .id = "YMH0006" }, /* Opl3-SA */
171+
{ .id = "YMH0022" }, /* Opl3-SAx */
172+
{ .id = "PNPb02f" }, /* Generic */
173+
{ }
174174
};
175175

176176
MODULE_DEVICE_TABLE(pnp, pnp_devids);

drivers/input/input.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,9 @@ static void __input_unregister_device(struct input_dev *dev)
22122212
input_wakeup_procfs_readers();
22132213
}
22142214

2215+
if (dev->ff && dev->ff->stop)
2216+
dev->ff->stop(dev->ff);
2217+
22152218
device_del(&dev->dev);
22162219
}
22172220

drivers/input/joystick/adafruit-seesaw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static int seesaw_probe(struct i2c_client *client)
304304
}
305305

306306
static const struct i2c_device_id seesaw_id_table[] = {
307-
{ SEESAW_DEVICE_NAME },
307+
{ .name = SEESAW_DEVICE_NAME },
308308
{ /* Sentinel */ }
309309
};
310310
MODULE_DEVICE_TABLE(i2c, seesaw_id_table);

drivers/input/joystick/as5011.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static void as5011_remove(struct i2c_client *client)
337337
}
338338

339339
static const struct i2c_device_id as5011_id[] = {
340-
{ MODULE_DEVICE_ALIAS },
340+
{ .name = MODULE_DEVICE_ALIAS },
341341
{ }
342342
};
343343
MODULE_DEVICE_TABLE(i2c, as5011_id);

drivers/input/joystick/iforce/iforce-packets.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,18 @@ void iforce_process_packet(struct iforce *iforce,
186186

187187
/* Check if an effect was just started or stopped */
188188
i = data[1] & 0x7f;
189-
if (data[1] & 0x80) {
190-
if (!test_and_set_bit(FF_CORE_IS_PLAYED, iforce->core_effects[i].flags)) {
191-
/* Report play event */
192-
input_report_ff_status(dev, i, FF_STATUS_PLAYING);
189+
if (i < IFORCE_EFFECTS_MAX) {
190+
if (data[1] & 0x80) {
191+
if (!test_and_set_bit(FF_CORE_IS_PLAYED,
192+
iforce->core_effects[i].flags)) {
193+
/* Report play event */
194+
input_report_ff_status(dev, i, FF_STATUS_PLAYING);
195+
}
196+
} else if (test_and_clear_bit(FF_CORE_IS_PLAYED,
197+
iforce->core_effects[i].flags)) {
198+
/* Report stop event */
199+
input_report_ff_status(dev, i, FF_STATUS_STOPPED);
193200
}
194-
} else if (test_and_clear_bit(FF_CORE_IS_PLAYED, iforce->core_effects[i].flags)) {
195-
/* Report stop event */
196-
input_report_ff_status(dev, i, FF_STATUS_STOPPED);
197201
}
198202

199203
for (j = 3; j < len; j += 2)

0 commit comments

Comments
 (0)