summaryrefslogtreecommitdiff
path: root/firmware/target/arm/wmcodec-pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/wmcodec-pp.c')
-rw-r--r--firmware/target/arm/wmcodec-pp.c54
1 files changed, 1 insertions, 53 deletions
diff --git a/firmware/target/arm/wmcodec-pp.c b/firmware/target/arm/wmcodec-pp.c
index 8aa862c187..471cd8f4a5 100644
--- a/firmware/target/arm/wmcodec-pp.c
+++ b/firmware/target/arm/wmcodec-pp.c
@@ -23,19 +23,8 @@
23 * KIND, either express or implied. 23 * KIND, either express or implied.
24 * 24 *
25 ****************************************************************************/ 25 ****************************************************************************/
26#include "lcd.h" 26
27#include "cpu.h"
28#include "kernel.h"
29#include "thread.h"
30#include "power.h"
31#include "debug.h"
32#include "system.h" 27#include "system.h"
33#include "sprintf.h"
34#include "button.h"
35#include "string.h"
36#include "file.h"
37#include "buffer.h"
38#include "audio.h"
39 28
40#if CONFIG_CPU == PP5020 29#if CONFIG_CPU == PP5020
41#include "i2c-pp5020.h" 30#include "i2c-pp5020.h"
@@ -51,47 +40,6 @@
51#define I2C_AUDIO_ADDRESS 0x1a 40#define I2C_AUDIO_ADDRESS 0x1a
52#endif 41#endif
53 42
54/*
55 * Reset the I2S BIT.FORMAT I2S, 16bit, FIFO.FORMAT 32bit
56 */
57void i2s_reset(void)
58{
59#if CONFIG_CPU == PP5020
60 /* I2S soft reset */
61 outl(inl(0x70002800) | 0x80000000, 0x70002800);
62 outl(inl(0x70002800) & ~0x80000000, 0x70002800);
63
64 /* BIT.FORMAT [11:10] = I2S (default) */
65 outl(inl(0x70002800) & ~0xc00, 0x70002800);
66 /* BIT.SIZE [9:8] = 16bit (default) */
67 outl(inl(0x70002800) & ~0x300, 0x70002800);
68
69 /* FIFO.FORMAT [6:4] = 32 bit LSB */
70 /* since BIT.SIZ < FIFO.FORMAT low 16 bits will be 0 */
71 outl(inl(0x70002800) | 0x30, 0x70002800);
72
73 /* RX_ATN_LVL=1 == when 12 slots full */
74 /* TX_ATN_LVL=1 == when 12 slots empty */
75 outl(inl(0x7000280c) | 0x33, 0x7000280c);
76
77 /* Rx.CLR = 1, TX.CLR = 1 */
78 outl(inl(0x7000280c) | 0x1100, 0x7000280c);
79#elif CONFIG_CPU == PP5002
80 /* I2S device reset */
81 outl(inl(0xcf005030) | 0x80, 0xcf005030);
82 outl(inl(0xcf005030) & ~0x80, 0xcf005030);
83
84 /* I2S controller enable */
85 outl(inl(0xc0002500) | 0x1, 0xc0002500);
86
87 /* BIT.FORMAT [11:10] = I2S (default) */
88 /* BIT.SIZE [9:8] = 24bit */
89 /* FIFO.FORMAT = 24 bit LSB */
90
91 /* reset DAC and ADC fifo */
92 outl(inl(0xc000251c) | 0x30000, 0xc000251c);
93#endif
94}
95 43
96/* 44/*
97 * Initialise the WM8975 for playback via headphone and line out. 45 * Initialise the WM8975 for playback via headphone and line out.