thc_swdma_read(9)
π thc_swdma_read β like, the kernel API manual page, bestie π
okay so real quick, this is thc_swdma_read(9) from the Kernel API Manual, and it's literally the glow-up you needed for reading data off a touch device using software DMA. no cap. let's get into it β¨
πΈ NAME πΈ
thc_swdma_read β use software DMA to read data from touch device π
like, that's the whole vibe. software. DMA. reading. touch device. iconic.
β¨ SYNOPSIS β¨
int thc_swdma_read (struct thc_device *dev , void *write_buff , size_t
write_len , u32 *prd_tbl_len , void *read_buff , size_t *read_len );
she takes six arguments and returns an int, and honestly? main character energy π
π¦ ARGUMENTS π¦
okay bestie, here's the cast of characters β every single one, no skipping, i promise:
devβ the pointer of THC private device context. this is your device's whole personality, like its private little world πwrite_buffβ the pointer of write buffer for the SWDMA sequence. this is what you're sending out into the void π«Άwrite_lenβ the write data length for SWDMA sequence. how much you're sending, in numbers. slay πprd_tbl_lenβ the prd table length of SWDMA engine, and heads up: this one can be set toNULLif you're not about that PRD-table life πread_buffβ the pointer of the read data buffer. this is where the data lands when it comes home πread_lenβ the pointer of the read data length. note it's a pointer β she wants to hand back a length to you, so give her somewhere to put it π
β RETURN β
0on success π (we love a flawless win)- other error codes on failed π (and yeah, if it's not
0, something went sideways β go check those error codes, fr fr)
π₯ SEE ALSO π₯
the kernel file, in all her glory:
./drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
and the whole friend group β every single one, no gatekeeping β¨:
thc_dma_set_max_packet_sizes(9)thc_dma_allocate(9)thc_dma_release(9)thc_dma_configure(9)thc_dma_unconfigure(9)thc_rxdma_reset(9)thc_rxdma_read(9)thc_dma_write(9)
π lowkey a warning but make it cute:prd_tbl_lenis the only argument that's allowed to beNULL. don't go settingdevorread_lentoNULLand then acting surprised, bestie π«Ά
okay that's the whole page, you ate that π
β¨ the source/version situation is literally ./drivers/hid/intel-thc-hid/in... and the date is October 2026 β so yeah, she's fresh, she's future-dated, she's iconic, and that's the whole thc_swdma_read(9) sign-off queen energy πππ¦πβπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms