summaryrefslogtreecommitdiff
path: root/firmware/target/arm/adc-as3514.c
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-03-23 05:02:37 +0000
committerTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-03-23 05:02:37 +0000
commit47ab95904efe238568e4cc66f0d3aacd9e7a8c10 (patch)
tree8da94d74b9e0ef3ad01011d706781577eeec0e26 /firmware/target/arm/adc-as3514.c
parent655034983547c0678842e7407cebe0ea12b006cc (diff)
downloadrockbox-47ab95904efe238568e4cc66f0d3aacd9e7a8c10.tar.gz
rockbox-47ab95904efe238568e4cc66f0d3aacd9e7a8c10.zip
Add handler for audio irq.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25299 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/adc-as3514.c')
-rw-r--r--firmware/target/arm/adc-as3514.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/target/arm/adc-as3514.c b/firmware/target/arm/adc-as3514.c
index 9c2a421441..77d65455fb 100644
--- a/firmware/target/arm/adc-as3514.c
+++ b/firmware/target/arm/adc-as3514.c
@@ -37,6 +37,18 @@ unsigned short adc_read(int channel)
37 { 37 {
38 unsigned char buf[2]; 38 unsigned char buf[2];
39 39
40 /*
41 * The AS3514 ADC will trigger an interrupt when the conversion
42 * is finished, if the corresponding enable bit in IRQ_ENRD2
43 * is set.
44 * Previously the code did not wait and this apparently did
45 * not pose any problems, but this should be more correct.
46 * Without the wait the data read back may be completely or
47 * partially (first one of the two bytes) stale.
48 */
49 ascodec_wait_adc_finished();
50
51
40 /* Read data */ 52 /* Read data */
41 if (ascodec_readbytes(AS3514_ADC_0, 2, buf) >= 0) 53 if (ascodec_readbytes(AS3514_ADC_0, 2, buf) >= 0)
42 { 54 {