mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-12 05:25:11 -04:00
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>
This commit is contained in:
parent
1037d585d3
commit
b5db0a068a
@ -237,11 +237,4 @@ int gpio_request(int gpio, const char *label)
|
|||||||
*/
|
*/
|
||||||
void gpio_free(unsigned gpio)
|
void gpio_free(unsigned gpio)
|
||||||
{
|
{
|
||||||
const struct gpio_bank *bank;
|
|
||||||
|
|
||||||
if (check_gpio(gpio) < 0)
|
|
||||||
return;
|
|
||||||
bank = get_gpio_bank(gpio);
|
|
||||||
|
|
||||||
_set_gpio_direction(bank, get_gpio_index(gpio), 1);
|
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,6 @@ static void zoom2_debug_board_detect (void)
|
|||||||
*/
|
*/
|
||||||
gpio_direction_input(158);
|
gpio_direction_input(158);
|
||||||
val = gpio_get_value(158);
|
val = gpio_get_value(158);
|
||||||
gpio_free(158);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!val)
|
if (!val)
|
||||||
|
@ -95,7 +95,6 @@ void zoom2_identify(void)
|
|||||||
|
|
||||||
gpio_direction_input(94);
|
gpio_direction_input(94);
|
||||||
val = gpio_get_value(94);
|
val = gpio_get_value(94);
|
||||||
gpio_free(94);
|
|
||||||
|
|
||||||
if (val)
|
if (val)
|
||||||
revision = ZOOM2_REVISION_BETA;
|
revision = ZOOM2_REVISION_BETA;
|
||||||
|
@ -118,10 +118,6 @@ int get_board_revision(void)
|
|||||||
revision = gpio_get_value(115) << 2 |
|
revision = gpio_get_value(115) << 2 |
|
||||||
gpio_get_value(113) << 1 |
|
gpio_get_value(113) << 1 |
|
||||||
gpio_get_value(112);
|
gpio_get_value(112);
|
||||||
|
|
||||||
gpio_free(112);
|
|
||||||
gpio_free(113);
|
|
||||||
gpio_free(115);
|
|
||||||
} else {
|
} else {
|
||||||
printf("Error: unable to acquire board revision GPIOs\n");
|
printf("Error: unable to acquire board revision GPIOs\n");
|
||||||
revision = -1;
|
revision = -1;
|
||||||
@ -153,8 +149,7 @@ int get_sdio2_config(void)
|
|||||||
sdio_direct = 0;
|
sdio_direct = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpio_free(130);
|
gpio_direction_input(130);
|
||||||
gpio_free(139);
|
|
||||||
} else {
|
} else {
|
||||||
printf("Error: unable to acquire sdio2 clk GPIOs\n");
|
printf("Error: unable to acquire sdio2 clk GPIOs\n");
|
||||||
sdio_direct = -1;
|
sdio_direct = -1;
|
||||||
|
@ -127,10 +127,6 @@ int get_board_revision(void)
|
|||||||
revision = gpio_get_value(173) << 2 |
|
revision = gpio_get_value(173) << 2 |
|
||||||
gpio_get_value(172) << 1 |
|
gpio_get_value(172) << 1 |
|
||||||
gpio_get_value(171);
|
gpio_get_value(171);
|
||||||
|
|
||||||
gpio_free(171);
|
|
||||||
gpio_free(172);
|
|
||||||
gpio_free(173);
|
|
||||||
} else {
|
} else {
|
||||||
printf("Error: unable to acquire board revision GPIOs\n");
|
printf("Error: unable to acquire board revision GPIOs\n");
|
||||||
revision = -1;
|
revision = -1;
|
||||||
@ -522,8 +518,6 @@ int do_userbutton(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
printf("NOT pressed.\n");
|
printf("NOT pressed.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
gpio_free(gpio);
|
|
||||||
|
|
||||||
return !button;
|
return !button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user