diff options
Diffstat (limited to 'drivers/iio/buffer')
-rw-r--r-- | drivers/iio/buffer/Kconfig | 10 | ||||
-rw-r--r-- | drivers/iio/buffer/industrialio-buffer-dmaengine.c | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/iio/buffer/Kconfig b/drivers/iio/buffer/Kconfig index 63f265c8b466..047b931591a9 100644 --- a/drivers/iio/buffer/Kconfig +++ b/drivers/iio/buffer/Kconfig @@ -11,7 +11,7 @@ config IIO_BUFFER_CB usage. That is, those where the data is pushed to the consumer. config IIO_BUFFER_DMA - tristate + tristate "Industrial I/O DMA buffer infrastructure" help Provides the generic IIO DMA buffer infrastructure that can be used by drivers for devices with DMA support to implement the IIO buffer. @@ -20,13 +20,13 @@ config IIO_BUFFER_DMA infrastructure. config IIO_BUFFER_DMAENGINE - tristate + tristate "Industrial I/O DMA buffer integration with DMAEngine" select IIO_BUFFER_DMA help Provides a bonding of the generic IIO DMA buffer infrastructure with the - DMAengine framework. This can be used by converter drivers with a DMA port + DMAEngine framework. This can be used by converter drivers with a DMA port connected to an external DMA controller which is supported by the - DMAengine framework. + DMAEngine framework. Should be selected by drivers that want to use this functionality. @@ -48,7 +48,7 @@ config IIO_KFIFO_BUF often to read from the buffer. config IIO_TRIGGERED_BUFFER - tristate + tristate "Industrial I/O triggered buffer support" select IIO_TRIGGER select IIO_KFIFO_BUF help diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c index 6dedf12b69a4..93b4e9e6bb55 100644 --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c @@ -45,7 +45,8 @@ static struct dmaengine_buffer *iio_buffer_to_dmaengine_buffer( return container_of(buffer, struct dmaengine_buffer, queue.buffer); } -static void iio_dmaengine_buffer_block_done(void *data) +static void iio_dmaengine_buffer_block_done(void *data, + const struct dmaengine_result *result) { struct iio_dma_buffer_block *block = data; unsigned long flags; @@ -53,6 +54,7 @@ static void iio_dmaengine_buffer_block_done(void *data) spin_lock_irqsave(&block->queue->list_lock, flags); list_del(&block->head); spin_unlock_irqrestore(&block->queue->list_lock, flags); + block->bytes_used -= result->residue; iio_dma_buffer_block_done(block); } @@ -74,7 +76,7 @@ static int iio_dmaengine_buffer_submit_block(struct iio_dma_buffer_queue *queue, if (!desc) return -ENOMEM; - desc->callback = iio_dmaengine_buffer_block_done; + desc->callback_result = iio_dmaengine_buffer_block_done; desc->callback_param = block; cookie = dmaengine_submit(desc); @@ -157,7 +159,7 @@ static const struct attribute *iio_dmaengine_buffer_attrs[] = { * Once done using the buffer iio_dmaengine_buffer_free() should be used to * release it. */ -struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev, +static struct iio_buffer *iio_dmaengine_buffer_alloc(struct device *dev, const char *channel) { struct dmaengine_buffer *dmaengine_buffer; @@ -209,7 +211,6 @@ err_free: kfree(dmaengine_buffer); return ERR_PTR(ret); } -EXPORT_SYMBOL(iio_dmaengine_buffer_alloc); /** * iio_dmaengine_buffer_free() - Free dmaengine buffer @@ -217,7 +218,7 @@ EXPORT_SYMBOL(iio_dmaengine_buffer_alloc); * * Frees a buffer previously allocated with iio_dmaengine_buffer_alloc(). */ -void iio_dmaengine_buffer_free(struct iio_buffer *buffer) +static void iio_dmaengine_buffer_free(struct iio_buffer *buffer) { struct dmaengine_buffer *dmaengine_buffer = iio_buffer_to_dmaengine_buffer(buffer); @@ -227,7 +228,6 @@ void iio_dmaengine_buffer_free(struct iio_buffer *buffer) iio_buffer_put(buffer); } -EXPORT_SYMBOL_GPL(iio_dmaengine_buffer_free); static void __devm_iio_dmaengine_buffer_free(struct device *dev, void *res) { |