Skip to content

Commit d797da4

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem updates from Dmitry Torokhov: "Two new drivers for Elan hardware (for I2C touchpad and touchscreen found in several Chromebooks and other devices), a driver for Goodix touch panel, and small fixes to Cypress I2C trackpad and other input drivers. Also we switched to use __maybe_unused instead of gating suspend/ resume code with #ifdef guards to get better compile coverage" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (27 commits) Input: gpio_keys - fix warning regarding uninitialized 'button' variable Input: add support for Elan eKTH I2C touchscreens Input: gpio_keys - fix warning regarding uninitialized 'irq' variable Input: cyapa - use 'error' for error codes Input: cyapa - fix resuming the device Input: gpio_keys - add device tree support for interrupt only keys Input: amikbd - allocate temporary keymap buffer on the stack Input: amikbd - fix build if !CONFIG_HW_CONSOLE Input: lm8323 - missing error check in lm8323_set_disable() Input: initialize device counter variables with -1 Input: initialize input_no to -1 to avoid subtraction Input: i8042 - do not try to load on Intel NUC D54250WYK Input: atkbd - correct MSC_SCAN events for force_release keys Input: cyapa - switch to using managed resources Input: lifebook - use "static inline" instead of "inline" in lifebook.h Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resume Input: mouse - use __maybe_unused instead of ifdef around suspend/resume Input: misc - use __maybe_unused instead of ifdef around suspend/resume Input: cap11xx - support for irq-active-high option Input: cap11xx - add support for various cap11xx devices ...
2 parents d6666be + f20c86c commit d797da4

Some content is hidden

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

77 files changed

+4949
-922
lines changed

Documentation/devicetree/bindings/input/cap1106.txt Documentation/devicetree/bindings/input/cap11xx.txt

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
Device tree bindings for Microchip CAP1106, 6 channel capacitive touch sensor
1+
Device tree bindings for Microchip CAP11xx based capacitive touch sensors
22

3-
The node for this driver must be a child of a I2C controller node, as the
3+
The node for this device must be a child of a I2C controller node, as the
44
device communication via I2C only.
55

66
Required properties:
77

8-
compatible: Must be "microchip,cap1106"
8+
compatible: Must contain one of:
9+
"microchip,cap1106"
10+
"microchip,cap1126"
11+
"microchip,cap1188"
912

1013
reg: The I2C slave address of the device.
11-
Only 0x28 is valid.
1214

1315
interrupts: Property describing the interrupt line the
1416
device's ALERT#/CM_IRQ# pin is connected to.
@@ -26,6 +28,10 @@ Optional properties:
2628
Valid values are 1, 2, 4, and 8.
2729
By default, a gain of 1 is set.
2830

