From 888451fb0f3f8b8a3e6e81a087e4545eeba7a774 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 26 Nov 2008 14:25:45 +0000 Subject: Get rid of remaining audiohw_enable_output style codec setup and use pre/post split initialization. Move some SoC-specific code like i2s_reset out of the codec drivers. Helps to unify drivers and it was only ever used to enable. I cannot possibly test everything so report (I'll be on call ;) or fix problems if any crop up. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19228 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/wmcodec-pp.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'firmware/target/arm/wmcodec-pp.c') diff --git a/firmware/target/arm/wmcodec-pp.c b/firmware/target/arm/wmcodec-pp.c index 0d751f6b3f..031f5c8d47 100644 --- a/firmware/target/arm/wmcodec-pp.c +++ b/firmware/target/arm/wmcodec-pp.c @@ -29,6 +29,7 @@ #include "system.h" #include "audiohw.h" #include "i2c-pp.h" +#include "i2s.h" #include "wmcodec.h" #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(MROBE_100) @@ -43,7 +44,8 @@ /* * Initialise the PP I2C and I2S. */ -void audiohw_init(void) { +void audiohw_init(void) +{ #ifdef CPU_PP502x /* normal outputs for CDI and I2S pin groups */ DEV_INIT2 &= ~0x300; @@ -95,21 +97,13 @@ void audiohw_init(void) { outl(inl(0xcf000028) & ~0x8, 0xcf000028); #endif /* IPOD_1G2G/3G */ #endif + + /* reset the I2S controller into known state */ + i2s_reset(); -#if defined(HAVE_WM8731) || defined(HAVE_WM8751) || defined(HAVE_WM8975) \ - || defined(HAVE_WM8758) audiohw_preinit(); -#endif - } -#if !defined(HAVE_WM8731) && !defined(HAVE_WM8751) && !defined(HAVE_WM8975) \ - && !defined(HAVE_WM8758) -void audiohw_postinit(void) -{ -} -#endif - void wmcodec_write(int reg, int data) { pp_i2c_send(I2C_AUDIO_ADDRESS, (reg<<1) | ((data&0x100)>>8),data&0xff); -- cgit v1.2.3