linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: "Enrico Weigelt, metux IT consult" <lkml@metux.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	platform-driver-x86 <platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH 2/2] x86: pcengines apuv2 gpio/leds/keys platform driver
Date: Fri, 8 Feb 2019 15:30:59 +0100	[thread overview]
Message-ID: <CACRpkdaFJyGYeDZ83LQBG4pr3tgtYPkDQ3RGrrGPM==Sw1vE2w@mail.gmail.com> (raw)
In-Reply-To: <1549588593-4856-2-git-send-email-lkml@metux.net>

On Fri, Feb 8, 2019 at 2:16 AM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:

> From: "Enrico Weigelt, metux IT consult" <info@metux.net>
>
> Driver for PCengines APUv2 board that supports GPIOs via AMD PCH
> and attached LEDs and keys.
>
> Cc: linux-gpio@vger.kernel.org
> Cc: linus.walleij@linaro.org
> Cc: bgolaszewski@baylibre.com
> Cc: dvhart@infradead.org
> Cc: andy@infradead.org
> Cc: platform-driver-x86@vger.kernel.org
>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Andy can provide more details on this patch here are some quick
remarks:

> +#define GPIO_BASE              100
> +
> +#define GPIO_LED1              (GPIO_BASE+0)
> +#define GPIO_LED2              (GPIO_BASE+1)
> +#define GPIO_LED3              (GPIO_BASE+2)
> +#define GPIO_MODESW            (GPIO_BASE+3)
> +#define GPIO_SIMSWAP           (GPIO_BASE+4)

Instead of hardcoding the GPIO base and offsets like this, use:

#include <linux/gpio/machine.h>

and define a descriptor table using the name of your gpiochip.
There should be examples of other board quirks doing this.
I have already patched gpio-leds.c to accept LEDs from
descriptor tables, see commit
commit 45d4c6de4e497e5b0026c77044ae5fcddf8fecd8
"leds: gpio: Try to lookup gpiod from device"

Yours,
Linus Walleij

  reply	other threads:[~2019-02-08 14:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08  1:16 [PATCH 1/2] x86: gpio: AMD G-Series pch gpio platform driver Enrico Weigelt, metux IT consult
2019-02-08  1:16 ` [PATCH 2/2] x86: pcengines apuv2 gpio/leds/keys " Enrico Weigelt, metux IT consult
2019-02-08 14:30   ` Linus Walleij [this message]
2019-02-08 15:21     ` Andy Shevchenko
2019-02-11 10:38     ` Enrico Weigelt, metux IT consult
2019-02-13  9:35       ` Linus Walleij
2019-02-14 10:57         ` Enrico Weigelt, metux IT consult
2019-02-08 14:25 ` [PATCH 1/2] x86: gpio: AMD G-Series pch gpio " Linus Walleij
2019-02-08 15:20   ` Andy Shevchenko
2019-02-08 17:47   ` Joe Perches
2019-02-11 10:46   ` Enrico Weigelt, metux IT consult
2019-02-13  9:02     ` Linus Walleij
2019-02-14  9:53       ` Enrico Weigelt, metux IT consult
2019-02-14  9:56   ` Enrico Weigelt, metux IT consult
2019-02-20  9:37     ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2019-02-13 20:57 APUv2/v3 board support V2 Enrico Weigelt, metux IT consult
2019-02-13 20:57 ` [PATCH 2/2] x86: pcengines apuv2 gpio/leds/keys platform driver Enrico Weigelt, metux IT consult
2019-02-14  2:13   ` Andy Shevchenko
2019-02-07 17:13 [PATCH 1/2] x86: gpio: AMD G-Series pch gpio " Enrico Weigelt, metux IT consult
2019-02-07 17:13 ` [PATCH 2/2] x86: pcengines apuv2 gpio/leds/keys " Enrico Weigelt, metux IT consult
2019-02-07 18:24   ` Andy Shevchenko

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='CACRpkdaFJyGYeDZ83LQBG4pr3tgtYPkDQ3RGrrGPM==Sw1vE2w@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andy@infradead.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=dvhart@infradead.org \
    --cc=info@metux.net \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@metux.net \
    --cc=platform-driver-x86@vger.kernel.org \
    /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).