Skip to content

Commit bd7e8c9

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - a new driver for ADC driven joysticks - a new Zintix touchscreen driver - enhancements to Intel SoC button array driver - support for F3A "function" in Synaptics RMI4 driver - assorted driver fixups * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (29 commits) Input: Add MAINTAINERS entry for SiS i2c touch input driver Input: evdev - per-client waitgroups Input: synaptics - enable InterTouch for ThinkPad T14 Gen 1 Input: synaptics - enable InterTouch for ThinkPad P1/X1E gen 2 Input: synaptics-rmi4 - support bootloader v8 in f34v7 Input: synaptics-rmi4 - add support for F3A Input: synaptics-rmi4 - rename f30_data to gpio_data Input: add zinitix touchscreen driver dt-bindings: input/touchscreen: add bindings for zinitix Input: joystick - add ADC attached joystick driver. dt-bindings: input: Add docs for ADC driven joystick Input: sun4i-ps2 - fix handling of platform_get_irq() error Input: twl4030_keypad - fix handling of platform_get_irq() error Input: omap4-keypad - fix handling of platform_get_irq() error Input: ep93xx_keypad - fix handling of platform_get_irq() error Input: stmfts - fix a & vs && typo Input: imx6ul_tsc - unify open/close and PM paths Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume() Input: elants_i2c - fix typo for an attribute to show calibration count Input: elants_i2c - report resolution of ABS_MT_TOUCH_MAJOR by FW information. ...
2 parents 40a03b7 + bb0bc0c commit bd7e8c9

33 files changed

Lines changed: 1531 additions & 171 deletions
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
# Copyright 2019-2020 Artur Rojek
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/input/adc-joystick.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: ADC attached joystick
9+
10+
maintainers:
11+
- Artur Rojek <contact@artur-rojek.eu>
12+
13+
description: >
14+
Bindings for joystick devices connected to ADC controllers supporting
15+
the Industrial I/O subsystem.
16+
17+
properties:
18+
compatible:
19+
const: adc-joystick
20+
21+
io-channels:
22+
minItems: 1
23+
maxItems: 1024
24+
description: >
25+
List of phandle and IIO specifier pairs.
26+
Each pair defines one ADC channel to which a joystick axis is connected.
27+
See Documentation/devicetree/bindings/iio/iio-bindings.txt for details.
28+
29+
'#address-cells':
30+
const: 1
31+
32+
'#size-cells':
33+
const: 0
34+
35+
required:
36+
- compatible
37+
- io-channels
38+
- '#address-cells'
39+
- '#size-cells'
40+
41+
additionalProperties: false
42+
43+
patternProperties:
44+
"^axis@[0-9a-f]+$":
45+
type: object
46+
description: >
47+
Represents a joystick axis bound to the given ADC channel.
48+
For each entry in the io-channels list, one axis subnode with a matching
49+
reg property must be specified.
50+
51+
properties:
52+
reg:
53+
minimum: 0
54+
maximum: 1023
55+
description: Index of an io-channels list entry bound to this axis.
56+
57+
linux,code:
58+
$ref: /schemas/types.yaml#/definitions/uint32
59+
description: EV_ABS specific event code generated by the axis.
60+
61+
abs-range:
62+
allOf:
63+
- $ref: /schemas/types.yaml#/definitions/uint32-array
64+
- items:
65+
- description: minimum value
66+
- description: maximum value
67+
description: >
68+
Minimum and maximum values produced by the axis.
69+
For an ABS_X axis this will be the left-most and right-most
70+
inclination of the joystick. If min > max, it is left to userspace to
71+
treat the axis as inverted.
72+
This property is interpreted as two signed 32 bit values.
73+
74+
abs-fuzz:
75+
$ref: /schemas/types.yaml#/definitions/uint32
76+
description: >
77+
Amount of noise in the input value.
78+
Omitting this property indicates the axis is precise.
79+
80+
abs-flat:
81+
$ref: /schemas/types.yaml#/definitions/uint32
82+
description: >
83+
Axial "deadzone", or area around the center position, where the axis
84+
is considered to be at rest.
85+
Omitting this property indicates the axis always returns to exactly
86+
the center position.
87+
88+
required:
89+
- reg
90+
- linux,code
91+
- abs-range
92+
93+
additionalProperties: false
94+
95+
examples:
96+
- |
97+
#include <dt-bindings/iio/adc/ingenic,adc.h>
98+
#include <dt-bindings/input/input.h>
99+
100+
joystick: adc-joystick {
101+
compatible = "adc-joystick";
102+
io-channels = <&adc INGENIC_ADC_TOUCH_XP>,
103+
<&adc INGENIC_ADC_TOUCH_YP>;
104+
#address-cells = <1>;
105+
#size-cells = <0>;
106+
107+
axis@0 {
108+
reg = <0>;
109+
linux,code = <ABS_X>;
110+
abs-range = <3300 0>;
111+
abs-fuzz = <4>;
112+
abs-flat = <200>;
113+
};
114+
axis@1 {
115+
reg = <1>;
116+
linux,code = <ABS_Y>;
117+
abs-range = <0 3300>;
118+
abs-fuzz = <4>;
119+
abs-flat = <200>;
120+
};
121+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Device tree bindings for Zinitx BT541 touchscreen controller
2+
3+
Required properties:
4+
5+
- compatible : Should be "zinitix,bt541"
6+
- reg : I2C address of the chip. Should be 0x20
7+
- interrupts : Interrupt to which the chip is connected
8+
9+
Optional properties:
10+
11+
- vdd-supply : Analog power supply regulator on VCCA pin
12+
- vddo-supply : Digital power supply regulator on VDD pin
13+
- zinitix,mode : Mode of reporting touch points. Some modes may not work
14+
with a particular ts firmware for unknown reasons. Available
15+
modes are 1 and 2. Mode 2 is the default and preferred.
16+
17+
The touchscreen-* properties are documented in touchscreen.txt in this
18+
directory.
19+
20+
Example:
21+
22+
i2c@00000000 {
23+
/* ... */
24+
25+
bt541@20 {
26+
compatible = "zinitix,bt541";
27+
reg = <0x20>;
28+
interrupt-parent = <&msmgpio>;
29+
interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
30+
pinctrl-names = "default";
31+
pinctrl-0 = <&tsp_default>;
32+
vdd-supply = <&reg_vdd_tsp>;
33+
vddo-supply = <&pm8916_l6>;
34+
touchscreen-size-x = <540>;
35+
touchscreen-size-y = <960>;
36+
zinitix,mode = <2>;
37+
};
38+
39+
/* ... */
40+
};

Documentation/devicetree/bindings/vendor-prefixes.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,8 @@ patternProperties:
12221222
description: Shenzhen Zidoo Technology Co., Ltd.
12231223
"^zii,.*":
12241224
description: Zodiac Inflight Innovations
1225+
"^zinitix,.*":
1226+
description: Zinitix Co., Ltd
12251227
"^zte,.*":
12261228
description: ZTE Corp.
12271229
"^zyxel,.*":

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16044,6 +16044,13 @@ F: Documentation/fb/sisfb.rst
1604416044
F: drivers/video/fbdev/sis/
1604516045
F: include/video/sisfb.h
1604616046

16047+
SIS I2C TOUCHSCREEN DRIVER
16048+
M: Mika Penttilä <mika.penttila@nextfour.com>
16049+
L: linux-input@vger.kernel.org
16050+
S: Maintained
16051+
F: Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt
16052+
F: drivers/input/touchscreen/sis_i2c.c
16053+
1604716054
SIS USB2VGA DRIVER
1604816055
M: Thomas Winischhofer <thomas@winischhofer.net>
1604916056
S: Maintained

drivers/hid/hid-rmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
720720
}
721721

722722
if (data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)
723-
rmi_hid_pdata.f30_data.disable = true;
723+
rmi_hid_pdata.gpio_data.disable = true;
724724

725725
data->xport.dev = hdev->dev.parent;
726726
data->xport.pdata = rmi_hid_pdata;

drivers/input/evdev.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
struct evdev {
2929
int open;
3030
struct input_handle handle;
31-
wait_queue_head_t wait;
3231
struct evdev_client __rcu *grab;
3332
struct list_head client_list;
3433
spinlock_t client_lock; /* protects client_list */
@@ -43,6 +42,7 @@ struct evdev_client {
4342
unsigned int tail;
4443
unsigned int packet_head; /* [future] position of the first element of next packet */
4544
spinlock_t buffer_lock; /* protects access to buffer, head and tail */
45+
wait_queue_head_t wait;
4646
struct fasync_struct *fasync;
4747
struct evdev *evdev;
4848
struct list_head node;
@@ -245,7 +245,6 @@ static void evdev_pass_values(struct evdev_client *client,
245245
const struct input_value *vals, unsigned int count,
246246
ktime_t *ev_time)
247247
{
248-
struct evdev *evdev = client->evdev;
249248
const struct input_value *v;
250249
struct input_event event;
251250
struct timespec64 ts;
@@ -282,7 +281,7 @@ static void evdev_pass_values(struct evdev_client *client,
282281
spin_unlock(&client->buffer_lock);
283282

284283
if (wakeup)
285-
wake_up_interruptible_poll(&evdev->wait,
284+
wake_up_interruptible_poll(&client->wait,
286285
EPOLLIN | EPOLLOUT | EPOLLRDNORM | EPOLLWRNORM);
287286
}
288287

@@ -426,11 +425,11 @@ static void evdev_hangup(struct evdev *evdev)
426425
struct evdev_client *client;
427426

428427
spin_lock(&evdev->client_lock);
429-
list_for_each_entry(client, &evdev->client_list, node)
428+
list_for_each_entry(client, &evdev->client_list, node) {
430429
kill_fasync(&client->fasync, SIGIO, POLL_HUP);
430+
wake_up_interruptible_poll(&client->wait, EPOLLHUP | EPOLLERR);
431+
}
431432
spin_unlock(&evdev->client_lock);
432-
433-
wake_up_interruptible_poll(&evdev->wait, EPOLLHUP | EPOLLERR);
434433
}
435434

436435
static int evdev_release(struct inode *inode, struct file *file)
@@ -479,6 +478,7 @@ static int evdev_open(struct inode *inode, struct file *file)
479478
if (!client)
480479
return -ENOMEM;
481480

481+
init_waitqueue_head(&client->wait);
482482
client->bufsize = bufsize;
483483
spin_lock_init(&client->buffer_lock);
484484
client->evdev = evdev;
@@ -595,7 +595,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
595595
break;
596596

597597
if (!(file->f_flags & O_NONBLOCK)) {
598-
error = wait_event_interruptible(evdev->wait,
598+
error = wait_event_interruptible(client->wait,
599599
client->packet_head != client->tail ||
600600
!evdev->exist || client->revoked);
601601
if (error)
@@ -613,7 +613,7 @@ static __poll_t evdev_poll(struct file *file, poll_table *wait)
613613
struct evdev *evdev = client->evdev;
614614
__poll_t mask;
615615

616-
poll_wait(file, &evdev->wait, wait);
616+
poll_wait(file, &client->wait, wait);
617617

618618
if (evdev->exist && !client->revoked)
619619
mask = EPOLLOUT | EPOLLWRNORM;
@@ -946,7 +946,7 @@ static int evdev_revoke(struct evdev *evdev, struct evdev_client *client,
946946
client->revoked = true;
947947
evdev_ungrab(evdev, client);
948948
input_flush_device(&evdev->handle, file);
949-
wake_up_interruptible_poll(&evdev->wait, EPOLLHUP | EPOLLERR);
949+
wake_up_interruptible_poll(&client->wait, EPOLLHUP | EPOLLERR);
950950

951951
return 0;
952952
}
@@ -1358,7 +1358,6 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
13581358
INIT_LIST_HEAD(&evdev->client_list);
13591359
spin_lock_init(&evdev->client_lock);
13601360
mutex_init(&evdev->mutex);
1361-
init_waitqueue_head(&evdev->wait);
13621361
evdev->exist = true;
13631362

13641363
dev_no = minor;

drivers/input/input-mt.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,14 @@ static int adjust_dual(int *begin, int step, int *end, int eq, int mu)
323323
p = begin + step;
324324
s = p == end ? f + 1 : *p;
325325

326-
for (; p != end; p += step)
327-
if (*p < f)
328-
s = f, f = *p;
329-
else if (*p < s)
326+
for (; p != end; p += step) {
327+
if (*p < f) {
328+
s = f;
329+
f = *p;
330+
} else if (*p < s) {
330331
s = *p;
332+
}
333+
}
331334

332335
c = (f + s + 1) / 2;
333336
if (c == 0 || (c > mu && (!eq || mu > 0)))

drivers/input/joystick/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ config JOYSTICK_A3D
4242
To compile this driver as a module, choose M here: the
4343
module will be called a3d.
4444

45+
config JOYSTICK_ADC
46+
tristate "Simple joystick connected over ADC"
47+
depends on IIO
48+
select IIO_BUFFER_CB
49+
help
50+
Say Y here if you have a simple joystick connected over ADC.
51+
52+
To compile this driver as a module, choose M here: the
53+
module will be called adc-joystick.
54+
4555
config JOYSTICK_ADI
4656
tristate "Logitech ADI digital joysticks and gamepads"
4757
select GAMEPORT

drivers/input/joystick/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Each configuration option enables a list of files.
77

88
obj-$(CONFIG_JOYSTICK_A3D) += a3d.o
9+
obj-$(CONFIG_JOYSTICK_ADC) += adc-joystick.o
910
obj-$(CONFIG_JOYSTICK_ADI) += adi.o
1011
obj-$(CONFIG_JOYSTICK_AMIGA) += amijoy.o
1112
obj-$(CONFIG_JOYSTICK_AS5011) += as5011.o

0 commit comments

Comments
 (0)