summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Kukla <roolku@rockbox.org>2008-01-20 12:59:23 +0000
committerRobert Kukla <roolku@rockbox.org>2008-01-20 12:59:23 +0000
commit47cfed1f1bdec15ee8e771c050c9e6b9fa12d0bf (patch)
tree70a1bc0d05e37449c52ffa9e6369404a88095bd3
parent9e93b9e30a524f7ca787b1198d572a9f36da080e (diff)
downloadrockbox-47cfed1f1bdec15ee8e771c050c9e6b9fa12d0bf.tar.gz
rockbox-47cfed1f1bdec15ee8e771c050c9e6b9fa12d0bf.zip
audio on the m:robe 100
- using the existing wm8751 driver (from gigabeat port) integrated into the portal player environment - only 44.1kHz at the moment - for some reason the output is very quiet - due to the lack of usable buttons the easiest (?) way to start an audio file is to copy the .playlist_control, config.cfg and nvram.bin files from another target, where auto resume is enabled. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16117 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/audio/wm8751.c4
-rw-r--r--firmware/export/config-mrobe100.h6
-rw-r--r--firmware/target/arm/pcm-pp.c16
-rw-r--r--firmware/target/arm/wmcodec-pp.c6
4 files changed, 23 insertions, 9 deletions
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c
index 78e129803e..c4e1a62e50 100644
--- a/firmware/drivers/audio/wm8751.c
+++ b/firmware/drivers/audio/wm8751.c
@@ -100,6 +100,10 @@ static int adaptivebass2hw(int value)
/* Reset and power up the WM8751 */
void audiohw_preinit(void)
{
+#ifdef CPU_PP502x
+ i2s_reset();
+#endif
+
/*
* 1. Switch on power supplies.
* By default the WM8751 is in Standby Mode, the DAC is
diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h
index 8866bd0da9..0d49023b63 100644
--- a/firmware/export/config-mrobe100.h
+++ b/firmware/export/config-mrobe100.h
@@ -56,11 +56,7 @@
#define PLUGIN_BUFFER_SIZE 0x80000
/* Wolfsom audio codec */
-/* TODO: #define HAVE_WM8751 */
-#define HAVE_WM8731
-
-/* WM8731 has no tone controls, so we use the software ones */
-#define HAVE_SW_TONE_CONTROLS
+#define HAVE_WM8751
#define AB_REPEAT_ENABLE 1
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index d2a503c0da..5a9d3b3670 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -23,6 +23,10 @@
#include "audio.h"
#include "sound.h"
+#ifdef HAVE_WM8751
+#define MROBE100_44100HZ (0x40|(0x11 << 1)|1)
+#endif
+
/** DMA **/
#ifdef CPU_PP502x
@@ -81,15 +85,25 @@ struct dma_data dma_play_data NOCACHEBSS_ATTR =
};
static unsigned long pcm_freq NOCACHEDATA_ATTR = HW_SAMPR_DEFAULT; /* 44.1 is default */
+#ifdef HAVE_WM8751
+/* Samplerate control for audio codec */
+static int sr_ctrl = MROBE100_44100HZ;
+#endif
void pcm_set_frequency(unsigned int frequency)
{
(void)frequency;
pcm_freq = HW_SAMPR_DEFAULT;
+#ifdef HAVE_WM8751
+ sr_ctrl = MROBE100_44100HZ;
+#endif
}
void pcm_apply_settings(void)
{
+#ifdef HAVE_WM8751
+ audiohw_set_frequency(sr_ctrl);
+#endif
pcm_curr_sampr = pcm_freq;
}
@@ -308,7 +322,7 @@ void pcm_play_dma_init(void)
/* Initialize default register values. */
audiohw_init();
-#ifndef HAVE_WM8731
+#if !defined(HAVE_WM8731) && !defined(HAVE_WM8751)
/* Power on */
audiohw_enable_output(true);
/* Unmute the master channel (DAC should be at zero point now). */
diff --git a/firmware/target/arm/wmcodec-pp.c b/firmware/target/arm/wmcodec-pp.c
index 1f688d135f..c9e034a188 100644
--- a/firmware/target/arm/wmcodec-pp.c
+++ b/firmware/target/arm/wmcodec-pp.c
@@ -28,7 +28,7 @@
#include "audiohw.h"
#include "i2c-pp.h"
-#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
+#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(MROBE_100)
/* The H10's audio codec uses an I2C address of 0x1b */
#define I2C_AUDIO_ADDRESS 0x1b
#else
@@ -96,13 +96,13 @@ void audiohw_init(void) {
#endif /* IPOD_1G2G/3G */
#endif
-#ifdef HAVE_WM8731
+#if defined(HAVE_WM8731) || defined(HAVE_WM8751)
audiohw_preinit();
#endif
}
-#ifndef HAVE_WM8731
+#if !defined(HAVE_WM8731) && !defined(HAVE_WM8751)
void audiohw_postinit(void)
{
}