summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-goodix-spi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* HID: hid-goodix-spi: Add OF supportsCharles Wang2024-11-131-6/+11
| | | | | | | | | | | This patch introduces the following changes: - Adds OF match table. - Hardcodes hid-report-addr in the driver rather than fetching it from the device property. Signed-off-by: Charles Wang <charles.goodix@gmail.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
* HID: hid-goodix: Fix HID get/set feature operation overwritten problemCharles Wang2024-11-061-5/+6
| | | | | | | | | Implement the hid get/set feature report function using a separate address, rather than sharing an address with coordinate reporting, to prevent feature events from being overwritten by coordinate events. Signed-off-by: Charles Wang <charles.goodix@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
* HID: hid-goodix: Return 0 when receiving an empty HID feature packageCharles Wang2024-11-061-2/+5
| | | | | | | | | Align with the i2c-hid driver by returning 0 instead of -EINVAL when an empty response is received, ensuring that userspace programs utilizing the hidraw node receive consistent return values. Signed-off-by: Charles Wang <charles.goodix@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
* move asm/unaligned.h to linux/unaligned.hAl Viro2024-10-021-1/+1
| | | | | | | | | | | | | | | | | | | asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header. auto-generated by the following: for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
* HID: hid-goodix: drop unsupported and undocumented DT partKrzysztof Kozlowski2024-09-251-9/+0
| | | | | | | | | Drop support for Devicetree from, because the binding is being reverted (on basis of duplicating existing binding) and property was not added to the original binding. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
* HID: hid-goodix: Fix type promotion bug in goodix_hid_get_raw_report()Dan Carpenter2024-08-291-7/+15
| | | | | | | | | | | | | | | | | | | | The issue is GOODIX_HID_PKG_LEN_SIZE is defined as sizeof(u16) which is type size_t. However, goodix_hid_check_ack_status() returns negative error codes or potentially a positive but invalid length which is too small. So when we compare "if ((response_data_len <= GOODIX_HID_PKG_LEN_SIZE)" then negative error codes are type promoted to size_t and counted as a positive large value and treated as valid. It would have been easy enough to add some casting to avoid the type promotion, however this patch takes a more thourough approach and moves the length check into goodix_hid_check_ack_status(). Now the function only return negative error codes or zero on success and the length pointer is never set to an invalid length. Fixes: 75e16c8ce283 ("HID: hid-goodix: Add Goodix HID-over-SPI driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
* HID: hid-goodix: Add Goodix HID-over-SPI driverCharles Wang2024-08-191-0/+810
This patch introduces a new driver to support the Goodix GT7986U touch controller. This device is not compatible with Microsoft's HID-over-SPI protocol and therefore needs to implement its own flavor. The data reported is packaged according to the HID protocol but uses SPI for communication to improve speed. This enables the device to transmit not only coordinate data but also corresponding raw data that can be accessed by user-space programs through the hidraw interface. The raw data can be utilized for functions like palm rejection, thereby improving the touch experience. Key features: - Device connection confirmation and initialization - IRQ-based event reporting to the input subsystem - Support for HIDRAW operations (GET_REPORT and SET_REPORT) Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Charles Wang <charles.goodix@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>