platform/kernel/linux-starfive.git
12 months agoInput: pinephone-keyboard - use devm_regulator_get_enable()
Christophe JAILLET [Sat, 17 Jun 2023 07:05:42 +0000 (09:05 +0200)]
Input: pinephone-keyboard - use devm_regulator_get_enable()

Use devm_regulator_get_enable() instead of hand writing it. It saves some
line of code.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/78d7a4719ed7c372a7aa62afb66d4f1561799b5f.1686985515.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: bu21029_ts - use local 'client->dev' variable in probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:17 +0000 (18:28 +0200)]
Input: bu21029_ts - use local 'client->dev' variable in probe()

'dev' is shorter and simpler than '&client->dev' and in few cases it
allows to skip line wrapping. Probe function uses '&client->dev' a lot,
so this improves readability slightly.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-25-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: bu21013_ts - use local 'client->dev' variable in probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:16 +0000 (18:28 +0200)]
Input: bu21013_ts - use local 'client->dev' variable in probe()

'dev' is shorter and simpler than '&client->dev' and in few cases it
allows to skip line wrapping. Probe function uses '&client->dev' a lot,
so this improves readability slightly.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230625162817.100397-24-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: bcm-keypad - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:15 +0000 (18:28 +0200)]
Input: bcm-keypad - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe() and devm_clk_get_optional().  Less code and the error
value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-23-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: sx8643 - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:14 +0000 (18:28 +0200)]
Input: sx8643 - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-22-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: surface3_spi - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:13 +0000 (18:28 +0200)]
Input: surface3_spi - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-21-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: sis_i2c - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:12 +0000 (18:28 +0200)]
Input: sis_i2c - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-20-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: silead - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:11 +0000 (18:28 +0200)]
Input: silead - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-19-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: resistive-adc-touch - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:10 +0000 (18:28 +0200)]
Input: resistive-adc-touch - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-18-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: raydium_i2c_ts - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:09 +0000 (18:28 +0200)]
Input: raydium_i2c_ts - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-17-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: pixcir_i2c_ts - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:08 +0000 (18:28 +0200)]
Input: pixcir_i2c_ts - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-16-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: melfas_mip4 - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:07 +0000 (18:28 +0200)]
Input: melfas_mip4 - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-15-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: goodix - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:06 +0000 (18:28 +0200)]
Input: goodix - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-14-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: elants_i2c - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:05 +0000 (18:28 +0200)]
Input: elants_i2c - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-13-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: ektf2127 - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:04 +0000 (18:28 +0200)]
Input: ektf2127 - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-12-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: edf-ft5x06 - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:03 +0000 (18:28 +0200)]
Input: edf-ft5x06 - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-11-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: cy8ctma140 - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:02 +0000 (18:28 +0200)]
Input: cy8ctma140 - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230625162817.100397-10-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: chipone_icn8318 - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:01 +0000 (18:28 +0200)]
Input: chipone_icn8318 - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: bu21029_ts - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:28:00 +0000 (18:28 +0200)]
Input: bu21029_ts - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-8-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: bu21013_ts - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:27:59 +0000 (18:27 +0200)]
Input: bu21013_ts - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-7-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: elan_i2c - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:27:58 +0000 (18:27 +0200)]
Input: elan_i2c - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-6-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: rotary_encoder - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:27:57 +0000 (18:27 +0200)]
Input: rotary_encoder - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-5-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: pwm-vibra - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:27:56 +0000 (18:27 +0200)]
Input: pwm-vibra - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: gpio-vibra - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:27:55 +0000 (18:27 +0200)]
Input: gpio-vibra - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230625162817.100397-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: gpio_keys_polled - simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Jun 2023 16:27:54 +0000 (18:27 +0200)]
Input: gpio_keys_polled - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230625162817.100397-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: exc3000 - support power supply regulators
Mike Looijmans [Fri, 7 Jul 2023 23:29:15 +0000 (16:29 -0700)]
Input: exc3000 - support power supply regulators

Add power supply regulator support to the exc3000 devices.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Link: https://lore.kernel.org/r/20230707131042.10795-2-mike.looijmans@topic.nl
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agodt-bindings: input: exc3000: support power supply regulators
Mike Looijmans [Fri, 7 Jul 2023 23:28:07 +0000 (16:28 -0700)]
dt-bindings: input: exc3000: support power supply regulators

Add power supply regulator support to the exc3000 devices.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230707131042.10795-1-mike.looijmans@topic.nl
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: xpad - add GameSir T4 Kaleid Controller support
Jonathan Frederick [Fri, 7 Jul 2023 22:11:33 +0000 (15:11 -0700)]
Input: xpad - add GameSir T4 Kaleid Controller support

Add VID and PID to the xpad_device table to allow driver
to use the GameSir T4 Kaleid Controller, which is
XTYPE_XBOX360 compatible in xinput mode.

Signed-off-by: Jonathan Frederick <doublej472@gmail.com>
Link: https://lore.kernel.org/r/ZKeKSbP3faIPv5jB@dbj-hp-flip
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: xpad - add GameSir VID for Xbox One controllers
Sam Lantinga [Fri, 7 Jul 2023 22:10:59 +0000 (15:10 -0700)]
Input: xpad - add GameSir VID for Xbox One controllers

Signed-off-by: Sam Lantinga <slouken@libsdl.org>
Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230607012812.379640-3-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: xpad - fix support for some third-party controllers
Vicki Pfau [Fri, 7 Jul 2023 17:34:41 +0000 (10:34 -0700)]
Input: xpad - fix support for some third-party controllers

Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch
and Gamesir-G3w, require a specific packet that the first-party XInput
driver sends before it will start sending reports. It's not currently known
what this packet does, but since the first-party driver always sends it's
unlikely that this could cause issues with existing controllers.

Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230607012812.379640-2-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: gameport - use IS_REACHABLE() instead of open-coding it
Dmitry Torokhov [Fri, 7 Jul 2023 23:18:29 +0000 (16:18 -0700)]
Input: gameport - use IS_REACHABLE() instead of open-coding it

Replace an open-coded preprocessor conditional with an equivalent helper.

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/ZKYLLmsdCH0Gp7TO@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 months agoInput: gameport - add ISA and HAS_IOPORT dependencies
Niklas Schnelle [Wed, 5 Jul 2023 21:56:28 +0000 (14:56 -0700)]
Input: gameport - add ISA and HAS_IOPORT dependencies

In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
not being declared. As ISA already implies HAS_IOPORT we can simply add
this dependency and guard sections of code using inb()/outb() as
alternative access methods.

Co-developed-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Link: https://lore.kernel.org/r/20230703152355.3897456-2-schnelle@linux.ibm.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
13 months agoInput: pm8941-powerkey - fix debounce on gen2+ PMICs
Caleb Connolly [Tue, 6 Jun 2023 19:05:32 +0000 (12:05 -0700)]
Input: pm8941-powerkey - fix debounce on gen2+ PMICs

Since PM8998/PM660, the power key debounce register was redefined to
support shorter debounce times. On PM8941 the shortest debounce time
(represented by register value 0) was 15625us, on PM8998 the shortest
debounce time is 62us, with the default being 2ms.

Adjust the bit shift to correctly program debounce on PM8998 and newer.

Fixes: 68c581d5e7d8 ("Input: add Qualcomm PM8941 power key driver")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20230529-pm8941-pwrkey-debounce-v1-2-c043a6d5c814@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
13 months agoMAINTAINERS: Adjust Qualcomm driver globbing
Caleb Connolly [Tue, 6 Jun 2023 19:03:30 +0000 (12:03 -0700)]
MAINTAINERS: Adjust Qualcomm driver globbing

The only drivers matching pm8???-* are two levels deep, adjust the glob
to match them.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20230529-pm8941-pwrkey-debounce-v1-1-c043a6d5c814@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
13 months agoInput: gameport - provide default trigger() and read()
Dmitry Torokhov [Tue, 6 Jun 2023 18:16:25 +0000 (11:16 -0700)]
Input: gameport - provide default trigger() and read()

Instead of constantly checking pointer(s) for non-NULL-ness provide
default implementations of trigger() and read() and instantiate them during
pore registration if driver-specific versions were not provided.

Link: https://lore.kernel.org/r/ZGvoqP5PAAsJuky4@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
13 months agoInput: tps65219-pwrbutton - use regmap_set_bits()
Uwe Kleine-König [Tue, 6 Jun 2023 17:42:36 +0000 (10:42 -0700)]
Input: tps65219-pwrbutton - use regmap_set_bits()

regmap_set_bits() is equivalent to regmap_update_bits() if mask == val.
The probe function uses regmap_clear_bits() to enable irqs, so
symmetrically make use of regmap_set_bits() to disable them. There is no
semantic difference.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/r/20230605161458.117361-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
13 months agoInput: tps65219-pwrbutton - convert to .remove_new()
Uwe Kleine-König [Tue, 6 Jun 2023 17:27:24 +0000 (10:27 -0700)]
Input: tps65219-pwrbutton - convert to .remove_new()

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning).

To improve here there is a quest to make the remove callback return void.
In the first step of this quest all drivers are converted to .remove_new()
which already returns void. Eventually after all drivers are converted,
.remove_new() is renamed to .remove().

Before this driver might have returned an error. In this case emit a
warning that tells more about the problem than the generic warning by
the core, and instead of making the remove callback return zero
unconditionally, convert to .remove_new() which is equivalent.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/r/20230605161458.117361-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: tests - add test to cover all input_grab_device() function
Dana Elfassy [Tue, 23 May 2023 21:49:42 +0000 (14:49 -0700)]
Input: tests - add test to cover all input_grab_device() function

Currently input_grab_device() isn't covered by any tests
Thus, adding a test to cover the cases:
1. The device is grabbed successfully
2. Trying to grab a device that is already grabbed by another input
   handle

Signed-off-by: Dana Elfassy <dangel101@gmail.com>
Tested-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20230522215514.722564-1-dangel101@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: gpio-keys - use input_report_key()
Geert Uytterhoeven [Tue, 23 May 2023 21:42:15 +0000 (14:42 -0700)]
Input: gpio-keys - use input_report_key()

Use the input_report_key() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/185f3320e39000159d4bd843fd3119b94c30d607.1684854795.git.geert+renesas@glider.be
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: xpad - spelling fixes for "Xbox"
Ismael Ferreras Morezuelas [Tue, 23 May 2023 00:21:07 +0000 (17:21 -0700)]
Input: xpad - spelling fixes for "Xbox"

The Linux kernel is notorious for misspelling X-Box, X-box, XBox or XBOX;
the official spelling is actually just Xbox. Plain and simple.

Tried to respect the existing notes but still following the style guide.
No functional changes intended. This only affects ancillary parts.

