Message ID | 1542727156-31432-3-git-send-email-fabrizio.castro@bp.renesas.com (mailing list archive) |
---|---|
State | Under Review |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | Request GPIO when enabling interrupt | expand |
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 1322f7e..615404c 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -168,6 +168,9 @@ static int gpio_rcar_irq_set_type(struct irq_data *d, unsigned int type) default: return -EINVAL; } + + pinctrl_mux_gpio_request_enable(gc->base + hwirq); + return 0; }
As it turns out, the bootloader or a POR may get in the way of the current implementation of gpio_rcar_irq_set_type, as the pinmuxing may not be GPIO. This patch makes sure the pin is configured as a GPIO when requesting it an interrupt, as that's necessary for the interrupt to work properly. Failing to do so may damage the board as this can cause shorts. Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> --- drivers/gpio/gpio-rcar.c | 3 +++ 1 file changed, 3 insertions(+)