RE: [PATCH v10 4/6] HID: intel-thc-hid: intel-ipts: add the HID device

From: Xu, Even

Date: Wed Dec 02 2026 - 21:24:02 EST


Hi, Emfox,

From the code, there is data size register offset at 0x08 which can mention the touch device output max size and input max size.
So the best way is use PIO to first read 64bytes configure registers and understood the device capabilities, then use these capabilities to configure THC, allocate buffer, configure DMA...
That is also the same way QuickSPI/QuickI2C driver used, it will be clearer and avoid the memory re-allocation.

In general, Touch device's capabilities will not change during suspend/resume.
The only exception case is touch firmware update. In this case, it will require a full re-enumeration flow.

There are also some naming related suggestions:
THC is a dedicated device instance, that means, one THC hardware instance only maps to one port, and one port only can connect to one touch devices.
So the port in function name can be ignored.
The suggestion is, if the function is for THC itself, just use THC/thc as the name, if the function is for operating touch device, you can add TIC/tic(Touch IC) in the function name.

Above just some suggestion, not mandatory, you can take them into consideration as code implementation.

I just reviewed first 4 patches in V10, patch 5/6 not finished yet.
Will send review comments later.

Thanks!

Best Regards,
Even Xu

> -----Original Message-----
> From: Emfox Zhou <emfox@xxxxxxxxxx>
> Sent: Wednesday, December 2, 2026 11:40 PM
> To: Xu, Even <even.xu@xxxxxxxxx>
> Cc: Sun, Xinpeng <xinpeng.sun@xxxxxxxxx>; Jiri Kosina <jikos@xxxxxxxxxx>;
> Benjamin Tissoires <bentiss@xxxxxxxxxx>; linux-input@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v10 4/6] HID: intel-thc-hid: intel-ipts: add the HID device
>
> On Wed, 2 Dec 2026, Xu, Even wrote:
> > Why all buffers are need to be resized?
>
> The sizes come from the configuration block, which is only readable after the
> controller is out of reset in thc_ipts_port_start(), so probe cannot know them and
> the buffers are allocated on the first start.
> thc_ipts_resize() only grows, so a normal start is a few comparisons and no
> allocation; it runs again on every start because a resume may report larger limits.
> All four follow max_rx/max_tx: desc and feature hold replies that arrive through
> the receive engine, so they are bounded by max_rx as well.
>
> Your other comments on this series are addressed in the v11 I am about to post.
>
> Thanks,
> Emfox