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>
This commit is contained in:
parent
aa9ad05449
commit
b7f056307d
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue