[RFC v3 2/2] gpio: rcar: Set pin as a GPIO when configuring an interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/gpio/gpio-rcar.c | 3 +++
 1 file changed, 3 insertions(+)

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;
 }
 
-- 
2.7.4




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux