Lines Matching +full:hid +full:- +full:over +full:- +full:i2c
1 .. SPDX-License-Identifier: GPL-2.0
10 - A natively half-duplex Quad I/O capable SPI master
11 - Low latency I2C interface to support HIDI2C compliant devices
12 - A HW sequencer with RW DMA capability to system memory
15 Host driver configures and controls the touch devices over THC interface. THC provides high
16 bandwidth DMA services to the touch driver and transfers the HID report to host system main memory.
22 Unlike other common SPI/I2C controllers, THC handles the HID device data interrupt and reset
29 -------------------------------
31 Below diagram illustrates the high-level architecture of THC software/hardware stack, which is fully
36 ----------------------------------------------
37 | +-----------------------------------+ |
39 | +-----------------------------------+ |
40 | +-----------------------------------+ |
41 | | HID Multi-touch Driver | |
42 | +-----------------------------------+ |
43 | +-----------------------------------+ |
44 | | HID Core | |
45 | +-----------------------------------+ |
46 | +-----------------------------------+ |
48 | +-----------------------------------+ |
49 | +-----------------------------------+ |
51 | +-----------------------------------+ |
52 | +----------------+ +----------------+ |
54 | +----------------+ +----------------+ |
55 ----------------------------------------------
56 ----------------------------------------------
57 | +-----------------------------------+ |
59 | +-----------------------------------+ |
60 | +-----------------------------------+ |
62 | +-----------------------------------+ |
63 | +-----------------------------------+ |
65 | +-----------------------------------+ |
66 ----------------------------------------------
69 components that sense and transfer either discrete touch data or heatmap data in the form of HID
70 reports over the SPI/I2C bus to the THC Controller on the host.
78 THC QuickSPI/QuickI2C driver, also as known as HIDSPI/HIDI2C driver, is registered as a HID
79 low-level driver that manages the THC Controller and implements HIDSPI/HIDI2C protocol.
83 ------------------------
86 ---------------------------------
88 | +---------------------------+ |
90 | +---------------------------+ |
91 | +---------------------------+ |
93 | +---------------------------+ |
94 +---------------+ | +------------+ +------------+ |
95 | System Memory +---+--+ DMA | | PIO | |
96 +---------------+ | +------------+ +------------+ |
97 | +---------------------------+ |
99 | +---------------------------+ |
100 | +------------+ +------------+ |
101 | | SPI/I2C | | GPIO | |
103 | +------------+ +------------+ |
104 ---------------------------------
111 PIO (Programmed I/O, defined in section 3.2) status and control, SPI bus configure, I2C subIP
119 SPI bus and I2C bus to finish a bus data transaction, it also can automatically handle
125 As THC supports HIDSPI/HIDI2C protocols, it has SPI controller and I2C subIP in it to expose
126 SPI bus and I2C bus. THC also integrates a GPIO controller to provide interrupt line support
133 ------------------
141 --------------------
143 THC supports two types of bus for Touch IC connection: Enhanced SPI bus and I2C bus.
164 | --------------------THC sends---------------------------------|
169 | ---------THC Sends---------------||-----Touch IC sends--------|
172 2.2.2 I2C Port
175 THC also integrates I2C controller in it, it's called I2C SubSystem. When PORT_TYPE = 01, THC
176 is configured to I2C mode. Comparing to SPI mode which can be configured through MMIO registers
177 directly, THC needs to use PIO read (by setting SubIP read opcode) to I2C subIP APB registers'
195 ----------
219 When THC is working in I2C mode, opcodes are used to tell THC what's the next PIO type:
220 I2C SubIP APB register read, I2C SubIP APB register write, I2C touch IC device read,
221 I2C touch IC device write, I2C touch IC device write followed by read.
223 Here are the THC pre-defined opcodes for I2C mode:
226 opcode Corresponding I2C command Address
228 0x12 Read I2C SubIP APB internal registers 0h - FFh
229 0x13 Write I2C SubIP APB internal registers 0h - FFh
230 0x14 Read external Touch IC through I2C bus N/A
231 0x18 Write external Touch IC through I2C bus N/A
232 0x1C Write then read external Touch IC through I2C bus N/A
236 -------
239 configuration registers, or access I2C subIP's configuration registers. To use PIO to perform
240 I/O operations, driver should pre-program PIO control registers and PIO data registers and kick
255 always in HID device descriptor which needs THC driver to read it out from HID Device (Touch IC).
262 - Program read/write data size in THC_SS_BC.
263 - Program I/O target address in THC_SW_SEQ_DATA0_ADDR.
264 - If write, program the write data in THC_SW_SEQ_DATA0..THC_SW_SEQ_DATAn.
265 - Program the PIO opcode in THC_SS_CMD.
266 - Set TSSGO = 1 to start the PIO write sequence.
267 - If THC_SS_CD_IE = 1, SW will receives a MSI when the PIO is completed.
268 - If read, read out the data in THC_SW_SEQ_DATA0..THC_SW_SEQ_DATAn.
271 -------
279 raw data mode. RxDMA2 is used for HID data mode and it is the RxDMA engine currently driver uses
280 for HID input report data retrieval.
283 software, THC will start auto-handling receiving logic.
292 For I2C mode, THC RxDMA's behavior is a little bit different, because of HIDI2C protocol difference
328 -------
344 ------------------------ -------------- --------------
345 | PRD table base address +----+ PRD table #1 +-----+ PRD Entry #1 |
346 ------------------------ -------------- --------------
347 --------------
349 --------------
350 --------------
352 --------------
360 To simplify the design, SW assumes worst-case memory fragmentation. Therefore,each PRD table shall
362 number of PRD-entries per PRD table.
382 to the PRD which the DMA engine is currently processing. This pointer rolls over once the circular
388 next PRD table is going to be stored. SW needs to ensure that this pointer rolls over once the
419 .. code-block:: c
425 In general, every PRD table means one HID touch data packet. Every DMA engine can support
437 --------------
439 - Call ACPI _RST method to reset Touch IC device.
440 - Read the reset response from TIC through PIO read.
441 - Issue a command to retrieve device descriptor from Touch IC through PIO write.
442 - Read the device descriptor from Touch IC through PIO read.
443 - If the device descriptor is valid, allocate DMA buffers and configure all DMA channels.
444 - Issue a command to retrieve report descriptor from Touch IC through DMA.
447 --------------------------
451 - Touch IC interrupts the THC Controller using an in-band THC interrupt.
452 - THC Sequencer reads the input report header by transmitting read approval as a signal
454 - THC Sequencer executes a Input Report Body Read operation corresponding to the value
456 - THC DMA engine begins fetching data from the THC Sequencer and writes to host memory
460 - The THC Sequencer checks for the “Last Fragment Flag” bit in the Input Report Header.
462 - If the “Last Fragment Flag” bit is enabled the THC Sequencer enters End-of-Frame Processing.
466 - THC DMA engine increments the read pointer of the Read PRD CB, sets EOF interrupt status
468 - If THC EOF interrupt is enabled by the driver in the control register (THC_M_PRT_READ_DMA_CNTRL_2…
473 - THC QuickSPI driver checks CB write Ptr and CB read Ptr to identify if any data frame in DMA
475 - THC QuickSPI driver gets first unprocessed PRD table.
476 - THC QuickSPI driver scans all PRD entries in this PRD table to calculate the total frame size.
477 - THC QuickSPI driver copies all frame data out.
478 - THC QuickSPI driver checks the data type according to input report body, and calls related
480 - THC QuickSPI driver updates write Ptr.
483 ---------------------------
487 - HID core calls raw_request callback with a request to THC QuickSPI driver.
488 - THC QuickSPI Driver converts request provided data into the output report packet and copies it
490 - Start TxDMA to complete the write operation.
496 --------------
498 - Read device descriptor from Touch IC device through PIO write followed by read.
499 - If the device descriptor is valid, allocate DMA buffers and configure all DMA channels.
500 - Use PIO or TxDMA to write a SET_POWER request to TIC's command register, and check if the
502 - Use PIO or TxDMA to write a RESET request to TIC's command register. If the write operation
504 - Use SWDMA to read report descriptor through TIC's report descriptor register.
507 --------------------------
511 - Touch IC asserts the interrupt indicating that it has an interrupt to send to HOST.
512 THC Sequencer issues a READ request over the I2C bus. The HIDI2C device returns the
514 - THC Sequencer continues the Read operation as per the size of data indicated in the
516 - THC DMA engine begins fetching data from the THC Sequencer and writes to host memory
521 - THC Sequencer enters End-of-Input Report Processing.
522 - If the device has no more input reports to send to the host, it de-asserts the interrupt
528 - THC DMA engine increments the read pointer of the Read PRD CB, sets EOF interrupt status
530 - If THC EOF interrupt is enabled by the driver in the control register
535 - THC QuickI2C driver checks CB write Ptr and CB read Ptr to identify if any data frame in DMA
537 - THC QuickI2C driver gets first unprocessed PRD table.
538 - THC QuickI2C driver scans all PRD entries in this PRD table to calculate the total frame size.
539 - THC QuickI2C driver copies all frame data out.
540 - THC QuickI2C driver call hid_input_report to send the input report content to HID core, which
543 - THC QuickI2C driver updates write Ptr.
546 ---------------------------
550 - HID core call THC QuickI2C raw_request callback.
551 - THC QuickI2C uses PIO or TXDMA to write a SET_REPORT request to TIC's command register. Report
553 - THC QuickI2C programs TxDMA buffer with TX Data to be written to TIC's data register. The first
567 - HIDSPI: https://download.microsoft.com/download/c/a/0/ca07aef3-3e10-4022-b1e9-c98cea99465d/HidSpi…
568 - HIDI2C: https://download.microsoft.com/download/7/d/d/7dd44bb7-2a7a-4505-ac1c-7227d3d96d5b/hid-ov…