linux/drivers/hid/i2c-hid
Johan Hovold 9af867c05b HID: i2c-hid: fix handling of unpopulated devices
A recent commit reordered probe so that the interrupt line is now
requested before making sure that the device exists.

This breaks machines like the Lenovo ThinkPad X13s which rely on the
HID driver to probe second-source devices and only register the variant
that is actually populated. Specifically, the interrupt line may now
already be (temporarily) claimed when doing asynchronous probing of the
touchpad:

	genirq: Flags mismatch irq 191. 00082008 (hid-over-i2c) vs. 00082008 (hid-over-i2c)
	i2c_hid_of 21-0015: Could not register for hid-over-i2c interrupt, irq = 191, ret = -16
	i2c_hid_of: probe of 21-0015 failed with error -16

Fix this by restoring the old behaviour of first making sure the device
exists before requesting the interrupt line.

Note that something like this should probably be implemented also for
"panel followers", whose actual probe is currently effectively deferred
until the DRM panel is probed (e.g. by powering down the device after
making sure it exists and only then register it as a follower).

Fixes: 675cd877c9 ("HID: i2c-hid: Rearrange probe() to power things up later")
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Dennis Gilmore <dgilmore@redhat.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231002155857.24584-1-johan+linaro@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2023-10-06 09:14:19 +02:00
..
i2c-hid-acpi.c HID: i2c-hid: Switch i2c drivers back to use .probe() 2023-06-08 16:21:55 +02:00
i2c-hid-core.c HID: i2c-hid: fix handling of unpopulated devices 2023-10-06 09:14:19 +02:00
i2c-hid-dmi-quirks.c HID: retain initial quirks set up when creating HID devices 2023-02-09 14:24:30 +01:00
i2c-hid-of-elan.c HID: i2c-hid: elan: Add ili9882t timing 2023-08-21 17:21:43 +02:00
i2c-hid-of-goodix.c Merge branch 'for-6.5/i2c-hid' into for-linus 2023-06-27 22:42:28 +02:00
i2c-hid-of.c HID: i2c-hid: Switch i2c drivers back to use .probe() 2023-06-08 16:21:55 +02:00
i2c-hid.h HID: multitouch: Add quirks for flipped axes 2023-01-18 10:08:51 +01:00
Kconfig HID: i2c-hid: add more DRM dependencies 2023-08-03 07:36:41 -07:00
Makefile HID: i2c-hid: elan: Add support for Elan eKTH6915 i2c-hid touchscreens 2022-06-08 11:46:23 +02:00