summaryrefslogtreecommitdiff
path: root/firmware/target/mips
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-03-24 17:59:44 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-03-24 17:59:44 +0000
commit19bd97bcccaf7731abd7139d7da8760b4856fc86 (patch)
treeee8ec8a1026fe9556fbd1c658bf57b75f2e57b1c /firmware/target/mips
parent2670e3f0387882dbc70346d0449939a9c5726d0c (diff)
Correct the set_frequency() function on the Onda VX747 (fixes sound)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20512 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/codec-jz4740.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c b/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c
index 05ca2d02d4..44d291f312 100644
--- a/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c
@@ -48,8 +48,6 @@ static int HP_register_value;
#endif
static bool HP_on_off_flag;
-static void i2s_codec_set_samplerate(unsigned short rate);
-
static void i2s_codec_reset(void)
{
REG_ICDC_CDCCR1 = (ICDC_CDCCR1_SW2ON | ICDC_CDCCR1_PDVR | ICDC_CDCCR1_PDVRA | ICDC_CDCCR1_VRCGL |
@@ -80,7 +78,7 @@ static void i2s_codec_init(void)
//REG_ICDC_CDCCR2 = (ICDC_CDCCR2_AINVOL(ICDC_CDCCR2_AINVOL_DB(0)) | ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_48)
REG_ICDC_CDCCR2 = ( ICDC_CDCCR2_AINVOL(14) | ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_44)
- | ICDC_CDCCR2_HPVOL(ICDC_CDCCR2_HPVOL_6));
+ | ICDC_CDCCR2_HPVOL(ICDC_CDCCR2_HPVOL_0));
REG_ICDC_CDCCR1 &= ~(ICDC_CDCCR1_SUSPD | ICDC_CDCCR1_RST);
@@ -98,8 +96,6 @@ static void i2s_codec_init(void)
ICDC_CDCCR1_SW1ON | ICDC_CDCCR1_HPMUTE)) | (ICDC_CDCCR1_EDAC
| ICDC_CDCCR1_SW2ON);
- REG_ICDC_CDCCR2 |= 3;
-
HP_on_off_flag = 1; /* HP is on */
}
@@ -265,46 +261,44 @@ static void HP_turn_off(void)
}
#endif
-static void i2s_codec_set_samplerate(unsigned short rate)
+static void i2s_codec_set_samplerate(unsigned int rate)
{
- unsigned short speed = 0;
+ unsigned int speed;
switch (rate)
{
case 8000:
- speed = 0 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_8);
break;
case 11025:
- speed = 1 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_11);
break;
case 12000:
- speed = 2 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_12);
break;
case 16000:
- speed = 3 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_16);
break;
case 22050:
- speed = 4 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_22);
break;
case 24000:
- speed = 5 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_24);
break;
case 32000:
- speed = 6 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_32);
break;
case 44100:
- speed = 7 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_44);
break;
case 48000:
- speed = 8 << 8;
+ speed = ICDC_CDCCR2_SMPR(ICDC_CDCCR2_SMPR_48);
break;
default:
- break;
+ return;
}
- REG_ICDC_CDCCR2 |= 0x00000f00;
-
- speed |= 0xfffff0ff;
- REG_ICDC_CDCCR2 &= speed;
+ REG_ICDC_CDCCR2 &= ~ICDC_CDCCR2_SMPR(0xF);
+ REG_ICDC_CDCCR2 |= speed;
}
void audiohw_mute(bool mute)