summaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-at91/at91_pio.h
diff options
context:
space:
mode:
authorJens Scharsig <js_at_ng@scharsoft.de>2010-02-03 22:46:16 +0100
committerTom Rix <Tom.Rix@windriver.com>2010-02-12 12:31:54 -0600
commitea8fbba73184a40437bdeccd888cf448d5f1105e (patch)
treedc0c802fc211dde3a13eed77576e9b72617f4e27 /include/asm-arm/arch-at91/at91_pio.h
parent5d8e359c38d3ab80015e47d0cab792efe75cacf9 (diff)
add a new AT91 GPIO driver
* add a real AT91 GPIO driver instead of header inline code * resolve the mixing of port and pins * change board config files to use new driver * add macros to gpio to realize backward compatibility Signed-off-by: Jens Scharsig <js_at_ng@scharsoft.de>
Diffstat (limited to 'include/asm-arm/arch-at91/at91_pio.h')
-rw-r--r--include/asm-arm/arch-at91/at91_pio.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/asm-arm/arch-at91/at91_pio.h b/include/asm-arm/arch-at91/at91_pio.h
index 92c37171fc..e5946ca7e0 100644
--- a/include/asm-arm/arch-at91/at91_pio.h
+++ b/include/asm-arm/arch-at91/at91_pio.h
@@ -100,10 +100,20 @@ typedef union at91_pio {
at91_port_t port[AT91_PIO_PORTS];
} at91_pio_t;
+#ifdef CONFIG_AT91_GPIO
+int at91_set_a_periph(unsigned port, unsigned pin, int use_pullup);
+int at91_set_b_periph(unsigned port, unsigned pin, int use_pullup);
+int at91_set_pio_input(unsigned port, unsigned pin, int use_pullup);
+int at91_set_pio_multi_drive(unsigned port, unsigned pin, int is_on);
+int at91_set_pio_output(unsigned port, unsigned pin, int value);
+int at91_set_pio_periph(unsigned port, unsigned pin, int use_pullup);
+int at91_set_pio_pullup(unsigned port, unsigned pin, int use_pullup);
+int at91_set_pio_deglitch(unsigned port, unsigned pin, int is_on);
+int at91_set_pio_value(unsigned port, unsigned pin, int value);
+int at91_get_pio_value(unsigned port, unsigned pin);
+#endif
#endif
-#define AT91_PIN_TO_MASK(x) (1<<x)
-#define AT91_PORTPIN(PORT, PIN) ((0x0##PORT - 9) * 32 + ((PIN) & 0x1F))
#define AT91_PIO_PORTA 0x0
#define AT91_PIO_PORTB 0x1
#define AT91_PIO_PORTC 0x2