Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  ...
  • Loading branch information
torvalds committed Apr 1, 2022
2 parents 6a34fdc + 8b188fb commit aa240ee
Show file tree
Hide file tree
Showing 36 changed files with 1,364 additions and 333 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/mediatek,mt6779-keypad.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Mediatek's Keypad Controller device tree bindings

maintainers:
- Fengping Yu <[email protected]>

allOf:
- $ref: "/schemas/input/matrix-keymap.yaml#"

description: |
Mediatek's Keypad controller is used to interface a SoC with a matrix-type
keypad device. The keypad controller supports multiple row and column lines.
A key can be placed at each intersection of a unique row and a unique column.
The keypad controller can sense a key-press and key-release and report the
event using a interrupt to the cpu.
properties:
compatible:
oneOf:
- const: mediatek,mt6779-keypad
- items:
- enum:
- mediatek,mt6873-keypad
- const: mediatek,mt6779-keypad

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 1

clock-names:
items:
- const: kpd

wakeup-source:
description: use any event on keypad as wakeup event
type: boolean

debounce-delay-ms:
maximum: 256
default: 16

required:
- compatible
- reg
- interrupts
- clocks
- clock-names

additionalProperties: false

examples:
- |
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
soc {
#address-cells = <2>;
#size-cells = <2>;
keyboard@10010000 {
compatible = "mediatek,mt6779-keypad";
reg = <0 0x10010000 0 0x1000>;
interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_FALLING>;
clocks = <&clk26m>;
clock-names = "kpd";
};
};
5 changes: 4 additions & 1 deletion Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ For MT6397/MT6323 MFD bindings see:
Documentation/devicetree/bindings/mfd/mt6397.txt

Required properties:
- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
- compatible: Should be one of:
- "mediatek,mt6397-keys"
- "mediatek,mt6323-keys"
- "mediatek,mt6358-keys"
- linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml

Optional Properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/touchscreen/imagis,ist3038c.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Imagis IST30XXC family touchscreen controller bindings

maintainers:
- Markuss Broks <[email protected]>

allOf:
- $ref: touchscreen.yaml#

properties:
$nodename:
pattern: "^touchscreen@[0-9a-f]+$"

compatible:
enum:
- imagis,ist3038c

reg:
maxItems: 1

interrupts:
maxItems: 1

vdd-supply:
description: Power supply regulator for the chip

vddio-supply:
description: Power supply regulator for the I2C bus

touchscreen-size-x: true
touchscreen-size-y: true
touchscreen-fuzz-x: true
touchscreen-fuzz-y: true
touchscreen-inverted-x: true
touchscreen-inverted-y: true
touchscreen-swapped-x-y: true

additionalProperties: false

required:
- compatible
- reg
- interrupts
- touchscreen-size-x
- touchscreen-size-y

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
touchscreen@50 {
compatible = "imagis,ist3038c";
reg = <0x50>;
interrupt-parent = <&gpio>;
interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
vdd-supply = <&ldo1_reg>;
vddio-supply = <&ldo2_reg>;
touchscreen-size-x = <720>;
touchscreen-size-y = <1280>;
touchscreen-fuzz-x = <10>;
touchscreen-fuzz-y = <10>;
touchscreen-inverted-x;
touchscreen-inverted-y;
};
};
...
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,8 @@ patternProperties:
description: Ingenieurburo Fur Ic-Technologie (I/F/I)
"^ilitek,.*":
description: ILI Technology Corporation (ILITEK)
"^imagis,.*":
description: Imagis Technologies Co., Ltd.
"^img,.*":
description: Imagination Technologies Ltd.
"^imi,.*":
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9517,6 +9517,12 @@ M: Stanislaw Gruszka <[email protected]>
S: Maintained
F: drivers/usb/atm/ueagle-atm.c

IMAGIS TOUCHSCREEN DRIVER
M: Markuss Broks <[email protected]>
S: Maintained
F: Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml
F: drivers/input/touchscreen/imagis.c

IMGTEC ASCII LCD DRIVER
M: Paul Burton <[email protected]>
S: Maintained
Expand Down
11 changes: 11 additions & 0 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,25 @@ config HOLTEK_FF
Say Y here if you have a Holtek On Line Grip based game controller
and want to have force feedback support for it.

config HID_VIVALDI_COMMON
tristate
help
ChromeOS Vivaldi HID parsing support library. This is a hidden
option so that drivers can use common code to parse the HID
descriptors for vivaldi function row keymap.

