1.1 --- a/pkg/devices/lib/aic/src/x1600.cc Fri Nov 03 19:58:11 2023 +0100
1.2 +++ b/pkg/devices/lib/aic/src/x1600.cc Tue Nov 07 19:20:32 2023 +0100
1.3 @@ -312,32 +312,13 @@
1.4 }
1.5 }
1.6
1.7 -/* Obtain a DMA-accessible buffer for sample transfers. */
1.8 -
1.9 -long
1.10 -Aic_x1600_channel::get_buffer(uint32_t count, l4_addr_t *addr)
1.11 -{
1.12 - long err = get_dma_region(count, 8, &_vaddr, &_paddr, &_mem);
1.13 -
1.14 - if (err)
1.15 - return err;
1.16 -
1.17 - // Set the region size as the requested size, not any allocated size.
1.18 -
1.19 - _size = count;
1.20 - *addr = _vaddr;
1.21 - return L4_EOK;
1.22 -}
1.23 -
1.24 /* Transfer a sample using the given byte count (total sample size), sample rate
1.25 (or frequency), sample unit size (or resolution, width). */
1.26
1.27 uint32_t
1.28 -Aic_x1600_channel::transfer(uint32_t count, uint32_t sample_rate, uint8_t sample_size)
1.29 +Aic_x1600_channel::transfer(l4re_dma_space_dma_addr_t paddr, uint32_t count,
1.30 + uint32_t sample_rate, uint8_t sample_size)
1.31 {
1.32 - if (count > _size)
1.33 - return 0;
1.34 -
1.35 /* To play a sample:
1.36
1.37 - Configure the sample size using the Aic_output_size settings in Aic_control
1.38 @@ -375,7 +356,7 @@
1.39
1.40 uint32_t sample_unit = (sample_size == 8) ? 1 : (sample_size == 16) ? 2 : 4;
1.41 uint32_t unit_count = count / sample_unit;
1.42 - uint32_t to_transfer = _dma->transfer(_paddr,
1.43 + uint32_t to_transfer = _dma->transfer(paddr,
1.44 _aic_start + Aic_fifo_data,
1.45 unit_count,
1.46 true,
1.47 @@ -436,12 +417,10 @@
1.48 static_cast<Dma_x1600_channel *>(dma));
1.49 }
1.50
1.51 -long x1600_aic_get_buffer(void *channel, uint32_t count, l4_addr_t *addr)
1.52 +uint32_t x1600_aic_transfer(void *channel, l4re_dma_space_dma_addr_t paddr,
1.53 + uint32_t count, uint32_t sample_rate,
1.54 + uint8_t sample_size)
1.55 {
1.56 - return static_cast<Aic_x1600_channel *>(channel)->get_buffer(count, addr);
1.57 + return static_cast<Aic_x1600_channel *>(channel)->transfer(paddr, count,
1.58 + sample_rate, sample_size);
1.59 }
1.60 -
1.61 -uint32_t x1600_aic_transfer(void *channel, uint32_t count, uint32_t sample_rate, uint8_t sample_size)
1.62 -{
1.63 - return static_cast<Aic_x1600_channel *>(channel)->transfer(count, sample_rate, sample_size);
1.64 -}