pcm: Further cleanup of unused bits of the PCM ACPI:

* pcm_get_bytes_remaining()
 * pcm_calculate_peaks()
 * pcm_get_peak_buffer()

Nothing in-tree uses these at all (except for the lua plugin wrapper)

Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
This commit is contained in:
Solomon Peachy 2020-11-11 23:20:19 -05:00
parent 1a68856f52
commit 388adff3cc
29 changed files with 5 additions and 231 deletions

View file

@ -200,17 +200,6 @@ void pcm_dma_apply_settings(void)
0x01ffffff);
}
size_t pcm_get_bytes_waiting(void)
{
int oldstatus = disable_irq_save();
size_t addr = DMAC_CH_SRC_ADDR(0);
size_t start_addr = (size_t)dma_start_addr;
size_t start_size = dma_start_size;
restore_interrupt(oldstatus);
return start_size - addr + start_addr;
}
const void * pcm_play_dma_get_peak_buffer(int *count)
{
int oldstatus = disable_irq_save();

View file

@ -175,12 +175,6 @@ void pcm_dma_apply_settings(void)
pcm_play_unlock();
}
size_t pcm_get_bytes_waiting(void)
{
struct imx233_dma_info_t info = imx233_dma_get_info(APB_AUDIO_DAC, DMA_INFO_AHB_BYTES);
return info.ahb_bytes;
}
const void *pcm_play_dma_get_peak_buffer(int *count)
{
if(!dac_freezed)

View file

@ -224,30 +224,6 @@ void pcm_play_dma_stop(void)
play_stop_pcm();
}
/* Return the number of bytes waiting - full L-R sample pairs only */
size_t pcm_get_bytes_waiting(void)
{
static unsigned long dsa NOCACHEBSS_ATTR;
long offs, size;
int oldstatus;
/* read burst dma source address register in channel context */
sdma_read_words(&dsa, CHANNEL_CONTEXT_ADDR(DMA_PLAY_CH_NUM)+0x0b, 1);
oldstatus = disable_irq_save();
offs = dsa - (unsigned long)dma_play_bd.buf_addr;
size = dma_play_bd.mode.count;
restore_irq(oldstatus);
/* Be addresses are coherent (no buffer change during read) */
if (offs >= 0 && offs < size)
{
return (size - offs) & ~3;
}
return 0;
}
/* Return a pointer to the samples and the number of them in *count */
const void * pcm_play_dma_get_peak_buffer(int *count)
{

View file

@ -194,11 +194,6 @@ void pcm_play_unlock(void)
restore_fiq(status);
}
size_t pcm_get_bytes_waiting(void)
{
return dma_play_data.size & ~3;
}
#ifdef HAVE_RECORDING
/* TODO: implement */
void pcm_rec_dma_init(void)

View file

@ -192,11 +192,6 @@ void pcm_dma_apply_settings(void)
{
}
size_t pcm_get_bytes_waiting(void)
{
return p_size & ~3;
}
const void * pcm_play_dma_get_peak_buffer(int *count)
{
unsigned long addr = (unsigned long)p;

View file

@ -497,11 +497,6 @@ void pcm_play_dma_stop(void)
#endif
}
size_t pcm_get_bytes_waiting(void)
{
return dma_play_data.size & ~3;
}
void pcm_play_dma_init(void)
{
/* Initialize default register values. */

View file

@ -250,12 +250,6 @@ void pcm_dma_apply_settings(void)
audiohw_set_frequency(pcm_fsel);
}
size_t pcm_get_bytes_waiting(void)
{
/* current terminate count is in transfer size units (4bytes here) */
return (HDMA_CCNT0 & 0xffff)<<2;
}
/* audio DMA ISR called when chunk from callers buffer has been transfered */
void INT_HDMA(void)
{

View file

@ -220,12 +220,6 @@ void fiq_handler(void)
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
}
size_t pcm_get_bytes_waiting(void)
{
/* lie a little and only return full pairs */
return (DSTAT2 & 0xFFFFE) * 2;
}
const void * pcm_play_dma_get_peak_buffer(int *count)
{
unsigned long addr = DCSRC2;

View file

@ -260,12 +260,6 @@ void fiq_handler(void)
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
}
size_t pcm_get_bytes_waiting(void)
{
/* lie a little and only return full pairs */
return (DSTAT2 & 0xFFFFE) * 2;
}
const void * pcm_play_dma_get_peak_buffer(int *count)
{
unsigned long addr = DCSRC2;

View file

@ -259,12 +259,7 @@ void pcm_play_dma_postinit(void)
/* set the configured PCM frequency */
void pcm_dma_apply_settings(void)
{
pcm_dma_set_freq(pcm_fsel);
}
size_t pcm_get_bytes_waiting(void)
{
return (nextsize + DMACTCNT0 + 2) << 1;
pcm_dma_set_freq(pcm_fsel);
}
const void * pcm_play_dma_get_peak_buffer(int *count)

View file

@ -216,13 +216,6 @@ void pcm_play_dma_postinit(void)
audiohw_postinit();
}
size_t pcm_get_bytes_waiting(void)
{
size_t total_bytes;
dmac_ch_get_info(&dma_play_ch, NULL, &total_bytes);
return total_bytes;
}
const void* pcm_play_dma_get_peak_buffer(int *count)
{
void *addr = dmac_ch_get_info(&dma_play_ch, count, NULL);

View file

@ -84,8 +84,3 @@ void pcm_play_unlock(void)
{
}
size_t pcm_get_bytes_waiting(void)
{
return 0;
}

View file

@ -120,11 +120,6 @@ void pcm_play_unlock(void)
}
size_t pcm_get_bytes_waiting(void)
{
return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
}
/* Only used when debugging */
static char buffer[80];

View file

@ -127,11 +127,6 @@ void pcm_play_unlock(void)
}
size_t pcm_get_bytes_waiting(void)
{
return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
}
/* Only used when debugging */
static char buffer[80];