Skip to content

Commit 0201710

Browse files
committed
Merge branch 'next' into for-linus
Prepare input updates for 6.13 merge window.
2 parents 5c822c0 + 0433773 commit 0201710

File tree

145 files changed

+1507
-1841
lines changed

Some content is hidden

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

145 files changed

+1507
-1841
lines changed

Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- mediatek,mt6331-keys
2929
- mediatek,mt6357-keys
3030
- mediatek,mt6358-keys
31+
- mediatek,mt6359-keys
3132
- mediatek,mt6397-keys
3233

3334
power-off-time-sec: true

Documentation/devicetree/bindings/input/rotary-encoder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ properties:
4141
device, hence no steps need to be passed.
4242

4343
rotary-encoder,rollover:
44-
$ref: /schemas/types.yaml#/definitions/int32
44+
$ref: /schemas/types.yaml#/definitions/flag
4545
description:
4646
Automatic rollover when the rotary value becomes
4747
greater than the specified steps or smaller than 0. For absolute axis only.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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/novatek,nvt-ts.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Novatek NVT Touchscreen Controller
8+
9+
maintainers:
10+
- Hans de Goede <hdegoede@redhat.com>
11+
12+
allOf:
13+
- $ref: touchscreen.yaml#
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- novatek,nt11205-ts
19+
- novatek,nt36672a-ts
20+
21+
reg:
22+
maxItems: 1
23+
24+
interrupts:
25+
maxItems: 1
26+
27+
reset-gpios:
28+
maxItems: 1
29+
30+
vcc-supply: true
31+
iovcc-supply: true
32+
33+
required:
34+
- compatible
35+
- reg
36+
- interrupts
37+
38+
unevaluatedProperties: false
39+
40+
examples:
41+
- |
42+
#include <dt-bindings/gpio/gpio.h>
43+
#include <dt-bindings/interrupt-controller/arm-gic.h>
44+
i2c {
45+
#address-cells = <1>;
46+
#size-cells = <0>;
47+
touchscreen@1 {
48+
compatible = "novatek,nt36672a-ts";
49+
reg = <0x01>;
50+
interrupts-extended = <&tlmm 31 IRQ_TYPE_EDGE_RISING>;
51+
reset-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
52+
vcc-supply = <&vreg_l22a_2p85>;
53+
iovcc-supply = <&vreg_l14a_1p8>;
54+
pinctrl-0 = <&ts_int_default &ts_reset_default>;
55+
pinctrl-1 = <&ts_int_sleep &ts_reset_sleep>;
56+
pinctrl-names = "default", "sleep";
57+
touchscreen-size-x = <1080>;
58+
touchscreen-size-y = <2246>;
59+
};
60+
};
61+
62+
...

Documentation/input/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ events on a read. Their layout is::
264264
struct timeval time;
265265
unsigned short type;
266266
unsigned short code;
267-
unsigned int value;
267+
int value;
268268
};
269269

270270
``time`` is the timestamp, it returns the time at which the event happened.

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16260,6 +16260,7 @@ NOVATEK NVT-TS I2C TOUCHSCREEN DRIVER
1626016260
M: Hans de Goede <hdegoede@redhat.com>
1626116261
L: linux-input@vger.kernel.org
1626216262
S: Maintained
16263+
F: Documentation/devicetree/bindings/input/touchscreen/novatek,nvt-ts.yaml
1626316264
F: drivers/input/touchscreen/novatek-nvt-ts.c
1626416265

1626516266
NSDEPS

drivers/input/input.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ int input_open_device(struct input_handle *handle)
605605

606606
handle->open++;
607607

