From a9c20f5789c13b486d217024a020f9d6163e2d51 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 21 May 2008 08:42:11 +0000 Subject: Gigabeat S: 1) Rework event handling and static registration mechanism. No target- specific code in mc13783 driver. GPIO event driver interfaces more cleanly. 2) Somewhat related - enable thread priority for bootloader which is desireable here (ffs is used for GPIO event enabling anyway and that goes along with priority). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17593 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx31/gigabeat-s/adc-imx31.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'firmware/target/arm/imx31/gigabeat-s/adc-imx31.c') diff --git a/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c b/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c index d26d708da1..2f4e45c3b1 100644 --- a/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c @@ -77,11 +77,11 @@ unsigned short adc_read(int channel) mutex_unlock(&adc_mtx); - /* Channels 0-3/8-11 in ADD1, 0-4/12-15 in ADD2 */ + /* Channels 0-3/8-11 in ADD1, 4-7/12-15 in ADD2 */ return (channel & 4) ? MC13783_ADD2r(data) : MC13783_ADD1r(data); } -/* Called when conversion is complete */ +/* Called by mc13783 interrupt thread when conversion is complete */ void adc_done(void) { wakeup_signal(&adc_wake); @@ -100,7 +100,8 @@ void adc_init(void) MC13783_RTHEN | MC13783_CHRGICON); /* Enable ADC, set multi-channel mode */ mc13783_write(MC13783_ADC1, MC13783_ADEN); - /* Enable the ADCDONE interrupt - notifications are dispatched by - * event handler. */ - mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_ADCDONEM); + + /* Enable ADCDONE event */ + mc13783_write(MC13783_INTERRUPT_STATUS0, MC13783_ADCDONEI); + mc13783_enable_event(MC13783_ADCDONE_EVENT); } -- cgit v1.2.3