summaryrefslogtreecommitdiffstats
path: root/firmware/target/coldfire
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-07-02 21:09:28 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-07-02 21:09:28 +0000
commit971a6e9c9480d07b939f5e80a050ef9f49c89f81 (patch)
treee01d1843ceb6e4c3efb5a9de7a2b862eb368a461 /firmware/target/coldfire
parent15d0ac01345346ae348bb15c58ddf88ef0ac0020 (diff)
downloadrockbox-971a6e9c9480d07b939f5e80a050ef9f49c89f81.tar.gz
rockbox-971a6e9c9480d07b939f5e80a050ef9f49c89f81.tar.bz2
rockbox-971a6e9c9480d07b939f5e80a050ef9f49c89f81.zip
HD200 - Setup codec as I2S master and enable recording
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27250 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire')
-rw-r--r--firmware/target/coldfire/mpio/audio-mpio.c7
-rw-r--r--firmware/target/coldfire/pcm-coldfire.c13
2 files changed, 13 insertions, 7 deletions
diff --git a/firmware/target/coldfire/mpio/audio-mpio.c b/firmware/target/coldfire/mpio/audio-mpio.c
index 217881547e..88c43383ca 100644
--- a/firmware/target/coldfire/mpio/audio-mpio.c
+++ b/firmware/target/coldfire/mpio/audio-mpio.c
@@ -46,6 +46,7 @@ void audio_set_output_source(int source)
if ((unsigned)source >= AUDIO_NUM_SOURCES)
source = AUDIO_SRC_PLAYBACK;
+ /* route incoming audio samples to DAC */
IIS2CONFIG = (IIS2CONFIG & ~(7 << 8)) | (txsrc_select[source+1] << 8);
restore_irq(level);
@@ -73,8 +74,8 @@ void audio_input_mux(int source, unsigned flags)
break;
case AUDIO_SRC_MIC:
- case AUDIO_SRC_LINEIN:
- /* recording only */
+ case AUDIO_SRC_LINEIN:
+ /* recording only */
if (source != last_source)
{
audiohw_set_recsrc(source,true);
@@ -89,10 +90,10 @@ void audio_input_mux(int source, unsigned flags)
last_recording = recording;
+ audiohw_set_recsrc(source,recording);
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
coldfire_set_dataincontrol(recording ?
((3 << 14) | (4 << 3)) : 0);
- audiohw_set_recsrc(source, recording);
break;
}
diff --git a/firmware/target/coldfire/pcm-coldfire.c b/firmware/target/coldfire/pcm-coldfire.c
index 06f17d1170..fa320dff3f 100644
--- a/firmware/target/coldfire/pcm-coldfire.c
+++ b/firmware/target/coldfire/pcm-coldfire.c
@@ -84,13 +84,18 @@ static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] =
#endif
#if CONFIG_CPU == MCF5249 && defined(HAVE_WM8750)
+/* We run codec in master mode.
+ * Codec can reconstruct all frequencies
+ * from single 11.2896 MHz master clock
+ */
static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] =
{
- [HW_FREQ_88] = { 0x0c, 0x01 },
- [HW_FREQ_44] = { 0x06, 0x01 },
- [HW_FREQ_22] = { 0x04, 0x01 },
- [HW_FREQ_11] = { 0x02, 0x01 },
+ [HW_FREQ_88] = { 0x00, 0x01 },
+ [HW_FREQ_44] = { 0x00, 0x01 },
+ [HW_FREQ_22] = { 0x00, 0x01 },
+ [HW_FREQ_11] = { 0x00, 0x01 },
};
+
#endif
#if (CONFIG_CPU == MCF5250 || CONFIG_CPU == MCF5249) && defined(HAVE_TLV320)