Commit Graph

1121596 Commits

Author SHA1 Message Date
Chen Jun
81cd7e8489 Input: i8042 - fix leaking of platform device on module removal
Avoid resetting the module-wide i8042_platform_device pointer in
i8042_probe() or i8042_remove(), so that the device can be properly
destroyed by i8042_exit() on module unload.

Fixes: 9222ba68c3 ("Input: i8042 - add deferred probe support")
Signed-off-by: Chen Jun <chenjun102@huawei.com>
Link: https://lore.kernel.org/r/20221109034148.23821-1-chenjun102@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-11-18 15:59:02 -08:00
Takashi Iwai
26c263bf18 Input: i8042 - apply probe defer to more ASUS ZenBook models
There are yet a few more ASUS ZenBook models that require the deferred
probe.  At least, there are different ZenBook UX325x and UX425x
models.  Let's extend the DMI matching table entries for adapting
those missing models.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20221108142027.28480-1-tiwai@suse.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-11-08 10:22:46 -08:00
Hans de Goede
e13757f524 Input: soc_button_array - add Acer Switch V 10 to dmi_use_low_level_irq[]
Like on the Acer Switch 10 SW5-012, the Acer Switch V 10 SW5-017's _LID
method messes with home- and power-button GPIO IRQ settings, causing an
IRQ storm.

Add a quirk entry for the Acer Switch V 10 to the dmi_use_low_level_irq[]
DMI quirk list, to use low-level IRQs on this model, fixing the IRQ storm.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20221106215320.67109-2-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-11-07 10:33:26 -08:00
Hans de Goede
8e9ada1d0e Input: soc_button_array - add use_low_level_irq module parameter
It seems that the Windows drivers for the ACPI0011 soc_button_array
device use low level triggered IRQs rather then using edge triggering.

Some ACPI tables depend on this, directly poking the GPIO controller's
registers to clear the trigger type when closing a laptop's/2-in-1's lid
and re-instating the trigger when opening the lid again.

Linux sets the edge/level on which to trigger to both low+high since
it is using edge type IRQs, the ACPI tables then ends up also setting
the bit for level IRQs and since both low and high level have been
selected by Linux we get an IRQ storm leading to soft lockups.

As a workaround for this the soc_button_array already contains
a DMI quirk table with device models known to have this issue.

