Skip to content

Commit

Permalink
iio: cf_axi_dds: add cf_axi_dds_dma_fifo_en() helper
Browse files Browse the repository at this point in the history
The intent is to make the cf_axi_dds_state struct opaque. To do that, the
`pl_dma_fifo_en` needs an accessor.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
  • Loading branch information
commodo committed Jul 9, 2019
1 parent 112794d commit 228c133
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions drivers/iio/frequency/cf_axi_dds.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@

static const unsigned int interpolation_factors_available[] = {1, 8};

bool cf_axi_dds_dma_fifo_en(struct cf_axi_dds_state *st)
{
return st->pl_dma_fifo_en;
}
EXPORT_SYMBOL(cf_axi_dds_dma_fifo_en);

void dds_write(struct cf_axi_dds_state *st,
unsigned int reg, unsigned int val)
{
Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/frequency/cf_axi_dds.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,6 @@ unsigned int dds_slave_read(struct cf_axi_dds_state *st, unsigned int reg);
void dds_master_write(struct cf_axi_dds_state *st,
unsigned int reg, unsigned int val);

bool cf_axi_dds_dma_fifo_en(struct cf_axi_dds_state *st);

#endif /* ADI_AXI_DDS_H_ */
2 changes: 1 addition & 1 deletion drivers/iio/frequency/cf_axi_dds_buffer_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static int dds_buffer_submit_block(struct iio_dma_buffer_queue *queue,
if (block->block.bytes_used) {
bool enable_fifo = false;

if (st->pl_dma_fifo_en &&
if (cf_axi_dds_dma_fifo_en(st) &&
(block->block.flags & IIO_BUFFER_BLOCK_FLAG_CYCLIC)) {
block->block.flags &= ~IIO_BUFFER_BLOCK_FLAG_CYCLIC;
enable_fifo = true;
Expand Down

0 comments on commit 228c133

Please sign in to comment.