1
0
Fork 0
forked from len0rd/rockbox

No more ear doctor visits after powering/unpowering the Gigabeat. Cleanup a little too.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13312 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2007-05-03 18:08:00 +00:00
parent 441a8d8054
commit d989f19eda
5 changed files with 45 additions and 88 deletions

View file

@ -31,8 +31,8 @@
#define GIGABEAT_44100HZ (0x11 << 1)
#define GIGABEAT_88200HZ (0x1f << 1)
static int pcm_freq = HW_SAMPR_DEFAULT; /* 44.1 is default */
static int sr_ctrl = GIGABEAT_44100HZ;
static int pcm_freq = 0; /* 44.1 is default */
static int sr_ctrl = 0;
#define FIFO_COUNT ((IISFCON >> 6) & 0x01F)
/* number of bytes in FIFO */
@ -71,11 +71,10 @@ void pcm_init(void)
pcm_paused = false;
pcm_callback_for_more = NULL;
audiohw_init();
audiohw_enable_output(true);
pcm_set_frequency(SAMPR_44);
audiohw_init();
/* init GPIO */
GPCCON = (GPCCON & ~(3<<14)) | (1<<14);
GPCDAT |= 1<<7;
@ -92,6 +91,7 @@ void pcm_init(void)
void pcm_postinit(void)
{
audiohw_postinit();
pcm_apply_settings();
}
void pcm_play_dma_start(const void *addr, size_t size)

View file

@ -23,33 +23,14 @@
* KIND, either express or implied.
*
****************************************************************************/
#include "lcd.h"
#include "cpu.h"
#include "kernel.h"
#include "thread.h"
#include "power.h"
#include "debug.h"
#include "system.h"
#include "sprintf.h"
#include "button.h"
#include "string.h"
#include "file.h"
#include "buffer.h"
#include "audio.h"
#include "sound.h"
#include "i2c.h"
#include "i2c-meg-fx.h"
/*
* Reset the I2S BIT.FORMAT I2S, 16bit, FIFO.FORMAT 32bit
*/
void i2s_reset(void)
{
}
/*
* Initialise the WM8975 for playback via headphone and line out.
* Note, I'm using the WM8750 datasheet as its apparently close.
*/
int audiohw_init(void) {
int audiohw_init(void)
{
/* reset I2C */
i2c_init();
@ -58,11 +39,9 @@ int audiohw_init(void) {
GPCCON |= (1 << 10);
GPCDAT |= (1 << 5);
return 0;
}
audiohw_preinit();
void audiohw_postinit(void)
{
return 0;
}
void wmcodec_write(int reg, int data)