Skip to content

Commit aa240ee

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 revert of a patch resetting extra buttons on touchpads claiming to be buttonpads as this caused regression on certain Dell devices - a new driver for Mediatek MT6779 keypad - a new driver for Imagis touchscreen - rework of Google/Chrome OS "Vivaldi" keyboard handling - assorted driver fixes. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (31 commits) Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads" Input: adi - remove redundant variable z Input: add Imagis touchscreen driver dt-bindings: input/touchscreen: bindings for Imagis Input: synaptics - enable InterTouch on ThinkPad T14/P14s Gen 1 AMD Input: stmfts - fix reference leak in stmfts_input_open Input: add bounds checking to input_set_capability() Input: iqs5xx - use local input_dev pointer HID: google: modify HID device groups of eel HID: google: Add support for vivaldi to hid-hammer HID: google: extract Vivaldi hid feature mapping for use in hid-hammer Input: extract ChromeOS vivaldi physmap show function HID: google: switch to devm when registering keyboard backlight LED Input: mt6779-keypad - fix signedness bug Input: mt6779-keypad - add MediaTek keypad driver dt-bindings: input: Add bindings for Mediatek matrix keypad Input: da9063 - use devm_delayed_work_autocancel() Input: goodix - fix race on driver unbind Input: goodix - use input_copy_abs() helper Input: add input_copy_abs() function ...
2 parents 6a34fdc + 8b188fb commit aa240ee

36 files changed

Lines changed: 1364 additions & 333 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/input/mediatek,mt6779-keypad.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Mediatek's Keypad Controller device tree bindings
8+
9+
maintainers:
10+
- Fengping Yu <fengping.yu@mediatek.com>
11+
12+
allOf:
13+
- $ref: "/schemas/input/matrix-keymap.yaml#"
14+
15+
description: |
16+
Mediatek's Keypad controller is used to interface a SoC with a matrix-type
17+
keypad device. The keypad controller supports multiple row and column lines.
18+
A key can be placed at each intersection of a unique row and a unique column.
19+
The keypad controller can sense a key-press and key-release and report the
20+
event using a interrupt to the cpu.
21+
22+
properties:
23+
compatible:
24+
oneOf:
25+
- const: mediatek,mt6779-keypad
26+
- items:
27+
- enum:
28+
- mediatek,mt6873-keypad
29+
- const: mediatek,mt6779-keypad
30+
31+
reg:
32+
maxItems: 1
33+
34+
interrupts:
35+
maxItems: 1
36+
37+
clocks:
38+
maxItems: 1
39+
40+
clock-names:
41+
items:
42+
- const: kpd
43+
44+
wakeup-source:
45+
description: use any event on keypad as wakeup event
46+
type: boolean
47+
48+
debounce-delay-ms:
49+
maximum: 256
50+
default: 16
51+
52+
required:
53+
- compatible
54+
- reg
55+
- interrupts
56+
- clocks
57+
- clock-names
58+
59+
additionalProperties: false
60+
61+
examples:
62+
- |
63+
#include <dt-bindings/input/input.h>
64+
#include <dt-bindings/interrupt-controller/arm-gic.h>
65+
66+
soc {
67+
#address-cells = <2>;
68+
#size-cells = <2>;
69+
70+
keyboard@10010000 {
71+
compatible = "mediatek,mt6779-keypad";
72+
reg = <0 0x10010000 0 0x1000>;
73+
interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_FALLING>;
74+
clocks = <&clk26m>;
75+
clock-names = "kpd";
76+
};
77+
};

Documentation/devicetree/bindings/input/mtk-pmic-keys.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ For MT6397/MT6323 MFD bindings see:
99
Documentation/devicetree/bindings/mfd/mt6397.txt
1010

1111
Required properties:
12-
- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
12+
- compatible: Should be one of:
13+
- "mediatek,mt6397-keys"
14+
- "mediatek,mt6323-keys"
15+
- "mediatek,mt6358-keys"
1316
- linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml
1417

