Repository navigation
Input: ft3658 - review fixes: DMA-safe buffers, fsleep(), the Google source - #133
Conversation
|
Thank you, @nesmeck, for taking all three suggestions, one commit each. The citation in the header checks out: I owe you a correction, because the first commit repeats two things I got wrong on #109:
Once the message is reworded, this is ready to merge, before #134, since your touch test ran with it. Sorry for sending you the wrong reason the first time. |
SPI transfer buffers must be DMA-safe (include/linux/spi/spi.h, Documentation/spi/spi-summary.rst), and tx and rx sit in struct ft3658 next to other fields, so a controller with a DMA channel would map memory those fields share. Put each buffer on its own ARCH_DMA_MINALIGN boundary, after every other field. On gs201 the USI SPI has no DMA channel and runs in polling mode, so this changes nothing on the Pixel 7. Tested on a Pixel 7 (7.3.0-rc6) with the touch node: the controller probes (chip id 0x56, firmware 0x16) and reports touches across the panel with no CRC errors. Suggested-by: Derek Ross <derekross@gmail.com> Assisted-by: Claude Opus 5.5 Signed-off-by: Alejandro Garcia <skipper.pelygro@gmail.com>
The controller needs chip select high for 150 us between transfers, and ft3658_read() runs only from probe and the threaded interrupt handler, both of which can sleep. Use fsleep() rather than spinning in udelay() on every transfer. Tested on a Pixel 7 (7.3.0-rc6) with the touch node: the controller probes (chip id 0x56, firmware 0x16) and reports touches across the panel with no CRC errors. Suggested-by: Derek Ross <derekross@gmail.com> Assisted-by: Claude Opus 5.5 Signed-off-by: Alejandro Garcia <skipper.pelygro@gmail.com>
The header says the protocol follows Google's GPL FocalTech driver for Pixel devices. Name the repository, the directory, the branch and the files, so a reviewer can follow it to the source: focaltech_spi.c for the framing, the status check, the 64-byte alignment rule and the CS-high delay, and focaltech_core.c for the power sequence and the report. Suggested-by: Derek Ross <derekross@gmail.com> Assisted-by: Claude Opus 5.5 Signed-off-by: Alejandro Garcia <skipper.pelygro@gmail.com>
fdc4f44 to
c87796f
Compare
|
Thanks for the correction. The reason you gave first was a fair reading of stock. I force-pushed (
Tested on the Pixel 7 on today's About #134, which landed before this one:
I also opened #167, which enables the MAX77759's I2C bus so 🤖 Generated with Claude Code |
|
Thank you, @nesmeck, for rewording the first commit and for taking I compared the new head with the one I commented on: the only changes are the first commit's message and the two alignment lines (plus I re-ran our gate on today's Nothing more needed from you. I'll merge it as it is. |
Follow-up to #109, one commit per review suggestion, each with
Suggested-by: Derek Ross:txandrxmove after every other field instruct ft3658, each__aligned(ARCH_DMA_MINALIGN), assalixp.cdoes. The SPI API requires DMA-safe transfer buffers (include/linux/spi/spi.h,Documentation/spi/spi-summary.rst). On gs201 the USI SPI has nodmasand runs in polling mode, so nothing changes on the Pixel 7.fsleep()instead ofudelay(). The 150 µs CS-high delay now sleeps instead of spinning.ft3658_read()only runs from probe and the threaded interrupt handler.kernel/google-modules/touch/focaltech_touch,ft3658/, branchandroid-gs-pantah-6.1-android16.focaltech_spi.cis the source for the framing, the status check, the 64-byte alignment rule and the CS-high delay, andfocaltech_core.cfor the power sequence and the report. The commit message says the same.There's no functional change beyond the first two, and the driver is still read-only (no flash writes).
Tested on a Pixel 7 (slot B, 7.3.0-rc6), on today's
omamobile(b0d62d9), with the USB bus PR on top. I ran one boot with the previous head (fdc4f4403), then one that changed only the alignment (7.3.0-rc6-omamobile-push1-gfe29f1dadbb5). In both:focaltech_ft3658loads at boot and reads chip id0x56, firmware0x16;dmesgshows no SPI or CRC errors.Checks:
tools/kernel-pr-check --build OUT --merge origin/omamobilepasses everything:🤖 Generated with Claude Code