diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/SOURCES | 8 | ||||
-rw-r--r-- | firmware/drivers/mas.c | 10 | ||||
-rw-r--r-- | firmware/export/config-fmrecorder.h | 2 | ||||
-rw-r--r-- | firmware/export/config-gmini120.h | 2 | ||||
-rw-r--r-- | firmware/export/config-gminisp.h | 2 | ||||
-rw-r--r-- | firmware/export/config-h100.h | 2 | ||||
-rw-r--r-- | firmware/export/config-h120.h | 2 | ||||
-rw-r--r-- | firmware/export/config-h300.h | 2 | ||||
-rw-r--r-- | firmware/export/config-iaudiox5.h | 2 | ||||
-rw-r--r-- | firmware/export/config-ondiofm.h | 2 | ||||
-rw-r--r-- | firmware/export/config-ondiosp.h | 2 | ||||
-rw-r--r-- | firmware/export/config-player.h | 2 | ||||
-rw-r--r-- | firmware/export/config-recorder.h | 2 | ||||
-rw-r--r-- | firmware/export/config-recorderv2.h | 2 | ||||
-rw-r--r-- | firmware/export/config.h | 4 | ||||
-rw-r--r-- | firmware/export/id3.h | 6 | ||||
-rw-r--r-- | firmware/export/mas.h | 12 | ||||
-rw-r--r-- | firmware/export/mp3_playback.h | 2 | ||||
-rw-r--r-- | firmware/export/mpeg.h | 2 | ||||
-rw-r--r-- | firmware/export/sound.h | 2 | ||||
-rw-r--r-- | firmware/id3.c | 12 | ||||
-rw-r--r-- | firmware/mp3_playback.c | 58 | ||||
-rw-r--r-- | firmware/mp3data.c | 2 | ||||
-rw-r--r-- | firmware/mpeg.c | 58 | ||||
-rw-r--r-- | firmware/sound.c | 50 | ||||
-rw-r--r-- | firmware/tuner_samsung.c | 2 |
26 files changed, 126 insertions, 126 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 84f54e56a3..a1afa4daea 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -85,7 +85,7 @@ drivers/i2c-coldfire.c | |||
85 | #else | 85 | #else |
86 | drivers/i2c.c | 86 | drivers/i2c.c |
87 | #endif | 87 | #endif |
88 | #if CONFIG_HWCODEC != MASNONE | 88 | #if CONFIG_CODEC != SWCODEC |
89 | drivers/mas.c | 89 | drivers/mas.c |
90 | #endif | 90 | #endif |
91 | #ifdef HAVE_RTC | 91 | #ifdef HAVE_RTC |
@@ -107,7 +107,7 @@ crt0.S | |||
107 | #endif | 107 | #endif |
108 | mp3_playback.c | 108 | mp3_playback.c |
109 | mp3data.c | 109 | mp3data.c |
110 | #if CONFIG_HWCODEC != MASNONE | 110 | #if CONFIG_CODEC != SWCODEC |
111 | mpeg.c | 111 | mpeg.c |
112 | #endif | 112 | #endif |
113 | #ifndef WIN32 /* the win32 sim has its own versin of these: */ | 113 | #ifndef WIN32 /* the win32 sim has its own versin of these: */ |
@@ -130,10 +130,10 @@ drivers/uda1380.c | |||
130 | #elif defined(HAVE_TLV320) && !defined(SIMULATOR) | 130 | #elif defined(HAVE_TLV320) && !defined(SIMULATOR) |
131 | drivers/tlv320.c | 131 | drivers/tlv320.c |
132 | #endif | 132 | #endif |
133 | #if (CONFIG_HWCODEC == MASNONE) && !defined(SIMULATOR) | 133 | #if (CONFIG_CODEC == SWCODEC) && !defined(SIMULATOR) |
134 | pcm_playback.c | 134 | pcm_playback.c |
135 | #endif | 135 | #endif |
136 | #if CONFIG_HWCODEC == MASNONE | 136 | #if CONFIG_CODEC == SWCODEC |
137 | replaygain.c | 137 | replaygain.c |
138 | #endif | 138 | #endif |
139 | #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) | 139 | #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) |
diff --git a/firmware/drivers/mas.c b/firmware/drivers/mas.c index 7c8b55c422..66ba6b6aff 100644 --- a/firmware/drivers/mas.c +++ b/firmware/drivers/mas.c | |||
@@ -132,7 +132,7 @@ int mas_writemem(int bank, int addr, const unsigned long* src, int len) | |||
132 | 132 | ||
133 | j = 0; | 133 | j = 0; |
134 | while(len--) { | 134 | while(len--) { |
135 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 135 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
136 | buf[i++] = 0; | 136 | buf[i++] = 0; |
137 | buf[i++] = ptr[j+1]; | 137 | buf[i++] = ptr[j+1]; |
138 | buf[i++] = ptr[j+2]; | 138 | buf[i++] = ptr[j+2]; |
@@ -232,7 +232,7 @@ static int mas_devread(unsigned long *dest, int len) | |||
232 | if (i2c_getack()) { | 232 | if (i2c_getack()) { |
233 | for (i=0;len;i++) { | 233 | for (i=0;len;i++) { |
234 | len--; | 234 | len--; |
235 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 235 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
236 | i2c_inb(0); /* Dummy read */ | 236 | i2c_inb(0); /* Dummy read */ |
237 | ptr[i*4+0] = 0; | 237 | ptr[i*4+0] = 0; |
238 | ptr[i*4+1] = i2c_inb(0) & 0x0f; | 238 | ptr[i*4+1] = i2c_inb(0) & 0x0f; |
@@ -270,7 +270,7 @@ void mas_reset(void) | |||
270 | { | 270 | { |
271 | or_b(0x01, &PAIORH); | 271 | or_b(0x01, &PAIORH); |
272 | 272 | ||
273 | #if CONFIG_HWCODEC == MAS3507D | 273 | #if CONFIG_CODEC == MAS3507D |
274 | /* PB5 is "MAS enable". make it GPIO output and high */ | 274 | /* PB5 is "MAS enable". make it GPIO output and high */ |
275 | PBCR2 &= ~0x0c00; | 275 | PBCR2 &= ~0x0c00; |
276 | or_b(0x20, &PBIORL); | 276 | or_b(0x20, &PBIORL); |
@@ -280,7 +280,7 @@ void mas_reset(void) | |||
280 | sleep(HZ/100); | 280 | sleep(HZ/100); |
281 | or_b(0x01, &PADRH); | 281 | or_b(0x01, &PADRH); |
282 | sleep(HZ/5); | 282 | sleep(HZ/5); |
283 | #elif (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 283 | #elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
284 | if(old_recorder) | 284 | if(old_recorder) |
285 | { | 285 | { |
286 | /* Older recorder models don't invert the POR signal */ | 286 | /* Older recorder models don't invert the POR signal */ |
@@ -299,7 +299,7 @@ void mas_reset(void) | |||
299 | #endif | 299 | #endif |
300 | } | 300 | } |
301 | 301 | ||
302 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 302 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
303 | int mas_direct_config_read(unsigned char reg) | 303 | int mas_direct_config_read(unsigned char reg) |
304 | { | 304 | { |
305 | int ret = 0; | 305 | int ret = 0; |
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index c53388984f..cf2e65addf 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #ifndef SIMULATOR | 29 | #ifndef SIMULATOR |
30 | 30 | ||
31 | /* Define this if you have a MAS3587F */ | 31 | /* Define this if you have a MAS3587F */ |
32 | #define CONFIG_HWCODEC MAS3587F | 32 | #define CONFIG_CODEC MAS3587F |
33 | 33 | ||
34 | /* Define this if you have a SH7034 */ | 34 | /* Define this if you have a SH7034 */ |
35 | #define CONFIG_CPU SH7034 | 35 | #define CONFIG_CPU SH7034 |
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h index 18019464e3..c833435dea 100644 --- a/firmware/export/config-gmini120.h +++ b/firmware/export/config-gmini120.h | |||
@@ -38,7 +38,7 @@ | |||
38 | #define CONFIG_I2C I2C_GMINI | 38 | #define CONFIG_I2C I2C_GMINI |
39 | 39 | ||
40 | /* Define this if you do software codec */ | 40 | /* Define this if you do software codec */ |
41 | #define CONFIG_HWCODEC MASNONE | 41 | #define CONFIG_CODEC SWCODEC |
42 | 42 | ||
43 | /* Type of mobile power, FIXME: probably different, make new type */ | 43 | /* Type of mobile power, FIXME: probably different, make new type */ |
44 | #define CONFIG_BATTERY BATT_LIION2200 | 44 | #define CONFIG_BATTERY BATT_LIION2200 |
diff --git a/firmware/export/config-gminisp.h b/firmware/export/config-gminisp.h index 2881471bc1..982e8f3725 100644 --- a/firmware/export/config-gminisp.h +++ b/firmware/export/config-gminisp.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #define CONFIG_I2C I2C_GMINI | 32 | #define CONFIG_I2C I2C_GMINI |
33 | 33 | ||
34 | /* Define this if you do software codec */ | 34 | /* Define this if you do software codec */ |
35 | #define CONFIG_HWCODEC MASNONE | 35 | #define CONFIG_CODEC SWCODEC |
36 | 36 | ||
37 | /* Type of mobile power, FIXME: probably different, make new type */ | 37 | /* Type of mobile power, FIXME: probably different, make new type */ |
38 | #define CONFIG_BATTERY BATT_LIION2200 | 38 | #define CONFIG_BATTERY BATT_LIION2200 |
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 1fd73c25d3..bdb1b1a163 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #define CONFIG_REMOTE_KEYPAD H100_REMOTE | 31 | #define CONFIG_REMOTE_KEYPAD H100_REMOTE |
32 | 32 | ||
33 | /* Define this if you do software codec */ | 33 | /* Define this if you do software codec */ |
34 | #define CONFIG_HWCODEC MASNONE | 34 | #define CONFIG_CODEC SWCODEC |
35 | 35 | ||
36 | /* Define this if you have an remote lcd */ | 36 | /* Define this if you have an remote lcd */ |
37 | #define HAVE_REMOTE_LCD | 37 | #define HAVE_REMOTE_LCD |
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index a1828efad2..2691a8a693 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #define CONFIG_REMOTE_KEYPAD H100_REMOTE | 27 | #define CONFIG_REMOTE_KEYPAD H100_REMOTE |
28 | 28 | ||
29 | /* Define this if you do software codec */ | 29 | /* Define this if you do software codec */ |
30 | #define CONFIG_HWCODEC MASNONE | 30 | #define CONFIG_CODEC SWCODEC |
31 | 31 | ||
32 | /* Define this if you have an remote lcd */ | 32 | /* Define this if you have an remote lcd */ |
33 | #define HAVE_REMOTE_LCD | 33 | #define HAVE_REMOTE_LCD |
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h index 251b6912b3..df97fd245d 100644 --- a/firmware/export/config-h300.h +++ b/firmware/export/config-h300.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define CONFIG_REMOTE_KEYPAD H300_REMOTE | 25 | #define CONFIG_REMOTE_KEYPAD H300_REMOTE |
26 | 26 | ||
27 | /* Define this if you do software codec */ | 27 | /* Define this if you do software codec */ |
28 | #define CONFIG_HWCODEC MASNONE | 28 | #define CONFIG_CODEC SWCODEC |
29 | 29 | ||
30 | /* Define this if you have an remote lcd */ | 30 | /* Define this if you have an remote lcd */ |
31 | #define HAVE_REMOTE_LCD | 31 | #define HAVE_REMOTE_LCD |
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index e2a170af66..f7d18c829e 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #define CONFIG_KEYPAD IAUDIO_X5_PAD | 24 | #define CONFIG_KEYPAD IAUDIO_X5_PAD |
25 | 25 | ||
26 | /* Define this if you do software codec */ | 26 | /* Define this if you do software codec */ |
27 | #define CONFIG_HWCODEC MASNONE | 27 | #define CONFIG_CODEC SWCODEC |
28 | 28 | ||
29 | /* Define this if you have an remote lcd */ | 29 | /* Define this if you have an remote lcd */ |
30 | #define HAVE_REMOTE_LCD | 30 | #define HAVE_REMOTE_LCD |
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index 1b2857668a..a384bae5b6 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #define CONFIG_CPU SH7034 | 28 | #define CONFIG_CPU SH7034 |
29 | 29 | ||
30 | /* Define this if you have a MAS3587F */ | 30 | /* Define this if you have a MAS3587F */ |
31 | #define CONFIG_HWCODEC MAS3587F | 31 | #define CONFIG_CODEC MAS3587F |
32 | 32 | ||
33 | /* Define this to the CPU frequency */ | 33 | /* Define this to the CPU frequency */ |
34 | #define CPU_FREQ 12000000 | 34 | #define CPU_FREQ 12000000 |
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 7ccda3257b..f3ba51209b 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #define CONFIG_CPU SH7034 | 21 | #define CONFIG_CPU SH7034 |
22 | 22 | ||
23 | /* Define this if you have a MAS3539F */ | 23 | /* Define this if you have a MAS3539F */ |
24 | #define CONFIG_HWCODEC MAS3539F | 24 | #define CONFIG_CODEC MAS3539F |
25 | 25 | ||
26 | /* Define this to the CPU frequency */ | 26 | /* Define this to the CPU frequency */ |
27 | #define CPU_FREQ 12000000 | 27 | #define CPU_FREQ 12000000 |
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index 70858a1636..c2dd7572b7 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #define CONFIG_CPU SH7034 | 20 | #define CONFIG_CPU SH7034 |
21 | 21 | ||
22 | /* Define this if you have a MAS3507D */ | 22 | /* Define this if you have a MAS3507D */ |
23 | #define CONFIG_HWCODEC MAS3507D | 23 | #define CONFIG_CODEC MAS3507D |
24 | 24 | ||
25 | /* Define this if you have a DAC3550A */ | 25 | /* Define this if you have a DAC3550A */ |
26 | #define HAVE_DAC3550A | 26 | #define HAVE_DAC3550A |
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index 51cdb79321..4df6fbfc6d 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #ifndef SIMULATOR | 23 | #ifndef SIMULATOR |
24 | 24 | ||
25 | /* Define this if you have a MAS3587F */ | 25 | /* Define this if you have a MAS3587F */ |
26 | #define CONFIG_HWCODEC MAS3587F | 26 | #define CONFIG_CODEC MAS3587F |
27 | 27 | ||
28 | /* Define this if you have a SH7034 */ | 28 | /* Define this if you have a SH7034 */ |
29 | #define CONFIG_CPU SH7034 | 29 | #define CONFIG_CPU SH7034 |
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index b2d6d01669..da0bb41f80 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #define CONFIG_CPU SH7034 | 29 | #define CONFIG_CPU SH7034 |
30 | 30 | ||
31 | /* Define this if you have a MAS3587F */ | 31 | /* Define this if you have a MAS3587F */ |
32 | #define CONFIG_HWCODEC MAS3587F | 32 | #define CONFIG_CODEC MAS3587F |
33 | 33 | ||
34 | /* Define this if you have a FM Recorder key system */ | 34 | /* Define this if you have a FM Recorder key system */ |
35 | #define HAVE_FMADC 1 | 35 | #define HAVE_FMADC 1 |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 1463656d03..bd817dcb2f 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -28,11 +28,11 @@ | |||
28 | #define S1A0903X01 0x01 /* Samsung */ | 28 | #define S1A0903X01 0x01 /* Samsung */ |
29 | #define TEA5767 0x02 /* Philips */ | 29 | #define TEA5767 0x02 /* Philips */ |
30 | 30 | ||
31 | /* CONFIG_HWCODEC */ | 31 | /* CONFIG_CODEC */ |
32 | #define MAS3587F 3587 | 32 | #define MAS3587F 3587 |
33 | #define MAS3507D 3507 | 33 | #define MAS3507D 3507 |
34 | #define MAS3539F 3539 | 34 | #define MAS3539F 3539 |
35 | #define MASNONE 1 /* if codec is done by SW */ | 35 | #define SWCODEC 1 /* if codec is done by SW */ |
36 | 36 | ||
37 | /* CONFIG_CPU */ | 37 | /* CONFIG_CPU */ |
38 | #define SH7034 7034 | 38 | #define SH7034 7034 |
diff --git a/firmware/export/id3.h b/firmware/export/id3.h index abb354b233..5deebd41de 100644 --- a/firmware/export/id3.h +++ b/firmware/export/id3.h | |||
@@ -28,14 +28,14 @@ | |||
28 | enum { | 28 | enum { |
29 | AFMT_UNKNOWN = 1, /* Unknown file format */ | 29 | AFMT_UNKNOWN = 1, /* Unknown file format */ |
30 | 30 | ||
31 | #if CONFIG_HWCODEC==MASNONE | 31 | #if CONFIG_CODEC==SWCODEC |
32 | AFMT_MPA_L1, /* MPEG Audio layer 1 */ | 32 | AFMT_MPA_L1, /* MPEG Audio layer 1 */ |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | AFMT_MPA_L2, /* MPEG Audio layer 2 */ | 35 | AFMT_MPA_L2, /* MPEG Audio layer 2 */ |
36 | AFMT_MPA_L3, /* MPEG Audio layer 3 */ | 36 | AFMT_MPA_L3, /* MPEG Audio layer 3 */ |
37 | 37 | ||
38 | #if CONFIG_HWCODEC==MASNONE | 38 | #if CONFIG_CODEC==SWCODEC |
39 | AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */ | 39 | AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */ |
40 | AFMT_OGG_VORBIS, /* Ogg Vorbis */ | 40 | AFMT_OGG_VORBIS, /* Ogg Vorbis */ |
41 | AFMT_FLAC, /* FLAC */ | 41 | AFMT_FLAC, /* FLAC */ |
@@ -118,7 +118,7 @@ struct mp3entry { | |||
118 | 118 | ||
119 | /* replaygain support */ | 119 | /* replaygain support */ |
120 | 120 | ||
121 | #if CONFIG_HWCODEC == MASNONE | 121 | #if CONFIG_CODEC == SWCODEC |
122 | char* track_gain_string; | 122 | char* track_gain_string; |
123 | char* album_gain_string; | 123 | char* album_gain_string; |
124 | long track_gain; /* 7.24 signed fixed point. 0 for no gain. */ | 124 | long track_gain; /* 7.24 signed fixed point. 0 for no gain. */ |
diff --git a/firmware/export/mas.h b/firmware/export/mas.h index f682fc676e..d25a1538ca 100644 --- a/firmware/export/mas.h +++ b/firmware/export/mas.h | |||
@@ -27,7 +27,7 @@ | |||
27 | /* | 27 | /* |
28 | MAS I2C defs | 28 | MAS I2C defs |
29 | */ | 29 | */ |
30 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 30 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
31 | #define MAS_ADR 0x3c | 31 | #define MAS_ADR 0x3c |
32 | #define MAS_DEV_WRITE (MAS_ADR | 0x00) | 32 | #define MAS_DEV_WRITE (MAS_ADR | 0x00) |
33 | #define MAS_DEV_READ (MAS_ADR | 0x01) | 33 | #define MAS_DEV_READ (MAS_ADR | 0x01) |
@@ -38,7 +38,7 @@ | |||
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | /* registers..*/ | 40 | /* registers..*/ |
41 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 41 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
42 | #define MAS_DATA_WRITE 0x68 | 42 | #define MAS_DATA_WRITE 0x68 |
43 | #define MAS_DATA_READ 0x69 | 43 | #define MAS_DATA_READ 0x69 |
44 | #define MAS_CODEC_WRITE 0x6c | 44 | #define MAS_CODEC_WRITE 0x6c |
@@ -62,7 +62,7 @@ | |||
62 | #define MAS_REG_KPRESCALE 0xe7 | 62 | #define MAS_REG_KPRESCALE 0xe7 |
63 | #define MAS_REG_KBASS 0x6b | 63 | #define MAS_REG_KBASS 0x6b |
64 | #define MAS_REG_KTREBLE 0x6f | 64 | #define MAS_REG_KTREBLE 0x6f |
65 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 65 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
66 | #define MAS_REG_KMDB_SWITCH 0x21 | 66 | #define MAS_REG_KMDB_SWITCH 0x21 |
67 | #define MAS_REG_KMDB_STR 0x22 | 67 | #define MAS_REG_KMDB_STR 0x22 |
68 | #define MAS_REG_KMDB_HAR 0x23 | 68 | #define MAS_REG_KMDB_HAR 0x23 |
@@ -78,7 +78,7 @@ | |||
78 | /* | 78 | /* |
79 | * MAS commands | 79 | * MAS commands |
80 | */ | 80 | */ |
81 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 81 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
82 | #define MAS_CMD_READ_ANCILLARY 0x50 | 82 | #define MAS_CMD_READ_ANCILLARY 0x50 |
83 | #define MAS_CMD_FAST_PRG_DL 0x60 | 83 | #define MAS_CMD_FAST_PRG_DL 0x60 |
84 | #define MAS_CMD_READ_IC_VER 0x70 | 84 | #define MAS_CMD_READ_IC_VER 0x70 |
@@ -101,7 +101,7 @@ | |||
101 | /* | 101 | /* |
102 | * MAS D0 memory cells (MAS3587F / MAS3539F) | 102 | * MAS D0 memory cells (MAS3587F / MAS3539F) |
103 | */ | 103 | */ |
104 | #if CONFIG_HWCODEC == MAS3587F | 104 | #if CONFIG_CODEC == MAS3587F |
105 | #define MAS_D0_APP_SELECT 0x7f6 | 105 | #define MAS_D0_APP_SELECT 0x7f6 |
106 | #define MAS_D0_APP_RUNNING 0x7f7 | 106 | #define MAS_D0_APP_RUNNING 0x7f7 |
107 | #define MAS_D0_ENCODER_CONTROL 0x7f0 | 107 | #define MAS_D0_ENCODER_CONTROL 0x7f0 |
@@ -120,7 +120,7 @@ | |||
120 | #define MAS_D0_MPEG_STATUS_2 0xfd2 | 120 | #define MAS_D0_MPEG_STATUS_2 0xfd2 |
121 | #define MAS_D0_CRC_ERROR_COUNT 0xfd3 | 121 | #define MAS_D0_CRC_ERROR_COUNT 0xfd3 |
122 | 122 | ||
123 | #elif CONFIG_HWCODEC == MAS3539F | 123 | #elif CONFIG_CODEC == MAS3539F |
124 | #define MAS_D0_APP_SELECT 0x34b | 124 | #define MAS_D0_APP_SELECT 0x34b |
125 | #define MAS_D0_APP_RUNNING 0x34c | 125 | #define MAS_D0_APP_RUNNING 0x34c |
126 | /* no encoder :( */ | 126 | /* no encoder :( */ |
diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h index 3611c1c9c1..772eafe971 100644 --- a/firmware/export/mp3_playback.h +++ b/firmware/export/mp3_playback.h | |||
@@ -32,7 +32,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
32 | bool superbass); | 32 | bool superbass); |
33 | 33 | ||
34 | /* exported just for mpeg.c, to keep the recording there */ | 34 | /* exported just for mpeg.c, to keep the recording there */ |
35 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 35 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
36 | void demand_irq_enable(bool on); | 36 | void demand_irq_enable(bool on); |
37 | #endif | 37 | #endif |
38 | 38 | ||
diff --git a/firmware/export/mpeg.h b/firmware/export/mpeg.h index d8dea3d143..6ce3b47275 100644 --- a/firmware/export/mpeg.h +++ b/firmware/export/mpeg.h | |||
@@ -43,7 +43,7 @@ | |||
43 | /* For ID3 info and VBR header */ | 43 | /* For ID3 info and VBR header */ |
44 | #define MPEG_RESERVED_HEADER_SPACE (4096 + 1500) | 44 | #define MPEG_RESERVED_HEADER_SPACE (4096 + 1500) |
45 | 45 | ||
46 | #if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR) | 46 | #if (CONFIG_CODEC == MAS3587F) || defined(SIMULATOR) |
47 | void mpeg_init_recording(void); | 47 | void mpeg_init_recording(void); |
48 | void mpeg_record(const char *filename); | 48 | void mpeg_record(const char *filename); |
49 | void mpeg_new_file(const char *filename); | 49 | void mpeg_new_file(const char *filename); |
diff --git a/firmware/export/sound.h b/firmware/export/sound.h index 9f4cd60ae8..772e2d6655 100644 --- a/firmware/export/sound.h +++ b/firmware/export/sound.h | |||
@@ -54,7 +54,7 @@ int sound_val2phys(int setting, int value); | |||
54 | const char *sound_unit(int setting); | 54 | const char *sound_unit(int setting); |
55 | int sound_numdecimals(int setting); | 55 | int sound_numdecimals(int setting); |
56 | int sound_steps(int setting); | 56 | int sound_steps(int setting); |
57 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) || defined(SIMULATOR) | 57 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || defined(SIMULATOR) |
58 | void sound_set_pitch(int permille); | 58 | void sound_set_pitch(int permille); |
59 | int sound_get_pitch(void); | 59 | int sound_get_pitch(void); |
60 | #endif | 60 | #endif |
diff --git a/firmware/id3.c b/firmware/id3.c index 90500663c1..8685d86790 100644 --- a/firmware/id3.c +++ b/firmware/id3.c | |||
@@ -83,14 +83,14 @@ static const char* const codec_labels[] = { | |||
83 | "ERR", /* Invalid codec type */ | 83 | "ERR", /* Invalid codec type */ |
84 | "???", /* Unknown file format */ | 84 | "???", /* Unknown file format */ |
85 | 85 | ||
86 | #if CONFIG_HWCODEC==MASNONE | 86 | #if CONFIG_CODEC==SWCODEC |
87 | "MP1", /* MPEG Audio layer 1 */ | 87 | "MP1", /* MPEG Audio layer 1 */ |
88 | #endif | 88 | #endif |
89 | 89 | ||
90 | "MP2", /* MPEG Audio layer 2 */ | 90 | "MP2", /* MPEG Audio layer 2 */ |
91 | "MP3", /* MPEG Audio layer 3 */ | 91 | "MP3", /* MPEG Audio layer 3 */ |
92 | 92 | ||
93 | #if CONFIG_HWCODEC==MASNONE | 93 | #if CONFIG_CODEC==SWCODEC |
94 | "WAV", /* Uncompressed PCM in a WAV file */ | 94 | "WAV", /* Uncompressed PCM in a WAV file */ |
95 | "OGG", /* Ogg Vorbis */ | 95 | "OGG", /* Ogg Vorbis */ |
96 | "FLAC", /* FLAC */ | 96 | "FLAC", /* FLAC */ |
@@ -310,7 +310,7 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos ) | |||
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | #if CONFIG_HWCODEC == MASNONE | 313 | #if CONFIG_CODEC == SWCODEC |
314 | /* parse user defined text, looking for replaygain information. */ | 314 | /* parse user defined text, looking for replaygain information. */ |
315 | static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) | 315 | static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) |
316 | { | 316 | { |
@@ -352,7 +352,7 @@ static const struct tag_resolver taglist[] = { | |||
352 | { "TCOM", 4, offsetof(struct mp3entry, composer), NULL }, | 352 | { "TCOM", 4, offsetof(struct mp3entry, composer), NULL }, |
353 | { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre }, | 353 | { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre }, |
354 | { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre }, | 354 | { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre }, |
355 | #if CONFIG_HWCODEC == MASNONE | 355 | #if CONFIG_CODEC == SWCODEC |
356 | { "TXXX", 4, 0, &parseuser }, | 356 | { "TXXX", 4, 0, &parseuser }, |
357 | #endif | 357 | #endif |
358 | }; | 358 | }; |
@@ -885,7 +885,7 @@ static int getsonglength(int fd, struct mp3entry *entry) | |||
885 | entry->version = info.version; | 885 | entry->version = info.version; |
886 | entry->layer = info.layer; | 886 | entry->layer = info.layer; |
887 | switch(entry->layer) { | 887 | switch(entry->layer) { |
888 | #if CONFIG_HWCODEC==MASNONE | 888 | #if CONFIG_CODEC==SWCODEC |
889 | case 0: | 889 | case 0: |
890 | entry->codectype=AFMT_MPA_L1; | 890 | entry->codectype=AFMT_MPA_L1; |
891 | break; | 891 | break; |
@@ -947,7 +947,7 @@ bool mp3info(struct mp3entry *entry, const char *filename, bool v1first) | |||
947 | if(-1 == fd) | 947 | if(-1 == fd) |
948 | return true; | 948 | return true; |
949 | 949 | ||
950 | #if CONFIG_HWCODEC != MASNONE | 950 | #if CONFIG_CODEC != SWCODEC |
951 | memset(entry, 0, sizeof(struct mp3entry)); | 951 | memset(entry, 0, sizeof(struct mp3entry)); |
952 | #endif | 952 | #endif |
953 | 953 | ||
diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c index 3a2fdb4f1a..b7114007b9 100644 --- a/firmware/mp3_playback.c +++ b/firmware/mp3_playback.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* hacking into mpeg.c, recording is still there */ | 38 | /* hacking into mpeg.c, recording is still there */ |
39 | #if CONFIG_HWCODEC == MAS3587F | 39 | #if CONFIG_CODEC == MAS3587F |
40 | enum | 40 | enum |
41 | { | 41 | { |
42 | MPEG_DECODER, | 42 | MPEG_DECODER, |
@@ -44,7 +44,7 @@ enum | |||
44 | } mpeg_mode; | 44 | } mpeg_mode; |
45 | #endif /* #ifdef MAS3587F */ | 45 | #endif /* #ifdef MAS3587F */ |
46 | 46 | ||
47 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 47 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
48 | extern unsigned long shadow_io_control_main; | 48 | extern unsigned long shadow_io_control_main; |
49 | extern unsigned shadow_codec_reg0; | 49 | extern unsigned shadow_codec_reg0; |
50 | #endif | 50 | #endif |
@@ -72,14 +72,14 @@ static void (*callback_for_more)(unsigned char**, int*); | |||
72 | bool audio_is_initialized = false; | 72 | bool audio_is_initialized = false; |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | #if CONFIG_HWCODEC != MASNONE | 75 | #if CONFIG_CODEC != SWCODEC |
76 | /* FIX: this code pretty much assumes a MAS */ | 76 | /* FIX: this code pretty much assumes a MAS */ |
77 | 77 | ||
78 | #ifndef SIMULATOR | 78 | #ifndef SIMULATOR |
79 | 79 | ||
80 | unsigned long mas_version_code; | 80 | unsigned long mas_version_code; |
81 | 81 | ||
82 | #if CONFIG_HWCODEC == MAS3507D | 82 | #if CONFIG_CODEC == MAS3507D |
83 | static void mas_poll_start(void) | 83 | static void mas_poll_start(void) |
84 | { | 84 | { |
85 | unsigned int count; | 85 | unsigned int count; |
@@ -104,7 +104,7 @@ static void mas_poll_start(void) | |||
104 | 104 | ||
105 | TSTR |= 0x02; /* Start timer 1 */ | 105 | TSTR |= 0x02; /* Start timer 1 */ |
106 | } | 106 | } |
107 | #elif CONFIG_HWCODEC != MASNONE | 107 | #elif CONFIG_CODEC != SWCODEC |
108 | static void postpone_dma_tick(void) | 108 | static void postpone_dma_tick(void) |
109 | { | 109 | { |
110 | unsigned int count; | 110 | unsigned int count; |
@@ -132,7 +132,7 @@ static void postpone_dma_tick(void) | |||
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | 134 | ||
135 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 135 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
136 | void demand_irq_enable(bool on) | 136 | void demand_irq_enable(bool on) |
137 | { | 137 | { |
138 | int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); | 138 | int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); |
@@ -147,7 +147,7 @@ void demand_irq_enable(bool on) | |||
147 | 147 | ||
148 | set_irq_level(oldlevel); | 148 | set_irq_level(oldlevel); |
149 | } | 149 | } |
150 | #endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ | 150 | #endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ |
151 | 151 | ||
152 | 152 | ||
153 | void play_tick(void) | 153 | void play_tick(void) |
@@ -194,7 +194,7 @@ void IMIA1(void) /* Timer 1 interrupt */ | |||
194 | if(playing) | 194 | if(playing) |
195 | play_tick(); | 195 | play_tick(); |
196 | TSR1 &= ~0x01; | 196 | TSR1 &= ~0x01; |
197 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 197 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
198 | /* Disable interrupt */ | 198 | /* Disable interrupt */ |
199 | IPRC &= ~0x000f; | 199 | IPRC &= ~0x000f; |
200 | #endif | 200 | #endif |
@@ -206,21 +206,21 @@ void IRQ6(void) /* PB14: MAS stop demand IRQ */ | |||
206 | SCR0 &= ~0x80; | 206 | SCR0 &= ~0x80; |
207 | } | 207 | } |
208 | 208 | ||
209 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 209 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
210 | #pragma interrupt | 210 | #pragma interrupt |
211 | void IRQ3(void) /* PA15: MAS demand IRQ */ | 211 | void IRQ3(void) /* PA15: MAS demand IRQ */ |
212 | { | 212 | { |
213 | /* Begin with setting the IRQ to edge sensitive */ | 213 | /* Begin with setting the IRQ to edge sensitive */ |
214 | ICR |= 0x0010; | 214 | ICR |= 0x0010; |
215 | 215 | ||
216 | #if CONFIG_HWCODEC == MAS3587F | 216 | #if CONFIG_CODEC == MAS3587F |
217 | if(mpeg_mode == MPEG_ENCODER) | 217 | if(mpeg_mode == MPEG_ENCODER) |
218 | rec_tick(); | 218 | rec_tick(); |
219 | else | 219 | else |
220 | #endif | 220 | #endif |
221 | postpone_dma_tick(); | 221 | postpone_dma_tick(); |
222 | } | 222 | } |
223 | #endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ | 223 | #endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ |
224 | 224 | ||
225 | static void setup_sci0(void) | 225 | static void setup_sci0(void) |
226 | { | 226 | { |
@@ -260,7 +260,7 @@ static void setup_sci0(void) | |||
260 | } | 260 | } |
261 | #endif /* SIMULATOR */ | 261 | #endif /* SIMULATOR */ |
262 | 262 | ||
263 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 263 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
264 | static void init_playback(void) | 264 | static void init_playback(void) |
265 | { | 265 | { |
266 | unsigned long val; | 266 | unsigned long val; |
@@ -310,7 +310,7 @@ static void init_playback(void) | |||
310 | mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1); | 310 | mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1); |
311 | } while((val & 0x0c) != 0x0c); | 311 | } while((val & 0x0c) != 0x0c); |
312 | 312 | ||
313 | #if CONFIG_HWCODEC == MAS3587F | 313 | #if CONFIG_CODEC == MAS3587F |
314 | mpeg_mode = MPEG_DECODER; | 314 | mpeg_mode = MPEG_DECODER; |
315 | #endif | 315 | #endif |
316 | 316 | ||
@@ -322,7 +322,7 @@ static void init_playback(void) | |||
322 | 322 | ||
323 | DEBUGF("MAS Decoding application started\n"); | 323 | DEBUGF("MAS Decoding application started\n"); |
324 | } | 324 | } |
325 | #endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ | 325 | #endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ |
326 | 326 | ||
327 | void mp3_init(int volume, int bass, int treble, int balance, int loudness, | 327 | void mp3_init(int volume, int bass, int treble, int balance, int loudness, |
328 | int avc, int channel_config, int stereo_width, | 328 | int avc, int channel_config, int stereo_width, |
@@ -346,7 +346,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
346 | (void)mdb_enable; | 346 | (void)mdb_enable; |
347 | (void)superbass; | 347 | (void)superbass; |
348 | #else | 348 | #else |
349 | #if CONFIG_HWCODEC == MAS3507D | 349 | #if CONFIG_CODEC == MAS3507D |
350 | unsigned long val; | 350 | unsigned long val; |
351 | (void)loudness; | 351 | (void)loudness; |
352 | (void)avc; | 352 | (void)avc; |
@@ -365,9 +365,9 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
365 | or_b(0x01, &PBIORH); /* output for PB8 */ | 365 | or_b(0x01, &PBIORH); /* output for PB8 */ |
366 | #endif | 366 | #endif |
367 | 367 | ||
368 | #if CONFIG_HWCODEC == MAS3507D | 368 | #if CONFIG_CODEC == MAS3507D |
369 | mas_reset(); | 369 | mas_reset(); |
370 | #elif CONFIG_HWCODEC == MAS3587F | 370 | #elif CONFIG_CODEC == MAS3587F |
371 | or_b(0x08, &PAIORH); /* output for /PR */ | 371 | or_b(0x08, &PAIORH); /* output for /PR */ |
372 | init_playback(); | 372 | init_playback(); |
373 | 373 | ||
@@ -375,7 +375,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
375 | DEBUGF("MAS3587 derivate %d, version %c%d\n", | 375 | DEBUGF("MAS3587 derivate %d, version %c%d\n", |
376 | (mas_version_code & 0xf000) >> 12, | 376 | (mas_version_code & 0xf000) >> 12, |
377 | 'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff); | 377 | 'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff); |
378 | #elif CONFIG_HWCODEC == MAS3539F | 378 | #elif CONFIG_CODEC == MAS3539F |
379 | or_b(0x08, &PAIORH); /* output for /PR */ | 379 | or_b(0x08, &PAIORH); /* output for /PR */ |
380 | init_playback(); | 380 | init_playback(); |
381 | 381 | ||
@@ -389,7 +389,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
389 | dac_init(); | 389 | dac_init(); |
390 | #endif | 390 | #endif |
391 | 391 | ||
392 | #if CONFIG_HWCODEC == MAS3507D | 392 | #if CONFIG_CODEC == MAS3507D |
393 | /* set IRQ6 to edge detect */ | 393 | /* set IRQ6 to edge detect */ |
394 | ICR |= 0x02; | 394 | ICR |= 0x02; |
395 | 395 | ||
@@ -430,14 +430,14 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
430 | 430 | ||
431 | #endif | 431 | #endif |
432 | 432 | ||
433 | #if CONFIG_HWCODEC == MAS3507D | 433 | #if CONFIG_CODEC == MAS3507D |
434 | mas_poll_start(); | 434 | mas_poll_start(); |
435 | 435 | ||
436 | mas_writereg(MAS_REG_KPRESCALE, 0xe9400); | 436 | mas_writereg(MAS_REG_KPRESCALE, 0xe9400); |
437 | dac_enable(true); | 437 | dac_enable(true); |
438 | #endif | 438 | #endif |
439 | 439 | ||
440 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 440 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
441 | ICR &= ~0x0010; /* IRQ3 level sensitive */ | 441 | ICR &= ~0x0010; /* IRQ3 level sensitive */ |
442 | PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */ | 442 | PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */ |
443 | #endif | 443 | #endif |
@@ -452,7 +452,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
452 | sound_set(SOUND_CHANNELS, channel_config); | 452 | sound_set(SOUND_CHANNELS, channel_config); |
453 | sound_set(SOUND_STEREO_WIDTH, stereo_width); | 453 | sound_set(SOUND_STEREO_WIDTH, stereo_width); |
454 | 454 | ||
455 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 455 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
456 | sound_set(SOUND_LOUDNESS, loudness); | 456 | sound_set(SOUND_LOUDNESS, loudness); |
457 | sound_set(SOUND_AVC, avc); | 457 | sound_set(SOUND_AVC, avc); |
458 | sound_set(SOUND_MDB_STRENGTH, mdb_strength); | 458 | sound_set(SOUND_MDB_STRENGTH, mdb_strength); |
@@ -471,12 +471,12 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
471 | void mp3_shutdown(void) | 471 | void mp3_shutdown(void) |
472 | { | 472 | { |
473 | #ifndef SIMULATOR | 473 | #ifndef SIMULATOR |
474 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 474 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
475 | unsigned long val = 1; | 475 | unsigned long val = 1; |
476 | mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &val, 1); /* Mute */ | 476 | mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &val, 1); /* Mute */ |
477 | #endif | 477 | #endif |
478 | 478 | ||
479 | #if CONFIG_HWCODEC == MAS3507D | 479 | #if CONFIG_CODEC == MAS3507D |
480 | dac_volume(0, 0, false); | 480 | dac_volume(0, 0, false); |
481 | #endif | 481 | #endif |
482 | 482 | ||
@@ -489,7 +489,7 @@ void mp3_shutdown(void) | |||
489 | 489 | ||
490 | void mp3_play_init(void) | 490 | void mp3_play_init(void) |
491 | { | 491 | { |
492 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 492 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
493 | init_playback(); | 493 | init_playback(); |
494 | #endif | 494 | #endif |
495 | playing = false; | 495 | playing = false; |
@@ -518,7 +518,7 @@ void mp3_play_data(const unsigned char* start, int size, | |||
518 | 518 | ||
519 | CHCR3 |= 0x0001; /* Enable DMA IRQ */ | 519 | CHCR3 |= 0x0001; /* Enable DMA IRQ */ |
520 | 520 | ||
521 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 521 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
522 | demand_irq_enable(true); | 522 | demand_irq_enable(true); |
523 | #endif | 523 | #endif |
524 | } | 524 | } |
@@ -557,7 +557,7 @@ void mp3_play_stop(void) | |||
557 | playing = false; | 557 | playing = false; |
558 | mp3_play_pause(false); | 558 | mp3_play_pause(false); |
559 | CHCR3 &= ~0x0001; /* Disable the DMA interrupt */ | 559 | CHCR3 &= ~0x0001; /* Disable the DMA interrupt */ |
560 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 560 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
561 | demand_irq_enable(false); | 561 | demand_irq_enable(false); |
562 | #endif | 562 | #endif |
563 | } | 563 | } |
@@ -591,7 +591,7 @@ unsigned char* mp3_get_pos(void) | |||
591 | 591 | ||
592 | #endif /* #ifndef SIMULATOR */ | 592 | #endif /* #ifndef SIMULATOR */ |
593 | 593 | ||
594 | #else /* CONFIG_HWCODEC != MASNONE */ | 594 | #else /* CONFIG_CODEC != SWCODEC */ |
595 | void mp3_init(int volume, int bass, int treble, int balance, int loudness, | 595 | void mp3_init(int volume, int bass, int treble, int balance, int loudness, |
596 | int avc, int channel_config, int stereo_width, | 596 | int avc, int channel_config, int stereo_width, |
597 | int mdb_strength, int mdb_harmonics, | 597 | int mdb_strength, int mdb_harmonics, |
@@ -651,4 +651,4 @@ bool mp3_is_playing(void) | |||
651 | return playing; | 651 | return playing; |
652 | } | 652 | } |
653 | 653 | ||
654 | #endif /* CONFIG_HWCODEC == MASNONE */ | 654 | #endif /* CONFIG_CODEC == SWCODEC */ |
diff --git a/firmware/mp3data.c b/firmware/mp3data.c index bca8560188..44c298a463 100644 --- a/firmware/mp3data.c +++ b/firmware/mp3data.c | |||
@@ -100,7 +100,7 @@ static bool is_mp3frameheader(unsigned long head) | |||
100 | return false; | 100 | return false; |
101 | if (!(head & LAYER_MASK)) /* no layer? */ | 101 | if (!(head & LAYER_MASK)) /* no layer? */ |
102 | return false; | 102 | return false; |
103 | #if CONFIG_HWCODEC != MASNONE | 103 | #if CONFIG_CODEC != SWCODEC |
104 | /* The MAS can't decode layer 1, so treat layer 1 data as invalid */ | 104 | /* The MAS can't decode layer 1, so treat layer 1 data as invalid */ |
105 | if ((head & LAYER_MASK) == LAYER_MASK) | 105 | if ((head & LAYER_MASK) == LAYER_MASK) |
106 | return false; | 106 | return false; |
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 721a4acbcc..394d6983b6 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include "config.h" | 21 | #include "config.h" |
22 | 22 | ||
23 | #if CONFIG_HWCODEC != MASNONE | 23 | #if CONFIG_CODEC != SWCODEC |
24 | 24 | ||
25 | #include "debug.h" | 25 | #include "debug.h" |
26 | #include "panic.h" | 26 | #include "panic.h" |
@@ -51,13 +51,13 @@ | |||
51 | extern unsigned long mas_version_code; | 51 | extern unsigned long mas_version_code; |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #if CONFIG_HWCODEC == MAS3587F | 54 | #if CONFIG_CODEC == MAS3587F |
55 | extern enum /* from mp3_playback.c */ | 55 | extern enum /* from mp3_playback.c */ |
56 | { | 56 | { |
57 | MPEG_DECODER, | 57 | MPEG_DECODER, |
58 | MPEG_ENCODER | 58 | MPEG_ENCODER |
59 | } mpeg_mode; | 59 | } mpeg_mode; |
60 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 60 | #endif /* CONFIG_CODEC == MAS3587F */ |
61 | 61 | ||
62 | extern char* playlist_peek(int steps); | 62 | extern char* playlist_peek(int steps); |
63 | extern bool playlist_check(int steps); | 63 | extern bool playlist_check(int steps); |
@@ -151,7 +151,7 @@ static long low_watermark; /* Dynamic low watermark level */ | |||
151 | static long low_watermark_margin; /* Extra time in seconds for watermark */ | 151 | static long low_watermark_margin; /* Extra time in seconds for watermark */ |
152 | static long lowest_watermark_level; /* Debug value to observe the buffer | 152 | static long lowest_watermark_level; /* Debug value to observe the buffer |
153 | usage */ | 153 | usage */ |
154 | #if CONFIG_HWCODEC == MAS3587F | 154 | #if CONFIG_CODEC == MAS3587F |
155 | static char recording_filename[MAX_PATH]; /* argument to thread */ | 155 | static char recording_filename[MAX_PATH]; /* argument to thread */ |
156 | static char delayed_filename[MAX_PATH]; /* internal copy of above */ | 156 | static char delayed_filename[MAX_PATH]; /* internal copy of above */ |
157 | 157 | ||
@@ -189,13 +189,13 @@ static unsigned long num_recorded_frames; | |||
189 | 189 | ||
190 | /* Shadow MAS registers */ | 190 | /* Shadow MAS registers */ |
191 | unsigned long shadow_encoder_control = 0; | 191 | unsigned long shadow_encoder_control = 0; |
192 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 192 | #endif /* CONFIG_CODEC == MAS3587F */ |
193 | 193 | ||
194 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 194 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
195 | unsigned long shadow_io_control_main = 0; | 195 | unsigned long shadow_io_control_main = 0; |
196 | unsigned long shadow_soft_mute = 0; | 196 | unsigned long shadow_soft_mute = 0; |
197 | unsigned shadow_codec_reg0; | 197 | unsigned shadow_codec_reg0; |
198 | #endif /* (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ | 198 | #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ |
199 | 199 | ||
200 | #ifdef HAVE_RECORDING | 200 | #ifdef HAVE_RECORDING |
201 | const unsigned char empty_id3_header[] = | 201 | const unsigned char empty_id3_header[] = |
@@ -211,7 +211,7 @@ static int get_playable_space(void); | |||
211 | static int get_unswapped_space(void); | 211 | static int get_unswapped_space(void); |
212 | #endif /* !SIMULATOR */ | 212 | #endif /* !SIMULATOR */ |
213 | 213 | ||
214 | #if CONFIG_HWCODEC == MAS3587F | 214 | #if CONFIG_CODEC == MAS3587F |
215 | static void init_recording(void); | 215 | static void init_recording(void); |
216 | static void start_prerecording(void); | 216 | static void start_prerecording(void); |
217 | static void start_recording(void); | 217 | static void start_recording(void); |
@@ -219,7 +219,7 @@ static void stop_recording(void); | |||
219 | static int get_unsaved_space(void); | 219 | static int get_unsaved_space(void); |
220 | static void pause_recording(void); | 220 | static void pause_recording(void); |
221 | static void resume_recording(void); | 221 | static void resume_recording(void); |
222 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 222 | #endif /* CONFIG_CODEC == MAS3587F */ |
223 | 223 | ||
224 | 224 | ||
225 | #ifndef SIMULATOR | 225 | #ifndef SIMULATOR |
@@ -661,7 +661,7 @@ static int get_unswapped_space(void) | |||
661 | return space; | 661 | return space; |
662 | } | 662 | } |
663 | 663 | ||
664 | #if CONFIG_HWCODEC == MAS3587F | 664 | #if CONFIG_CODEC == MAS3587F |
665 | static int get_unsaved_space(void) | 665 | static int get_unsaved_space(void) |
666 | { | 666 | { |
667 | int space = audiobuf_write - audiobuf_read; | 667 | int space = audiobuf_write - audiobuf_read; |
@@ -772,7 +772,7 @@ void rec_tick(void) | |||
772 | } | 772 | } |
773 | } | 773 | } |
774 | } | 774 | } |
775 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 775 | #endif /* CONFIG_CODEC == MAS3587F */ |
776 | 776 | ||
777 | void playback_tick(void) | 777 | void playback_tick(void) |
778 | { | 778 | { |
@@ -1029,10 +1029,10 @@ static void track_change(void) | |||
1029 | { | 1029 | { |
1030 | DEBUGF("Track change\n"); | 1030 | DEBUGF("Track change\n"); |
1031 | 1031 | ||
1032 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 1032 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
1033 | /* Reset the AVC */ | 1033 | /* Reset the AVC */ |
1034 | sound_set(SOUND_AVC, -1); | 1034 | sound_set(SOUND_AVC, -1); |
1035 | #endif /* (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ | 1035 | #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ |
1036 | 1036 | ||
1037 | if (num_tracks_in_memory() > 0) | 1037 | if (num_tracks_in_memory() > 0) |
1038 | { | 1038 | { |
@@ -1157,14 +1157,14 @@ static void mpeg_thread(void) | |||
1157 | int amount_to_read; | 1157 | int amount_to_read; |
1158 | int t1, t2; | 1158 | int t1, t2; |
1159 | int start_offset; | 1159 | int start_offset; |
1160 | #if CONFIG_HWCODEC == MAS3587F | 1160 | #if CONFIG_CODEC == MAS3587F |
1161 | int amount_to_save; | 1161 | int amount_to_save; |
1162 | int framelen; | 1162 | int framelen; |
1163 | unsigned long saved_header = 0; | 1163 | unsigned long saved_header = 0; |
1164 | int save_endpos = 0; | 1164 | int save_endpos = 0; |
1165 | int rc; | 1165 | int rc; |
1166 | long offset; | 1166 | long offset; |
1167 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 1167 | #endif /* CONFIG_CODEC == MAS3587F */ |
1168 | 1168 | ||
1169 | is_playing = false; | 1169 | is_playing = false; |
1170 | play_pending = false; | 1170 | play_pending = false; |
@@ -1173,10 +1173,10 @@ static void mpeg_thread(void) | |||
1173 | 1173 | ||
1174 | while(1) | 1174 | while(1) |
1175 | { | 1175 | { |
1176 | #if CONFIG_HWCODEC == MAS3587F | 1176 | #if CONFIG_CODEC == MAS3587F |
1177 | if(mpeg_mode == MPEG_DECODER) | 1177 | if(mpeg_mode == MPEG_DECODER) |
1178 | { | 1178 | { |
1179 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 1179 | #endif /* CONFIG_CODEC == MAS3587F */ |
1180 | yield(); | 1180 | yield(); |
1181 | 1181 | ||
1182 | /* Swap if necessary, and don't block on the queue_wait() */ | 1182 | /* Swap if necessary, and don't block on the queue_wait() */ |
@@ -1724,19 +1724,19 @@ static void mpeg_thread(void) | |||
1724 | break; | 1724 | break; |
1725 | #endif /* !USB_NONE */ | 1725 | #endif /* !USB_NONE */ |
1726 | 1726 | ||
1727 | #if CONFIG_HWCODEC == MAS3587F | 1727 | #if CONFIG_CODEC == MAS3587F |
1728 | case MPEG_INIT_RECORDING: | 1728 | case MPEG_INIT_RECORDING: |
1729 | init_recording(); | 1729 | init_recording(); |
1730 | init_recording_done = true; | 1730 | init_recording_done = true; |
1731 | break; | 1731 | break; |
1732 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 1732 | #endif /* CONFIG_CODEC == MAS3587F */ |
1733 | 1733 | ||
1734 | case SYS_TIMEOUT: | 1734 | case SYS_TIMEOUT: |
1735 | if (playing) | 1735 | if (playing) |
1736 | playlist_update_resume_info(audio_current_track()); | 1736 | playlist_update_resume_info(audio_current_track()); |
1737 | break; | 1737 | break; |
1738 | } | 1738 | } |
1739 | #if CONFIG_HWCODEC == MAS3587F | 1739 | #if CONFIG_CODEC == MAS3587F |
1740 | } | 1740 | } |
1741 | else | 1741 | else |
1742 | { | 1742 | { |
@@ -2069,7 +2069,7 @@ static void mpeg_thread(void) | |||
2069 | break; | 2069 | break; |
2070 | } | 2070 | } |
2071 | } | 2071 | } |
2072 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 2072 | #endif /* CONFIG_CODEC == MAS3587F */ |
2073 | } | 2073 | } |
2074 | } | 2074 | } |
2075 | #endif /* !SIMULATOR */ | 2075 | #endif /* !SIMULATOR */ |
@@ -2113,7 +2113,7 @@ bool audio_has_changed_track(void) | |||
2113 | return false; | 2113 | return false; |
2114 | } | 2114 | } |
2115 | 2115 | ||
2116 | #if CONFIG_HWCODEC == MAS3587F | 2116 | #if CONFIG_CODEC == MAS3587F |
2117 | void audio_init_playback(void) | 2117 | void audio_init_playback(void) |
2118 | { | 2118 | { |
2119 | init_playback_done = false; | 2119 | init_playback_done = false; |
@@ -2216,7 +2216,7 @@ static void init_recording(void) | |||
2216 | buffer, because the silly MAS will not negate EOD until at least one | 2216 | buffer, because the silly MAS will not negate EOD until at least one |
2217 | DMA transfer has taken place. | 2217 | DMA transfer has taken place. |
2218 | Now let's wait for some data to be encoded. */ | 2218 | Now let's wait for some data to be encoded. */ |
2219 | sleep(20); | 2219 | sleep(HZ/5); |
2220 | 2220 | ||
2221 | /* Now set it to Monitoring mode as default, saves power */ | 2221 | /* Now set it to Monitoring mode as default, saves power */ |
2222 | shadow_io_control_main = 0x525; | 2222 | shadow_io_control_main = 0x525; |
@@ -2630,7 +2630,7 @@ void mpeg_set_recording_options(int frequency, int quality, | |||
2630 | (void)editable; | 2630 | (void)editable; |
2631 | (void)prerecord_time; | 2631 | (void)prerecord_time; |
2632 | } | 2632 | } |
2633 | #endif /* CONFIG_HWCODEC == MAS3587F; SIMULATOR */ | 2633 | #endif /* CONFIG_CODEC == MAS3587F; SIMULATOR */ |
2634 | 2634 | ||
2635 | void audio_play(int offset) | 2635 | void audio_play(int offset) |
2636 | { | 2636 | { |
@@ -2786,13 +2786,13 @@ int audio_status(void) | |||
2786 | if(paused) | 2786 | if(paused) |
2787 | ret |= AUDIO_STATUS_PAUSE; | 2787 | ret |= AUDIO_STATUS_PAUSE; |
2788 | 2788 | ||
2789 | #if CONFIG_HWCODEC == MAS3587F | 2789 | #if CONFIG_CODEC == MAS3587F |
2790 | if(is_recording && !is_prerecording) | 2790 | if(is_recording && !is_prerecording) |
2791 | ret |= AUDIO_STATUS_RECORD; | 2791 | ret |= AUDIO_STATUS_RECORD; |
2792 | 2792 | ||
2793 | if(is_prerecording) | 2793 | if(is_prerecording) |
2794 | ret |= AUDIO_STATUS_PRERECORD; | 2794 | ret |= AUDIO_STATUS_PRERECORD; |
2795 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 2795 | #endif /* CONFIG_CODEC == MAS3587F */ |
2796 | 2796 | ||
2797 | if(mpeg_errno) | 2797 | if(mpeg_errno) |
2798 | ret |= AUDIO_STATUS_ERROR; | 2798 | ret |= AUDIO_STATUS_ERROR; |
@@ -2846,12 +2846,12 @@ void audio_init(void) | |||
2846 | 2846 | ||
2847 | memset(trackdata, sizeof(trackdata), 0); | 2847 | memset(trackdata, sizeof(trackdata), 0); |
2848 | 2848 | ||
2849 | #if CONFIG_HWCODEC == MAS3587F | 2849 | #if CONFIG_CODEC == MAS3587F |
2850 | if(read_hw_mask() & PR_ACTIVE_HIGH) | 2850 | if(read_hw_mask() & PR_ACTIVE_HIGH) |
2851 | and_b(~0x08, &PADRH); | 2851 | and_b(~0x08, &PADRH); |
2852 | else | 2852 | else |
2853 | or_b(0x08, &PADRH); | 2853 | or_b(0x08, &PADRH); |
2854 | #endif /* CONFIG_HWCODEC == MAS3587F */ | 2854 | #endif /* CONFIG_CODEC == MAS3587F */ |
2855 | 2855 | ||
2856 | #ifdef DEBUG | 2856 | #ifdef DEBUG |
2857 | dbg_timer_start(); | 2857 | dbg_timer_start(); |
@@ -2859,4 +2859,4 @@ void audio_init(void) | |||
2859 | #endif /* DEBUG */ | 2859 | #endif /* DEBUG */ |
2860 | } | 2860 | } |
2861 | 2861 | ||
2862 | #endif /* CONFIG_HWCODEC != MASNONE */ | 2862 | #endif /* CONFIG_CODEC != SWCODEC */ |
diff --git a/firmware/sound.c b/firmware/sound.c index cd772f5e9f..a36c244d1b 100644 --- a/firmware/sound.c +++ b/firmware/sound.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include "dac.h" | 31 | #include "dac.h" |
32 | #include "system.h" | 32 | #include "system.h" |
33 | #include "hwcompat.h" | 33 | #include "hwcompat.h" |
34 | #if CONFIG_HWCODEC == MASNONE | 34 | #if CONFIG_CODEC == SWCODEC |
35 | #include "pcm_playback.h" | 35 | #include "pcm_playback.h" |
36 | #endif | 36 | #endif |
37 | #endif | 37 | #endif |
@@ -40,7 +40,7 @@ | |||
40 | extern bool audio_is_initialized; | 40 | extern bool audio_is_initialized; |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 43 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
44 | extern unsigned long shadow_io_control_main; | 44 | extern unsigned long shadow_io_control_main; |
45 | extern unsigned shadow_codec_reg0; | 45 | extern unsigned shadow_codec_reg0; |
46 | #endif | 46 | #endif |
@@ -116,7 +116,7 @@ static const int steps[] = | |||
116 | static const int minval[] = | 116 | static const int minval[] = |
117 | { | 117 | { |
118 | 0, /* Volume */ | 118 | 0, /* Volume */ |
119 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 119 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
120 | -12, /* Bass */ | 120 | -12, /* Bass */ |
121 | -12, /* Treble */ | 121 | -12, /* Treble */ |
122 | #elif defined(HAVE_UDA1380) | 122 | #elif defined(HAVE_UDA1380) |
@@ -145,7 +145,7 @@ static const int minval[] = | |||
145 | static const int maxval[] = | 145 | static const int maxval[] = |
146 | { | 146 | { |
147 | 100, /* Volume */ | 147 | 100, /* Volume */ |
148 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 148 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
149 | 12, /* Bass */ | 149 | 12, /* Bass */ |
150 | 12, /* Treble */ | 150 | 12, /* Treble */ |
151 | #elif defined(HAVE_UDA1380) | 151 | #elif defined(HAVE_UDA1380) |
@@ -174,7 +174,7 @@ static const int maxval[] = | |||
174 | static const int defaultval[] = | 174 | static const int defaultval[] = |
175 | { | 175 | { |
176 | 70, /* Volume */ | 176 | 70, /* Volume */ |
177 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 177 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
178 | 6, /* Bass */ | 178 | 6, /* Bass */ |
179 | 6, /* Treble */ | 179 | 6, /* Treble */ |
180 | #elif defined(HAVE_UDA1380) | 180 | #elif defined(HAVE_UDA1380) |
@@ -231,7 +231,7 @@ int sound_default(int setting) | |||
231 | } | 231 | } |
232 | 232 | ||
233 | #ifndef SIMULATOR | 233 | #ifndef SIMULATOR |
234 | #if CONFIG_HWCODEC == MAS3507D /* volume/balance/treble/bass interdependency */ | 234 | #if CONFIG_CODEC == MAS3507D /* volume/balance/treble/bass interdependency */ |
235 | #define VOLUME_MIN -780 | 235 | #define VOLUME_MIN -780 |
236 | #define VOLUME_MAX 180 | 236 | #define VOLUME_MAX 180 |
237 | 237 | ||
@@ -351,7 +351,7 @@ static int tenthdb2master(int db) { | |||
351 | } | 351 | } |
352 | #endif | 352 | #endif |
353 | 353 | ||
354 | #if (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 | 354 | #if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 |
355 | /* volume/balance/treble/bass interdependency main part */ | 355 | /* volume/balance/treble/bass interdependency main part */ |
356 | #define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN) | 356 | #define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN) |
357 | 357 | ||
@@ -371,7 +371,7 @@ static void set_prescaled_volume(void) | |||
371 | prescale = 0; /* no need to prescale if we don't boost | 371 | prescale = 0; /* no need to prescale if we don't boost |
372 | bass or treble */ | 372 | bass or treble */ |
373 | 373 | ||
374 | #if CONFIG_HWCODEC == MAS3507D | 374 | #if CONFIG_CODEC == MAS3507D |
375 | mas_writereg(MAS_REG_KPRESCALE, prescale_table[prescale/10]); | 375 | mas_writereg(MAS_REG_KPRESCALE, prescale_table[prescale/10]); |
376 | #else /* UDA1380 */ | 376 | #else /* UDA1380 */ |
377 | uda1380_set_mixer_vol(prescale*2/5, prescale*2/5); | 377 | uda1380_set_mixer_vol(prescale*2/5, prescale*2/5); |
@@ -397,13 +397,13 @@ static void set_prescaled_volume(void) | |||
397 | r = VOLUME_MIN; | 397 | r = VOLUME_MIN; |
398 | } | 398 | } |
399 | 399 | ||
400 | #if CONFIG_HWCODEC == MAS3507D | 400 | #if CONFIG_CODEC == MAS3507D |
401 | dac_volume(tenthdb2reg(l), tenthdb2reg(r), false); | 401 | dac_volume(tenthdb2reg(l), tenthdb2reg(r), false); |
402 | #else /* UDA1380 */ | 402 | #else /* UDA1380 */ |
403 | uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r)); | 403 | uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r)); |
404 | #endif | 404 | #endif |
405 | } | 405 | } |
406 | #endif /* (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 */ | 406 | #endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */ |
407 | #endif /* !SIMULATOR */ | 407 | #endif /* !SIMULATOR */ |
408 | 408 | ||
409 | int channel_configuration = SOUND_CHAN_STEREO; | 409 | int channel_configuration = SOUND_CHAN_STEREO; |
@@ -475,12 +475,12 @@ static void set_channel_config(void) | |||
475 | break; | 475 | break; |
476 | } | 476 | } |
477 | 477 | ||
478 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 478 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
479 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LL, &val_ll, 1); /* LL */ | 479 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LL, &val_ll, 1); /* LL */ |
480 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LR, &val_lr, 1); /* LR */ | 480 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LR, &val_lr, 1); /* LR */ |
481 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RL, &val_rl, 1); /* RL */ | 481 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RL, &val_rl, 1); /* RL */ |
482 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RR, &val_rr, 1); /* RR */ | 482 | mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RR, &val_rr, 1); /* RR */ |
483 | #elif CONFIG_HWCODEC == MAS3507D | 483 | #elif CONFIG_CODEC == MAS3507D |
484 | mas_writemem(MAS_BANK_D1, 0x7f8, &val_ll, 1); /* LL */ | 484 | mas_writemem(MAS_BANK_D1, 0x7f8, &val_ll, 1); /* LL */ |
485 | mas_writemem(MAS_BANK_D1, 0x7f9, &val_lr, 1); /* LR */ | 485 | mas_writemem(MAS_BANK_D1, 0x7f9, &val_lr, 1); /* LR */ |
486 | mas_writemem(MAS_BANK_D1, 0x7fa, &val_rl, 1); /* RL */ | 486 | mas_writemem(MAS_BANK_D1, 0x7fa, &val_rl, 1); /* RL */ |
@@ -489,7 +489,7 @@ static void set_channel_config(void) | |||
489 | } | 489 | } |
490 | #endif /* !SIMULATOR */ | 490 | #endif /* !SIMULATOR */ |
491 | 491 | ||
492 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 492 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
493 | unsigned long mdb_shape_shadow = 0; | 493 | unsigned long mdb_shape_shadow = 0; |
494 | unsigned long loudness_shadow = 0; | 494 | unsigned long loudness_shadow = 0; |
495 | #endif | 495 | #endif |
@@ -499,7 +499,7 @@ void sound_set(int setting, int value) | |||
499 | #ifdef SIMULATOR | 499 | #ifdef SIMULATOR |
500 | setting = value; | 500 | setting = value; |
501 | #else | 501 | #else |
502 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 502 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
503 | int tmp; | 503 | int tmp; |
504 | #endif | 504 | #endif |
505 | 505 | ||
@@ -509,30 +509,30 @@ void sound_set(int setting, int value) | |||
509 | switch(setting) | 509 | switch(setting) |
510 | { | 510 | { |
511 | case SOUND_VOLUME: | 511 | case SOUND_VOLUME: |
512 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 512 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
513 | tmp = 0x7f00 * value / 100; | 513 | tmp = 0x7f00 * value / 100; |
514 | mas_codec_writereg(0x10, tmp & 0xff00); | 514 | mas_codec_writereg(0x10, tmp & 0xff00); |
515 | #elif (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 | 515 | #elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 |
516 | current_volume = VOLUME_MIN + (value * VOLUME_RANGE / 100); | 516 | current_volume = VOLUME_MIN + (value * VOLUME_RANGE / 100); |
517 | set_prescaled_volume(); /* tenth of dB */ | 517 | set_prescaled_volume(); /* tenth of dB */ |
518 | #endif | 518 | #endif |
519 | break; | 519 | break; |
520 | 520 | ||
521 | case SOUND_BALANCE: | 521 | case SOUND_BALANCE: |
522 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 522 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
523 | tmp = ((value * 127 / 100) & 0xff) << 8; | 523 | tmp = ((value * 127 / 100) & 0xff) << 8; |
524 | mas_codec_writereg(0x11, tmp & 0xff00); | 524 | mas_codec_writereg(0x11, tmp & 0xff00); |
525 | #elif CONFIG_HWCODEC == MAS3507D || defined HAVE_UDA1380 | 525 | #elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380 |
526 | current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ | 526 | current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ |
527 | set_prescaled_volume(); | 527 | set_prescaled_volume(); |
528 | #endif | 528 | #endif |
529 | break; | 529 | break; |
530 | 530 | ||
531 | case SOUND_BASS: | 531 | case SOUND_BASS: |
532 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 532 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
533 | tmp = ((value * 8) & 0xff) << 8; | 533 | tmp = ((value * 8) & 0xff) << 8; |
534 | mas_codec_writereg(0x14, tmp & 0xff00); | 534 | mas_codec_writereg(0x14, tmp & 0xff00); |
535 | #elif CONFIG_HWCODEC == MAS3507D | 535 | #elif CONFIG_CODEC == MAS3507D |
536 | mas_writereg(MAS_REG_KBASS, bass_table[value+15]); | 536 | mas_writereg(MAS_REG_KBASS, bass_table[value+15]); |
537 | current_bass = value * 10; | 537 | current_bass = value * 10; |
538 | set_prescaled_volume(); | 538 | set_prescaled_volume(); |
@@ -544,10 +544,10 @@ void sound_set(int setting, int value) | |||
544 | break; | 544 | break; |
545 | 545 | ||
546 | case SOUND_TREBLE: | 546 | case SOUND_TREBLE: |
547 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 547 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
548 | tmp = ((value * 8) & 0xff) << 8; | 548 | tmp = ((value * 8) & 0xff) << 8; |
549 | mas_codec_writereg(0x15, tmp & 0xff00); | 549 | mas_codec_writereg(0x15, tmp & 0xff00); |
550 | #elif CONFIG_HWCODEC == MAS3507D | 550 | #elif CONFIG_CODEC == MAS3507D |
551 | mas_writereg(MAS_REG_KTREBLE, treble_table[value+15]); | 551 | mas_writereg(MAS_REG_KTREBLE, treble_table[value+15]); |
552 | current_treble = value * 10; | 552 | current_treble = value * 10; |
553 | set_prescaled_volume(); | 553 | set_prescaled_volume(); |
@@ -558,7 +558,7 @@ void sound_set(int setting, int value) | |||
558 | #endif | 558 | #endif |
559 | break; | 559 | break; |
560 | 560 | ||
561 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 561 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
562 | case SOUND_LOUDNESS: | 562 | case SOUND_LOUDNESS: |
563 | loudness_shadow = (loudness_shadow & 0x04) | | 563 | loudness_shadow = (loudness_shadow & 0x04) | |
564 | (MAX(MIN(value * 4, 0x44), 0) << 8); | 564 | (MAX(MIN(value * 4, 0x44), 0) << 8); |
@@ -635,7 +635,7 @@ void sound_set(int setting, int value) | |||
635 | 635 | ||
636 | int sound_val2phys(int setting, int value) | 636 | int sound_val2phys(int setting, int value) |
637 | { | 637 | { |
638 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 638 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
639 | int result = 0; | 639 | int result = 0; |
640 | 640 | ||
641 | switch(setting) | 641 | switch(setting) |
@@ -660,7 +660,7 @@ int sound_val2phys(int setting, int value) | |||
660 | #endif | 660 | #endif |
661 | } | 661 | } |
662 | 662 | ||
663 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 663 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
664 | /* This function works by telling the decoder that we have another | 664 | /* This function works by telling the decoder that we have another |
665 | crystal frequency than we actually have. It will adjust its internal | 665 | crystal frequency than we actually have. It will adjust its internal |
666 | parameters and the result is that the audio is played at another pitch. | 666 | parameters and the result is that the audio is played at another pitch. |
diff --git a/firmware/tuner_samsung.c b/firmware/tuner_samsung.c index c024fceb9d..b0887d0d7a 100644 --- a/firmware/tuner_samsung.c +++ b/firmware/tuner_samsung.c | |||
@@ -52,7 +52,7 @@ void samsung_set(int setting, int value) | |||
52 | case RADIO_FREQUENCY: | 52 | case RADIO_FREQUENCY: |
53 | { | 53 | { |
54 | int pll_cnt; | 54 | int pll_cnt; |
55 | #if CONFIG_HWCODEC == MAS3587F | 55 | #if CONFIG_CODEC == MAS3587F |
56 | /* Shift the MAS internal clock away for certain frequencies to | 56 | /* Shift the MAS internal clock away for certain frequencies to |
57 | * avoid interference. */ | 57 | * avoid interference. */ |
58 | int pitch = 1000; | 58 | int pitch = 1000; |