devm_iio_dm..._with_handle(9)
β¨ devm_iio_dmaengine_buffer_setup_with_handle(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one's a little function from the kernel with a very long name, but don't panic β it's actually super straightforward. Let's get into it π«Ά
πΈ NAME πΈ
devm_iio_dmaengine_buffer_setup_with_handle β literally just sets up a DMA buffer for an IIO device. That's the whole vibe π
π¦ SYNOPSIS π¦
int devm_iio_dmaengine_buffer_setup_with_handle (struct device *dev ,
struct iio_dev *indio_dev , struct dma_chan *chan , enum
iio_buffer_direction dir );
π ARGUMENTS π
devβ the device that gives you devm ownership (i.e. the managed-lifetime situation, so you don't have to manually free it later β iconic behavior tbh)indio_devβ the IIO device this buffer is getting attached to πchanβ the DMA channel. your DMA channel. go get it, main character πdirβ the direction of the buffer,inorout. pick a lane bestie β¨
π DESCRIPTION π
So what actually happens here? It allocates a brand-new IIO buffer using devm_iio_dmaengine_buffer_alloc, then attaches that buffer to an IIO device using iio_device_attach_buffer. Two steps, both handled. slay π₯
It also appends the INDIO_BUFFER_HARDWARE mode to the supported modes of the IIO device β so the device officially supports that mode now. periodt π
And the tea β: this is the same as devm_iio_dmaengine_buffer_setup_ext, the one difference being that the caller manages requesting and releasing the DMA channel handle themselves. that's it, that's the whole distinction, no cap π
β SEE ALSO β
- Kernel file
./drivers/iio/buffer/industrialio-buffer-dmaengine.cβ go read the source if you want the full lore, iykyk π iio_dmaengine_buffer_alloc(9)iio_dmaengine_buffer_free(9)iio_dmaengine_buffer_teardown(9)iio_dmaengine_buffer_setup_ext(9)devm_iio_dmaengine_buffer_setup_ext(9)
and that's the page bestie πΈ this gem lives over in ./drivers/iio/buffer, dated October 2026, and it's part of the Kernel API Manual β the same page title we opened with, devm_iio_dm..._with_handle(9), coming right back around at the end like a true full-circle moment ππ love that for us, mwah π
π¦ 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