diff options
author | Rob Purchase <shotofadds@rockbox.org> | 2008-03-31 22:43:20 +0000 |
---|---|---|
committer | Rob Purchase <shotofadds@rockbox.org> | 2008-03-31 22:43:20 +0000 |
commit | 6fd72c750faa878bfe4f1e4d05771d4c9c6ae340 (patch) | |
tree | 1583b2766552cc8f385f7cb9e1398cb952316707 | |
parent | b4c20ce1af42a710c6be0ffd2b170574d3341f0f (diff) | |
download | rockbox-6fd72c750faa878bfe4f1e4d05771d4c9c6ae340.tar.gz rockbox-6fd72c750faa878bfe4f1e4d05771d4c9c6ae340.zip |
Introduce sanity check and extra nop to stabilise TCC780x set_cpu_frequency(). Re-enable HAVE_ADJUSTABLE_CPU_FREQ and kill a few warnings by setting HAVE_SW_TONE_CONTROLS.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16904 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/config-cowond2.h | 5 | ||||
-rw-r--r-- | firmware/sound.c | 6 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/system-tcc780x.c | 7 |
3 files changed, 9 insertions, 9 deletions
diff --git a/firmware/export/config-cowond2.h b/firmware/export/config-cowond2.h index aeb60bfce6..a2a1775500 100644 --- a/firmware/export/config-cowond2.h +++ b/firmware/export/config-cowond2.h | |||
@@ -84,8 +84,7 @@ | |||
84 | #define HAVE_WM8985 | 84 | #define HAVE_WM8985 |
85 | 85 | ||
86 | /* There is no hardware tone control */ | 86 | /* There is no hardware tone control */ |
87 | /* TODO: probably need to use this */ | 87 | #define HAVE_SW_TONE_CONTROLS |
88 | //#define HAVE_SW_TONE_CONTROLS | ||
89 | 88 | ||
90 | /* Define this for LCD backlight available */ | 89 | /* Define this for LCD backlight available */ |
91 | #define HAVE_BACKLIGHT | 90 | #define HAVE_BACKLIGHT |
@@ -122,7 +121,7 @@ | |||
122 | #define CPU_FREQ 48000000 | 121 | #define CPU_FREQ 48000000 |
123 | 122 | ||
124 | /* Define this if you have adjustable CPU frequency */ | 123 | /* Define this if you have adjustable CPU frequency */ |
125 | /* #define HAVE_ADJUSTABLE_CPU_FREQ */ | 124 | #define HAVE_ADJUSTABLE_CPU_FREQ |
126 | 125 | ||
127 | /* Offset ( in the firmware file's header ) to the file CRC */ | 126 | /* Offset ( in the firmware file's header ) to the file CRC */ |
128 | #define FIRMWARE_OFFSET_FILE_CRC 0 | 127 | #define FIRMWARE_OFFSET_FILE_CRC 0 |
diff --git a/firmware/sound.c b/firmware/sound.c index b4d1059f96..b559fe2b5e 100644 --- a/firmware/sound.c +++ b/firmware/sound.c | |||
@@ -227,7 +227,7 @@ static int tenthdb2reg(int db) | |||
227 | #if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ | 227 | #if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ |
228 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \ | 228 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \ |
229 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ | 229 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ |
230 | || defined(HAVE_AS3514) | 230 | || defined(HAVE_AS3514) || defined(HAVE_WM8985) |
231 | 231 | ||
232 | /* all values in tenth of dB MAS3507D UDA1380 */ | 232 | /* all values in tenth of dB MAS3507D UDA1380 */ |
233 | int current_volume = 0; /* -780..+180 -840.. 0 */ | 233 | int current_volume = 0; /* -780..+180 -840.. 0 */ |
@@ -405,7 +405,7 @@ void sound_set_volume(int value) | |||
405 | #elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ | 405 | #elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ |
406 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \ | 406 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \ |
407 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ | 407 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ |
408 | || defined(HAVE_AS3514) | 408 | || defined(HAVE_AS3514) || defined(HAVE_WM8985) |
409 | current_volume = value * 10; /* tenth of dB */ | 409 | current_volume = value * 10; /* tenth of dB */ |
410 | set_prescaled_volume(); | 410 | set_prescaled_volume(); |
411 | #elif CONFIG_CPU == PNX0101 | 411 | #elif CONFIG_CPU == PNX0101 |
@@ -424,7 +424,7 @@ void sound_set_balance(int value) | |||
424 | #elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380 \ | 424 | #elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380 \ |
425 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \ | 425 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \ |
426 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ | 426 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ |
427 | || defined(HAVE_AS3514) | 427 | || defined(HAVE_AS3514) || defined(HAVE_WM8985) |
428 | current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ | 428 | current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ |
429 | set_prescaled_volume(); | 429 | set_prescaled_volume(); |
430 | #elif CONFIG_CPU == PNX0101 | 430 | #elif CONFIG_CPU == PNX0101 |
diff --git a/firmware/target/arm/tcc780x/system-tcc780x.c b/firmware/target/arm/tcc780x/system-tcc780x.c index f6392b023a..c109b8ddda 100644 --- a/firmware/target/arm/tcc780x/system-tcc780x.c +++ b/firmware/target/arm/tcc780x/system-tcc780x.c | |||
@@ -291,11 +291,11 @@ int system_memory_guard(int newmode) | |||
291 | 291 | ||
292 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 292 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
293 | 293 | ||
294 | /* Note: This is not currently enabled because switching seems to | ||
295 | cause an occasional freeze. To be investigated. */ | ||
296 | |||
297 | void set_cpu_frequency(long frequency) | 294 | void set_cpu_frequency(long frequency) |
298 | { | 295 | { |
296 | if (cpu_frequency == frequency) | ||
297 | return; | ||
298 | |||
299 | /* CPU/COP frequencies can be scaled between Fbus (min) and Fsys (max). | 299 | /* CPU/COP frequencies can be scaled between Fbus (min) and Fsys (max). |
300 | Fbus should not be set below ~32Mhz with LCD enabled or the display | 300 | Fbus should not be set below ~32Mhz with LCD enabled or the display |
301 | will be garbled. */ | 301 | will be garbled. */ |
@@ -327,6 +327,7 @@ void set_cpu_frequency(long frequency) | |||
327 | asm volatile ( | 327 | asm volatile ( |
328 | "nop \n\t" | 328 | "nop \n\t" |
329 | "nop \n\t" | 329 | "nop \n\t" |
330 | "nop \n\t" | ||
330 | ); | 331 | ); |
331 | 332 | ||
332 | cpu_frequency = frequency; | 333 | cpu_frequency = frequency; |