Commit b5db0a068a25e71b178e4b89635af731cf2f7c24

Authored by Joe Hershberger
Committed by Albert ARIBAUD
1 parent 1037d585d3

omap: Don't use gpio_free to change direction to input

gpio_free() should not have the side effect of setting the line to input since this prevents the gpio command from being able to set a line as output.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>

Showing 5 changed files with 1 additions and 21 deletions Side-by-side Diff

arch/arm/cpu/armv7/omap-common/gpio.c
... ... @@ -237,12 +237,5 @@
237 237 */
238 238 void gpio_free(unsigned gpio)
239 239 {
240   - const struct gpio_bank *bank;
241   -
242   - if (check_gpio(gpio) < 0)
243   - return;
244   - bank = get_gpio_bank(gpio);
245   -
246   - _set_gpio_direction(bank, get_gpio_index(gpio), 1);
247 240 }
board/logicpd/zoom2/debug_board.c
... ... @@ -40,7 +40,6 @@
40 40 */
41 41 gpio_direction_input(158);
42 42 val = gpio_get_value(158);
43   - gpio_free(158);
44 43 }
45 44  
46 45 if (!val)
board/logicpd/zoom2/zoom2.c
... ... @@ -95,7 +95,6 @@
95 95  
96 96 gpio_direction_input(94);
97 97 val = gpio_get_value(94);
98   - gpio_free(94);
99 98  
100 99 if (val)
101 100 revision = ZOOM2_REVISION_BETA;
... ... @@ -118,10 +118,6 @@
118 118 revision = gpio_get_value(115) << 2 |
119 119 gpio_get_value(113) << 1 |
120 120 gpio_get_value(112);
121   -
122   - gpio_free(112);
123   - gpio_free(113);
124   - gpio_free(115);
125 121 } else {
126 122 printf("Error: unable to acquire board revision GPIOs\n");
127 123 revision = -1;
... ... @@ -153,8 +149,7 @@
153 149 sdio_direct = 0;
154 150 }
155 151  
156   - gpio_free(130);
157   - gpio_free(139);
  152 + gpio_direction_input(130);
158 153 } else {
159 154 printf("Error: unable to acquire sdio2 clk GPIOs\n");
160 155 sdio_direct = -1;
board/ti/beagle/beagle.c
... ... @@ -127,10 +127,6 @@
127 127 revision = gpio_get_value(173) << 2 |
128 128 gpio_get_value(172) << 1 |
129 129 gpio_get_value(171);
130   -
131   - gpio_free(171);
132   - gpio_free(172);
133   - gpio_free(173);
134 130 } else {
135 131 printf("Error: unable to acquire board revision GPIOs\n");
136 132 revision = -1;
... ... @@ -521,8 +517,6 @@
521 517 button = 0;
522 518 printf("NOT pressed.\n");
523 519 }
524   -
525   - gpio_free(gpio);
526 520  
527 521 return !button;
528 522 }