From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Marc Zyngier <marc.zyngier@arm.com>, linux-gpio@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Rob Herring <robh@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
David Daney <david.daney@cavium.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Jassi Brar <jaswinder.singh@linaro.org>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 0/3] gpio: uniphier: UniPhier GPIO driver
Date: Wed, 13 Sep 2017 17:56:27 +0900 [thread overview]
Message-ID: <1505292990-22957-1-git-send-email-yamada.masahiro@socionext.com> (raw)
This series adds UniPhier GPIO driver.
The interrupt controller part is implemented by using hierarchy irqdomain.
My problem is mapping of IRQ from this controller to the parent
irqchip is not contiguous.
IRQ line of GPIO ---> Parent interrupt
0 ---> 48
1 ---> 49
...
15 ---> 63
16 ---> 154
17 ---> 155
...
20 ---> 158
21 ---> 217
22 ---> 218
...
At first, I tried to hard-code parent irq numbers because it easily avoids
the statically allocated IRQ resource problem.
(https://lkml.org/lkml/2017/7/6/758)
But, hard-coding interrupts made Linus Walleij unhappy.
In v4, I tried to use the new API irq_domain_push_irq().
I needed to change it to make it work for DT, but seems controversial
in the irqdomain subsystem review.
In v5, I came up with another solution. The idea is simple.
.alloc() hook can call of_irq_parse_one() to retrieve the irq information
from DT property.
If virq is already allocated, we can simply dispose it and re-alloc it
in hierarchy domain manner.
Changes in v5:
- Split into a separate patch for DT binding
- Add a new patch to export of_phandle_args_to_fwspec
- Split DT binding into a separate file
- v4 depends on some patches that change irq_domain_push_irq(), but
they got negative feedback in the irqdomain subsystem review.
Yet another approach here. Parse "interrupts" property in
.alloc() hook. If the parent IRQ is already mapped, dispose it
and re-alloc in irqdomain manner.
Changes in v4:
- Add COMPILE_TEST and select IRQ_DOMAIN_HIERARCHY
- Reimplement irqchip part by using irq_domain_push_irq()
Changes in v3:
- Add .irq_set_affinity() hook
- Use irq_domain_create_hierarchy() instead of legacy
irq_domain_add_hierarchy()
Changes in v2:
- Remove +32 offset for parent interrupts to follow the GIC
binding convention
- Let uniphier_gpio_irq_alloc() fail if nr_irqs != 1
- Allocate gpio_chip statically because just one instance is
supported
- Fix suspend and resume hooks
Masahiro Yamada (3):
irqdomain: export of_phandle_args_to_fwspec
dt-bindings: gpio: uniphier: add UniPhier GPIO binding
gpio: uniphier: add UniPhier GPIO controller driver
.../devicetree/bindings/gpio/gpio-uniphier.txt | 43 ++
MAINTAINERS | 1 +
drivers/gpio/Kconfig | 8 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-uniphier.c | 504 +++++++++++++++++++++
include/dt-bindings/gpio/uniphier-gpio.h | 18 +
include/linux/irqdomain.h | 2 +
kernel/irq/irqdomain.c | 5 +-
8 files changed, 580 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-uniphier.txt
create mode 100644 drivers/gpio/gpio-uniphier.c
create mode 100644 include/dt-bindings/gpio/uniphier-gpio.h
--
2.7.4
next reply other threads:[~2017-09-13 8:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-13 8:56 Masahiro Yamada [this message]
2017-09-13 8:56 ` [PATCH v5 1/3] irqdomain: export of_phandle_args_to_fwspec Masahiro Yamada
2017-09-21 11:34 ` Linus Walleij
2017-09-21 12:04 ` Masahiro Yamada
2017-09-25 10:11 ` Thomas Gleixner
2017-09-27 2:42 ` Masahiro Yamada
2017-09-13 8:56 ` [PATCH v5 2/3] dt-bindings: gpio: uniphier: add UniPhier GPIO binding Masahiro Yamada
2017-09-13 8:56 ` [PATCH v5 3/3] gpio: uniphier: add UniPhier GPIO controller driver Masahiro Yamada
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=1505292990-22957-1-git-send-email-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=david.daney@cavium.com \
--cc=devicetree@vger.kernel.org \
--cc=jason@lakedaemon.net \
--cc=jaswinder.singh@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=tglx@linutronix.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