mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-12 06:32:34 -05:00
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:
parent
ef7ad19d37
commit
4368b59b09
1 changed files with 5 additions and 4 deletions
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue