]>
Commit | Line | Data |
---|---|---|
37554d48 SL |
1 | From 65f6c29a4c5894ae2e3de6d28bb0845e74844fad Mon Sep 17 00:00:00 2001 |
2 | From: Andrey Smirnov <andrew.smirnov@gmail.com> | |
3 | Date: Sun, 10 Mar 2019 23:27:31 -0700 | |
4 | Subject: gpio: vf610: Do not share irq_chip | |
5 | ||
6 | [ Upstream commit 338aa10750ba24d04beeaf5dc5efc032e5cf343f ] | |
7 | ||
8 | Fix the warning produced by gpiochip_set_irq_hooks() by allocating a | |
9 | dedicated IRQ chip per GPIO chip/port. | |
10 | ||
11 | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> | |
12 | Cc: Linus Walleij <linus.walleij@linaro.org> | |
13 | Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> | |
14 | Cc: Chris Healy <cphealy@gmail.com> | |
15 | Cc: Andrew Lunn <andrew@lunn.ch> | |
16 | Cc: Heiner Kallweit <hkallweit1@gmail.com> | |
17 | Cc: Fabio Estevam <festevam@gmail.com> | |
18 | Cc: linux-gpio@vger.kernel.org | |
19 | Cc: linux-kernel@vger.kernel.org | |
20 | Cc: linux-imx@nxp.com | |
21 | Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> | |
22 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
23 | --- | |
24 | drivers/gpio/gpio-vf610.c | 26 ++++++++++++-------------- | |
25 | 1 file changed, 12 insertions(+), 14 deletions(-) | |
26 | ||
27 | diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c | |
28 | index 7e09ce75ffb2..a9cb5571de54 100644 | |
29 | --- a/drivers/gpio/gpio-vf610.c | |
30 | +++ b/drivers/gpio/gpio-vf610.c | |
31 | @@ -37,6 +37,7 @@ struct fsl_gpio_soc_data { | |
32 | ||
33 | struct vf610_gpio_port { | |
34 | struct gpio_chip gc; | |
35 | + struct irq_chip ic; | |
36 | void __iomem *base; | |
37 | void __iomem *gpio_base; | |
38 | const struct fsl_gpio_soc_data *sdata; | |
39 | @@ -66,8 +67,6 @@ struct vf610_gpio_port { | |
40 | #define PORT_INT_EITHER_EDGE 0xb | |
41 | #define PORT_INT_LOGIC_ONE 0xc | |
42 | ||
43 | -static struct irq_chip vf610_gpio_irq_chip; | |
44 | - | |
45 | static const struct fsl_gpio_soc_data imx_data = { | |
46 | .have_paddr = true, | |
47 | }; | |
48 | @@ -243,15 +242,6 @@ static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable) | |
49 | return 0; | |
50 | } | |
51 | ||
52 | -static struct irq_chip vf610_gpio_irq_chip = { | |
53 | - .name = "gpio-vf610", | |
54 | - .irq_ack = vf610_gpio_irq_ack, | |
55 | - .irq_mask = vf610_gpio_irq_mask, | |
56 | - .irq_unmask = vf610_gpio_irq_unmask, | |
57 | - .irq_set_type = vf610_gpio_irq_set_type, | |
58 | - .irq_set_wake = vf610_gpio_irq_set_wake, | |
59 | -}; | |
60 | - | |
61 | static int vf610_gpio_probe(struct platform_device *pdev) | |
62 | { | |
63 | struct device *dev = &pdev->dev; | |
64 | @@ -259,6 +249,7 @@ static int vf610_gpio_probe(struct platform_device *pdev) | |
65 | struct vf610_gpio_port *port; | |
66 | struct resource *iores; | |
67 | struct gpio_chip *gc; | |
68 | + struct irq_chip *ic; | |
69 | int i; | |
70 | int ret; | |
71 | ||
72 | @@ -295,6 +286,14 @@ static int vf610_gpio_probe(struct platform_device *pdev) | |
73 | gc->direction_output = vf610_gpio_direction_output; | |
74 | gc->set = vf610_gpio_set; | |
75 | ||
76 | + ic = &port->ic; | |
77 | + ic->name = "gpio-vf610"; | |
78 | + ic->irq_ack = vf610_gpio_irq_ack; | |
79 | + ic->irq_mask = vf610_gpio_irq_mask; | |
80 | + ic->irq_unmask = vf610_gpio_irq_unmask; | |
81 | + ic->irq_set_type = vf610_gpio_irq_set_type; | |
82 | + ic->irq_set_wake = vf610_gpio_irq_set_wake; | |
83 | + | |
84 | ret = gpiochip_add_data(gc, port); | |
85 | if (ret < 0) | |
86 | return ret; | |
87 | @@ -306,14 +305,13 @@ static int vf610_gpio_probe(struct platform_device *pdev) | |
88 | /* Clear the interrupt status register for all GPIO's */ | |
89 | vf610_gpio_writel(~0, port->base + PORT_ISFR); | |
90 | ||
91 | - ret = gpiochip_irqchip_add(gc, &vf610_gpio_irq_chip, 0, | |
92 | - handle_edge_irq, IRQ_TYPE_NONE); | |
93 | + ret = gpiochip_irqchip_add(gc, ic, 0, handle_edge_irq, IRQ_TYPE_NONE); | |
94 | if (ret) { | |
95 | dev_err(dev, "failed to add irqchip\n"); | |
96 | gpiochip_remove(gc); | |
97 | return ret; | |
98 | } | |
99 | - gpiochip_set_chained_irqchip(gc, &vf610_gpio_irq_chip, port->irq, | |
100 | + gpiochip_set_chained_irqchip(gc, ic, port->irq, | |
101 | vf610_gpio_irq_handler); | |
102 | ||
103 | return 0; | |
104 | -- | |
105 | 2.20.1 | |
106 |