[U-Boot] [PATCH 07/14] MX5: efikamx: make use of GPIO framework

Marek Vasut marek.vasut at gmail.com
Sun Aug 21 13:54:18 CEST 2011


On Sunday, August 21, 2011 12:28:22 PM Stefano Babic wrote:
> Signed-off-by: Stefano Babic <sbabic at denx.de>
> CC: Marek Vasut <marek.vasut at gmail.com>
> ---
>  board/efikamx/efikamx.c |   62
> ++++++++++++++++++---------------------------- 1 files changed, 24
> insertions(+), 38 deletions(-)
> 
> diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
> index 4b36918..5be1f6c 100644
> --- a/board/efikamx/efikamx.c
> +++ b/board/efikamx/efikamx.c

[...]

> @@ -508,25 +495,24 @@ void setup_iomux_led(void)
>  {
>  	/* Blue LED */
>  	mxc_request_iomux(MX51_PIN_CSI1_D9, IOMUX_CONFIG_ALT3);
> -	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
> -				MXC_GPIO_DIRECTION_OUT);
> +	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9), 0);
> +
>  	/* Green LED */
>  	mxc_request_iomux(MX51_PIN_CSI1_VSYNC, IOMUX_CONFIG_ALT3);
> -	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
> -				MXC_GPIO_DIRECTION_OUT);
> +	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC), 0);
> +
>  	/* Red LED */
>  	mxc_request_iomux(MX51_PIN_CSI1_HSYNC, IOMUX_CONFIG_ALT3);
> -	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
> -				MXC_GPIO_DIRECTION_OUT);
> +	gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC), 0);

I'd be careful about the LEDs here. Anyway, I'll try to test it sometimes soon 
(begining of next week is ok?). If you won't get any feedback, you can have my 
Ack.

>  }
> 
>  void efikamx_toggle_led(uint32_t mask)
>  {
> -	mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
> +	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
>  			mask & EFIKAMX_LED_BLUE);
> -	mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
> +	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
>  			mask & EFIKAMX_LED_GREEN);
> -	mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
> +	gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
>  			mask & EFIKAMX_LED_RED);
>  }

Thanks Stefano, this really helps.

Cheers


More information about the U-Boot mailing list