soc/amd/common/block/gpio_banks: clear output enable in gpio_input_*
The functions to configure a GPIO as input with pull-up/down need to clear the output enable bit, so that the direction will be input. If the pin was configured as output before, the pin direction was still output after this call which is at least unexpected. Change-Id: Id1fa1669195080b34fd62324616825415728b0b4 Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49118 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
parent
dec00dd010
commit
a1f254b91b
|
@ -147,12 +147,12 @@ void gpio_set(gpio_t gpio_num, int value)
|
||||||
|
|
||||||
void gpio_input_pulldown(gpio_t gpio_num)
|
void gpio_input_pulldown(gpio_t gpio_num)
|
||||||
{
|
{
|
||||||
gpio_setbits32(gpio_num, GPIO_PULL_MASK, GPIO_PULLDOWN_ENABLE);
|
gpio_setbits32(gpio_num, GPIO_PULL_MASK | GPIO_OUTPUT_ENABLE, GPIO_PULLDOWN_ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gpio_input_pullup(gpio_t gpio_num)
|
void gpio_input_pullup(gpio_t gpio_num)
|
||||||
{
|
{
|
||||||
gpio_setbits32(gpio_num, GPIO_PULL_MASK, GPIO_PULLUP_ENABLE);
|
gpio_setbits32(gpio_num, GPIO_PULL_MASK | GPIO_OUTPUT_ENABLE, GPIO_PULLUP_ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gpio_input(gpio_t gpio_num)
|
void gpio_input(gpio_t gpio_num)
|
||||||
|
|
Loading…
Reference in New Issue