Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7e42142 authored by Linus Walleij's avatar Linus Walleij
Browse files

gpio: ftgpio: Move hardware initialization



It is probably wise to initialize the hardware before registering
the irq chip.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20190819082704.14237-1-linus.walleij@linaro.org
parent eb1e8bd6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -296,10 +296,6 @@ static int ftgpio_gpio_probe(struct platform_device *pdev)
	girq->handler = handle_bad_irq;
	girq->parents[0] = irq;

	ret = devm_gpiochip_add_data(dev, &g->gc, g);
	if (ret)
		goto dis_clk;

	/* Disable, unmask and clear all interrupts */
	writel(0x0, g->base + GPIO_INT_EN);
	writel(0x0, g->base + GPIO_INT_MASK);
@@ -308,6 +304,10 @@ static int ftgpio_gpio_probe(struct platform_device *pdev)
	/* Clear any use of debounce */
	writel(0x0, g->base + GPIO_DEBOUNCE_EN);

	ret = devm_gpiochip_add_data(dev, &g->gc, g);
	if (ret)
		goto dis_clk;

	platform_set_drvdata(pdev, g);
	dev_info(dev, "FTGPIO010 @%p registered\n", g->base);