summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/common/block/gpio_banks/gpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c
index 03804d56f1..bdc243fa2c 100644
--- a/src/soc/amd/common/block/gpio_banks/gpio.c
+++ b/src/soc/amd/common/block/gpio_banks/gpio.c
@@ -162,8 +162,9 @@ void gpio_input(gpio_t gpio_num)
void gpio_output(gpio_t gpio_num, int value)
{
- gpio_or32(gpio_num, GPIO_OUTPUT_ENABLE);
+ /* set GPIO output value before setting the direction to output to avoid glitches */
gpio_set(gpio_num, value);
+ gpio_or32(gpio_num, GPIO_OUTPUT_ENABLE);
}
const char *gpio_acpi_path(gpio_t gpio)