Skip to contentSkip to conversation

gpio/mpc8xxx: fix qoriq GPIO reading

PATCH In review Russell King 2 participants 2 messages Nov 19, 2019 – Nov 21, 2019 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio/mpc8xxx: fix qoriq GPIO reading

Qoriq requires the IBE register to be set to enable GPIO inputs to be read. Set it.

---
 drivers/gpio/gpio-mpc8xxx.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpio/gpio-mpc8xxx.c +4 -0
index c8673a5d9412..c7ac14f06837 100644
@@ -32,6 +32,7 @@
 #define GPIO_IMR		0x10
 #define GPIO_ICR		0x14
 #define GPIO_ICR2		0x18
+#define GPIO_IBE		0x18
 
 struct mpc8xxx_gpio_chip {
 	struct gpio_chip	gc;
@@ -357,6 +358,9 @@ static int mpc8xxx_probe(struct platform_device *pdev)
 
 	gc->to_irq = mpc8xxx_gpio_to_irq;
 
+	if (of_device_is_compatible(np, "fsl,qoriq-gpio"))
+		gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff);
+
 	ret = gpiochip_add_data(gc, mpc8xxx_gc);
 	if (ret) {
 		pr_err("%pOF: GPIO chip registration failed with status %d\n",
Signature · 1 line
2.20.1