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

Simon Glass sjg at chromium.org
Tue Jul 29 06:41:52 CEST 2014


Hi Tom,

On 28 July 2014 21:36, Tom Rini <trini at ti.com> wrote:
> 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?

Yes that's just wrong, I will fix it.

Regards,
Simon


More information about the U-Boot mailing list