From: Arnd Bergmann <arnd@arndb.de>
To: Alexandre Courbot <gnurou@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Grant Likely <grant.likely@linaro.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Aaron Lu <aaron.lu@intel.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Bryan Wu <cooloney@gmail.com>,
Darren Hart <dvhart@linux.intel.com>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: GPIO bindings guidelines (Was: Re: [PATCH v5 10/12] gpio: Support for unified device properties interface)
Date: Thu, 23 Oct 2014 14:25:19 +0200 [thread overview]
Message-ID: <2964475.27LDgQTJ7C@wuerfel> (raw)
In-Reply-To: <CAAVeFuJzZJdh+Z7hY-Ws3orxyO=PSqCB_eBphbWk3nRb15op2w@mail.gmail.com>
On Thursday 23 October 2014 15:02:46 Alexandre Courbot wrote:
> On Tue, Oct 21, 2014 at 4:54 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 21 October 2014 14:14:02 Alexandre Courbot wrote:
> > Drivers that use
> > existing bindings with the "foo-gpio" form (or worse, "foo-somethingelse"
> > can use the same internal interface as the drivers that use name plus
> > index. Do you see a problem using what I suggested for the combined
> > API:
> >
> > __gpiod_get(dev, propname, index); // use property name plus index
> > gpiod_get(dev, index); // use "gpios" plus index
> > gpiod_get_named(dev, "name"); use "name-gpios" with index 0
>
> Apart from the loosy naming practices which we sometimes see (and
> which should be caught during review), do you have something against
> requiring a name for all new GPIO bindings, i.e. for ensuring that all
> new properties are "name-gpio" and forbidding "gpios"?
Most other subsystems don't require a name, and traditionally we only
had anonymous indexed properties for a lot of things (registers,
interrupts, ...).
I still like the idea of using anonymous references for simple things,
but if you and Linus feel that it's better to mandate names from now on,
I won't complain.
> Requiring a proper name for all GPIOs makes a lot of sense IMHO, it
> makes drivers easier to understand and is less error-prone than long
> arrays of GPIOs. The API would then be basically what we have today:
>
> gpiod_get(dev, name) // use "name-gpios" with index 0
> gpiod_get_index(dev, name, index) // for the rare case where several
> GPIOs serve the same function. Not to be used lightly.
>
> ... with stronger guidelines for the definition of new bindings, and a
> big warning in the kerneldoc of gpiod_get_index().
>
> ACPI drivers that may use tables without _DSD should then use a way to
> bind GPIO names to indexes as a fallback for older hardware.
Ok.
Arnd
next prev parent reply other threads:[~2014-10-23 12:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 5:14 GPIO bindings guidelines (Was: Re: [PATCH v5 10/12] gpio: Support for unified device properties interface) Alexandre Courbot
2014-10-21 7:54 ` Arnd Bergmann
2014-10-22 8:10 ` Mika Westerberg
2014-10-22 8:33 ` Arnd Bergmann
2014-10-22 8:51 ` Mika Westerberg
2014-10-22 9:28 ` Arnd Bergmann
2014-10-22 14:07 ` Rafael J. Wysocki
2014-10-22 14:56 ` Mika Westerberg
2014-10-22 23:21 ` Rafael J. Wysocki
2014-10-23 12:56 ` Mika Westerberg
2014-10-23 21:51 ` Rafael J. Wysocki
2014-10-24 7:15 ` Alexandre Courbot
2014-10-24 7:34 ` Mika Westerberg
2014-10-24 22:00 ` Rafael J. Wysocki
2014-10-24 22:05 ` [PATCH] ACPI / GPIO: Driver GPIO mappings for ACPI GPIOs Rafael J. Wysocki
2014-10-27 5:21 ` Alexandre Courbot
2014-10-27 22:34 ` Rafael J. Wysocki
2014-10-28 4:11 ` Alexandre Courbot
2014-10-30 0:45 ` Rafael J. Wysocki
2014-10-30 10:22 ` Mika Westerberg
2014-11-03 13:22 ` Linus Walleij
2014-11-03 22:56 ` Rafael J. Wysocki
2014-11-14 8:58 ` Linus Walleij
2014-11-14 22:54 ` Rafael J. Wysocki
2014-11-17 4:28 ` Alexandre Courbot
2014-11-17 23:31 ` Rafael J. Wysocki
2014-10-27 7:50 ` GPIO bindings guidelines (Was: Re: [PATCH v5 10/12] gpio: Support for unified device properties interface) Mika Westerberg
2014-10-23 6:10 ` Alexandre Courbot
2014-10-23 12:08 ` Arnd Bergmann
2014-10-23 6:02 ` Alexandre Courbot
2014-10-23 12:25 ` Arnd Bergmann [this message]
2014-10-30 15:11 ` 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=2964475.27LDgQTJ7C@wuerfel \
--to=arnd@arndb.de \
--cc=aaron.lu@intel.com \
--cc=cooloney@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dvhart@linux.intel.com \
--cc=gnurou@gmail.com \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
/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