31+
microchip,irq-active-high: By default the interrupt pin is active low
32+
open drain. This property allows using the active
33+
high push-pull output.
34+
2935
linux,keycodes: Specifies an array of numeric keycode values to
3036
be used for the channels. If this property is
3137
omitted, KEY_A, KEY_B, etc are used as
@@ -43,11 +49,11 @@ i2c_controller {
4349
autorepeat;
4450
microchip,sensor-gain = <2>;
4551

46-
linux,keycodes = <103 /* KEY_UP */
47-
106 /* KEY_RIGHT */
48-
108 /* KEY_DOWN */
49-
105 /* KEY_LEFT */
50-
109 /* KEY_PAGEDOWN */
51-
104>; /* KEY_PAGEUP */
52+
linux,keycodes = <103>, /* KEY_UP */
53+
<106>, /* KEY_RIGHT */
54+
<108>, /* KEY_DOWN */
55+
<105>, /* KEY_LEFT */
56+
<109>, /* KEY_PAGEDOWN */
57+
<104>; /* KEY_PAGEUP */
5258
};
5359
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Elantech I2C Touchpad
2+
3+
Required properties:
4+
- compatible: must be "elan,ekth3000".
5+
- reg: I2C address of the chip.
6+
- interrupt-parent: a phandle for the interrupt controller (see interrupt
7+
binding[0]).
8+
- interrupts: interrupt to which the chip is connected (see interrupt
9+
binding[0]).
10+
11+
Optional properties:
12+
- wakeup-source: touchpad can be used as a wakeup source.
13+
- pinctrl-names: should be "default" (see pinctrl binding [1]).
14+
- pinctrl-0: a phandle pointing to the pin settings for the device (see
15+
pinctrl binding [1]).
16+
- vcc-supply: a phandle for the regulator supplying 3.3V power.
17+
18+
[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
19+
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
20+
21+
Example:
22+
&i2c1 {
23+
/* ... */
24+
25+
touchpad@15 {
26+
compatible = "elan,ekth3000";
27+
reg = <0x15>;
28+
interrupt-parent = <&gpio4>;
29+
interrupts = <0x0 IRQ_TYPE_EDGE_FALLING>;
30+
wakeup-source;
31+
};
32+
33+
/* ... */
34+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Elantech I2C Touchscreen
2+
3+
Required properties:
4+
- compatible: must be "elan,ekth3500".
5+
- reg: I2C address of the chip.
6+
- interrupt-parent: a phandle for the interrupt controller (see interrupt
7+
binding[0]).
8+
- interrupts: interrupt to which the chip is connected (see interrupt
9+
binding[0]).
10+
11+
Optional properties:
12+
- wakeup-source: touchscreen can be used as a wakeup source.
13+
- pinctrl-names: should be "default" (see pinctrl binding [1]).
14+
- pinctrl-0: a phandle pointing to the pin settings for the device (see
15+
pinctrl binding [1]).
16+
17+
[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
18+
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
19+
20+
Example:
21+
&i2c1 {
22+
/* ... */
23+
24+
touchscreen@10 {
25+
compatible = "elan,ekth3500";
26+
reg = <0x10>;
27+
interrupt-parent = <&gpio4>;
28+
interrupts = <0x0 IRQ_TYPE_EDGE_FALLING>;
29+
wakeup-source;
30+
};
31+
32+
/* ... */
33+
};

Documentation/devicetree/bindings/input/gpio-keys.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ Optional properties:
1010
Each button (key) is represented as a sub-node of "gpio-keys":
1111
Subnode properties:
1212

13-
- gpios: OF device-tree gpio specification.
1413
- label: Descriptive name of the key.
1514
- linux,code: Keycode to emit.
1615

16+
Required mutual exclusive subnode-properties:
17+
- gpios: OF device-tree gpio specification.
18+
- interrupts: the interrupt line for that input
19+
1720
Optional subnode-properties:
1821
- linux,input-type: Specify event type this button/key generates.
1922
If not specified defaults to <1> == EV_KEY.
@@ -33,4 +36,9 @@ Example nodes:
3336
linux,code = <103>;
3437
gpios = <&gpio1 0 1>;
3538
};
39+
button@22 {
40+
label = "GPIO Key DOWN";
41+
linux,code = <108>;
42+
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
43+
};
3644
...

Documentation/devicetree/bindings/vendor-prefixes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ dlink D-Link Corporation
4747
dmo Data Modul AG
4848
ebv EBV Elektronik
4949
edt Emerging Display Technologies
50+
elan Elan Microelectronic Corp.
5051
emmicro EM Microelectronic
5152
energymicro Silicon Laboratories (formerly Energy Micro AS)
5253
epcos EPCOS AG

MAINTAINERS

+6
Original file line numberDiff line numberDiff line change
@@ -4255,6 +4255,12 @@ L: [email protected]
42554255
S: Maintained
42564256
F: drivers/media/usb/go7007/
42574257

4258+
GOODIX TOUCHSCREEN
4259+
M: Bastien Nocera <[email protected]>
4260+
4261+
S: Maintained
4262+
F: drivers/input/touchscreen/goodix.c
4263+
42584264
GPIO SUBSYSTEM
42594265
M: Linus Walleij <[email protected]>
42604266
M: Alexandre Courbot <[email protected]>

drivers/input/gameport/gameport.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,14 @@ EXPORT_SYMBOL(gameport_set_phys);
527527
*/
528528
static void gameport_init_port(struct gameport *gameport)
529529
{
530-
static atomic_t gameport_no = ATOMIC_INIT(0);
530+
static atomic_t gameport_no = ATOMIC_INIT(-1);
531531

532532
__module_get(THIS_MODULE);
533533

534534
mutex_init(&gameport->drv_mutex);
535535
device_initialize(&gameport->dev);
536536
dev_set_name(&gameport->dev, "gameport%lu",
537-
(unsigned long)atomic_inc_return(&gameport_no) - 1);
537+
(unsigned long)atomic_inc_return(&gameport_no));
538538
gameport->dev.bus = &gameport_bus;
539539
gameport->dev.release = gameport_release_port;
540540
if (gameport->parent)

drivers/input/input.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ EXPORT_SYMBOL_GPL(input_class);
17751775
*/
17761776
struct input_dev *input_allocate_device(void)
17771777
{
1778-
static atomic_t input_no = ATOMIC_INIT(0);
1778+
static atomic_t input_no = ATOMIC_INIT(-1);
17791779
struct input_dev *dev;
17801780

17811781
dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL);
@@ -1790,7 +1790,7 @@ struct input_dev *input_allocate_device(void)
17901790
INIT_LIST_HEAD(&dev->node);
17911791

17921792
dev_set_name(&dev->dev, "input%lu",
1793-
(unsigned long) atomic_inc_return(&input_no) - 1);
1793+
(unsigned long)atomic_inc_return(&input_no));
17941794

17951795
__module_get(THIS_MODULE);
17961796
}

