[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 Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux