Skip to content

Commit 9afd9b7

Browse files
Gabriel Fernandezlinusw
authored andcommitted
gpio: stmpe: pass DT node to irqdomain
The irq domain was implemented but the device tree node was not transmitted to irq_domain_add_simple(). Cc: [email protected] Signed-off-by: Gabriel Fernandez <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 2ab3a74 commit 9afd9b7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/gpio/gpio-stmpe.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,15 @@ static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = {
307307
.xlate = irq_domain_xlate_twocell,
308308
};
309309

310-
static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio)
310+
static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio,
311+
struct device_node *np)
311312
{
312-
int base = stmpe_gpio->irq_base;
313+
int base = 0;
313314

314-
stmpe_gpio->domain = irq_domain_add_simple(NULL,
315+
if (!np)
316+
base = stmpe_gpio->irq_base;
317+
318+
stmpe_gpio->domain = irq_domain_add_simple(np,
315319
stmpe_gpio->chip.ngpio, base,
316320
&stmpe_gpio_irq_simple_ops, stmpe_gpio);
317321
if (!stmpe_gpio->domain) {
@@ -346,6 +350,9 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
346350
stmpe_gpio->chip = template_chip;
347351
stmpe_gpio->chip.ngpio = stmpe->num_gpios;
348352
stmpe_gpio->chip.dev = &pdev->dev;
353+
#ifdef CONFIG_OF
354+
stmpe_gpio->chip.of_node = np;
355+
#endif
349356
stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1;
350357

351358
if (pdata)
@@ -366,7 +373,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
366373
goto out_free;
367374

368375
if (irq >= 0) {
369-
ret = stmpe_gpio_irq_init(stmpe_gpio);
376+
ret = stmpe_gpio_irq_init(stmpe_gpio, np);
370377
if (ret)
371378
goto out_disable;
372379

0 commit comments

Comments
 (0)