HID: Intel-thc-hid: Intel-thc: Introduce interrupt delay control
authorEven Xu <even.xu@intel.com>
Wed, 14 May 2025 06:19:41 +0000 (14:19 +0800)
committerJiri Kosina <jkosina@suse.com>
Tue, 10 Jun 2025 19:15:59 +0000 (21:15 +0200)
commit22da60f0304b6bfd2c7cba8ee88086f344ef5206
tree6c5d1f11763a78d18a0bec272b33f4c305b9c268
parent45e92a093099eaf71ff2915a5f6ab5c04c8385e6
HID: Intel-thc-hid: Intel-thc: Introduce interrupt delay control

This patch adds support for a new feature, named "Interrupt Delay",
allowing driver to set a specific delay time for next interrupt
detection. It gives driver a capability to control THC waiting time for
the next interrupt, to reduce the likelihood of spurious readings.

APIs added:
- thc_i2c_set_rx_int_delay(): Set I2C Rx input interrupt delay value
- thc_i2c_rx_int_delay_enable(): Enable or disable I2C Rx interrupt delay

As this interrupt delay feature is only applicable to RxDMA and must
remain disabled during SWDMA operations, it also involves a change
in SWDMA code to record the max input size control feature state
before SWDMA and restore the state after SWDMA.

Signed-off-by: Even Xu <even.xu@intel.com>
Tested-by: Chong Han <chong.han@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Documentation/hid/intel-thc-hid.rst
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.h
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.h
drivers/hid/intel-thc-hid/intel-thc/intel-thc-hw.h