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 --- .../target/arm/imx31/gigabeat-s/gpio-gigabeat-s.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'firmware/target/arm/imx31/gigabeat-s/gpio-gigabeat-s.c') diff --git a/firmware/target/arm/imx31/gigabeat-s/gpio-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/gpio-gigabeat-s.c index cfbb7fcc4c..64d156407e 100644 --- a/firmware/target/arm/imx31/gigabeat-s/gpio-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/gpio-gigabeat-s.c @@ -22,18 +22,23 @@ #include "system.h" #include "gpio-imx31.h" -extern int mc13783_event(void); +/* Gigabeat S definitions for static GPIO event registration */ -static const struct gpio_event gpio1_events = +/* Describes single events for each GPIO1 pin */ +static const struct gpio_event gpio1_events[] = { - .line = MC13783_GPIO_LINE, - .sense = GPIO_SENSE_RISING, - .callback = mc13783_event, + [MC13783_EVENT_ID-GPIO1_EVENT_FIRST] = + { + .mask = 1 << MC13783_GPIO_LINE, + .sense = GPIO_SENSE_RISING, + .callback = mc13783_event, + } }; +/* Describes the events attached to GPIO1 port */ const struct gpio_event_list gpio1_event_list = { - .priority = 7, - .count = 1, - .events = &gpio1_events, + .ints_priority = 7, + .count = ARRAYLEN(gpio1_events), + .events = gpio1_events, }; -- cgit v1.2.3