1518
Optional Properties:
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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/imagis,ist3038c.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Imagis IST30XXC family touchscreen controller bindings
8+
9+
maintainers:
10+
- Markuss Broks <markuss.broks@gmail.com>
11+
12+
allOf:
13+
- $ref: touchscreen.yaml#
14+
15+
properties:
16+
$nodename:
17+
pattern: "^touchscreen@[0-9a-f]+$"
18+
19+
compatible:
20+
enum:
21+
- imagis,ist3038c
22+
23+
reg:
24+
maxItems: 1
25+
26+
interrupts:
27+
maxItems: 1
28+
29+
vdd-supply:
30+
description: Power supply regulator for the chip
31+
32+
vddio-supply:
33+
description: Power supply regulator for the I2C bus
34+
35+
touchscreen-size-x: true
36+
touchscreen-size-y: true
37+
touchscreen-fuzz-x: true
38+
touchscreen-fuzz-y: true
39+
touchscreen-inverted-x: true
40+
touchscreen-inverted-y: true
41+
touchscreen-swapped-x-y: true
42+
43+
additionalProperties: false
44+
45+
required:
46+
- compatible
47+
- reg
48+
- interrupts
49+
- touchscreen-size-x
50+
- touchscreen-size-y
51+
52+
examples:
53+
- |
54+
#include <dt-bindings/interrupt-controller/irq.h>
55+
i2c {
56+
#address-cells = <1>;
57+
#size-cells = <0>;
58+
touchscreen@50 {
59+
compatible = "imagis,ist3038c";
60+
reg = <0x50>;
61+
interrupt-parent = <&gpio>;
62+
interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
63+
vdd-supply = <&ldo1_reg>;
64+
vddio-supply = <&ldo2_reg>;
65+
touchscreen-size-x = <720>;
66+
touchscreen-size-y = <1280>;
67+
touchscreen-fuzz-x = <10>;
68+
touchscreen-fuzz-y = <10>;
69+
touchscreen-inverted-x;
70+
touchscreen-inverted-y;
71+
};
72+
};
73+
74+
...

Documentation/devicetree/bindings/vendor-prefixes.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ patternProperties:
560560
description: Ingenieurburo Fur Ic-Technologie (I/F/I)
561561
"^ilitek,.*":
562562
description: ILI Technology Corporation (ILITEK)
563+
"^imagis,.*":
564+
description: Imagis Technologies Co., Ltd.
563565
"^img,.*":
564566
description: Imagination Technologies Ltd.
565567
"^imi,.*":

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9517,6 +9517,12 @@ M: Stanislaw Gruszka <stf_xl@wp.pl>
95179517
S: Maintained
95189518
F: drivers/usb/atm/ueagle-atm.c
95199519

9520+
IMAGIS TOUCHSCREEN DRIVER
9521+
M: Markuss Broks <markuss.broks@gmail.com>
9522+
S: Maintained
9523+
F: Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml
9524+
F: drivers/input/touchscreen/imagis.c
9525+
95209526
IMGTEC ASCII LCD DRIVER
95219527
M: Paul Burton <paulburton@kernel.org>
95229528
S: Maintained

drivers/hid/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,25 @@ config HOLTEK_FF
405405
Say Y here if you have a Holtek On Line Grip based game controller
406406
and want to have force feedback support for it.
407407

408+
config HID_VIVALDI_COMMON
409+
tristate
410+
help
411+
ChromeOS Vivaldi HID parsing support library. This is a hidden
412+
option so that drivers can use common code to parse the HID
413+
descriptors for vivaldi function row keymap.
414+
408415
config HID_GOOGLE_HAMMER
409416
tristate "Google Hammer Keyboard"
417+
select HID_VIVALDI_COMMON
418+
select INPUT_VIVALDIFMAP
410419
depends on USB_HID && LEDS_CLASS && CROS_EC
411420
help
412421
Say Y here if you have a Google Hammer device.
413422

414423
config HID_VIVALDI
415424
tristate "Vivaldi Keyboard"
425+
select HID_VIVALDI_COMMON
426+
select INPUT_VIVALDIFMAP
416427
depends on HID
417428
help
418429
Say Y here if you want to enable support for Vivaldi keyboards.

drivers/hid/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ obj-$(CONFIG_HID_FT260) += hid-ft260.o
5050
obj-$(CONFIG_HID_GEMBIRD) += hid-gembird.o
5151
obj-$(CONFIG_HID_GFRM) += hid-gfrm.o
5252
obj-$(CONFIG_HID_GLORIOUS) += hid-glorious.o
53+
obj-$(CONFIG_HID_VIVALDI_COMMON) += hid-vivaldi-common.o
5354
obj-$(CONFIG_HID_GOOGLE_HAMMER) += hid-google-hammer.o
5455
obj-$(CONFIG_HID_VIVALDI) += hid-vivaldi.o
5556
obj-$(CONFIG_HID_GT683R) += hid-gt683r.o

