From: Arnd Bergmann <arnd@arndb.de>
To: Y Vo <yvo@apm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>, Phong Vo <pvo@apm.com>,
Toan Le <toanle@apm.com>, Loc Ho <lho@apm.com>,
Feng Kan <fkan@apm.com>, Quan Nguyen <qnguyen@apm.com>,
Duc Dang <dhdang@apm.com>, patches <patches@apm.com>
Subject: Re: [PATCH 2/2] Documentation: gpio: Update description for X-Gene standby GPIO controller DTS binding
Date: Fri, 11 Sep 2015 16:47:28 +0200 [thread overview]
Message-ID: <3318725.Seeb48hirI@wuerfel> (raw)
In-Reply-To: <CAL4ahLeF8qQJciam467P2ixrxtMPTK2J9OtaVvcjtPF=9to0BQ@mail.gmail.com>
On Friday 11 September 2015 21:23:31 Y Vo wrote:
> >> /* Board-specific: exclude GPIO_DS8 to leave it as GPIO */
> >> &sbgpio {
> >> interrupts = <0x0 0x29 0x1>, /* GPIO_DS9 */
> >> <0x0 0x2a 0x1>, /* GPIO_DS10 */
> >> <0x0 0x2b 0x1>, /* GPIO_DS11 */
> >> <0x0 0x2c 0x1>, /* GPIO_DS12 */
> >> <0x0 0x2d 0x1>; /* GPIO_DS13 */
> >> }
> >
> > This would be a very unusual binding, because that requires the driver
> > to know the contents of the properties in advance and the driver
> > cannot derive the function of an irq from the position in the array.
> >
> > Please come up with another approach that is more like other drivers
> > do this and that makes it possible to reuse the driver if the
> > interrupt numbers change.
> The GPIO standby doesn't support interrupt controller itself, it only
> wires the GPIO line to the external IRQ of GIC. So it is not similar
> to other driver. Each GPIO is fixed to GIC IRQ index, and never
> change.
That is not relevant here, what matters is just that each IRQ still
has a very specific function, which is basically what every driver
does.
> Is that possible if we change to this approach:
> - Keep all GPIO as GPIO mode by default.
> - If anyone want to use them as interrupt, they must add the interrupt
> node to DT specific-board below:
>
> Example to configure GPIO_DS11, 12, 13 as external irq:
>
> &sbgpio {
> interrupts = <0x0 0x2b 0x1>, /* GPIO_DS11 */
> <0x0 0x2c 0x1>, /* GPIO_DS12 */
> <0x0 0x2d 0x1>; /* GPIO_DS13 */
That is exactly the same as you have in your patch. You should
always list all interrupts that the gpio controller is wired
to, whether they are used or not.
Ideally, the driver just decides at runtime how to wire that
mux, based on how the gpio is configured by the client driver.
If the client asks for an interrupt (with gpio_to_irq) and is
it is configured as an input, then you connect it to the GIC,
otherwise you leave it to be handled by the gpio chip itself.
Any reason you can't do that?
Arnd
next prev parent reply other threads:[~2015-09-11 14:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 9:22 [PATCH 0/2] gpio: xgene: add support to configure GPIO line as input, output or external IRQ pin Y Vo
2015-09-11 9:22 ` [PATCH 1/2] " Y Vo
2015-10-02 9:51 ` Linus Walleij
2015-10-02 14:03 ` Y Vo
2015-09-11 9:22 ` [PATCH 2/2] Documentation: gpio: Update description for X-Gene standby GPIO controller DTS binding Y Vo
2015-09-11 9:35 ` Arnd Bergmann
2015-09-11 11:24 ` Y Vo
2015-09-11 12:46 ` Arnd Bergmann
2015-09-11 14:23 ` Y Vo
2015-09-11 14:47 ` Arnd Bergmann [this message]
2015-09-11 15:06 ` Y Vo
2015-09-11 16:45 ` Arnd Bergmann
2015-09-12 5:55 ` Y Vo
2015-09-14 9:11 ` Arnd Bergmann
2015-09-14 9:39 ` Y Vo
2015-09-14 14:47 ` Arnd Bergmann
2015-09-14 15:06 ` Y Vo
2015-09-14 15:18 ` Arnd Bergmann
2015-09-14 15:23 ` Marc Zyngier
2015-09-16 1:48 ` Y Vo
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=3318725.Seeb48hirI@wuerfel \
--to=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=dhdang@apm.com \
--cc=fkan@apm.com \
--cc=lho@apm.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=patches@apm.com \
--cc=pvo@apm.com \
--cc=qnguyen@apm.com \
--cc=toanle@apm.com \
--cc=yvo@apm.com \
/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).