]> www.infradead.org Git - users/jedix/linux-maple.git/commit
HID: intel-thc-hid: intel-thc: Add THC DMA interfaces
authorEven Xu <even.xu@intel.com>
Mon, 6 Jan 2025 02:31:35 +0000 (10:31 +0800)
committerJiri Kosina <jkosina@suse.com>
Thu, 9 Jan 2025 09:14:15 +0000 (10:14 +0100)
commita688404b2e20f00cce6d0a2b888ef4ca9154e144
treeded5d120cd1fdc0912cf3b8dbab8589a9890a382
parent86f5f4abe799ac8cd9f28346818781fd9bdb642f
HID: intel-thc-hid: intel-thc: Add THC DMA interfaces

As THC PIO only has 64 bytes FIFO length, THC DMAs are introduced to
send/receive large data packets.

THC has three types of DMA channels: Read DMA channel (RxDMA), Write DMA
channel (TxDMA) and Software DMA (SWDMA).

In addition to basic DMA functions, THC RxDMA also includes an auto
hardware sequence which can handle external touch device's interrupt
automatically without software involved. THC RxDMA channel usually is
used for handling touch input reports.

THC TxDMA is very similar with general IO TxDMA, and usually is used
for sending command/request to exteranl touch device.

THC SWDMA can perform read, write followed by read operation
according to different configurations. Unlike RxDMA triggered by bus
activity, SWDMA can be triggered by SW driver at any time, for example:
- Retrieving an input report without interrupt
- Sending command followed by reading response

THC DMA operation flow includes 4 steps:
1. Allocate DMA buffers
2. Configure opcode, fill PRD table with DMA buffers, enable DMA channel
3. Wait for completion, read out DMA buffers and update buffer pointers
4. Stop DMA and release DMA buffers

THC Hardware layer driver provides APIs for all above DMA Steps.

Co-developed-by: Xinpeng Sun <xinpeng.sun@intel.com>
Signed-off-by: Xinpeng Sun <xinpeng.sun@intel.com>
Signed-off-by: Even Xu <even.xu@intel.com>
Tested-by: Rui Zhang <rui1.zhang@intel.com>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Tested-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/intel-thc-hid/Makefile
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 [new file with mode: 0644]
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.h [new file with mode: 0644]