[PATCH 2/7] imx/gpio: make gpio_get_value actually work

Sascha Hauer s.hauer at pengutronix.de
Thu Apr 22 07:16:44 EDT 2010


On Mon, Apr 19, 2010 at 10:28:13AM +0200, Wolfram Sang wrote:
> From: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> 
> Newer i.MX-variants can route the content of the Sample Status Register to the
> Data Register, but older ones can't. So, use the Sample Register to be generic.
> As a drawback, the ability to read back the values of output GPIOs is lost.

I never heard of this. Anyway, output gpios are not supposed to be able
to read back in the GPIO API, so I suggest we use Uwes original commit
message.

Sascha


> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
> ---
>  arch/arm/mach-imx/gpio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/gpio.c b/arch/arm/mach-imx/gpio.c
> index 6157bd1..c6a59a6 100644
> --- a/arch/arm/mach-imx/gpio.c
> +++ b/arch/arm/mach-imx/gpio.c
> @@ -121,7 +121,7 @@ int gpio_get_value(unsigned gpio)
>  	if (!base)
>  		return -EINVAL;
>  
> -	val = readl(base + GPIO_DR);
> +	val = readl(base + GPIO_PSR);
>  
>  	return val & (1 << shift) ? 1 : 0;
>  }
> -- 
> 1.7.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list