Commit a98b38b83db3d377ede6b72cebe7ed2dc4127766

Authored by Pavel Pisa
Committed by Russell King
1 parent fd51bcc5dc

[ARM] 4561/1: i.MX/MX1 GPIO parenthes omission and input setup fix

During GPIO testing on PiMX1 board there has been revealed
problem with some pins input functions. The GIUS bit has
to be set for inputs to work reliably too. It is surprising
that input worked on some inputs with incorrect setup before.
DR is not mandatory, but it ensures stable constant level
on internal traces.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

arch/arm/mach-imx/generic.c
... ... @@ -101,10 +101,11 @@
101 101  
102 102 int imx_gpio_request(unsigned gpio, const char *label)
103 103 {
104   - if(gpio >= (GPIO_PORT_MAX + 1) * 32)
  104 + if(gpio >= (GPIO_PORT_MAX + 1) * 32) {
105 105 printk(KERN_ERR "imx_gpio: Attempt to request nonexistent GPIO %d for \"%s\"\n",
106 106 gpio, label ? label : "?");
107 107 return -EINVAL;
  108 + }
108 109  
109 110 if(test_and_set_bit(gpio, imx_gpio_alloc_map)) {
110 111 printk(KERN_ERR "imx_gpio: GPIO %d already used. Allocation for \"%s\" failed\n",
... ... @@ -129,7 +130,7 @@
129 130  
130 131 int imx_gpio_direction_input(unsigned gpio)
131 132 {
132   - imx_gpio_mode(gpio| GPIO_IN);
  133 + imx_gpio_mode(gpio | GPIO_IN | GPIO_GIUS | GPIO_DR);
133 134 return 0;
134 135 }
135 136