Skip to content

Commit 986ec63

Browse files
author
Marc Zyngier
committed
gpio: tegra186: Allow optional irq parent callbacks
Make the tegra186 GPIO driver resistent to variable depth interrupt hierarchy, which we are about to introduce. No functionnal change yet. Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 5556797 commit 986ec63

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

drivers/gpio/gpio-tegra186.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,18 @@ static int tegra186_irq_set_type(struct irq_data *data, unsigned int type)
430430
else
431431
irq_set_handler_locked(data, handle_edge_irq);
432432

433-
return irq_chip_set_type_parent(data, type);
433+
if (data->parent_data)
434+
return irq_chip_set_type_parent(data, type);
435+
436+
return 0;
437+
}
438+
439+
static int tegra186_irq_set_wake(struct irq_data *data, unsigned int on)
440+
{
441+
if (data->parent_data)
442+
return irq_chip_set_wake_parent(data, on);
443+
444+
return 0;
434445
}
435446

436447
static void tegra186_gpio_irq(struct irq_desc *desc)
@@ -678,7 +689,7 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
678689
gpio->intc.irq_mask = tegra186_irq_mask;
679690
gpio->intc.irq_unmask = tegra186_irq_unmask;
680691
gpio->intc.irq_set_type = tegra186_irq_set_type;
681-
gpio->intc.irq_set_wake = irq_chip_set_wake_parent;
692+
gpio->intc.irq_set_wake = tegra186_irq_set_wake;
682693

683694
irq = &gpio->gpio.irq;
684695
irq->chip = &gpio->intc;

0 commit comments

Comments
 (0)