diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index f32558aa59..7f5b4b6b94 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -31,14 +31,19 @@ static inline void gpio_write32(gpio_t gpio_num, uint32_t value) write32(gpio_ctrl_ptr(gpio_num), value); } -static inline uint8_t iomux_read8(uint8_t reg) +static inline void *gpio_mux_ptr(gpio_t gpio_num) { - return read8(acpimmio_iomux + reg); + return acpimmio_iomux + gpio_num; } -static inline void iomux_write8(uint8_t reg, uint8_t value) +static inline uint8_t iomux_read8(gpio_t gpio_num) { - write8(acpimmio_iomux + reg, value); + return read8(gpio_mux_ptr(gpio_num)); +} + +static inline void iomux_write8(gpio_t gpio_num, uint8_t value) +{ + write8(gpio_mux_ptr(gpio_num), value); } static uint8_t get_gpio_mux(gpio_t gpio)