From: Vincent Pelletier <plr.vincent@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [RFC] qnap-tsx51: add new driver for leds and button support on QNAP TS-x51 series
Date: Wed, 15 Jun 2016 00:45:04 +0000 [thread overview]
Message-ID: <20160615004504.7b83d83c@gmail.com> (raw)
In-Reply-To: <CACRpkdZ57_evCC=+hev9kNpY4bNViG+oBP7pOh8HkgRA0-oLXA@mail.gmail.com>
On Tue, 14 Jun 2016 09:17:18 +0200, Linus Walleij
<linus.walleij@linaro.org> wrote:
> Yes, you can have static mappings, it's a bit tricky and only
> done in a few places in the kernel. You have to add a static
> lookup table using #include <linux/gpio/machine.h>
>
> See:
> arch/arm/mach-integrator/impd1.c function impd1_probe()
> for an example.
>
> git grep gpiod_add_lookup_table
> for other examples.
Thanks for the examples.
I notice that no driver using gpiod_add_lookup_table also uses
gpiod_get for the gpios it just declared (output reordered & annotated):
$ git grep -l gpiod_add_lookup_table | xargs grep -l gpiod_get
Documentation/gpio/board.txt
drivers/gpio/gpiolib.c
include/linux/gpio/machine.h
All above are on the gpio subsystem side, so it makes sense to
reference both.
drivers/mfd/intel_soc_pmic_core.c
This one declares a "panel" descriptor and gets one for
"intel_soc_pmic", so it is not using the descriptor it declares.
$
So I wonder if it makes sense at all for a driver to both define a gpio
lookup table and then look for each gpio it just defined.
Maybe I am doing it wrong and/or at the wrong level ?
I looked at the ACPI API and try to find a way to extend the
incomplete tables when my platform module gets loaded. It seems
possible with devicetree (drivers/of/dynamic.c) but I couldn't find a
way with APCI yet. I did find that it's possible to override acpi
entire tables, but that seems overkill for my needs (it's not that the
existing tables are wrong, they are incomplete) and hard to maintain
(depends on bios revision).
Regards,
--
Vincent Pelletier
next prev parent reply other threads:[~2016-06-15 0:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 0:44 [RFC] qnap-tsx51: add new driver for leds and button support on QNAP TS-x51 series Vincent Pelletier
2016-06-14 7:17 ` Linus Walleij
2016-06-15 0:45 ` Vincent Pelletier [this message]
2016-06-17 21:02 ` Linus Walleij
2016-06-18 7:18 ` Vincent Pelletier
2016-06-18 8:00 ` Linus Walleij
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=20160615004504.7b83d83c@gmail.com \
--to=plr.vincent@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@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).