Skip to content

Commit e6ce25b

Browse files
dlechnunojsa
authored andcommitted
iio: buffer-dmaengine: document iio_dmaengine_buffer_setup_ext
The iio_dmaengine_buffer_setup_ext() function is public and should be documented. Also, while touching this, fix the description of @dev in related functions. @dev does not strictly have to be the parent of the IIO device. It is only passed to dma_request_chan() so strictly speaking, it can be any device that is a valid DMA channel consumer. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20241115-dlech-mainline-spi-engine-offload-2-v5-9-bea815bd5ea5@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent abb9290 commit e6ce25b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

drivers/iio/buffer/industrialio-buffer-dmaengine.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static const struct iio_dev_attr *iio_dmaengine_buffer_attrs[] = {
255255

256256
/**
257257
* iio_dmaengine_buffer_alloc() - Allocate new buffer which uses DMAengine
258-
* @dev: Parent device for the buffer
258+
* @dev: DMA channel consumer device
259259
* @channel: DMA channel name, typically "rx".
260260
*
261261
* This allocates a new IIO buffer which internally uses the DMAengine framework
@@ -344,6 +344,21 @@ void iio_dmaengine_buffer_free(struct iio_buffer *buffer)
344344
}
345345
EXPORT_SYMBOL_NS_GPL(iio_dmaengine_buffer_free, IIO_DMAENGINE_BUFFER);
346346

347+
/**
348+
* iio_dmaengine_buffer_setup_ext() - Setup a DMA buffer for an IIO device
349+
* @dev: DMA channel consumer device
350+
* @indio_dev: IIO device to which to attach this buffer.
351+
* @channel: DMA channel name, typically "rx".
352+
* @dir: Direction of buffer (in or out)
353+
*
354+
* This allocates a new IIO buffer with devm_iio_dmaengine_buffer_alloc()
355+
* and attaches it to an IIO device with iio_device_attach_buffer().
356+
* It also appends the INDIO_BUFFER_HARDWARE mode to the supported modes of the
357+
* IIO device.
358+
*
359+
* Once done using the buffer iio_dmaengine_buffer_free() should be used to
360+
* release it.
361+
*/
347362
struct iio_buffer *iio_dmaengine_buffer_setup_ext(struct device *dev,
348363
struct iio_dev *indio_dev,
349364
const char *channel,
@@ -409,7 +424,7 @@ static void __devm_iio_dmaengine_buffer_free(void *buffer)
409424

410425
/**
411426
* devm_iio_dmaengine_buffer_setup_ext() - Setup a DMA buffer for an IIO device
412-
* @dev: Parent device for the buffer
427+
* @dev: Device for devm ownership and DMA channel consumer device
413428
* @indio_dev: IIO device to which to attach this buffer.
414429
* @channel: DMA channel name, typically "rx".
415430
* @dir: Direction of buffer (in or out)

0 commit comments

Comments
 (0)