config HID_GOOGLE_HAMMER
tristate "Google Hammer Keyboard"
select HID_VIVALDI_COMMON
select INPUT_VIVALDIFMAP
depends on USB_HID && LEDS_CLASS && CROS_EC
help
Say Y here if you have a Google Hammer device.

config HID_VIVALDI
tristate "Vivaldi Keyboard"
select HID_VIVALDI_COMMON
select INPUT_VIVALDIFMAP
depends on HID
help
Say Y here if you want to enable support for Vivaldi keyboards.
Expand Down
1 change: 1 addition & 0 deletions drivers/hid/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ obj-$(CONFIG_HID_FT260) += hid-ft260.o
obj-$(CONFIG_HID_GEMBIRD) += hid-gembird.o
obj-$(CONFIG_HID_GFRM) += hid-gfrm.o
obj-$(CONFIG_HID_GLORIOUS) += hid-glorious.o
obj-$(CONFIG_HID_VIVALDI_COMMON) += hid-vivaldi-common.o
obj-$(CONFIG_HID_GOOGLE_HAMMER) += hid-google-hammer.o
obj-$(CONFIG_HID_VIVALDI) += hid-vivaldi.o
obj-$(CONFIG_HID_GT683R) += hid-gt683r.o
Expand Down
51 changes: 25 additions & 26 deletions drivers/hid/hid-google-hammer.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <linux/acpi.h>
#include <linux/hid.h>
#include <linux/input/vivaldi-fmap.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of.h>
Expand All @@ -25,6 +26,7 @@
#include <asm/unaligned.h>

#include "hid-ids.h"
#include "hid-vivaldi-common.h"

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

kbd_backlight = kzalloc(sizeof(*kbd_backlight), GFP_KERNEL);
kbd_backlight = devm_kzalloc(&hdev->dev, sizeof(*kbd_backlight),
GFP_KERNEL);
if (!kbd_backlight)
return -ENOMEM;

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

error = led_classdev_register(&hdev->dev, &kbd_backlight->cdev);
if (error)
goto err_free_mem;

hid_set_drvdata(hdev, kbd_backlight);
return 0;

err_free_mem:
kfree(kbd_backlight);
return error;
}

static void hammer_unregister_leds(struct hid_device *hdev)
{
struct hammer_kbd_leds *kbd_backlight = hid_get_drvdata(hdev);

if (kbd_backlight) {
led_classdev_unregister(&kbd_backlight->cdev);
kfree(kbd_backlight);
}
return devm_led_classdev_register(&hdev->dev, &kbd_backlight->cdev);
}

#define HID_UP_GOOGLEVENDOR 0xffd10000
Expand Down Expand Up @@ -512,11 +495,23 @@ static void hammer_get_folded_state(struct hid_device *hdev)
kfree(buf);
}

static void hammer_stop(void *hdev)
{
hid_hw_stop(hdev);
}

static int hammer_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{
struct vivaldi_data *vdata;
int error;

vdata = devm_kzalloc(&hdev->dev, sizeof(*vdata), GFP_KERNEL);
if (!vdata)
return -ENOMEM;

hid_set_drvdata(hdev, vdata);

error = hid_parse(hdev);
if (error)
return error;
Expand All @@ -525,6 +520,10 @@ static int hammer_probe(struct hid_device *hdev,
if (error)
return error;

error = devm_add_action(&hdev->dev, hammer_stop, hdev);
if (error)
return error;

/*
* We always want to poll for, and handle tablet mode events from
* devices that have folded usage, even when nobody has opened the input
Expand Down Expand Up @@ -577,15 +576,13 @@ static void hammer_remove(struct hid_device *hdev)
spin_unlock_irqrestore(&cbas_ec_lock, flags);
}

hammer_unregister_leds(hdev);

hid_hw_stop(hdev);
/* Unregistering LEDs and stopping the hardware is done via devm */
}

static const struct hid_device_id hammer_devices[] = {
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) },
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
{ HID_DEVICE(BUS_USB, HID_GROUP_VIVALDI,
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_EEL) },
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) },
Expand All @@ -610,6 +607,8 @@ static struct hid_driver hammer_driver = {
.id_table = hammer_devices,
.probe = hammer_probe,
.remove = hammer_remove,
.feature_mapping = vivaldi_feature_mapping,
.input_configured = vivaldi_input_configured,
.input_mapping = hammer_input_mapping,
.event = hammer_event,
};
Expand Down
Loading

0 comments on commit aa240ee

Please sign in to comment.