summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-tc3589x.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-07-16 12:34:59 +0300
committerLinus Walleij <linus.walleij@linaro.org>2020-07-20 16:33:34 +0300
commit0fcfd9aa61034ac6f0352520379927bfc6576f1c (patch)
tree79ca6bb646edea5418d360c146ac7239d1dce8e4 /drivers/gpio/gpio-tc3589x.c
parent80606cb24161d504acb4d89f406d68f72196575e (diff)
downloadlinux-0fcfd9aa61034ac6f0352520379927bfc6576f1c.tar.xz
gpio: tc35892: Use irqchip template
This makes the driver use the irqchip template to assign properties to the gpio_irq_chip instead of using the explicit calls to gpiochip_irqchip_add_nested() and gpiochip_set_nested_irqchip(). The irqchip is instead added while adding the gpiochip. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20200716093459.76378-1-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpio/gpio-tc3589x.c')
-rw-r--r--drivers/gpio/gpio-tc3589x.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 6be0684cfa49..58b0da9eb76f 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -289,6 +289,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent);
struct device_node *np = pdev->dev.of_node;
struct tc3589x_gpio *tc3589x_gpio;
+ struct gpio_irq_chip *girq;
int ret;
int irq;
@@ -317,6 +318,16 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
tc3589x_gpio->chip.base = -1;
tc3589x_gpio->chip.of_node = np;
+ girq = &tc3589x_gpio->chip.irq;
+ girq->chip = &tc3589x_gpio_irq_chip;
+ /* This will let us handle the parent IRQ in the driver */
+ girq->parent_handler = NULL;
+ girq->num_parents = 0;
+ girq->parents = NULL;
+ girq->default_type = IRQ_TYPE_NONE;
+ girq->handler = handle_simple_irq;
+ girq->threaded = true;
+
/* Bring the GPIO module out of reset */
ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL,
TC3589x_RSTCTRL_GPIRST, 0);
@@ -339,21 +350,6 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
return ret;
}
- ret = gpiochip_irqchip_add_nested(&tc3589x_gpio->chip,
- &tc3589x_gpio_irq_chip,
- 0,
- handle_simple_irq,
- IRQ_TYPE_NONE);
- if (ret) {
- dev_err(&pdev->dev,
- "could not connect irqchip to gpiochip\n");
- return ret;
- }
-
- gpiochip_set_nested_irqchip(&tc3589x_gpio->chip,
- &tc3589x_gpio_irq_chip,
- irq);
-
platform_set_drvdata(pdev, tc3589x_gpio);
return 0;