forked from len0rd/rockbox
Audio Init: Just can't stand that heirarchy. Add one level of abstraction. Might come in handy anyhow. Use sound.h instead of the conditional includes for audio hardware headers. If someone doesn't like that, yell at my evil twin. :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12718 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c5cd27f5d1
commit
c2d2106fd7
8 changed files with 31 additions and 32 deletions
|
|
@ -3444,7 +3444,7 @@ static void audio_thread(void)
|
|||
{
|
||||
struct event ev;
|
||||
|
||||
audiohw_postinit();
|
||||
pcm_postinit();
|
||||
|
||||
#ifdef PLAYBACK_VOICE
|
||||
/* Unlock mutex that init stage locks before creating this thread */
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ typedef void (*pcm_more_callback_type)(unsigned char **start,
|
|||
typedef int (*pcm_more_callback_type2)(int status);
|
||||
|
||||
void pcm_init(void);
|
||||
void pcm_postinit(void);
|
||||
|
||||
/* set the pcm frequency - use values in hw_sampr_list
|
||||
* use -1 for the default frequency
|
||||
|
|
|
|||
|
|
@ -20,15 +20,9 @@
|
|||
#include "kernel.h"
|
||||
#include "logf.h"
|
||||
#include "audio.h"
|
||||
#if defined(HAVE_WM8975)
|
||||
#include "wm8975.h"
|
||||
#elif defined(HAVE_WM8758)
|
||||
#include "wm8758.h"
|
||||
#elif defined(HAVE_WM8731) || defined(HAVE_WM8721)
|
||||
#include "wm8731l.h"
|
||||
#elif CONFIG_CPU == PNX0101
|
||||
#include "sound.h"
|
||||
#if CONFIG_CPU == PNX0101
|
||||
#include "string.h"
|
||||
#include "pnx0101.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
@ -224,6 +218,11 @@ void pcm_init(void)
|
|||
DMAR10(1) |= 1;
|
||||
}
|
||||
|
||||
void pcm_postinit(void)
|
||||
{
|
||||
audiohw_postinit();
|
||||
}
|
||||
|
||||
void pcm_set_frequency(unsigned int frequency)
|
||||
{
|
||||
(void)frequency;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "kernel.h"
|
||||
#include "logf.h"
|
||||
#include "audio.h"
|
||||
#include "wm8975.h"
|
||||
#include "sound.h"
|
||||
#include "file.h"
|
||||
#include "mmu-meg-fx.h"
|
||||
|
||||
|
|
@ -120,7 +120,10 @@ void pcm_init(void)
|
|||
|
||||
}
|
||||
|
||||
|
||||
void pcm_postinit(void)
|
||||
{
|
||||
audiohw_postinit();
|
||||
}
|
||||
|
||||
void pcm_play_dma_start(const void *addr, size_t size)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,15 +21,7 @@
|
|||
#include "kernel.h"
|
||||
#include "logf.h"
|
||||
#include "audio.h"
|
||||
#if defined(HAVE_WM8975)
|
||||
#include "wm8975.h"
|
||||
#elif defined(HAVE_WM8758)
|
||||
#include "wm8758.h"
|
||||
#elif defined(HAVE_WM8731) || defined(HAVE_WM8721)
|
||||
#include "wm8731l.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "sound.h"
|
||||
|
||||
/* peaks */
|
||||
#ifdef HAVE_RECORDING
|
||||
|
|
@ -334,7 +326,7 @@ size_t pcm_get_bytes_waiting(void)
|
|||
void pcm_init(void)
|
||||
{
|
||||
}
|
||||
void audiohw_postinit(void)
|
||||
void pcm_postinit(void)
|
||||
{
|
||||
}
|
||||
#else
|
||||
|
|
@ -356,6 +348,11 @@ void pcm_init(void)
|
|||
/* Call pcm_play_dma_stop to initialize everything. */
|
||||
pcm_play_dma_stop();
|
||||
}
|
||||
|
||||
void pcm_postinit(void)
|
||||
{
|
||||
audiohw_postinit();
|
||||
}
|
||||
#endif /* HAVE_PP5024_CODEC */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,7 @@
|
|||
#include "kernel.h"
|
||||
#include "logf.h"
|
||||
#include "audio.h"
|
||||
#if defined(HAVE_UDA1380)
|
||||
#include "uda1380.h"
|
||||
#elif defined(HAVE_TLV320)
|
||||
#include "tlv320.h"
|
||||
#endif
|
||||
#include "sound.h"
|
||||
#if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT)
|
||||
#include "spdif.h"
|
||||
#endif
|
||||
|
|
@ -273,6 +269,11 @@ void pcm_init(void)
|
|||
and_l(~(1 << 14), &IMR); /* bit 14 is DMA0 */
|
||||
} /* pcm_init */
|
||||
|
||||
void pcm_postinit(void)
|
||||
{
|
||||
audiohw_postinit();
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return BCR0 & 0xffffff;
|
||||
|
|
|
|||
|
|
@ -262,9 +262,3 @@ void remove_thread(int threadnum)
|
|||
#define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
|
||||
unsigned char vp_dummy[VIRT_SIZE];
|
||||
|
||||
|
||||
void audiohw_postinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -316,5 +316,9 @@ int pcm_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void pcm_postinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* ROCKBOX_HAS_SIMSOUND */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue