d93f39c746f8a373bc521dd66bd237f7c93ccb5d
[openwrt/openwrt.git] / target / linux / ramips / patches-4.14 / 0029-gpio-ralink-Add-support-for-GPIO-as-interrupt-contro.patch
1 From 57fa7f2f4ef6f78ce1d30509c0d111aa3791b524 Mon Sep 17 00:00:00 2001
2 From: Daniel Santos <daniel.santos@pobox.com>
3 Date: Sun, 4 Nov 2018 20:24:32 -0600
4 Subject: gpio-ralink: Add support for GPIO as interrupt-controller
5
6 Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
7 ---
8 Documentation/devicetree/bindings/gpio/gpio-ralink.txt | 6 ++++++
9 drivers/gpio/gpio-ralink.c | 2 +-
10 2 files changed, 7 insertions(+), 1 deletion(-)
11
12 diff --git a/Documentation/devicetree/bindings/gpio/gpio-ralink.txt b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
13 index 5cd17f225fe3..2775449614d4 100644
14 --- a/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
15 +++ b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
16 @@ -17,6 +17,9 @@ Required properties:
17
18 Optional properties:
19 - ralink,gpio-base : Specify the GPIO chips base number
20 +- interrupt-controller : marks this as an interrupt controller
21 +- #interrupt-cells : a standard two-cell interrupt flag, see
22 + interrupt-controller/interrupts.txt
23
24 Example:
25
26 @@ -28,6 +31,9 @@ Example:
27
28 reg = <0x600 0x34>;
29
30 + interrupt-controller;
31 + #interrupt-cells = <2>;
32 +
33 interrupt-parent = <&intc>;
34 interrupts = <6>;
35
36 diff --git a/drivers/gpio/gpio-ralink.c b/drivers/gpio/gpio-ralink.c
37 index 27910e384013..b6e30083d012 100644
38 --- a/drivers/gpio/gpio-ralink.c
39 +++ b/drivers/gpio/gpio-ralink.c
40 @@ -220,7 +220,7 @@ static int gpio_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
41 }
42
43 static const struct irq_domain_ops irq_domain_ops = {
44 - .xlate = irq_domain_xlate_onecell,
45 + .xlate = irq_domain_xlate_twocell,
46 .map = gpio_map,
47 };
48
49 --
50 2.16.4
51