diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-05 09:24:56 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-05 09:24:56 +0000 |
commit | 4368b59b09b0e07111b58ac9c6d423ddeec7d9c6 (patch) | |
tree | f531a870ee3c17b2e8f6002f815b1f3d423e2cd0 | |
parent | ef7ad19d37f24826eb8ff6be34c4f91a02832473 (diff) | |
download | rockbox-4368b59b09b0e07111b58ac9c6d423ddeec7d9c6.tar.gz rockbox-4368b59b09b0e07111b58ac9c6d423ddeec7d9c6.zip |
Sansa AMS : don't reinvent adc_read(), patch by FlynDice
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21651 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/as3525/system-as3525.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 828ed2ef3e..3b24ac2f39 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "system.h" | 24 | #include "system.h" |
25 | #include "panic.h" | 25 | #include "panic.h" |
26 | #include "ascodec-target.h" | 26 | #include "ascodec-target.h" |
27 | #include "adc.h" | ||
27 | #include "dma-target.h" | 28 | #include "dma-target.h" |
28 | #include "clock-target.h" | 29 | #include "clock-target.h" |
29 | #include "fmradio_i2c.h" | 30 | #include "fmradio_i2c.h" |
@@ -330,11 +331,11 @@ void set_cpu_frequency(long frequency) | |||
330 | { | 331 | { |
331 | /* Increasing frequency so boost voltage before change */ | 332 | /* Increasing frequency so boost voltage before change */ |
332 | ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20)); | 333 | ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20)); |
334 | |||
333 | /* Wait for voltage to be at least 1.20v before making fclk > 200 MHz */ | 335 | /* Wait for voltage to be at least 1.20v before making fclk > 200 MHz */ |
334 | do | 336 | while(adc_read(ADC_CVDD) < 480) /* 480 * .0025 = 1.20V */ |
335 | ascodec_write(AS3514_ADC_0, 4<<4); /* ADC Input = CVDD */ | 337 | ; |
336 | while (ascodec_read(AS3514_ADC_1) < 0xe0); /* 0x1e0 *.0025 = 1.20v */ | 338 | |
337 | /* e0 = 8LSB's of 0x1e0 */ | ||
338 | asm volatile( | 339 | asm volatile( |
339 | "mrc p15, 0, r0, c1, c0 \n" | 340 | "mrc p15, 0, r0, c1, c0 \n" |
340 | 341 | ||