From ea8fbba73184a40437bdeccd888cf448d5f1105e Mon Sep 17 00:00:00 2001 From: Jens Scharsig Date: Wed, 3 Feb 2010 22:46:16 +0100 Subject: 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 --- include/asm-arm/arch-at91/at91_pio.h | 14 ++- include/asm-arm/arch-at91/gpio.h | 168 ++++------------------------------- include/configs/afeb9260.h | 1 + include/configs/at91cap9adk.h | 1 + include/configs/at91sam9260ek.h | 1 + include/configs/at91sam9261ek.h | 1 + include/configs/at91sam9263ek.h | 1 + include/configs/at91sam9m10g45ek.h | 1 + include/configs/at91sam9rlek.h | 1 + include/configs/cpu9260.h | 1 + include/configs/meesc.h | 1 + include/configs/pm9261.h | 1 + include/configs/pm9263.h | 1 + include/configs/sbc35_a9g20.h | 1 + include/configs/tny_a9260.h | 1 + 15 files changed, 43 insertions(+), 152 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-at91/at91_pio.h b/include/asm-arm/arch-at91/at91_pio.h index 92c3717..e5946ca 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<