Signed-off-by: Ismael Ferreras Morezuelas <swyterzone@gmail.com>
Link: https://lore.kernel.org/r/401b1d94-1348-15fd-b48f-a80e8885c7a4@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: add HAS_IOPORT dependencies
Niklas Schnelle [Mon, 22 May 2023 21:52:24 +0000 (14:52 -0700)]
Input: add HAS_IOPORT dependencies

In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
not being declared. We thus need to add HAS_IOPORT as dependency for
those drivers using them.

Co-developed-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Link: https://lore.kernel.org/r/20230522105049.1467313-16-schnelle@linux.ibm.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: libps2 - do not discard non-ack bytes when controlling LEDs
Dmitry Torokhov [Thu, 11 May 2023 18:52:47 +0000 (11:52 -0700)]
Input: libps2 - do not discard non-ack bytes when controlling LEDs

Upon receiving a PS/2 command the device and controller are supposed to
stop sending normal data (scancodes or movement packets) and instead
immediately start delivering ACK/NAK and command response. Unfortunately
often EC has an output buffer which may contain latched data by the time
the EC receives a command from the host. The kernel used to ignore such
data, but that may cause "stuck" keys if the data dropped happens to be a
break code or a part of a break code. This occasionally happens, for
example, on Chromebooks when the kernel tries to toggle CapsLock LED on
a keyboard while user releases Alt+Search keyboard shortcut.

Fix this by passing the first non-ACK byte to the normal handler for a
handful of PS/2 commands that are expected to be used during normal device
operation (as opposed to probe/configuration time).

Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Link: https://lore.kernel.org/r/20230511185252.386941-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: libps2 - introduce common interrupt handler
Dmitry Torokhov [Mon, 15 May 2023 23:14:29 +0000 (16:14 -0700)]
Input: libps2 - introduce common interrupt handler

Instead of exposing inner workings of libps2 to drivers such as atkbd and
psmouse, have them define pre-receive and receive callbacks, and provide a
common handler that can be used with underlying serio port.

While at this add kerneldoc to the module.

Link: https://lore.kernel.org/r/ZGK81cxqjr/KS1kA@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: libps2 - fix aborting PS/2 commands
Dmitry Torokhov [Thu, 11 May 2023 18:52:45 +0000 (11:52 -0700)]
Input: libps2 - fix aborting PS/2 commands

When aborting PS/2 command the kernel should [re]set all flags before
waking up waiters, otherwise waiting thread may read obsolete values
of flags.

Reported-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Link: https://lore.kernel.org/r/20230511185252.386941-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: libps2 - fix NAK handling
Dmitry Torokhov [Thu, 11 May 2023 18:52:44 +0000 (11:52 -0700)]
Input: libps2 - fix NAK handling

Do not try to process "resend" or "reject" responses from the device
as normal response data for a command.

Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Link: https://lore.kernel.org/r/20230511185252.386941-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: libps2 - rework handling of command response
Dmitry Torokhov [Thu, 11 May 2023 18:52:43 +0000 (11:52 -0700)]
Input: libps2 - rework handling of command response

It is not entirely correct that libps2 sets PS2_FLAG_CMD1 after
the device acknowledges each byte sent to the device by the host.
Rework the code so that PS2_FLAG_CMD1 and PS2_FLAG_CMD are set only once,
at the beginning of PS/2 command execution.

Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Link: https://lore.kernel.org/r/20230511185252.386941-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: libps2 - remove special handling of ACK for command byte
Dmitry Torokhov [Thu, 11 May 2023 18:52:42 +0000 (11:52 -0700)]
Input: libps2 - remove special handling of ACK for command byte

When getting unexpected data while waiting for an acknowledgement it does
not matter what command phase is currently executed, and ps2_handle_ack()
should indicate that no further processing is needed for the received data
byte. Remove PS2_FLAG_ACK_CMD and associated handling.

Note that while it is possible to make ps2_handle_ack (and
ps2_handle_repsonse) return void, it will be done when the code will be
converted to common PS/2 interrupt handler later.

Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Link: https://lore.kernel.org/r/20230511185252.386941-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: libps2 - attach ps2dev instances as serio port's drvdata
Dmitry Torokhov [Thu, 11 May 2023 18:52:41 +0000 (11:52 -0700)]
Input: libps2 - attach ps2dev instances as serio port's drvdata

In preparation of having unified interrupt handler for PS/2 devices,
instead of attaching instances of psmouse and atkbd structures as serio's
driver data, switch to attaching ps2dev instances.

Reviewed-by: Raul Rangel <rrangel@chromium.org>
Link: https://lore.kernel.org/r/20230511185252.386941-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: Switch i2c drivers back to use .probe()
Uwe Kleine-König [Wed, 17 May 2023 16:55:42 +0000 (09:55 -0700)]
Input: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230517164645.162294-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agodt-bindings: input: cypress,cyapa: convert to dtschema
Krzysztof Kozlowski [Thu, 11 May 2023 18:36:39 +0000 (11:36 -0700)]
dt-bindings: input: cypress,cyapa: convert to dtschema

Convert the Cypress All Points Addressable (APA) I2C Touchpad / Trackpad
bindings to DT schema.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230511102559.175088-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: adxl34x - do not hardcode interrupt trigger type
Marek Vasut [Thu, 11 May 2023 00:27:55 +0000 (17:27 -0700)]
Input: adxl34x - do not hardcode interrupt trigger type

Instead of hardcoding IRQ trigger type to IRQF_TRIGGER_HIGH, let's
respect the settings specified in the firmware description.

