From a1d3ed25346ab4174cb7fd066158cebc8e29fc79 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sat, 24 Dec 2011 17:59:43 +0000 Subject: ypr0: Cleanup and simplify ascodec functions. Fix audiohw_{pre,post}init() not being called. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31423 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/audio/as3514.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'firmware/drivers/audio/as3514.c') diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index 0fe3070c19..a430afdf88 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c @@ -78,13 +78,12 @@ const struct sound_settings_info audiohw_settings[] = { #endif }; -#ifndef SAMSUNG_YPR0 /* Shadow registers */ static uint8_t as3514_regs[AS3514_NUM_AUDIO_REGS]; /* 8-bit registers */ /* * little helper method to set register values. - * With the help of as3514_regs, we minimize i2c + * With the help of as3514_regs, we minimize i2c/syscall * traffic. */ static void as3514_write(unsigned int reg, unsigned int value) @@ -111,29 +110,7 @@ static void as3514_write_masked(unsigned int reg, unsigned int bits, { as3514_write(reg, (as3514_regs[reg] & ~mask) | (bits & mask)); } -#else -static void as3514_write(unsigned int reg, unsigned int value) -{ - ascodec_write(reg, value); -} -/* Helpers to set/clear bits */ -static void as3514_set(unsigned int reg, unsigned int bits) -{ - ascodec_write(reg, ascodec_read(reg) | bits); -} - -static void as3514_clear(unsigned int reg, unsigned int bits) -{ - ascodec_write(reg, ascodec_read(reg) & ~bits); -} - -static void as3514_write_masked(unsigned int reg, unsigned int bits, - unsigned int mask) -{ - ascodec_write(reg, (ascodec_read(reg) & ~mask) | (bits & mask)); -} -#endif /* convert tenth of dB volume to master volume register value */ int tenthdb2master(int db) { @@ -168,11 +145,8 @@ int sound_val2phys(int setting, int value) */ void audiohw_preinit(void) { - -#ifndef SAMSUNG_YPR0 /* read all reg values */ ascodec_readbytes(0x0, AS3514_NUM_AUDIO_REGS, as3514_regs); -#endif #ifdef HAVE_AS3543 -- cgit v1.2.3