summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gpio-imx31.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-05-07 10:53:19 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-05-07 10:53:19 +0000
commitd7ef2474120f2a009af139754f6d387c8e83c949 (patch)
tree7b63172498900d1c63c238fd256e532b23dd411e /firmware/target/arm/imx31/gpio-imx31.h
parent235fc05e3be7508c310cfd2ff5151d30b78be971 (diff)
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
Diffstat (limited to 'firmware/target/arm/imx31/gpio-imx31.h')
-rw-r--r--firmware/target/arm/imx31/gpio-imx31.h55
1 files changed, 14 insertions, 41 deletions
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);