Fixes: e27c729219ad ("Input: add driver for ADXL345/346 Digital Accelerometers")
Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20230509203555.549158-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: pwm-vibra - add support for enable GPIO
Luca Weiss [Mon, 8 May 2023 16:41:54 +0000 (09:41 -0700)]
Input: pwm-vibra - add support for enable GPIO

Some pwm vibrators have a dedicated enable GPIO that needs to be set
high so that the vibrator works. Add support for that optionally.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20230427-hammerhead-vibra-v1-3-e87eeb94da51@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: pwm-vibra - add newline to dev_err prints
Luca Weiss [Mon, 8 May 2023 16:41:40 +0000 (09:41 -0700)]
Input: pwm-vibra - add newline to dev_err prints

Make sure all printed messages end with a newline.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Link: https://lore.kernel.org/r/20230427-hammerhead-vibra-v1-2-e87eeb94da51@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agodt-bindings: input: pwm-vibrator: Add enable-gpio
Luca Weiss [Mon, 8 May 2023 16:41:28 +0000 (09:41 -0700)]
dt-bindings: input: pwm-vibrator: Add enable-gpio

Some pwm vibrators have a dedicated enable GPIO that needs to be set
high so that the vibrator works. Document that.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20230427-hammerhead-vibra-v1-1-e87eeb94da51@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: ili210x - probe even if no resolution information
Marek Vasut [Sat, 6 May 2023 18:40:03 +0000 (11:40 -0700)]
Input: ili210x - probe even if no resolution information

Probe the touch controller driver even if resolution information is not
available. This can happen e.g. in case the touch controller suffered a
failed firmware update and is stuck in bootloader mode.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20230217025200.203833-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: edt-ft5x06 - add delay after waking up
Philipp Puschmann [Fri, 5 May 2023 18:48:45 +0000 (11:48 -0700)]
Input: edt-ft5x06 - add delay after waking up

The touch controller needs some time to wake-up after setting the wake-up
gpio. Without having a delay after wake-up probing regularly fails in
edt_ft5x06_ts_identify() with an error (i.e. EREMOTEIO) that was caused
by a failed i2c transfer.

The datasheet sets the wake-up time to 5 ms, although it is not entirely
clear.

Signed-off-by: Philipp Puschmann <p.puschmann@pironex.com>
Link: https://lore.kernel.org/r/20230505115823.545803-1-p.puschmann@pironex.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: cyttsp5 - implement proper sleep and wakeup procedures
Maximilian Weigand [Fri, 5 May 2023 18:30:12 +0000 (11:30 -0700)]
Input: cyttsp5 - implement proper sleep and wakeup procedures

The touchscreen can be put into a deep sleep state that prevents it from
emitting touch irqs. Put the touchscreen into deep sleep during suspend
if it is not marked as a wakeup source.

This also fixes a problem with the touchscreen getting unresponsive after
system resume when a falling edge trigger is used for the interrupt.
When left on during suspend, the touchscreen would pull the interrupt
line down in response to touch events, leaving the interrupt effectively
disabled after resume.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20230504120316.408687-2-mweigand2017@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: tests - fix input_test_match_device_id test
Dmitry Torokhov [Fri, 5 May 2023 18:16:29 +0000 (11:16 -0700)]
Input: tests - fix input_test_match_device_id test

Properly initialize input_device_id structure in
input_test_match_device_id test to make sure it contains no garbage
causing the test to randomly fail.

Fixes: fdefcbdd6f36 ("Input: Add KUnit tests for some of the input core helper functions")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/ZFLI7T2qZTGJ1UUK@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: avoid calling input_set_abs_val() in the event handling core
Dmitry Torokhov [Tue, 2 May 2023 20:16:57 +0000 (13:16 -0700)]
Input: avoid calling input_set_abs_val() in the event handling core

input_abs_set_val() can nominally call input_alloc_absinfo() which may
allocate memory with GFP_KERNEL flag. This does not happen when
input_abs_set_val() is called by the input core to set current MT slot when
handling a new input event, but it trips certain static analyzers.

Rearrange the code to access the relevant structures directly.

Reported-by: Teng Qi <starmiku1207184332@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Link: https://lore.kernel.org/r/ZFBg379uuHjf+YEM@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: tests - modular KUnit tests should not depend on KUNIT=y
Geert Uytterhoeven [Tue, 2 May 2023 16:42:29 +0000 (09:42 -0700)]
Input: tests - modular KUnit tests should not depend on KUNIT=y

While KUnit tests that cannot be built as a loadable module must depend
on "KUNIT=y", this is not true for modular tests, where it adds an
unnecessary limitation.

Fix this by relaxing the dependency to "KUNIT".

Fixes: fdefcbdd6f361841 ("Input: Add KUnit tests for some of the input core helper functions")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/483c4f520e4acc6357ebba3e605977b4c56374df.1683022164.git.geert+renesas@glider.be
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: tests - fix use-after-free and refcount underflow in input_test_exit()
Geert Uytterhoeven [Tue, 2 May 2023 16:41:46 +0000 (09:41 -0700)]
Input: tests - fix use-after-free and refcount underflow in input_test_exit()

With CONFIG_DEBUG_SLAB=y:

        # Subtest: input_core
        1..3
    input: Test input device as /devices/virtual/input/input1
    8<--- cut here ---
    Unable to handle kernel paging request at virtual address 6b6b6dd7 when read
    ...
     __lock_acquire from lock_acquire+0x26c/0x300
     lock_acquire from _raw_spin_lock_irqsave+0x50/0x64
     _raw_spin_lock_irqsave from devres_remove+0x20/0x7c
     devres_remove from devres_destroy+0x8/0x24
     devres_destroy from input_free_device+0x2c/0x60
     input_free_device from kunit_try_run_case+0x70/0x94 [kunit]