Add a module parameter for this so that users can easily test if their
device is affected too and so that they can use the module parameter
as a workaround.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20221106215320.67109-1-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-11-07 10:33:25 -08:00
Tetsuo Handa
b8ebf25099 Input: iforce - invert valid length check when fetching device IDs
syzbot is reporting uninitialized value at iforce_init_device() [1], for
commit 6ac0aec6b0 ("Input: iforce - allow callers supply data buffer
when fetching device IDs") is checking that valid length is shorter than
bytes to read. Since iforce_get_id_packet() stores valid length when
returning 0, the caller needs to check that valid length is longer than or
equals to bytes to read.

Reported-by: syzbot <syzbot+4dd880c1184280378821@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 6ac0aec6b0 ("Input: iforce - allow callers supply data buffer when fetching device IDs")
Link: https://lore.kernel.org/r/531fb432-7396-ad37-ecba-3e42e7f56d5c@I-love.SAKURA.ne.jp
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-11-07 10:28:58 -08:00
Hans de Goede
c7e37cc624 Input: goodix - try resetting the controller when no config is set
On ACPI systems (irq_pin_access_method == IRQ_PIN_ACCESS_ACPI_*) the driver
does not reset the controller at probe time, because sometimes the system
firmware loads a config and resetting might loose this config.

On the Nanote UMPC-01 device OTOH the config is in flash of the controller,
the controller needs a reset to load this; and the system firmware does not
reset the controller on a cold boot.

To fix the Nanote UMPC-01 touchscreen not working on a cold boot, try
resetting the controller and then re-reading the config when encountering
a config with 0 width/height/max_touch_num value and the controller has
not already been reset by goodix_ts_probe().

This should be safe to do in general because normally we should never
encounter a config with 0 width/height/max_touch_num. Doing this in
general not only avoids the need for a DMI quirk, but also might help
other systems.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Link: https://lore.kernel.org/r/20221025122930.421377-2-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-11-03 12:49:35 -07:00
Sheng-Liang Pan
a01aca4b05 dt-bindings: input: touchscreen: Add compatible for Goodix GT7986U chip
Add a compatible for Goodix touch screen chip GT7986U which is
is expected to be fully compatible with a driver written for GT7375P.

Signed-off-by: Sheng-Liang Pan <sheng-liang.pan@quanta.corp-partner.google.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221006185333.v7.3.I52e4b4b20e2eb0ae20f2a9bb198aa6410f04cf16@changeid
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-10-16 21:49:30 -07:00
Aman Dhoot
ac5408991e Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode
The device works fine in native RMI mode, there is no reason to use legacy
PS/2 mode with it.

Signed-off-by: Aman Dhoot <amandhoot12@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-10-15 20:44:12 -07:00
Dmitry Torokhov
5f8f8574c7 Merge branch 'next' into for-linus
Prepare input updates for 6.1 merge window.
2022-10-09 22:30:23 -07:00
Liang He
fe5b6aaef7 Input: i8042 - fix refount leak on sparc
In i8042_platform_init() and i8042_platform_exit(), we should call
of_node_put() for the reference 'root' returned by
of_find_node_by_path() which has increased the refcount.

Fixes: f57caaefac ("[SERIO] i8042-sparcio.h: Convert to of_driver framework.")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220711064300.358757-1-windhl@126.com
[dtor: rearranged i8042_is_mr_coffee() a bit]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-10-09 22:26:53 -07:00
Huacai Chen
fdd7c96176 Input: i8042 - add LoongArch support in i8042-acpipnpio.h
LoongArch uses ACPI and nearly the same as X86/IA64 for 8042. So modify
i8042-acpipnpio.h slightly and enable it for LoongArch in i8042.h. Then
i8042 driver can work well under the ACPI firmware with PNP typed key-
board and mouse configured in DSDT.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220917064020.1639709-2-chenhuacai@loongson.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-10-09 22:26:52 -07:00
Huacai Chen
8761b9b580 Input: i8042 - rename i8042-x86ia64io.h to i8042-acpipnpio.h
Now i8042-x86ia64io.h is shared by X86 and IA64, but it can be shared
by more platforms (such as LoongArch) with ACPI firmware on which PNP
typed keyboard and mouse is configured in DSDT. So rename it to i8042-
acpipnpio.h.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220917064020.1639709-1-chenhuacai@loongson.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-10-09 22:26:52 -07:00
Samuel Holland
63c5eb157c Input: pinephone-keyboard - support the proxied I2C bus
The PinePhone keyboard case contains a battery managed by an integrated
power bank IC. The power bank IC communicates over I2C, and the keyboard
MCU firmware provides an interface to read and write its registers.
Let's use this interface to implement a SMBus adapter, so we can reuse
the driver for the power bank IC.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220618165747.55709-4-samuel@sholland.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-10-09 22:26:52 -07:00
Samuel Holland
17406967ec Input: pinephone-keyboard - add PinePhone keyboard driver
The official Pine64 PinePhone keyboard case contains a matrix keypad and
a MCU which runs a libre firmware. Add support for its I2C interface.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220618165747.55709-3-samuel@sholland.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-10-09 22:26:52 -07:00
Samuel Holland
7502426140 dt-bindings: input: Add the PinePhone keyboard binding
Add devicetree support for the PinePhone keyboard case, which provides a
matrix keyboard interface and a proxied I2C bus.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220618165747.55709-2-samuel@sholland.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-30 23:22:30 -07:00
Rob Herring
1d666ab2da dt-bindings: input: Convert hid-over-i2c to DT schema
Convert the hid-over-i2c binding to DT schema format. The supplies should
probably be specific to a specific device, but it seems they are already
in use otherwise. 'wakeup-source' is added as it was not explicitly
documented.

There's a few warnings for undocumented properties 'vcc-supply' and
'reset-gpios'. Those remain as they probably should have a specific
compatible as well.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220927150916.1091217-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-30 21:00:55 -07:00
Christophe JAILLET
2d09ac951b input: drop empty comment blocks
Commit 1a59d1b8e0 ("treewide: Replace GPLv2 boilerplate/reference with
SPDX - rule 156") has left some empty comment blocks.

Remove them to save a few lines of code.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/26a2b905b259bfffaf2de5b26f2007b8606970ed.1664478665.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-29 16:25:42 -07:00
Nate Yocom
fff1011a26 Input: xpad - add X-Box Adaptive Profile button
Adds a new quirk for controllers that have a Profile button which has 4
states, reflected as an ABS_PROFILE axis with 4 values.

Signed-off-by: Nate Yocom <nate@yocom.org>
Tested-by: Bastien Nocera <hadess@hadess.net>
Link: https://lore.kernel.org/r/20220908173930.28940-6-nate@yocom.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-28 18:31:39 -07:00
Nate Yocom
1260cd04a6 Input: add ABS_PROFILE to uapi and documentation
Define new ABS_PROFILE axis for input devices which need it, e.g. X-Box
Adaptive Controller and X-Box Elite 2.

Signed-off-by: Nate Yocom <nate@yocom.org>
Link: https://lore.kernel.org/r/20220908173930.28940-4-nate@yocom.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-28 18:31:37 -07:00
Nate Yocom
f45aaae620 Input: xpad - add X-Box Adaptive XBox button
Adaptive controller sets 0x02 bit for this button, all others set 0x01
so presence of either is used for BTN_MODE.

Signed-off-by: Nate Yocom <nate@yocom.org>
Tested-by: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com
Link: https://lore.kernel.org/r/20220908173930.28940-3-nate@yocom.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-28 18:31:36 -07:00
Nate Yocom
d218fe0433 Input: xpad - add X-Box Adaptive support
Adds correct VID/PID for this XTYPE_XBOXONE compatible controller to
xpad_device[] table.

Signed-off-by: Nate Yocom <nate@yocom.org>
Tested-by: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220908173930.28940-2-nate@yocom.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-28 18:31:34 -07:00
Colin Ian King
c85c36798b Input: ims-pcu - fix spelling mistake "BOOLTLOADER" -> "BOOTLOADER"
There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220928211003.61872-1-colin.i.king@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-28 15:22:46 -07:00
Zeng Heng
25d0bef5d1 Input: ibm-panel - add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Link: https://lore.kernel.org/r/20220928143133.1809491-1-zengheng4@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-28 09:04:32 -07:00
Andy Shevchenko
600655cdc0 Input: icn8505 - utilize acpi_get_subsystem_id()
Replace open coded variant of recently introduced
acpi_get_subsystem_id().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220928110548.43955-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-28 09:01:32 -07:00
Pavel Rojtberg
677065244a Input: xpad - decipher xpadone packages with GIP defines
only renames, no functional changes. Some of the packets we send
seem superfluous now. Unfortunately I dont have the hardware to verify
whether they are.

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Link: https://lore.kernel.org/r/20220913213133.584979-3-rojtberg@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-27 18:03:46 -07:00
Pavel Rojtberg
90c9978959 Input: xpad - refactor using BIT() macro
reduces the amount of magic numbers and makes the code more readable

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Link: https://lore.kernel.org/r/20220913213133.584979-2-rojtberg@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-27 18:03:44 -07:00
zhang songyi
9dedc91593 Input: synaptics-rmi4 - convert to use sysfs_emit() APIs
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the value
to be returned to user space.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
Link: https://lore.kernel.org/r/20220927070936.258300-1-zhang.songyi@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-27 09:00:41 -07:00
Dmitry Torokhov
2b7672b0fa Input: twl4030-pwrbutton - add missing of.h include
The driver is using of_match_ptr() and therefore needs to include
of.h header.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220927052217.2784593-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-27 08:43:04 -07:00
Sebastian Krzyszkowiak
e62563db85 Input: snvs_pwrkey - fix SNVS_HPVIDR1 register address
Both i.MX6 and i.MX8 reference manuals list 0xBF8 as SNVS_HPVIDR1
(chapters 57.9 and 6.4.5 respectively).

Without this, trying to read the revision number results in 0 on
all revisions, causing the i.MX6 quirk to apply on all platforms,
which in turn causes the driver to synthesise power button release
events instead of passing the real one as they happen even on
platforms like i.MX8 where that's not wanted.

Fixes: 1a26c92071 ("Input: snvs_pwrkey - send key events for i.MX6 S, DL and Q")
Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/4599101.ElGaqSPkdT@pliszka
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-27 07:18:30 -07:00
Gustavo A. R. Silva
24613f7c7f Input: applespi - replace zero-length array with DECLARE_FLEX_ARRAY() helper
Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations in anonymous union with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for flexible-array members in unions.

Link: https://github.com/KSPP/linux/issues/193
Link: https://github.com/KSPP/linux/issues/219
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/YzIeJeqU73G+UI8g@work
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-26 22:02:32 -07:00
Dmitry Torokhov
da7a0123ed Input: ep93xx_keypad - add missing linux/input.h include
We are going to clean up matrix_keymap.h from unnecessary includes,
so the driver needs to include API that it uses directly.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220923194738.927408-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-26 08:15:17 -07:00
Dmitry Torokhov
4e9cded619 Input: imx_keypad - add missing linux/input.h include
We are going to clean up matrix_keymap.h from unnecessary includes,
so the driver needs to include API that it uses directly.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220923194738.927408-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-26 08:15:10 -07:00
Dmitry Torokhov
81a7cba79d Input: mt6779-keypad - add missing linux/input.h include
We are going to clean up matrix_keymap.h from unnecessary includes,
so the driver needs to include API that it uses directly.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220923194738.927408-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-26 08:15:03 -07:00
Dmitry Torokhov
d25a9d8f8d Input: st-keyscan - add missing linux/input.h and linux/of.h includes
We are going to clean up matrix_keymap.h from unnecessary includes,
so the driver needs to include API that it uses directly.

Also let's sort includes alphabetically.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220923194738.927408-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-26 08:14:29 -07:00
Dmitry Torokhov
ddc9589d79 Input: lm8333 - add missing linux/input.h include
We are going to clean up matrix_keymap.h from unnecessary includes,
so the driver needs to include API that it uses directly.

Also let's sort includes alphabetically and drop unneeded irq.h

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220923194738.927408-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-26 08:13:24 -07:00
Jason Wang
5db8a0d31c Input: joydev - fix comment typo
The double `from' is duplicated in the comment, remove one.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Link: https://lore.kernel.org/r/20220804120800.60415-1-wangborong@cdjrlc.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-25 00:57:25 -07:00
Luca Weiss
4160f9680d dt-bindings: input: qcom,pm8xxx-vib: convert to yaml
Convert the PM8xxx PMIC Vibrator bindings to dt-schema.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220917155705.2284-1-luca@z3ntu.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-24 23:25:47 -07:00
Peter Ujfalusi
6dc0a438f9 Input: twl4030-vibra - drop legacy, non DT boot support
Legacy or non DT boot is no longer possible on systems where the
tw4030/5030 is used.

Drop the support for handling legacy pdata.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20220616153323.29464-1-peter.ujfalusi@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-24 22:40:04 -07:00
Mark Pearson
2fd003ee8a Input: synaptics - disable Intertouch for Lenovo T14 and P14s AMD G1
Since intertouch was enabled for the T14 and P14s AMD G1 laptops there
have been a number of reports of touchpads not working well.

Debugging this with Synaptics they noted that intertouch should not be
enabled as SMBUS host notify is not available on these laptops.

Reverting the previous commit (e4ce4d3a93)
to restore functionality back to what it was.

Note - we are working with Synaptics to see if there is a better
solution, but nothing is confirmed as yet.

Signed-off-by: Mark Pearson <markpearson@lenovo.com>
Link: https://lore.kernel.org/r/20220920193936.8709-1-markpearson@lenovo.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-24 22:18:13 -07:00
Jeff LaBundy
e336d85e5b Input: iqs62x-keys - drop unused device node references
Each call to device/fwnode_get_named_child_node() must be matched
with a call to fwnode_handle_put() once the corresponding node is
no longer in use. This ensures a reference count remains balanced
in the case of dynamic device tree support.

Currently, the driver never calls fwnode_handle_put(). This patch
adds the missing calls.

Fixes: ce1cb0eec8 ("input: keyboard: Add support for Azoteq IQS620A/621/622/624/625")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/YyYbYvlkq5cy55dc@nixie71
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-24 22:17:43 -07:00
Yang Yingliang
a54dc27bd2 Input: melfas_mip4 - fix return value check in mip4_probe()
devm_gpiod_get_optional() may return ERR_PTR(-EPROBE_DEFER),
add a minus sign to fix it.

Fixes: 6ccb1d8f78 ("Input: add MELFAS MIP4 Touchscreen driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220924030715.1653538-1-yangyingliang@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-24 22:09:49 -07:00
Matthias Schiffer
87d3d1b140 Input: synaptics-rmi4 - drop useless gotos in rmi_f34v7_do_reflash()
Returning directly makes the code clearer.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-10-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:14 -07:00
Matthias Schiffer
7d128a8d41 Input: synaptics-rmi4 - simplify rmi_f34v7_start_reflash()
rmi_f34v7_enter_flash_prog() already enables IRQs and checks the flash
status - there's no need for rmi_f34v7_start_reflash() to do the same just
before calling rmi_f34v7_enter_flash_prog().

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-9-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00
Matthias Schiffer
b077d523d4 Input: synaptics-rmi4 - remove unneeded struct register_offset
All register offsets are fixed, and a number of places even read or
write multiple registers as a block, so there is no way to support
reordering them without move involved changes. Remove the unneeded level
of indirection in the register access.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-8-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00
Matthias Schiffer
d8d007f25c Input: synaptics-rmi4 - make rmi_f34v7_erase_all() use the "erase all" command
A full erase is required to recover from error conditions like "Bad
Partition Table". Various individual partition erase commands can be
(and need to be) omitted, as they will fail until a new partition table
has been written.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-7-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00
Matthias Schiffer
d316e709cd Input: synaptics-rmi4 - reset after writing partition table
When recovering from a bad partition table (for example after an
interrupted update), a reset is necessary for the new partition table to
become effective. Without this reset, writing the core code partition
will fail with status 0x03 (Invalid Command).

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-6-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00
Matthias Schiffer
0113b49bd9 Input: synaptics-rmi4 - rewrite partition table unconditionally
Preparation for use of the "erase application" command, which is required
to recover from a bad partition table error condition. Rather than adding
complex fallback error paths for such errors, it seems more robust to do
the full erase unconditionally.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-5-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00
Matthias Schiffer
b4d6c6a07f Input: synaptics-rmi4 - fix command completion check for bootloader v7/v8
The command register is reset to 0 when a command has completed. Check
for this condition instead of the error status, which will not accurately
reflect completion. In particular, the incorrect condition caused every
command error to be reported as a timeout.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-4-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00
Matthias Schiffer
33fe4d976f Input: synaptics-rmi4 - introduce rmi_f34v7_check_command_status() helper
Add a function that waits for the last command to complete and checks
the status, and use it where appropriate. This prepares for the subsequent
fix of the completion condition in rmi_f34_attention(), which would
previously lead to a timeout instead of a more detailed error message
whenever a command was unsuccessful with v7/v8 bootloaders.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-3-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00
Matthias Schiffer
28f677e9d1 Input: synaptics-rmi4 - fix firmware update operations with bootloader v8
Commit a6977d758f ("Input: synaptics-rmi4 - support bootloader v8 in
f34v7") allowed the F34v7 driver to probe with bootloader v8, but it did
not update various other bootloader version checks in the F34 code.

Fixes: a6977d758f ("Input: synaptics-rmi4 - support bootloader v8 in f34v7")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-2-matthias.schiffer@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-09-23 13:00:13 -07:00