drivers/hid/hid-google-hammer.c

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <linux/acpi.h>
1717
#include <linux/hid.h>
18+
#include <linux/input/vivaldi-fmap.h>
1819
#include <linux/leds.h>
1920
#include <linux/module.h>
2021
#include <linux/of.h>
@@ -25,6 +26,7 @@
2526
#include <asm/unaligned.h>
2627

2728
#include "hid-ids.h"
29+
#include "hid-vivaldi-common.h"
2830

2931
/*
3032
* C(hrome)B(ase)A(ttached)S(witch) - switch exported by Chrome EC and reporting
@@ -340,9 +342,9 @@ static int hammer_kbd_brightness_set_blocking(struct led_classdev *cdev,
340342
static int hammer_register_leds(struct hid_device *hdev)
341343
{
342344
struct hammer_kbd_leds *kbd_backlight;
343-
int error;
344345

345-
kbd_backlight = kzalloc(sizeof(*kbd_backlight), GFP_KERNEL);
346+
kbd_backlight = devm_kzalloc(&hdev->dev, sizeof(*kbd_backlight),
347+
GFP_KERNEL);
346348
if (!kbd_backlight)
347349
return -ENOMEM;
348350

@@ -356,26 +358,7 @@ static int hammer_register_leds(struct hid_device *hdev)
356358
/* Set backlight to 0% initially. */
357359
hammer_kbd_brightness_set_blocking(&kbd_backlight->cdev, 0);
358360

359-
error = led_classdev_register(&hdev->dev, &kbd_backlight->cdev);
360-
if (error)
361-
goto err_free_mem;
362-
363-
hid_set_drvdata(hdev, kbd_backlight);
364-
return 0;
365-
366-
err_free_mem:
367-
kfree(kbd_backlight);
368-
return error;
369-
}
370-
371-
static void hammer_unregister_leds(struct hid_device *hdev)
372-
{
373-
struct hammer_kbd_leds *kbd_backlight = hid_get_drvdata(hdev);
374-
375-
if (kbd_backlight) {
376-
led_classdev_unregister(&kbd_backlight->cdev);
377-
kfree(kbd_backlight);
378-
}
361+
return devm_led_classdev_register(&hdev->dev, &kbd_backlight->cdev);
379362
}
380363

381364
#define HID_UP_GOOGLEVENDOR 0xffd10000
@@ -512,11 +495,23 @@ static void hammer_get_folded_state(struct hid_device *hdev)
512495
kfree(buf);
513496
}
514497

498+
static void hammer_stop(void *hdev)
499+
{
500+
hid_hw_stop(hdev);
501+
}
502+
515503
static int hammer_probe(struct hid_device *hdev,
516504
const struct hid_device_id *id)
517505
{
506+
struct vivaldi_data *vdata;
518507
int error;
519508

509+
vdata = devm_kzalloc(&hdev->dev, sizeof(*vdata), GFP_KERNEL);
510+
if (!vdata)
511+
return -ENOMEM;
512+
513+
hid_set_drvdata(hdev, vdata);
514+
520515
error = hid_parse(hdev);
521516
if (error)
522517
return error;
@@ -525,6 +520,10 @@ static int hammer_probe(struct hid_device *hdev,
525520
if (error)
526521
return error;
527522

523+
error = devm_add_action(&hdev->dev, hammer_stop, hdev);
524+
if (error)
525+
return error;
526+
528527
/*
529528
* We always want to poll for, and handle tablet mode events from
530529
* devices that have folded usage, even when nobody has opened the input
@@ -577,15 +576,13 @@ static void hammer_remove(struct hid_device *hdev)
577576
spin_unlock_irqrestore(&cbas_ec_lock, flags);
578577
}
579578

580-
hammer_unregister_leds(hdev);
581-
582-
hid_hw_stop(hdev);
579+
/* Unregistering LEDs and stopping the hardware is done via devm */
583580
}
584581

585582
static const struct hid_device_id hammer_devices[] = {
586583
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
587584
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) },
588-
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
585+
{ HID_DEVICE(BUS_USB, HID_GROUP_VIVALDI,
589586
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_EEL) },
590587
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
591588
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) },
@@ -610,6 +607,8 @@ static struct hid_driver hammer_driver = {
610607
.id_table = hammer_devices,
611608
.probe = hammer_probe,
612609
.remove = hammer_remove,
610+
.feature_mapping = vivaldi_feature_mapping,
611+
.input_configured = vivaldi_input_configured,
613612
.input_mapping = hammer_input_mapping,
614613
.event = hammer_event,
615614
};

0 commit comments

Comments
 (0)