aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorDaniel Santos <daniel.santos@pobox.com>2018-11-04 20:48:13 -0600
committerJohn Crispin <john@phrozen.org>2018-11-26 12:05:45 +0100
commit89eb1a6d7250c33ff5b43f4af3c0c78ffd3d8eb9 (patch)
tree71c9473b68f1a89a97048e2d9fbf3a26638c5ef3 /target/linux
parent9989fd5154fd8301bf363ddae0b5083220141865 (diff)
downloadupstream-89eb1a6d7250c33ff5b43f4af3c0c78ffd3d8eb9.tar.gz
upstream-89eb1a6d7250c33ff5b43f4af3c0c78ffd3d8eb9.tar.bz2
upstream-89eb1a6d7250c33ff5b43f4af3c0c78ffd3d8eb9.zip
ralink: Add support for GPIO as interrupt-controller
The gpio-ralink driver has everything it needs to be used as an interrupt controller except for device tree support. This simple patch adds that support by configuring the irq domain to use two cells and adding the appropriate documentation to the devicetree bindings. Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ramips/patches-4.14/0029-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-4.14/0029-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch b/target/linux/ramips/patches-4.14/0029-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch
new file mode 100644
index 0000000000..d93f39c746
--- /dev/null
+++ b/target/linux/ramips/patches-4.14/0029-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch
@@ -0,0 +1,51 @@
+From 57fa7f2f4ef6f78ce1d30509c0d111aa3791b524 Mon Sep 17 00:00:00 2001
+From: Daniel Santos <daniel.santos@pobox.com>
+Date: Sun, 4 Nov 2018 20:24:32 -0600
+Subject: gpio-ralink: Add support for GPIO as interrupt-controller
+
+Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
+---
+ Documentation/devicetree/bindings/gpio/gpio-ralink.txt | 6 ++++++
+ drivers/gpio/gpio-ralink.c | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Documentation/devicetree/bindings/gpio/gpio-ralink.txt b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
+index 5cd17f225fe3..2775449614d4 100644
+--- a/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
++++ b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
+@@ -17,6 +17,9 @@ Required properties:
+
+ Optional properties:
+ - ralink,gpio-base : Specify the GPIO chips base number
++- interrupt-controller : marks this as an interrupt controller
++- #interrupt-cells : a standard two-cell interrupt flag, see
++ interrupt-controller/interrupts.txt
+
+ Example:
+
+@@ -28,6 +31,9 @@ Example:
+
+ reg = <0x600 0x34>;
+
++ interrupt-controller;
++ #interrupt-cells = <2>;
++
+ interrupt-parent = <&intc>;
+ interrupts = <6>;
+
+diff --git a/drivers/gpio/gpio-ralink.c b/drivers/gpio/gpio-ralink.c
+index 27910e384013..b6e30083d012 100644
+--- a/drivers/gpio/gpio-ralink.c
++++ b/drivers/gpio/gpio-ralink.c
+@@ -220,7 +220,7 @@ static int gpio_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
+ }
+
+ static const struct irq_domain_ops irq_domain_ops = {
+- .xlate = irq_domain_xlate_onecell,
++ .xlate = irq_domain_xlate_twocell,
+ .map = gpio_map,
+ };
+
+--
+2.16.4
+