[PATCH v2] ARM: sa1100: simpad: Correct I2C GPIO offsets

Arnd Bergmann arnd at arndb.de
Wed Nov 8 02:55:23 PST 2017


On Wed, Nov 8, 2017 at 11:54 AM, Arnd Bergmann <arnd at arndb.de> wrote:
> On Tue, Nov 7, 2017 at 9:18 PM, Linus Walleij <linus.walleij at linaro.org> wrote:
>
>> diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
>> index 9db483a42826..7d4feb8a49ac 100644
>> --- a/arch/arm/mach-sa1100/simpad.c
>> +++ b/arch/arm/mach-sa1100/simpad.c
>> @@ -328,9 +328,9 @@ static struct platform_device simpad_gpio_leds = {
>>  static struct gpiod_lookup_table simpad_i2c_gpiod_table = {
>>         .dev_id = "i2c-gpio",
>>         .table = {
>> -               GPIO_LOOKUP_IDX("gpio", GPIO_GPIO21, NULL, 0,
>> +               GPIO_LOOKUP_IDX("gpio", 21, NULL, 0,
>>                                 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
>> -               GPIO_LOOKUP_IDX("gpio", GPIO_GPIO25, NULL, 1,
>> +               GPIO_LOOKUP_IDX("gpio", 25, NULL, 1,
>>                                 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
>>         },
>>  };
>
> This looks like it's probably correct, but now I'm puzzled by another line in
> the same file:
>
> static struct gpio_keys_button simpad_button_table[] = {
>         { KEY_POWER, IRQ_GPIO_POWER_BUTTON, 1, "power button" },
> };
>
> Here we pass a gpio number as well, but we use the macro for the IRQ
> number that is apparently 32 higher than the gpio number. This came from the
> same commit that introduced the GPIO_GPIO21 reference, so it may well
> be broken, too.
>
> I'm fine with your version getting merged as it certainly can't make things
> worse, it fixes the build warning, and it probably fixes one thing that is
> wrong today

I also meant to say

Acked-by: Arnd Bergmann <arnd at arndb.de>

for this patch going through the i2c tree.



More information about the linux-arm-kernel mailing list