thc_swdma_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to NULL if 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 ⭐

  • 0 on 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 ✨:


πŸ’€ lowkey a warning but make it cute: prd_tbl_len is the only argument that's allowed to be NULL. don't go setting dev or read_len to NULL and 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