summaryrefslogtreecommitdiff
path: root/drivers/hid
AgeCommit message (Collapse)AuthorFilesLines
2023-06-19Backmerge tag 'v6.4-rc7' of ↵Dave Airlie5-12/+26
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next Linux 6.4-rc7 Need this to pull in the msm work. Signed-off-by: Dave Airlie <airlied@redhat.com>
2023-06-06Merge tag 'for-linus-2023060501' of ↵Linus Torvalds1-7/+6
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fix from Jiri Kosina: - Final, confirmed fix for regression causing some devices connected via Logitech HID++ Unifying receiver take too long to initialize (Benjamin Tissoires) * tag 'for-linus-2023060501' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: hidpp: terminate retry loop on success
2023-06-05HID: hidpp: terminate retry loop on successBenjamin Tissoires1-7/+6
It seems we forgot the normal case to terminate the retry loop, making us asking 3 times each command, which is probably a little bit too much. And remove the ugly "goto exit" that can be replaced by a simpler "break" Fixes: 586e8fede795 ("HID: logitech-hidpp: Retry commands when device is busy") Suggested-by: Mark Lord <mlord@pobox.com> Tested-by: Mark Lord <mlord@pobox.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-06-01Merge tag 'for-linus-2023060101' of ↵Linus Torvalds5-6/+21
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - Regression fix for overlong long timeouts during initialization on some Logitech Unifying devices (Bastien Nocera) - error handling and overflow fixes for Wacom driver (Denis Arefev, Jason Gerecke, Nikita Zhandarovich) * tag 'for-linus-2023060101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: logitech-hidpp: Handle timeout differently from busy HID: wacom: Add error check to wacom_parse_and_register() HID: google: add jewel USB id HID: wacom: avoid integer overflow in wacom_intuos_inout() HID: wacom: Check for string overflow from strscpy calls
2023-05-31HID: logitech-hidpp: Handle timeout differently from busyBastien Nocera1-0/+1
If an attempt at contacting a receiver or a device fails because the receiver or device never responds, don't restart the communication, only restart it if the receiver or device answers that it's busy, as originally intended. This was the behaviour on communication timeout before commit 586e8fede795 ("HID: logitech-hidpp: Retry commands when device is busy"). This fixes some overly long waits in a critical path on boot, when checking whether the device is connected by getting its HID++ version. Signed-off-by: Bastien Nocera <hadess@hadess.net> Suggested-by: Mark Lord <mlord@pobox.com> Fixes: 586e8fede795 ("HID: logitech-hidpp: Retry commands when device is busy") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217412 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-05-23HID: wacom: Add error check to wacom_parse_and_register()Denis Arefev1-1/+6
Added a variable check and transition in case of an error Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev <arefev@swemel.ru> Reviewed-by: Ping Cheng <ping.cheng@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-05-23HID: google: add jewel USB idSung-Chi Li2-0/+3
Add 1 additional hammer-like device. Signed-off-by: Sung-Chi Li <lschyi@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-05-23HID: wacom: avoid integer overflow in wacom_intuos_inout()Nikita Zhandarovich1-1/+1
If high bit is set to 1 in ((data[3] & 0x0f << 28), after all arithmetic operations and integer promotions are done, high bits in wacom->serial[idx] will be filled with 1s as well. Avoid this, albeit unlikely, issue by specifying left operand's __u64 type for the right operand. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: 3bea733ab212 ("USB: wacom tablet driver reorganization") Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru> Reviewed-by: Ping Cheng <ping.cheng@wacom.com> Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-05-23HID: wacom: Check for string overflow from strscpy callsJason Gerecke1-4/+10
The strscpy function is able to return an error code when a copy would overflow the size of the destination. The copy is stopped and the buffer terminated before overflow actually occurs so it is safe to continue execution, but we should still produce a warning should this occur. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Ping Cheng <ping.cheng@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-05-09Merge drm/drm-next into drm-misc-nextMaxime Ripard40-631/+943
Start the 6.5 release cycle. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2023-05-08hid/hid-picolcd_fb: Use struct fb_info.screen_bufferThomas Zimmermann1-2/+2
Use info->screen_buffer when reading and writing framebuffers in system memory. It's the correct pointer for this address space. The struct fb_info has a union to store the framebuffer memory. This can either be info->screen_base if the framebuffer is stored in I/O memory, or info->screen_buffer if the framebuffer is stored in system memory. As the driver operates on the latter address space, it is wrong to use .screen_base and .screen_buffer must be used instead. This also gets rid of casting needed due to not using the correct data type. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-4-tzimmermann@suse.de
2023-04-27Merge tag 'driver-core-6.4-rc1' of ↵Linus Torvalds10-10/+10
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the large set of driver core changes for 6.4-rc1. Once again, a busy development cycle, with lots of changes happening in the driver core in the quest to be able to move "struct bus" and "struct class" into read-only memory, a task now complete with these changes. This will make the future rust interactions with the driver core more "provably correct" as well as providing more obvious lifetime rules for all busses and classes in the kernel. The changes required for this did touch many individual classes and busses as many callbacks were changed to take const * parameters instead. All of these changes have been submitted to the various subsystem maintainers, giving them plenty of time to review, and most of them actually did so. Other than those changes, included in here are a small set of other things: - kobject logging improvements - cacheinfo improvements and updates - obligatory fw_devlink updates and fixes - documentation updates - device property cleanups and const * changes - firwmare loader dependency fixes. All of these have been in linux-next for a while with no reported problems" * tag 'driver-core-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (120 commits) device property: make device_property functions take const device * driver core: update comments in device_rename() driver core: Don't require dynamic_debug for initcall_debug probe timing firmware_loader: rework crypto dependencies firmware_loader: Strip off \n from customized path zram: fix up permission for the hot_add sysfs file cacheinfo: Add use_arch[|_cache]_info field/function arch_topology: Remove early cacheinfo error message if -ENOENT cacheinfo: Check cache properties are present in DT cacheinfo: Check sib_leaf in cache_leaves_are_shared() cacheinfo: Allow early level detection when DT/ACPI info is missing/broken cacheinfo: Add arm64 early level initializer implementation cacheinfo: Add arch specific early level initializer tty: make tty_class a static const structure driver core: class: remove struct class_interface * from callbacks driver core: class: mark the struct class in struct class_interface constant driver core: class: make class_register() take a const * driver core: class: mark class_release() as taking a const * driver core: remove incorrect comment for device_create* MIPS: vpe-cmp: remove module owner pointer from struct class usage. ...
2023-04-27Merge tag 'for-linus-2023042601' of ↵Linus Torvalds25-614/+917
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - import a bunch of HID selftests from out-of-tree hid-tools project (Benjamin Tissoires) - drastically reducing Bluetooth disconnects on hid-nintendo driven devices (Daniel J. Ogorchock) - lazy initialization of battery interfaces in wacom driver (Jason Gerecke) - generic support for all Kye tablets (David Yang) - proper rumble queue overrun handling in hid-nintendo (Daniel J. Ogorchock) - support for ADC measurement in logitech-hidpp driver (Bastien Nocera) - reset GPIO support in i2c-hid (Hans de Goede) - improved handling of generic "Digitizer" usage (Jason Gerecke) - support for KEY_CAMERA_FOCUS (Feng Qi) - quirks for Apple Geyser 3 and Apple Geyser 4 (Alex Henrie) - assorted functional fixes and device ID additions * tag 'for-linus-2023042601' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (54 commits) HID: amd_sfh: Fix max supported HID devices HID: wacom: generic: Set battery quirk only when we see battery data HID: wacom: Lazy-init batteries HID: Ignore battery for ELAN touchscreen on ROG Flow X13 GV301RA HID: asus: explicitly include linux/leds.h HID: lg-g15: explicitly include linux/leds.h HID: steelseries: explicitly include linux/leds.h HID: apple: Set the tilde quirk flag on the Geyser 3 HID: apple: explicitly include linux/leds.h HID: mcp2221: fix get and get_direction for gpio HID: mcp2221: fix report layout for gpio get HID: wacom: Set a default resolution for older tablets HID: i2c-hid-of: Add reset GPIO support to i2c-hid-of HID: i2c-hid-of: Allow using i2c-hid-of on non OF platforms HID: i2c-hid-of: Consistenly use dev local variable in probe() HID: kye: Fix rdesc for kye tablets HID: amd_sfh: Support for additional light sensor HID: amd_sfh: Handle "no sensors" enabled for SFH1.1 HID: amd_sfh: Increase sensor command timeout for SFH1.1 HID: amd_sfh: Correct the stop all command ...
2023-04-27Merge branch 'for-6.4/wacom' into for-linusJiri Kosina3-41/+54
- improved handling of battery quirk (Jason Gerecke) - lazy initialization of battery interfaces (Jason Gerecke)
2023-04-27Merge branch 'for-6.4/nintendo' into for-linusJiri Kosina1-9/+86
- drastically reducing Bluetooth disconnects on hid-nintendo driven devices (Daniel J. Ogorchock) - proper rumble queue overrun handling (Daniel J. Ogorchock)
2023-04-27Merge branch 'for-6.4/mcp2221' into for-linusJiri Kosina1-3/+3
- generic code improvements for mcp2221 driver (Louis Morhet)
2023-04-26Merge branch 'for-6.4/logitech-hidpp' into for-linusJiri Kosina1-7/+249
- support for ADC measurement (Bastien Nocera) - support for Logitech G935 (Bastien Nocera)
2023-04-26Merge branch 'for-6.4/led-includes' into for-linusJiri Kosina3-0/+3
- explicit include fixes (Thomas Weißschuh)
2023-04-26Merge branch 'for-6.4/kye' into for-linusJiri Kosina3-526/+421
- generic support for all Kye tablets (David Yang)
2023-04-26Merge branch 'for-6.4/i2c-hid' into for-linusJiri Kosina2-11/+33
- reset GPIO support (Hans de Goede)
2023-04-26Merge branch 'for-6.4/core' into for-linusJiri Kosina2-0/+13
- improve handling of generic "Digitizer" usage (Jason Gerecke) - support for KEY_CAMERA_FOCUS (Feng Qi)
2023-04-26Merge branch 'for-6.4/apple' into for-linusJiri Kosina1-8/+12
- quirks for Apple Geyser 3 and Apple Geyser 4 (Alex Henrie)
2023-04-25HID: amd_sfh: Fix max supported HID devicesBasavaraj Natikar1-1/+1
commit 4bd763568dbd ("HID: amd_sfh: Support for additional light sensor") adds additional sensor devices, but forgets to add the number of HID devices to match. Thus, the number of HID devices does not match the actual number of sensors. In order to prevent corruption and system hangs when more than the allowed number of HID devices are accessed, the number of HID devices is increased accordingly. Fixes: 4bd763568dbd ("HID: amd_sfh: Support for additional light sensor") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217354 Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Link: https://lore.kernel.org/r/20230424160406.2579888-1-Basavaraj.Natikar@amd.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-14HID: wacom: generic: Set battery quirk only when we see battery dataJason Gerecke1-22/+11
Some devices will include battery status usages in the HID descriptor but we won't see that battery data for one reason or another. For example, AES sensors won't send battery data unless an AES pen is in proximity. If a user does not have an AES pen but instead only interacts with the AES touchscreen with their fingers then there is no need for us to create a battery object. Similarly, if a family of peripherals shares the same HID descriptor between wired-only and wireless-capable SKUs, users of the former may never see a battery event and will not want a power_supply object created. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217062 Link: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2354 Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Tested-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-14HID: wacom: Lazy-init batteriesJason Gerecke2-17/+6
Rather than creating batteries as part of the initial device probe, let's make the process lazy. This gives us the opportunity to prevent batteries from being created in situations where they are unnecessary. There are two cases in particular where batteries are being unnecessarily created at initialization. These are AES sensors (for which we don't know any battery status information until a battery-powered pen actually comes into prox) peripheral tablets which share HID descriptors between the wired-only and wireless-capable SKUs of a family of devices. This patch will delay battery initialization of the former until a pen actually comes into prox. It will delay battery initialization of the latter until either a pen comes into prox or a "heartbeat" packet is processed. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217062 Link: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2354 Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Tested-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-14Daniel Borkmann says:Jakub Kicinski1-3/+0
==================== pull-request: bpf-next 2023-04-13 We've added 260 non-merge commits during the last 36 day(s) which contain a total of 356 files changed, 21786 insertions(+), 11275 deletions(-). The main changes are: 1) Rework BPF verifier log behavior and implement it as a rotating log by default with the option to retain old-style fixed log behavior, from Andrii Nakryiko. 2) Adds support for using {FOU,GUE} encap with an ipip device operating in collect_md mode and add a set of BPF kfuncs for controlling encap params, from Christian Ehrig. 3) Allow BPF programs to detect at load time whether a particular kfunc exists or not, and also add support for this in light skeleton, from Alexei Starovoitov. 4) Optimize hashmap lookups when key size is multiple of 4, from Anton Protopopov. 5) Enable RCU semantics for task BPF kptrs and allow referenced kptr tasks to be stored in BPF maps, from David Vernet. 6) Add support for stashing local BPF kptr into a map value via bpf_kptr_xchg(). This is useful e.g. for rbtree node creation for new cgroups, from Dave Marchevsky. 7) Fix BTF handling of is_int_ptr to skip modifiers to work around tracing issues where a program cannot be attached, from Feng Zhou. 8) Migrate a big portion of test_verifier unit tests over to test_progs -a verifier_* via inline asm to ease {read,debug}ability, from Eduard Zingerman. 9) Several updates to the instruction-set.rst documentation which is subject to future IETF standardization (https://lwn.net/Articles/926882/), from Dave Thaler. 10) Fix BPF verifier in the __reg_bound_offset's 64->32 tnum sub-register known bits information propagation, from Daniel Borkmann. 11) Add skb bitfield compaction work related to BPF with the overall goal to make more of the sk_buff bits optional, from Jakub Kicinski. 12) BPF selftest cleanups for build id extraction which stand on its own from the upcoming integration work of build id into struct file object, from Jiri Olsa. 13) Add fixes and optimizations for xsk descriptor validation and several selftest improvements for xsk sockets, from Kal Conley. 14) Add BPF links for struct_ops and enable switching implementations of BPF TCP cong-ctls under a given name by replacing backing struct_ops map, from Kui-Feng Lee. 15) Remove a misleading BPF verifier env->bypass_spec_v1 check on variable offset stack read as earlier Spectre checks cover this, from Luis Gerhorst. 16) Fix issues in copy_from_user_nofault() for BPF and other tracers to resemble copy_from_user_nmi() from safety PoV, from Florian Lehner and Alexei Starovoitov. 17) Add --json-summary option to test_progs in order for CI tooling to ease parsing of test results, from Manu Bretelle. 18) Batch of improvements and refactoring to prep for upcoming bpf_local_storage conversion to bpf_mem_cache_{alloc,free} allocator, from Martin KaFai Lau. 19) Improve bpftool's visual program dump which produces the control flow graph in a DOT format by adding C source inline annotations, from Quentin Monnet. 20) Fix attaching fentry/fexit/fmod_ret/lsm to modules by extracting the module name from BTF of the target and searching kallsyms of the correct module, from Viktor Malik. 21) Improve BPF verifier handling of '<const> <cond> <non_const>' to better detect whether in particular jmp32 branches are taken, from Yonghong Song. 22) Allow BPF TCP cong-ctls to write app_limited of struct tcp_sock. A built-in cc or one from a kernel module is already able to write to app_limited, from Yixin Shen. Conflicts: Documentation/bpf/bpf_devel_QA.rst b7abcd9c656b ("bpf, doc: Link to submitting-patches.rst for general patch submission info") 0f10f647f455 ("bpf, docs: Use internal linking for link to netdev subsystem doc") https://lore.kernel.org/all/20230307095812.236eb1be@canb.auug.org.au/ include/net/ip_tunnels.h bc9d003dc48c3 ("ip_tunnel: Preserve pointer const in ip_tunnel_info_opts") ac931d4cdec3d ("ipip,ip_tunnel,sit: Add FOU support for externally controlled ipip devices") https://lore.kernel.org/all/20230413161235.4093777-1-broonie@kernel.org/ net/bpf/test_run.c e5995bc7e2ba ("bpf, test_run: fix crashes due to XDP frame overwriting/corruption") 294635a8165a ("bpf, test_run: fix &xdp_frame misplacement for LIVE_FRAMES") https://lore.kernel.org/all/20230320102619.05b80a98@canb.auug.org.au/ ==================== Link: https://lore.kernel.org/r/20230413191525.7295-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-04-13HID: Ignore battery for ELAN touchscreen on ROG Flow X13 GV301RAweiliang15032-0/+3
Ignore the reported battery level of the built-in touchscreen to suppress battery warnings when a stylus is used. The device ID was added and the battery ignore quirk was enabled. Signed-off-by: weiliang1503 <weiliang1503@gmail.com> Link: https://lore.kernel.org/r/20230330115638.16146-1-weiliang1503@gmail.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: asus: explicitly include linux/leds.hThomas Weißschuh1-0/+1
Instead of relying on an accidental, transitive inclusion of linux/leds.h use it directly. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230215-power_supply-leds-hid-v1-3-35b6f1dcee8a@weissschuh.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: lg-g15: explicitly include linux/leds.hThomas Weißschuh1-0/+1
Instead of relying on an accidental, transitive inclusion of linux/leds.h use it directly. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230215-power_supply-leds-hid-v1-2-35b6f1dcee8a@weissschuh.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: steelseries: explicitly include linux/leds.hThomas Weißschuh1-0/+1
Instead of relying on an accidental, transitive inclusion of linux/leds.h use it directly. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230215-power_supply-leds-hid-v1-1-35b6f1dcee8a@weissschuh.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: apple: Set the tilde quirk flag on the Geyser 3Alex Henrie1-1/+2
I was finally able to obtain a MacBook1,1 to test and I've now confirmed that it has the tilde key quirk as well: Product Model Year System CPU Shape Labels Country Quirky ============================================================================ 05ac:0218 A1181 2006 MacBook1,1 T2500 ISO British 13 Yes Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Link: https://lore.kernel.org/r/20230404024829.13982-1-alexhenrie24@gmail.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: apple: explicitly include linux/leds.hThomas Weißschuh1-0/+1
Instead of relying on an accidental, transitive inclusion of linux/leds.h use it directly. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230215-power_supply-leds-hid-v1-4-35b6f1dcee8a@weissschuh.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: mcp2221: fix get and get_direction for gpioLouis Morhet1-2/+2
The mcp2221_raw_event retrieves the value and direction of gpio on the same command, by setting the value on mcp->status and the direction on mcp->gpio_dir; and the offset at which they are read is based on mcp->gp_idx, set by the gpiochip callbacks. However, the individual gpiochip calls set the index to look for directly on the field they want to track. This create a "double offset" in the final read in the response report. Align the behaviour of mcp2221_raw_event and mcp_gpio_get/mcp_gpio_get_direction by putting gp_idx on those calls to the base offset of the gpio status struct. Signed-off-by: Louis Morhet <lmorhet@kalrayinc.com> Link: https://lore.kernel.org/r/dd0b23800a79d2a464e1e9ed429b018b69fd5df2.1680602387.git.lmorhet@kalrayinc.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: mcp2221: fix report layout for gpio getLouis Morhet1-1/+1
The documentation of the component (section 3.1.12 GET GPIO VALUES) describes the hid report structure with two fields per gpio: its value, followed by its direction. However, the driver describes it with a wrong order: direction followed by value. Fix the structure representing the report answered by the chip to the GET GPIO VALUES command. Fixes commit 567b8e9fed8a ("HID: mcp2221: Fix GPIO output handling") Signed-off-by: Louis Morhet <lmorhet@kalrayinc.com> Link: https://lore.kernel.org/r/945967fbab56d53f9630ad3844b64734f8c3107e.1680602387.git.lmorhet@kalrayinc.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: wacom: Set a default resolution for older tabletsPing Cheng1-2/+10
Some older tablets may not report physical maximum for X/Y coordinates. Set a default to prevent undefined resolution. Signed-off-by: Ping Cheng <ping.cheng@wacom.com> Link: https://lore.kernel.org/r/20230409164229.29777-1-ping.cheng@wacom.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: i2c-hid-of: Add reset GPIO support to i2c-hid-ofHans de Goede1-0/+21
Add reset GPIO support to the generic i2c-hid-of driver This is necessary to make the Wacom digitizer on the Lenovo Yoga Book 1 (yb1-x90f/l) work and this will also allow consolidating the 2 specialized i2c-hid-of-elan.c and i2c-hid-of-goodix.c drivers into the generic i2c-hid-of driver. For now the new "post-reset-deassert-delay-ms" property is only used on x86/ACPI (non devicetree) devs. IOW it is not used in actual devicetree files and the same goes for the reset GPIO. The devicetree-bindings maintainers have requested properties like these to not be added to the devicetree-bindings, so the new property + GPIO are deliberately not added to the existing devicetree-bindings. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20230413093625.71146-4-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: i2c-hid-of: Allow using i2c-hid-of on non OF platformsHans de Goede2-3/+7
There are some x86 tablets / 2-in-1s which ship with Android as their factory OS image. These have pretty broken ACPI tables, relying on everything being hardcoded in the factory kernel image. platform/x86/x86-android-tablets.c manually instantiates i2c-clients for i2c devices on these tablets to make them work with the mainline kernel. The Lenovo Yoga Book 1 (yb1-x90f/l) is such a 2-in-1. It has 2 I2C-HID devices its main touchscreen and a Wacom digitizer. Its main touchscreen can alternatively also be used in HiDeep's native protocol mode but for the Wacom digitizer we really need I2C-HID. This patch allows using i2c-hid-of on non OF platforms so that it can bind to a non ACPI instantiated i2c_client on x86 for the Wacom digitizer. Note the driver already has an "i2c-over-hid" i2c_device_id (rather then an of_device_id). Besides enabling building on non-OF platforms this also replaces the only of_property_read_u32() call with device_property_read_u32() note that other properties where already read using device_property_read_...(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20230413093625.71146-3-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: i2c-hid-of: Consistenly use dev local variable in probe()Hans de Goede1-8/+5
i2c_hid_of_probe() has a dev local variable pointing to &i2c_client->dev, consistently use this everywhere in i2c_hid_of_probe(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20230413093625.71146-2-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: kye: Fix rdesc for kye tabletsDavid Yang1-3/+10
I forget to add them in previous commit 2dd438cdc2e9 ("HID: kye: Add support for all kye tablets"). Signed-off-by: David Yang <mmyangfl@gmail.com> Link: https://lore.kernel.org/r/20230411173308.422756-1-mmyangfl@gmail.com Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-13HID: amd_sfh: Support for additional light sensorBasavaraj Natikar4-0/+10
There is support for additional light sensors in the SFH firmware. As a result, add support for additional light sensors. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Handle "no sensors" enabled for SFH1.1Basavaraj Natikar1-0/+11
Based on num_hid_devices, each sensor device is initialized. If "no sensors" is initialized, amd_sfh work initialization and scheduling doesn’t make sense and returns EOPNOTSUPP to stop driver probe. Hence, add a check for "no sensors" enabled to handle the special case. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Increase sensor command timeout for SFH1.1Basavaraj Natikar1-2/+2
The initialization of SFH1.1 sensors may take some time. Hence, increase sensor command timeouts in order to obtain status responses within a maximum timeout. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Correct the stop all commandBasavaraj Natikar1-1/+3
Misinterpreted the stop all command in SHF1.1 firmware. Therefore, it is necessary to update the stop all command accordingly to disable all sensors. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Add support for shutdown operationBasavaraj Natikar1-0/+9
As soon as the system is booted after shutdown, the sensors may remain in a weird state and fail to initialize. Therefore, all sensors should be turned off during shutdown. Fixes: 4f567b9f8141 ("SFH: PCIe driver to add support of AMD sensor fusion hub") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Fix illuminance valueBasavaraj Natikar2-2/+2
Illuminance value is actually 32 bits, but is incorrectly trancated to 16 bits. Hence convert to integer illuminace accordingly to reflect correct values. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Correct the sensor enable and disable commandBasavaraj Natikar1-0/+2
In order to start or stop sensors, the firmware command needs to be changed to add an additional default subcommand value. For this reason, add a subcommand value to enable or disable sensors accordingly. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Correct the structure fieldsBasavaraj Natikar1-3/+3
Misinterpreted sfh_cmd_base structure member fields. Therefore, adjust the structure member fields accordingly to reflect functionality. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13Merge tag 'for-linus-2023041201' of ↵Linus Torvalds6-4/+16
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - kernel panic fix for intel-ish-hid driver (Tanu Malhotra) - buffer overflow fix in hid-sensor-custom driver (Todd Brandt) - two device specific quirks (Alessandro Manca, Philippe Troin) * tag 'for-linus-2023041201' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: intel-ish-hid: Fix kernel panic during warm reset HID: hid-sensor-custom: Fix buffer overrun in device name HID: topre: Add support for 87 keys Realforce R2 HID: add HP 13t-aw100 & 14t-ea100 digitizer battery quirks
2023-04-03HID: logitech-hidpp: Set wireless_status for G935 receiverBastien Nocera1-1/+25
Set the USB interface "wireless_status" for the G935 receiver when receiving battery notifications. This will allow sound daemons such as Pipewire or PulseAudio to know whether or not the headset is turned on and connected. Signed-off-by: Bastien Nocera <hadess@hadess.net> Link: https://lore.kernel.org/r/20230302105555.51417-6-hadess@hadess.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-04-03HID: logitech-hidpp: Add Logitech G935 headsetBastien Nocera1-0/+3
Add the Logitech G935 headset that uses the HID++ protocol to the list of supported devices. Signed-off-by: Bastien Nocera <hadess@hadess.net> Link: https://lore.kernel.org/r/20230302105555.51417-3-hadess@hadess.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>