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
This commit is contained in:
Rafaël Carré 2009-07-05 09:24:56 +00:00
parent ef7ad19d37
commit 4368b59b09

View file

@ -24,6 +24,7 @@
#include "system.h" #include "system.h"
#include "panic.h" #include "panic.h"
#include "ascodec-target.h" #include "ascodec-target.h"
#include "adc.h"
#include "dma-target.h" #include "dma-target.h"
#include "clock-target.h" #include "clock-target.h"
#include "fmradio_i2c.h" #include "fmradio_i2c.h"
@ -330,11 +331,11 @@ void set_cpu_frequency(long frequency)
{ {
/* Increasing frequency so boost voltage before change */ /* Increasing frequency so boost voltage before change */
ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20)); 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 */ /* Wait for voltage to be at least 1.20v before making fclk > 200 MHz */
do while(adc_read(ADC_CVDD) < 480) /* 480 * .0025 = 1.20V */
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 */
asm volatile( asm volatile(
"mrc p15, 0, r0, c1, c0 \n" "mrc p15, 0, r0, c1, c0 \n"