[U-Boot] [PATCH v5 10/11] exynos: gpio: Convert to driver model

Tom Rini trini at ti.com
Mon Jul 28 22:36:16 CEST 2014


On Mon, Jul 28, 2014 at 06:11:37AM -0600, Simon Glass wrote:

> Convert the exynos GPIO driver to driver model. This implements the generic
> GPIO interface but not the extra Exynos-specific functions.

OK, so same comment as about the serial conversion.  And, I hear you
about there being big changes, but I think this illustrates best why we
need to keep function ordering the same:

[snip]
> @@ -132,35 +57,34 @@ static void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg)
>  	writel(value, &bank->con);
>  }
>  
> -static void s5p_gpio_set_value(struct s5p_gpio_bank *bank, int gpio, int en)
> +#ifndef CONFIG_SPL_BUILD
> +static int s5p_gpio_get_cfg_pin(struct s5p_gpio_bank *bank, int gpio)
>  {
>  	unsigned int value;
>  
> -	value = readl(&bank->dat);
> -	value &= ~DAT_MASK(gpio);
> -	if (en)
> -		value |= DAT_SET(gpio);
> -	writel(value, &bank->dat);
> +	value = readl(&bank->con);
> +	value &= CON_MASK(gpio);
> +	return CON_SFR_UNSHIFT(value, gpio);
>  }
[snip]
> -static unsigned int s5p_gpio_get_value(struct s5p_gpio_bank *bank, int gpio)
> +static void s5p_gpio_set_value(struct s5p_gpio_bank *bank, int gpio, int en)
>  {
>  	unsigned int value;
>  
>  	value = readl(&bank->dat);
> -	return !!(value & DAT_MASK(gpio));
> +	value &= ~DAT_MASK(gpio);
> +	if (en)
> +		value |= DAT_SET(gpio);
> +	writel(value, &bank->dat);
>  }

We've moved the function around, the signature changed but the guts
didn't at all?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140728/16e06cb7/attachment.pgp>


More information about the U-Boot mailing list