diff options
author | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-03-23 05:02:37 +0000 |
---|---|---|
committer | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-03-23 05:02:37 +0000 |
commit | 47ab95904efe238568e4cc66f0d3aacd9e7a8c10 (patch) | |
tree | 8da94d74b9e0ef3ad01011d706781577eeec0e26 /firmware/target/arm/adc-as3514.c | |
parent | 655034983547c0678842e7407cebe0ea12b006cc (diff) |
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.c | 12 |
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) { unsigned char buf[2]; + /* + * The AS3514 ADC will trigger an interrupt when the conversion + * is finished, if the corresponding enable bit in IRQ_ENRD2 + * is set. + * Previously the code did not wait and this apparently did + * not pose any problems, but this should be more correct. + * Without the wait the data read back may be completely or + * partially (first one of the two bytes) stale. + */ + ascodec_wait_adc_finished(); + + /* Read data */ if (ascodec_readbytes(AS3514_ADC_0, 2, buf) >= 0) { |