Without CONFIG_DEBUG_SLAB=y:

KTAP version 1
# Subtest: input_core
1..3
    input: Test input device as /devices/virtual/input/input1
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 694 at lib/refcount.c:28 refcount_warn_saturate+0x54/0x100
    refcount_t: underflow; use-after-free.
    ...
    Call Trace: [<0037cad4>] dump_stack+0xc/0x10
     [<00377614>] __warn+0x7e/0xb4
     [<0037768c>] warn_slowpath_fmt+0x42/0x62
     [<001eee1c>] refcount_warn_saturate+0x54/0x100
     [<000b1d34>] kfree_const+0x0/0x20
     [<0036290a>] __kobject_del+0x0/0x6e
     [<001eee1c>] refcount_warn_saturate+0x54/0x100
     [<00362a1a>] kobject_put+0xa2/0xb6
     [<11965770>] kunit_generic_run_threadfn_adapter+0x0/0x1c [kunit]

As per the comments for input_allocate_device() and
input_register_device(), input_free_device() must be called only to free
devices that have not been registered.  input_unregister_device()
already calls input_put_device(), thus leading to a use-after-free.

Moreover, the kunit_suite.exit() method is called after every test case,
even on failures.  As the test itself already does cleanups in its
failure paths, this may lead to a second use-after-free.

Fix the first issue by dropping the call to input_allocate_device() from
input_test_exit().
Fix the second issue by making the cleanup code conditional on a
successful test.

Fixes: fdefcbdd6f361841 ("Input: Add KUnit tests for some of the input core helper functions")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/957b3b309a44d39fb6e38b2a526b250f69ea3d2c.1683022164.git.geert+renesas@glider.be
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: uinput - allow injecting event times
Biswarup Pal [Tue, 2 May 2023 03:19:19 +0000 (20:19 -0700)]
Input: uinput - allow injecting event times

Currently, uinput doesn't use the input_set_timestamp API, so any
event injected using uinput is not accurately timestamped in terms of
measuring when the actual event happened. Hence, call the
input_set_timestamp API from uinput in order to provide a more
accurate sense of time for the event. Propagate only the timestamps
which are a) positive, b) within a pre-defined offset (10 secs) from
the current time, and c) not in the future.

Signed-off-by: Biswarup Pal <biswarupp@google.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Siarhei Vishniakou <svv@google.com>
Link: https://lore.kernel.org/r/20230427000152.1407471-1-biswarupp@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: atmel_mxt_ts - support capacitive keys
André Apitzsch [Tue, 2 May 2023 03:16:52 +0000 (20:16 -0700)]
Input: atmel_mxt_ts - support capacitive keys

Add support for touch keys found in some Atmel touch controller
configurations.

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: André Apitzsch <git@apitzsch.eu>
Link: https://lore.kernel.org/r/20230407-atmel_keys-v2-2-92446a4343cb@apitzsch.eu
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agodt-bindings: input: atmel,maxtouch: add linux,keycodes
André Apitzsch [Tue, 2 May 2023 03:16:37 +0000 (20:16 -0700)]
dt-bindings: input: atmel,maxtouch: add linux,keycodes

In some configurations the touch controller can support the touch keys.
Document the linux,keycodes property that enables those keys and
specifies the keycodes that should be used to report the key events.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: André Apitzsch <git@apitzsch.eu>
Link: https://lore.kernel.org/r/20230407-atmel_keys-v2-1-92446a4343cb@apitzsch.eu
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: i8042 - add missing include
Michał Mirosław [Tue, 2 May 2023 00:39:45 +0000 (17:39 -0700)]
Input: i8042 - add missing include

<linux/i8042.h> include uses ENODEV when included with
!IS_ENABLED(CONFIG_SERIO_I8042) and so need to include it.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Link: https://lore.kernel.org/r/49fd4d400d1ab62095e5ed75a6637f883c0d071b.1682795105.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: cyttsp4_core - change del_timer_sync() to timer_shutdown_sync()
Duoming Zhou [Tue, 2 May 2023 00:37:02 +0000 (17:37 -0700)]
Input: cyttsp4_core - change del_timer_sync() to timer_shutdown_sync()

The watchdog_timer can schedule tx_timeout_task and watchdog_work
can also arm watchdog_timer. The process is shown below:

----------- timer schedules work ------------
cyttsp4_watchdog_timer() //timer handler
  schedule_work(&cd->watchdog_work)

----------- work arms timer ------------
cyttsp4_watchdog_work() //workqueue callback function
  cyttsp4_start_wd_timer()
    mod_timer(&cd->watchdog_timer, ...)

Although del_timer_sync() and cancel_work_sync() are called in
cyttsp4_remove(), the timer and workqueue could still be rearmed.
As a result, the possible use after free bugs could happen. The
process is shown below:

  (cleanup routine)           |  (timer and workqueue routine)
cyttsp4_remove()              | cyttsp4_watchdog_timer() //timer
  cyttsp4_stop_wd_timer()     |   schedule_work()
    del_timer_sync()          |
                              | cyttsp4_watchdog_work() //worker
                              |   cyttsp4_start_wd_timer()
                              |     mod_timer()
    cancel_work_sync()        |
                              | cyttsp4_watchdog_timer() //timer
                              |   schedule_work()
    del_timer_sync()          |
  kfree(cd) //FREE            |
                              | cyttsp4_watchdog_work() // reschedule!
                              |   cd-> //USE

This patch changes del_timer_sync() to timer_shutdown_sync(),
which could prevent rearming of the timer from the workqueue.

Fixes: 17fb1563d69b ("Input: cyttsp4 - add core driver for Cypress TMA4XX touchscreen devices")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20230421082919.8471-1-duoming@zju.edu.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agodt-bindings: input: cypress,tt21000 - add wakeup-source entry to documentation
Maximilian Weigand [Tue, 2 May 2023 00:15:29 +0000 (17:15 -0700)]
dt-bindings: input: cypress,tt21000 - add wakeup-source entry to documentation

The touchscreen can be used to wake up systems from sleep and therefore
the wakeup-source entry should be included in the documentation.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230501113010.891786-6-mweigand@mweigand.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: cyttsp5 - remove unused code
Maximilian Weigand [Tue, 2 May 2023 00:13:25 +0000 (17:13 -0700)]
Input: cyttsp5 - remove unused code

The removed lines are remnants of the vendor driver and are not used in
the upstream driver.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20230501113010.891786-3-mweigand@mweigand.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: drv260x - fix magnitude handling
Luca Weiss [Tue, 2 May 2023 00:02:56 +0000 (17:02 -0700)]
Input: drv260x - fix magnitude handling

First of all, previously the 16-bit magnitude was written as-is to the
device which actually discarded the upper 8 bits since the device has
8-bit registers only. This meant that a strong_magnitude of 0xFF00 would
result in 0. To correct this shift the strong_magnitude / weak_magnitude
input values so we discard the lower 8 bits and keep the upper bits
instead.

Secondly the RTP mode that is used by default interprets the values as
signed (2s complement), so 0x81 = 0%, 0x00 = 50%, 0x7F = 100%. This
doesn't match the FF_RUMBLE interface at all, so let's tell the device
to interpret the data as unsigned instead which gets us 0x00 = 0% and
0xFF = 100%.

As last change switch ERM to using "Closed-Loop Mode, Unidirectional"
instead of "Open-Loop Mode" since it's recommended by the datasheet
compared to open loop and better matches our use case of 0% - 100%
vibration.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-4-1fb28b4cc698@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: drv260x - remove unused .reg_defaults
Luca Weiss [Tue, 2 May 2023 00:02:10 +0000 (17:02 -0700)]
Input: drv260x - remove unused .reg_defaults

Since the driver has disabled regmap caching with REGCACHE_NONE, it's
warning us that we provide defaults that are not used. Remove them.

  [    0.561159] drv260x-haptics 0-005a: No cache used with register defaults set!

Fixes: 7132fe4f5687 ("Input: drv260x - add TI drv260x haptics driver")
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-3-1fb28b4cc698@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: drv260x - sleep between polling GO bit
Luca Weiss [Tue, 2 May 2023 00:01:45 +0000 (17:01 -0700)]
Input: drv260x - sleep between polling GO bit

When doing the initial startup there's no need to poll without any
delay and spam the I2C bus.

Let's sleep 15ms between each attempt, which is the same time as used
in the vendor driver.

Fixes: 7132fe4f5687 ("Input: drv260x - add TI drv260x haptics driver")
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-2-1fb28b4cc698@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoInput: drv260x - fix typo in register value define
Luca Weiss [Mon, 1 May 2023 23:59:37 +0000 (16:59 -0700)]
Input: drv260x - fix typo in register value define

ANANLOG should be ANALOG. Fix the typo.

Fixes: 7132fe4f5687 ("Input: drv260x - add TI drv260x haptics driver")
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-1-1fb28b4cc698@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
14 months agoRevert "Input: xpad - fix support for some third-party controllers"
Dmitry Torokhov [Mon, 1 May 2023 22:11:55 +0000 (15:11 -0700)]
Revert "Input: xpad - fix support for some third-party controllers"

This reverts commit db7220c48d8d71476f881a7ae1285e1df4105409 because it
causes crashes when trying to dereference xpad->dev->dev in xpad_probe()
which has not been set up yet.

Reported-by: syzbot+a3f758b8d8cb7e49afec@syzkaller.appspotmail.com
Reported-by: Dongliang Mu <dzm91@hust.edu.cn>
Link: https://groups.google.com/g/syzkaller-bugs/c/iMhTgpGuIbM
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agodt-bindings: input: pwm-beeper: convert to dt schema
Peng Fan [Fri, 14 Apr 2023 06:35:26 +0000 (23:35 -0700)]
dt-bindings: input: pwm-beeper: convert to dt schema

Convert the binding doc to dt schema, and also fixed the
example from fixed-regulator to regulator-fixed.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230407075259.1593739-1-peng.fan@oss.nxp.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: xpad - fix PowerA EnWired Controller guide button
Vicki Pfau [Fri, 14 Apr 2023 06:58:12 +0000 (23:58 -0700)]
Input: xpad - fix PowerA EnWired Controller guide button

This commit explicitly disables the audio interface the same way the official
driver does. This is needed for some controllers, such as the PowerA Enhanced
Wired Controller for Series X|S (0x20d6:0x200e) to report the guide button.

Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230411031650.960322-3-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: xpad - add constants for GIP interface numbers
Vicki Pfau [Fri, 14 Apr 2023 06:57:42 +0000 (23:57 -0700)]
Input: xpad - add constants for GIP interface numbers

