From d7ef2474120f2a009af139754f6d387c8e83c949 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 7 May 2010 10:53:19 +0000 Subject: i.MX31/Gigabeat S minor cleaning: Make HW access more obvious in places I forgot to do earlier. Reduce the number of structs that need to be filled-out for some drivers just to simplify a little. Change some types. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25870 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx31/gpio-imx31.h | 55 +++++++++------------------------- 1 file changed, 14 insertions(+), 41 deletions(-) (limited to 'firmware/target/arm/imx31/gpio-imx31.h') diff --git a/firmware/target/arm/imx31/gpio-imx31.h b/firmware/target/arm/imx31/gpio-imx31.h index 72956d4efa..a1358672e8 100644 --- a/firmware/target/arm/imx31/gpio-imx31.h +++ b/firmware/target/arm/imx31/gpio-imx31.h @@ -42,22 +42,6 @@ enum gpio_module_number GPIO_NUM_GPIO, }; -/* Module corresponding to the event ID is identified by range */ -enum gpio_event_bases -{ -#if (GPIO_EVENT_MASK & USE_GPIO1_EVENTS) - GPIO1_EVENT_FIRST = 32*GPIO1_NUM, -#endif -#if (GPIO_EVENT_MASK & USE_GPIO2_EVENTS) - GPIO2_EVENT_FIRST = 32*GPIO2_NUM, -#endif -#if (GPIO_EVENT_MASK & USE_GPIO3_EVENTS) - GPIO3_EVENT_FIRST = 32*GPIO3_NUM, -#endif -}; - -#include "gpio-target.h" - /* Possible values for gpio interrupt line config */ enum gpio_int_sense_enum { @@ -69,44 +53,33 @@ enum gpio_int_sense_enum #define GPIO_SENSE_CONFIG_MASK 0x3 -/* Register map for each module */ -struct gpio_map -{ - volatile uint32_t dr; /* 00h */ - volatile uint32_t gdir; /* 04h */ - volatile uint32_t psr; /* 08h */ - union - { - struct - { - volatile uint32_t icr1; /* 0Ch */ - volatile uint32_t icr2; /* 10h */ - }; - volatile uint32_t icr[2]; /* 0Ch */ - }; - volatile uint32_t imr; /* 14h */ - volatile uint32_t isr; /* 18h */ -}; - /* Pending events will be called in array order which allows easy * pioritization */ /* Describes a single event for a pin */ struct gpio_event { - uint32_t mask; /* mask: 1 << (0...31) */ + unsigned long mask; /* mask: 1 << (0...31) */ enum gpio_int_sense_enum sense; /* Type of sense */ void (*callback)(void); /* Callback function */ }; -/* Describes the events attached to a port */ -struct gpio_event_list +/* Module corresponding to the event ID is identified by range */ +enum gpio_event_bases { - int ints_priority; /* Interrupt priority for this GPIO */ - unsigned count; /* Count of events for the module */ - const struct gpio_event *events; /* List of events */ +#if (GPIO_EVENT_MASK & USE_GPIO1_EVENTS) + GPIO1_EVENT_FIRST = 32*GPIO1_NUM, +#endif +#if (GPIO_EVENT_MASK & USE_GPIO2_EVENTS) + GPIO2_EVENT_FIRST = 32*GPIO2_NUM, +#endif +#if (GPIO_EVENT_MASK & USE_GPIO3_EVENTS) + GPIO3_EVENT_FIRST = 32*GPIO3_NUM, +#endif }; +#include "gpio-target.h" + void gpio_init(void); bool gpio_enable_event(enum gpio_event_ids id); void gpio_disable_event(enum gpio_event_ids id); -- cgit v1.2.3