summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-07-05 09:24:56 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-07-05 09:24:56 +0000
commit4368b59b09b0e07111b58ac9c6d423ddeec7d9c6 (patch)
treef531a870ee3c17b2e8f6002f815b1f3d423e2cd0
parentef7ad19d37f24826eb8ff6be34c4f91a02832473 (diff)
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.c9
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 @@
#include "system.h"
#include "panic.h"
#include "ascodec-target.h"
+#include "adc.h"
#include "dma-target.h"
#include "clock-target.h"
#include "fmradio_i2c.h"
@@ -330,11 +331,11 @@ void set_cpu_frequency(long frequency)
{
/* Increasing frequency so boost voltage before change */
ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20));
+
/* Wait for voltage to be at least 1.20v before making fclk > 200 MHz */
- do
- ascodec_write(AS3514_ADC_0, 4<<4); /* ADC Input = CVDD */
- while (ascodec_read(AS3514_ADC_1) < 0xe0); /* 0x1e0 *.0025 = 1.20v */
- /* e0 = 8LSB's of 0x1e0 */
+ while(adc_read(ADC_CVDD) < 480) /* 480 * .0025 = 1.20V */
+ ;
+
asm volatile(
"mrc p15, 0, r0, c1, c0 \n"