Wired GIP devices present multiple interfaces with the same USB identification
other than the interface number. This adds constants for differentiating two of
them and uses them where appropriate

Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230411031650.960322-2-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: synaptics-rmi4 - fix function name in kerneldoc
Jiapeng Chong [Fri, 14 Apr 2023 06:23:29 +0000 (23:23 -0700)]
Input: synaptics-rmi4 - fix function name in kerneldoc

No functional modification involved.

drivers/input/rmi4/rmi_bus.c:300: warning: expecting prototype for rmi_register_function_handler(). Prototype was for __rmi_register_function_handler() instead.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230209040710.111456-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: raspberrypi-ts - fix refcount leak in rpi_ts_probe
Miaoqian Lin [Fri, 14 Apr 2023 06:05:20 +0000 (23:05 -0700)]
Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe

rpi_firmware_get() take reference, we need to release it in error paths
as well. Use devm_rpi_firmware_get() helper to handling the resources.
Also remove the existing rpi_firmware_put().

Fixes: 0b9f28fed3f7 ("Input: add official Raspberry Pi's touchscreen driver")
Fixes: 3b8ddff780b7 ("input: raspberrypi-ts: Release firmware handle when not needed")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20221223074657.810346-1-linmq006@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - select REGMAP_I2C
Daniel Golle [Mon, 10 Apr 2023 23:55:44 +0000 (16:55 -0700)]
Input: edt-ft5x06 - select REGMAP_I2C

After starting to use regmap API to access registers the edt-ft5x06
driver depends on symbols provided by REGMAP_I2C:

edt-ft5x06.o: in function `edt_ft5x06_ts_probe':
edt-ft5x06.c:1154: undefined reference to `__regmap_init_i2c'
edt-ft5x06.o: in function `edt_ft5x06_ts_identify':
edt-ft5x06.c:897: undefined reference to `__regmap_init_i2c'

Make sure support for I2C regmap is actually selected by adding this
dependency to Kconfig.

Fixes: 9dfd9708ffba ("Input: edt-ft5x06 - convert to use regmap API")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/ZDRBExF1xmxalMZc@makrotopia.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: melfas_mip4 - report palm touches
JungHoon Hyun [Mon, 10 Apr 2023 02:36:57 +0000 (19:36 -0700)]
Input: melfas_mip4 - report palm touches

The driver had the code to differentiate between finger and palm touches,
but did not use this information when reporting contacts. Change it so that
proper "tool" type is assigned to reported contacts.

Signed-off-by: JungHoon Hyun <hyunjunghoon@melfas.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: cma3000_d0x - remove unneeded code
Jiapeng Chong [Mon, 10 Apr 2023 02:10:24 +0000 (19:10 -0700)]
Input: cma3000_d0x - remove unneeded code

Function input_set_abs_params() has already set EV_ABS bit for us.

drivers/input/misc/cma3000_d0x.c:328 cma3000_init() warn: inconsistent indenting.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230407021343.63512-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - calculate points data length only once
Dario Binacchi [Mon, 3 Apr 2023 04:36:46 +0000 (21:36 -0700)]
Input: edt-ft5x06 - calculate points data length only once

It is pointless and expensive to calculate data in the interrupt that
depends on the type of touchscreen, which is detected on the driver
probe and cannot then be changed.
So calculate the size of the data buffer on the driver probe, as well as
the data retrieval command, and then use them in the ISR.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-10-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - unify the crc check
Dario Binacchi [Mon, 3 Apr 2023 04:36:33 +0000 (21:36 -0700)]
Input: edt-ft5x06 - unify the crc check

With this patch, the CRC is always verified by the same function, even in
the case of accessing registers where the number of bytes is minimal.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-9-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - convert to use regmap API
Dario Binacchi [Mon, 3 Apr 2023 04:36:23 +0000 (21:36 -0700)]
Input: edt-ft5x06 - convert to use regmap API

It replaces custom read/write functions with regmap API, making the
driver code more generic.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-8-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - don't print error messages with dev_dbg()
Dario Binacchi [Mon, 3 Apr 2023 04:36:12 +0000 (21:36 -0700)]
Input: edt-ft5x06 - don't print error messages with dev_dbg()

In some parts of the code, error messages were improperly printed with
dev_dbg() calls. In those cases, dev_dbg() has been replaced with
dev_err().

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-7-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - remove code duplication
Dario Binacchi [Mon, 3 Apr 2023 04:27:48 +0000 (21:27 -0700)]
Input: edt-ft5x06 - remove code duplication

The use of the macros M06_REG_ADDR and M06_REG_CMD avoids code
duplication without impacting the application load, and reduces the
chances of errors or mistakes.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-6-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - don't recalculate the CRC
Dario Binacchi [Mon, 3 Apr 2023 04:27:34 +0000 (21:27 -0700)]
Input: edt-ft5x06 - don't recalculate the CRC

There is no need to recalculate the CRC when the data has not changed.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-5-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - add spaces to ensure format specification
Dario Binacchi [Sun, 2 Apr 2023 23:58:29 +0000 (16:58 -0700)]
Input: edt-ft5x06 - add spaces to ensure format specification

It adds spaces around '-' as recommended by the Linux coding style.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-4-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - remove unnecessary blank lines
Dario Binacchi [Sun, 2 Apr 2023 23:58:14 +0000 (16:58 -0700)]
Input: edt-ft5x06 - remove unnecessary blank lines

It removes unnecessary blank lines so that checkpatch doesn't complain
anymore.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-3-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: edt-ft5x06 - fix indentation
Dario Binacchi [Sun, 2 Apr 2023 23:57:04 +0000 (16:57 -0700)]
Input: edt-ft5x06 - fix indentation