608+
if (handle->handler->passive_observer)
609+
goto out;
610+
608611
if (dev->users++ || dev->inhibited) {
609612
/*
610613
* Device is already opened and/or inhibited,
@@ -668,11 +671,13 @@ void input_close_device(struct input_handle *handle)
668671

669672
__input_release_device(handle);
670673

671-
if (!--dev->users && !dev->inhibited) {
672-
if (dev->poller)
673-
input_dev_poller_stop(dev->poller);
674-
if (dev->close)
675-
dev->close(dev);
674+
if (!handle->handler->passive_observer) {
675+
if (!--dev->users && !dev->inhibited) {
676+
if (dev->poller)
677+
input_dev_poller_stop(dev->poller);
678+
if (dev->close)
679+
dev->close(dev);
680+
}
676681
}
677682

678683
if (!--handle->open) {

drivers/input/joystick/db9.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -505,39 +505,37 @@ static int db9_open(struct input_dev *dev)
505505
{
506506
struct db9 *db9 = input_get_drvdata(dev);
507507
struct parport *port = db9->pd->port;
508-
int err;
509508

510-
err = mutex_lock_interruptible(&db9->mutex);
511-
if (err)
512-
return err;
513-
514-
if (!db9->used++) {
515-
parport_claim(db9->pd);
516-
parport_write_data(port, 0xff);
517-
if (db9_modes[db9->mode].reverse) {
518-
parport_data_reverse(port);
519-
parport_write_control(port, DB9_NORMAL);
509+
scoped_guard(mutex_intr, &db9->mutex) {
510+
if (!db9->used++) {
511+
parport_claim(db9->pd);
512+
parport_write_data(port, 0xff);
513+
if (db9_modes[db9->mode].reverse) {
514+
parport_data_reverse(port);
515+
parport_write_control(port, DB9_NORMAL);
516+
}
517+
mod_timer(&db9->timer, jiffies + DB9_REFRESH_TIME);
520518
}
521-
mod_timer(&db9->timer, jiffies + DB9_REFRESH_TIME);
519+
520+
return 0;
522521
}
523522

524-
mutex_unlock(&db9->mutex);
525-
return 0;
523+
return -EINTR;
526524
}
527525

528526
static void db9_close(struct input_dev *dev)
529527
{
530528
struct db9 *db9 = input_get_drvdata(dev);
531529
struct parport *port = db9->pd->port;
532530

533-
mutex_lock(&db9->mutex);
531+
guard(mutex)(&db9->mutex);
532+
534533
if (!--db9->used) {
535534
del_timer_sync(&db9->timer);
536535
parport_write_control(port, 0x00);
537536
parport_data_forward(port);
538537
parport_release(db9->pd);
539538
}
540-
mutex_unlock(&db9->mutex);
541539
}
542540

543541
static void db9_attach(struct parport *pp)

drivers/input/joystick/gamecon.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -765,33 +765,31 @@ static void gc_timer(struct timer_list *t)
765765
static int gc_open(struct input_dev *dev)
766766
{
767767
struct gc *gc = input_get_drvdata(dev);
768-
int err;
769768

770-
err = mutex_lock_interruptible(&gc->mutex);
771-
if (err)
772-
return err;
769+
scoped_guard(mutex_intr, &gc->mutex) {
770+
if (!gc->used++) {
771+
parport_claim(gc->pd);
772+
parport_write_control(gc->pd->port, 0x04);
773+
mod_timer(&gc->timer, jiffies + GC_REFRESH_TIME);
774+
}
773775

774-
if (!gc->used++) {
775-
parport_claim(gc->pd);
776-
parport_write_control(gc->pd->port, 0x04);
777-
mod_timer(&gc->timer, jiffies + GC_REFRESH_TIME);
776+
return 0;
778777
}
779778

780-
mutex_unlock(&gc->mutex);
781-
return 0;
779+
return -EINTR;
782780
}
783781

784782
static void gc_close(struct input_dev *dev)
785783
{
786784
struct gc *gc = input_get_drvdata(dev);
787785

788-
mutex_lock(&gc->mutex);
786+
guard(mutex)(&gc->mutex);
787+
789788
if (!--gc->used) {
790789
del_timer_sync(&gc->timer);
791790
parport_write_control(gc->pd->port, 0x00);
792791
parport_release(gc->pd);
793792
}
794-
mutex_unlock(&gc->mutex);
795793
}
796794

797795
static int gc_setup_pad(struct gc *gc, int idx, int pad_type)

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

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ static int make_magnitude_modifier(struct iforce* iforce,
2121
unsigned char data[3];
2222

2323
if (!no_alloc) {
24-
mutex_lock(&iforce->mem_mutex);
25-
if (allocate_resource(&(iforce->device_memory), mod_chunk, 2,
26-
iforce->device_memory.start, iforce->device_memory.end, 2L,
27-
NULL, NULL)) {
28-
mutex_unlock(&iforce->mem_mutex);
24+
guard(mutex)(&iforce->mem_mutex);
25+
26+
if (allocate_resource(&iforce->device_memory, mod_chunk, 2,
27+
iforce->device_memory.start,
28+
iforce->device_memory.end,
29+
2L, NULL, NULL))
2930
return -ENOSPC;
30-
}
31-
mutex_unlock(&iforce->mem_mutex);
3231
}
3332

3433
data[0] = LO(mod_chunk->start);
@@ -54,14 +53,13 @@ static int make_period_modifier(struct iforce* iforce,
5453
period = TIME_SCALE(period);
5554

5655
if (!no_alloc) {
57-
mutex_lock(&iforce->mem_mutex);
58-
if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0c,
59-
iforce->device_memory.start, iforce->device_memory.end, 2L,
60-
NULL, NULL)) {
61-
mutex_unlock(&iforce->mem_mutex);
56+
guard(mutex)(&iforce->mem_mutex);
57+
58+
if (allocate_resource(&iforce->device_memory, mod_chunk, 0x0c,
59+
iforce->device_memory.start,
60+
iforce->device_memory.end,
61+
2L, NULL, NULL))
6262
return -ENOSPC;
63-
}
64-
mutex_unlock(&iforce->mem_mutex);
6563
}
6664

6765
data[0] = LO(mod_chunk->start);
@@ -94,14 +92,13 @@ static int make_envelope_modifier(struct iforce* iforce,
9492
fade_duration = TIME_SCALE(fade_duration);
9593

9694
if (!no_alloc) {
97-
mutex_lock(&iforce->mem_mutex);
95+
guard(mutex)(&iforce->mem_mutex);
96+
9897
if (allocate_resource(&(iforce->device_memory), mod_chunk, 0x0e,
99-
iforce->device_memory.start, iforce->device_memory.end, 2L,
100-
NULL, NULL)) {
101-
mutex_unlock(&iforce->mem_mutex);
98+
iforce->device_memory.start,
99+
iforce->device_memory.end,
100+
2L, NULL, NULL))
102101
return -ENOSPC;
103-
}
104-
mutex_unlock(&iforce->mem_mutex);
105102
}
106103

107104
data[0] = LO(mod_chunk->start);
@@ -131,14 +128,13 @@ static int make_condition_modifier(struct iforce* iforce,
131128
unsigned char data[10];
132129

133130
if (!no_alloc) {
134-
mutex_lock(&iforce->mem_mutex);
131+
guard(mutex)(&iforce->mem_mutex);
132+
135133
if (allocate_resource(&(iforce->device_memory), mod_chunk, 8,
136-
iforce->device_memory.start, iforce->device_memory.end, 2L,
137-
NULL, NULL)) {
138-
mutex_unlock(&iforce->mem_mutex);
134+
iforce->device_memory.start,
135+
iforce->device_memory.end,
136+
2L, NULL, NULL))
139137
return -ENOSPC;
140-
}
141-
mutex_unlock(&iforce->mem_mutex);
142138
}
143139

144140
data[0] = LO(mod_chunk->start);

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

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,49 +31,42 @@ int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)
3131
int c;
3232
int empty;
3333
int head, tail;
34-
unsigned long flags;
3534

3635
/*
3736
* Update head and tail of xmit buffer
3837
*/
39-
spin_lock_irqsave(&iforce->xmit_lock, flags);
40-
41-
head = iforce->xmit.head;
42-
tail = iforce->xmit.tail;
43-
44-
45-
if (CIRC_SPACE(head, tail, XMIT_SIZE) < n+2) {
46-
dev_warn(&iforce->dev->dev,
47-
"not enough space in xmit buffer to send new packet\n");
48-
spin_unlock_irqrestore(&iforce->xmit_lock, flags);
49-
return -1;
50-
}
38+
scoped_guard(spinlock_irqsave, &iforce->xmit_lock) {
39+
head = iforce->xmit.head;
40+
tail = iforce->xmit.tail;
41+
42+
if (CIRC_SPACE(head, tail, XMIT_SIZE) < n + 2) {
43+
dev_warn(&iforce->dev->dev,
44+
"not enough space in xmit buffer to send new packet\n");
45+
return -1;
46+
}
5147

52-
empty = head == tail;
53-
XMIT_INC(iforce->xmit.head, n+2);
48+
empty = head == tail;
49+
XMIT_INC(iforce->xmit.head, n + 2);
5450

5551
/*
5652
* Store packet in xmit buffer
5753
*/
58-
iforce->xmit.buf[head] = HI(cmd);
59-
XMIT_INC(head, 1);
60-
iforce->xmit.buf[head] = LO(cmd);
61-
XMIT_INC(head, 1);
62-
63-
c = CIRC_SPACE_TO_END(head, tail, XMIT_SIZE);
64-
if (n < c) c=n;
65-
66-
memcpy(&iforce->xmit.buf[head],
67-
data,
68-
c);
69-
if (n != c) {
70-
memcpy(&iforce->xmit.buf[0],
71-
data + c,
72-
n - c);
54+
iforce->xmit.buf[head] = HI(cmd);
55+
XMIT_INC(head, 1);
56+
iforce->xmit.buf[head] = LO(cmd);
57+
XMIT_INC(head, 1);
58+
59+
c = CIRC_SPACE_TO_END(head, tail, XMIT_SIZE);
60+
if (n < c)
61+
c = n;
62+
63+
memcpy(&iforce->xmit.buf[head], data, c);
64+
if (n != c)
65+
memcpy(&iforce->xmit.buf[0], data + c, n - c);
66+
67+
XMIT_INC(head, n);
7368
}
74-
XMIT_INC(head, n);
7569

76-
spin_unlock_irqrestore(&iforce->xmit_lock, flags);
7770
/*
7871
* If necessary, start the transmission
7972
*/

0 commit comments

Comments
 (0)