diff mbox series

gpio/mpc8xxx: fix qoriq GPIO reading

Message ID E1iX3HC-00069N-0T@rmk-PC.armlinux.org.uk
State New
Headers show
Series gpio/mpc8xxx: fix qoriq GPIO reading | expand

Commit Message

Russell King (Oracle) Nov. 19, 2019, 1:10 p.m. UTC
Qoriq requires the IBE register to be set to enable GPIO inputs to be
read.  Set it.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/gpio/gpio-mpc8xxx.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Linus Walleij Nov. 21, 2019, 1:30 p.m. UTC | #1
On Tue, Nov 19, 2019 at 2:10 PM Russell King <rmk+kernel@armlinux.org.uk> wrote:

> Qoriq requires the IBE register to be set to enable GPIO inputs to be
> read.  Set it.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Patch applied.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index c8673a5d9412..c7ac14f06837 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -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",