From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org, Jochen Friedrich <jochen@scram.de>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Russell King <linux@arm.linux.org.uk>
Subject: Re: [PATCH v2] ARM: sa1100: simpad: Correct I2C GPIO offsets
Date: Wed, 8 Nov 2017 11:54:13 +0100 [thread overview]
Message-ID: <CAK8P3a0_kB8NBifbutqyvY_FYHnZTpwK-m0KZV3swpMa4fxjrA@mail.gmail.com> (raw)
In-Reply-To: <20171107201857.5752-1-linus.walleij@linaro.org>
On Tue, Nov 7, 2017 at 9:18 PM, Linus Walleij <linus.walleij@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, but I'd also like to see someone figure these numbers out
properly, or maybe we should think about just removing the file if nobody
has noticed that it didn't work in the past six years.
Arnd
next prev parent reply other threads:[~2017-11-08 10:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 20:18 [PATCH v2] ARM: sa1100: simpad: Correct I2C GPIO offsets Linus Walleij
2017-11-07 20:36 ` Wolfram Sang
2017-11-08 10:54 ` Arnd Bergmann [this message]
2017-11-08 10:55 ` Arnd Bergmann
2017-11-10 14:50 ` Wolfram Sang
2017-11-10 15:01 ` Linus Walleij
2017-11-10 15:17 ` Arnd Bergmann
2017-11-24 10:04 ` Linus Walleij
2017-11-24 12:36 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK8P3a0_kB8NBifbutqyvY_FYHnZTpwK-m0KZV3swpMa4fxjrA@mail.gmail.com \
--to=arnd@arndb.de \
--cc=jochen@scram.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).