summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMark Arigo <markarigo@gmail.com>2009-08-01 17:51:00 +0000
committerMark Arigo <markarigo@gmail.com>2009-08-01 17:51:00 +0000
commitfc570147e66b91686aeffdf9896eb209027cf9ca (patch)
treeb462ec064ef0a6e7c05dd5fd287448de0a17cfe0 /firmware
parent4e7517dfb1946ad8e7cbc626db2252d04dee629b (diff)
downloadrockbox-fc570147e66b91686aeffdf9896eb209027cf9ca.tar.gz
rockbox-fc570147e66b91686aeffdf9896eb209027cf9ca.zip
Philips SA9200: initialize i2c, i2s, and as3514 as the OF does. Fixes clicks/pops heard when reading the adc.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22101 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/as3514.c5
-rw-r--r--firmware/target/arm/i2c-pp.c7
-rw-r--r--firmware/target/arm/i2s-pp.c8
3 files changed, 20 insertions, 0 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c
index dc6efb511a..b7c99f433b 100644
--- a/firmware/drivers/audio/as3514.c
+++ b/firmware/drivers/audio/as3514.c
@@ -182,8 +182,13 @@ void audiohw_preinit(void)
182 as3514_write(AS3514_HPH_OUT_L, 182 as3514_write(AS3514_HPH_OUT_L,
183 HPH_OUT_L_HP_ON | HPH_OUT_L_HP_MUTE | 0x00); 183 HPH_OUT_L_HP_ON | HPH_OUT_L_HP_MUTE | 0x00);
184 184
185#ifdef PHILIPS_SA9200
186 /* LRCK 8-23kHz (there are audible clicks while reading the ADC otherwise) */
187 as3514_write(AS3514_PLLMODE, PLLMODE_LRCK_8_23);
188#else
185 /* LRCK 24-48kHz */ 189 /* LRCK 24-48kHz */
186 as3514_write(AS3514_PLLMODE, PLLMODE_LRCK_24_48); 190 as3514_write(AS3514_PLLMODE, PLLMODE_LRCK_24_48);
191#endif
187 192
188 /* DAC_Mute_off */ 193 /* DAC_Mute_off */
189 as3514_set(AS3514_DAC_L, DAC_L_DAC_MUTE_off); 194 as3514_set(AS3514_DAC_L, DAC_L_DAC_MUTE_off);
diff --git a/firmware/target/arm/i2c-pp.c b/firmware/target/arm/i2c-pp.c
index 13c8cf0a1e..60497b04b9 100644
--- a/firmware/target/arm/i2c-pp.c
+++ b/firmware/target/arm/i2c-pp.c
@@ -299,6 +299,13 @@ void i2c_init(void)
299 outl(0x1e, 0x600060a4); 299 outl(0x1e, 0x600060a4);
300 300
301 ascodec_write(AS3514_SUPERVISOR, 5); 301 ascodec_write(AS3514_SUPERVISOR, 5);
302#elif defined(PHILIPS_SA9200)
303 outl(0x0, 0x600060a4);
304 outl(inl(0x600060a4) | 0x20, 0x600060a4);
305
306 outl(inl(0x7000c020) | 0x3, 0x7000c020);
307 outl(0x55, 0x7000c02c);
308 outl(0x54, 0x7000c030);
302#endif 309#endif
303#endif 310#endif
304 311
diff --git a/firmware/target/arm/i2s-pp.c b/firmware/target/arm/i2s-pp.c
index e4b9f8e1df..c9d66d53ae 100644
--- a/firmware/target/arm/i2s-pp.c
+++ b/firmware/target/arm/i2s-pp.c
@@ -63,9 +63,17 @@ void i2s_reset(void)
63#ifdef HAVE_AS3514 63#ifdef HAVE_AS3514
64 /* AS3514 can only operate as I2S Slave */ 64 /* AS3514 can only operate as I2S Slave */
65 IISCONFIG |= IIS_MASTER; 65 IISCONFIG |= IIS_MASTER;
66
66 /* Set I2S to 44.1kHz */ 67 /* Set I2S to 44.1kHz */
68#ifdef PHILIPS_SA9200
69 /* values taken from the SA9200 OF */
70 IISCLK = (IISCLK & ~0x1ff) | 31;
71 IISDIV = (IISDIV & ~0xc0000000) | (2 << 30);
72 IISDIV = (IISDIV & ~0x3f) | 16;
73#else
67 IISCLK = (IISCLK & ~0x1ff) | 33; 74 IISCLK = (IISCLK & ~0x1ff) | 33;
68 IISDIV = 7; 75 IISDIV = 7;
76#endif
69#endif /* HAVE_AS3514 */ 77#endif /* HAVE_AS3514 */
70 78
71 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE16_2); 79 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE16_2);