[U-Boot] [PATCH 2/9] i.MX31: add a simple gpio driver

Magnus Lilja lilja.magnus at gmail.com
Wed Feb 4 19:54:27 CET 2009


Hi

2009/2/4 Guennadi Liakhovetski <lg at denx.de>:
> This is a minimal driver, so far only managing output. It will
> be used by the mxc_spi.c driver.
>
> Signed-off-by: Guennadi Liakhovetski <lg at denx.de>
> ---
>
> Jean-Christophe: also an ack from you, please.
>
>  drivers/gpio/Makefile            |    3 +-
>  drivers/gpio/mx31_gpio.c         |   71 ++++++++++++++++++++++++++++++++++++++
>  include/asm-arm/arch-mx31/mx31.h |    9 +++++
>  3 files changed, 82 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/gpio/mx31_gpio.c
>
> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> index dd618ed..ce049e4 100644
> --- a/drivers/gpio/Makefile
> +++ b/drivers/gpio/Makefile
> @@ -25,7 +25,8 @@ include $(TOPDIR)/config.mk
>
>  LIB    := $(obj)libgpio.a
>
> -COBJS-$(CONFIG_PCA953X)        += pca953x.o
> +COBJS-$(CONFIG_PCA953X)                += pca953x.o
> +COBJS-$(CONFIG_MX31_GPIO)      += mx31_gpio.o

Might want to sort these in alphabetically order.

...

> diff --git a/include/asm-arm/arch-mx31/mx31.h b/include/asm-arm/arch-mx31/mx31.h
> index 0552c27..fb8d8c0 100644
> --- a/include/asm-arm/arch-mx31/mx31.h
> +++ b/include/asm-arm/arch-mx31/mx31.h
> @@ -27,4 +27,13 @@
>  extern u32 mx31_get_ipg_clk(void);
>  extern void mx31_gpio_mux(unsigned long mode);

'extern' is not needed here. Some header files seems to have extern
while some don't.

>
> +enum mx31_gpio_direction {
> +       MX31_GPIO_DIRECTION_IN,
> +       MX31_GPIO_DIRECTION_OUT,
> +};
> +
> +extern void mx31_gpio_direction(unsigned int gpio,
> +                               enum mx31_gpio_direction direction);
> +extern void mx31_gpio_set(unsigned int gpio, unsigned int value);

'extern' is not needed here.


Regards, Magnus


More information about the U-Boot mailing list