Matches the alignment to the open parenthesis as suggested by
checkpatch.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20230402200951.1032513-2-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: tsc2007 - enable cansleep pendown GPIO
Benjamin Bara [Sun, 2 Apr 2023 23:55:27 +0000 (16:55 -0700)]
Input: tsc2007 - enable cansleep pendown GPIO

When a hard IRQ is triggered, the soft IRQ, which decides if an actual
pen down happened, should always be triggered. This enables the usage of
"can_sleep" GPIO chips as "pen down" GPIO, as the value is not read
during the hard IRQ anymore. This might be the case if the GPIO chip is
an expander behind i2c.

Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Link: https://lore.kernel.org/r/20230328-tsc2007-sleep-v5-1-fc55e76d0ced@skidata.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: Add KUnit tests for some of the input core helper functions
Javier Martinez Canillas [Sun, 2 Apr 2023 05:45:09 +0000 (22:45 -0700)]
Input: Add KUnit tests for some of the input core helper functions

The input subsystem doesn't currently have any unit tests, let's add a
CONFIG_INPUT_KUNIT_TEST option that builds a test suite to be executed
with the KUnit test infrastructure.

For now, only three tests were added for some of the input core helper
functions that are trivial to test:

  * input_test_polling: set/get poll interval and set-up a poll handler.

  * input_test_timestamp: set/get input event timestamps.

  * input_test_match_device_id: match a device by bus, vendor, product,
                                version and events capable of handling.

But having the minimal KUnit support allows to add more tests and suites
as follow-up changes. The tests can be run with the following command:

  $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/input/tests/

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Enric Balletbo i Serra <eballetbo@redhat.com>
config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20230330/202303301815.kRKFM3NH-lkp@intel.com/config)
Link: https://lore.kernel.org/r/20230330081831.2291351-1-javierm@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: add a new Novatek NVT-ts driver
Hans de Goede [Sat, 1 Apr 2023 21:21:43 +0000 (14:21 -0700)]
Input: add a new Novatek NVT-ts driver

Add a new driver for the Novatek i2c touchscreen controller as found
on the Acer Iconia One 7 B1-750 tablet. Unfortunately the touchscreen
controller model-number is unknown. Even with the tablet opened up it
is impossible to read the model-number.

Android calls this a "NVT-ts" touchscreen, but that may apply to other
Novatek controller models too.

This appears to be the same controller as the one supported by
https://github.com/advx9600/android/blob/master/touchscreen/NVTtouch_Android4.0/NVTtouch.c
but unfortunately that does not give us a model-number either.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20230326212308.55730-1-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: xpad - fix support for some third-party controllers
Vicki Pfau [Fri, 24 Mar 2023 17:42:27 +0000 (10:42 -0700)]
Input: xpad - fix support for some third-party controllers

Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and
Gamesir-G3w, require a specific packet that the first-party XInput driver sends
before it will start sending reports. It's not currently known what this packet
does, but since the first-party driver always sends it's unlikely that this
could cause issues with existing controllers.

Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230324040446.3487725-3-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
15 months agoInput: xpad - treat Qanba controllers as Xbox360 controllers
Pierre-Loup A. Griffais [Fri, 24 Mar 2023 17:40:39 +0000 (10:40 -0700)]
Input: xpad - treat Qanba controllers as Xbox360 controllers

They act that way in PC mode.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>
Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230324040446.3487725-2-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
16 months agodt-bindings: input: Drop unneeded quotes
Rob Herring [Tue, 21 Mar 2023 18:54:15 +0000 (11:54 -0700)]
dt-bindings: input: Drop unneeded quotes

Cleanup bindings dropping unneeded quotes. Once all these are fixed,
checking for this can be enabled in yamllint.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # for mediatek,mt6779-keypad.yaml
Link: https://lore.kernel.org/r/20230320234718.2930154-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
16 months agoInput: xpad - add VID for Turtle Beach controllers
Vicki Pfau [Fri, 24 Mar 2023 01:32:43 +0000 (18:32 -0700)]
Input: xpad - add VID for Turtle Beach controllers

This adds support for the Turtle Beach REACT-R and Recon Xbox controllers

Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230225012147.276489-4-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
16 months agoInput: xpad - remove unused field in VID/PID table
Vicki Pfau [Fri, 24 Mar 2023 01:31:40 +0000 (18:31 -0700)]
Input: xpad - remove unused field in VID/PID table

The list of specific VID/PID combinations for various controllers recently
added a new field "xtype". However, this field isn't used, nor filled in
the table itself, and was likely added by mistake and overlooked during
review.  Since this field isn't used, it's safe to remove.

Signed-off-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/20230225012147.276489-3-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
16 months agoInput: iqs62x-keys - suppress duplicated error message in .remove()
Uwe Kleine-König [Mon, 20 Mar 2023 04:23:25 +0000 (21:23 -0700)]
Input: iqs62x-keys - suppress duplicated error message in .remove()

If a platform driver's remove callback returns non-zero the driver core
emits an error message. In such a case however iqs62x_keys_remove()
already issued a (better) message. So return zero to suppress the
generic message.

This patch has no other side effects as platform_remove() ignores the
return value of .remove() after the warning.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230318225110.261439-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
16 months agoInput: bcm_iproc_tsc - drop of_match_ptr for ID table
Krzysztof Kozlowski [Fri, 17 Mar 2023 11:15:49 +0000 (04:15 -0700)]
Input: bcm_iproc_tsc - drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230312131514.351603-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>