drivers/input/joystick/xpad.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,8 @@ static void xpad_led_set(struct led_classdev *led_cdev,
886886

887887
static int xpad_led_probe(struct usb_xpad *xpad)
888888
{
889-
static atomic_t led_seq = ATOMIC_INIT(0);
890-
long led_no;
889+
static atomic_t led_seq = ATOMIC_INIT(-1);
890+
unsigned long led_no;
891891
struct xpad_led *led;
892892
struct led_classdev *led_cdev;
893893
int error;
@@ -899,9 +899,9 @@ static int xpad_led_probe(struct usb_xpad *xpad)
899899
if (!led)
900900
return -ENOMEM;
901901

902-
led_no = (long)atomic_inc_return(&led_seq) - 1;
902+
led_no = atomic_inc_return(&led_seq);
903903

904-
snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
904+
snprintf(led->name, sizeof(led->name), "xpad%lu", led_no);
905905
led->xpad = xpad;
906906

907907
led_cdev = &led->led_cdev;

drivers/input/keyboard/Kconfig

+4-4
Original file line numberDiff line numberDiff line change
@@ -665,14 +665,14 @@ config KEYBOARD_CROS_EC
665665
To compile this driver as a module, choose M here: the
666666
module will be called cros_ec_keyb.
667667

668-
config KEYBOARD_CAP1106
669-
tristate "Microchip CAP1106 touch sensor"
668+
config KEYBOARD_CAP11XX
669+
tristate "Microchip CAP11XX based touch sensors"
670670
depends on OF && I2C
671671
select REGMAP_I2C
672672
help
673-
Say Y here to enable the CAP1106 touch sensor driver.
673+
Say Y here to enable the CAP11XX touch sensor driver.
674674

675675
To compile this driver as a module, choose M here: the
676-
module will be called cap1106.
676+
module will be called cap11xx.
677677

678678
endif

drivers/input/keyboard/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
1111
obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o
1212
obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
1313
obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
14-
obj-$(CONFIG_KEYBOARD_CAP1106) += cap1106.o
14+
obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o
1515
obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o
1616
obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
1717
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o

drivers/input/keyboard/amikbd.c

+30-17
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
4545
MODULE_DESCRIPTION("Amiga keyboard driver");
4646
MODULE_LICENSE("GPL");
4747

48+
#ifdef CONFIG_HW_CONSOLE
4849
static unsigned char amikbd_keycode[0x78] __initdata = {
4950
[0] = KEY_GRAVE,
5051
[1] = KEY_1,
@@ -144,6 +145,32 @@ static unsigned char amikbd_keycode[0x78] __initdata = {
144145
[103] = KEY_RIGHTMETA
145146
};
146147

148+
static void __init amikbd_init_console_keymaps(void)
149+
{
150+
/* We can spare 512 bytes on stack for temp_map in init path. */
151+
unsigned short temp_map[NR_KEYS];
152+
int i, j;
153+
154+
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
155+
if (!key_maps[i])
156+
continue;
157+
memset(temp_map, 0, sizeof(temp_map));
158+
for (j = 0; j < 0x78; j++) {
159+
if (!amikbd_keycode[j])
160+
continue;
161+
temp_map[j] = key_maps[i][amikbd_keycode[j]];
162+
}
163+
for (j = 0; j < NR_KEYS; j++) {
164+
if (!temp_map[j])
165+
temp_map[j] = 0xf200;
166+
}
167+
memcpy(key_maps[i], temp_map, sizeof(temp_map));
168+
}
169+
}
170+
#else /* !CONFIG_HW_CONSOLE */
171+
static inline void amikbd_init_console_keymaps(void) {}
172+
#endif /* !CONFIG_HW_CONSOLE */
173+
147174
static const char *amikbd_messages[8] = {
148175
[0] = KERN_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n",
149176
[1] = KERN_WARNING "amikbd: keyboard lost sync\n",
@@ -186,7 +213,7 @@ static irqreturn_t amikbd_interrupt(int irq, void *data)
186213
static int __init amikbd_probe(struct platform_device *pdev)
187214
{
188215
struct input_dev *dev;
189-
int i, j, err;
216+
int i, err;
190217

191218
dev = input_allocate_device();
192219
if (!dev) {
@@ -207,22 +234,8 @@ static int __init amikbd_probe(struct platform_device *pdev)
207234
for (i = 0; i < 0x78; i++)
208235
set_bit(i, dev->keybit);
209236

210-
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
211-
static u_short temp_map[NR_KEYS] __initdata;
212-
if (!key_maps[i])
213-
continue;
214-
memset(temp_map, 0, sizeof(temp_map));
215-
for (j = 0; j < 0x78; j++) {
216-
if (!amikbd_keycode[j])
217-
continue;
218-
temp_map[j] = key_maps[i][amikbd_keycode[j]];
219-
}
220-
for (j = 0; j < NR_KEYS; j++) {
221-
if (!temp_map[j])
222-
temp_map[j] = 0xf200;
223-
}
224-
memcpy(key_maps[i], temp_map, sizeof(temp_map));
225-
}
237+
amikbd_init_console_keymaps();
238+
226239
ciaa.cra &= ~0x41; /* serial data in, turn off TA */
227240
err = request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd",
228241
dev);

drivers/input/keyboard/atkbd.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
456456

457457
keycode = atkbd->keycode[code];
458458

459-
if (keycode != ATKBD_KEY_NULL)
460-
input_event(dev, EV_MSC, MSC_SCAN, code);
459+
if (!(atkbd->release && test_bit(code, atkbd->force_release_mask)))
460+
if (keycode != ATKBD_KEY_NULL)
461+
input_event(dev, EV_MSC, MSC_SCAN, code);
461462

462463
switch (keycode) {
463464
case ATKBD_KEY_NULL:
@@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
511512
input_sync(dev);
512513

513514
if (value && test_bit(code, atkbd->force_release_mask)) {
515+
input_event(dev, EV_MSC, MSC_SCAN, code);
514516
input_report_key(dev, keycode, 0);
515517
input_sync(dev);
516518
}

0 commit comments

Comments
 (0)