summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-08-05 15:52:46 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-09-08 00:17:14 +0000
commitb7f056307daa7badbf0786a001bac948cdf0814c (patch)
treecac3e86103ca9b28ec2ea7419a43b15c13d8f4e7 /src
parentaa9ad0544908761248e9ea9bd5d44e3d0d6b90ea (diff)
soc/amd/common/block/gpio_banks: inline iomux_read8 and iomux_write8
Since both functions are only called from one function each, inline them into those functions. Also get_gpio_mux just returned the return value of iomux_read8, so there were two functions with identical functionality which shouldn't be the case. Suggested-by: Martin Roth <martinroth@chromium.org> Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I5662d0226edb25a9954fa47b42e208729a79e5a9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56830 Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/common/block/gpio_banks/gpio.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c
index 7f5b4b6b94..ce7e20a737 100644
--- a/src/soc/amd/common/block/gpio_banks/gpio.c
+++ b/src/soc/amd/common/block/gpio_banks/gpio.c
@@ -36,25 +36,15 @@ static inline void *gpio_mux_ptr(gpio_t gpio_num)
return acpimmio_iomux + gpio_num;
}
-static inline uint8_t iomux_read8(gpio_t gpio_num)
+static uint8_t get_gpio_mux(gpio_t gpio_num)
{
return read8(gpio_mux_ptr(gpio_num));
}
-static inline void iomux_write8(gpio_t gpio_num, uint8_t value)
+static void set_gpio_mux(gpio_t gpio_num, uint8_t function)
{
- write8(gpio_mux_ptr(gpio_num), value);
-}
-
-static uint8_t get_gpio_mux(gpio_t gpio)
-{
- return iomux_read8(gpio);
-}
-
-static void set_gpio_mux(gpio_t gpio, uint8_t function)
-{
- iomux_write8(gpio, function & AMD_GPIO_MUX_MASK);
- get_gpio_mux(gpio); /* Flush posted write */
+ write8(gpio_mux_ptr(gpio_num), function & AMD_GPIO_MUX_MASK);
+ get_gpio_mux(gpio_num); /* Flush posted write */
}
static int get_gpio_gevent(gpio_t gpio, const struct soc_amd_event *table,