From 298150d9ebed413589a3743a18f1af186f7dcf8f Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 28 Jul 2021 17:36:46 +0200 Subject: [PATCH] soc/amd/common/block/include/gpio_banks: use gpio_t for gpio numbers With the addition of the remote GPIO support, the GPIO number won't fit into 8 bit any more, so use the gpio_t type instead which is an uint32_t typedef. Signed-off-by: Felix Held Change-Id: I3de93fd3a2f2af3c1e3b335fef84019c56482051 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56693 Reviewed-by: Marshall Dawson Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/gpio_banks/gpio.c | 2 +- .../amd/common/block/include/amdblocks/gpio_banks.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index 85f273646b..108635a340 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -15,7 +15,7 @@ #include #include -static int get_gpio_gevent(uint8_t gpio, const struct soc_amd_event *table, +static int get_gpio_gevent(gpio_t gpio, const struct soc_amd_event *table, size_t items) { int i; diff --git a/src/soc/amd/common/block/include/amdblocks/gpio_banks.h b/src/soc/amd/common/block/include/amdblocks/gpio_banks.h index 098208b123..d17aa7aea7 100644 --- a/src/soc/amd/common/block/include/amdblocks/gpio_banks.h +++ b/src/soc/amd/common/block/include/amdblocks/gpio_banks.h @@ -6,15 +6,17 @@ #include #include "gpio_defs.h" +typedef uint32_t gpio_t; + struct soc_amd_gpio { - uint8_t gpio; + gpio_t gpio; uint8_t function; uint32_t control; uint32_t flags; }; struct soc_amd_event { - uint8_t gpio; + gpio_t gpio; uint8_t event; }; @@ -24,7 +26,7 @@ struct gpio_wake_state { /* Number of wake_gpio with a valid setting. */ uint32_t num_valid_wake_gpios; /* GPIO index number that caused a wake. */ - uint8_t wake_gpios[16]; + gpio_t wake_gpios[16]; }; /* Fill gpio_wake_state object for future event reporting. */ @@ -52,8 +54,6 @@ static inline bool is_gpio_event_active_low(uint32_t flags) return (flags & GPIO_FLAG_EVENT_ACTIVE_MASK) == GPIO_FLAG_EVENT_ACTIVE_LOW; } -typedef uint32_t gpio_t; - /* * gpio_configure_pads_with_override accepts as input two GPIO tables: * 1. Base config