drivers: spi: gecko: Add support for devices with a single USART
This commit adds support for devices such as EFR32xG24 in the SPI
driver, as these devices only have a single USART peripheral.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
diff --git a/drivers/spi/spi_gecko.c b/drivers/spi/spi_gecko.c
index d074857..5baaa57 100644
--- a/drivers/spi/spi_gecko.c
+++ b/drivers/spi/spi_gecko.c
@@ -33,7 +33,10 @@
#define CLOCK_USART(id) _CONCAT(cmuClock_USART, id)
#define GET_GECKO_USART_CLOCK(n) CLOCK_USART(DT_INST_PROP(n, peripheral_id))
#else
-#if (USART_COUNT <= 2)
+#if (USART_COUNT == 1)
+#define CLOCK_USART(ref) (((ref) == USART0) ? cmuClock_USART0 \
+ : -1)
+#elif (USART_COUNT == 2)
#define CLOCK_USART(ref) (((ref) == USART0) ? cmuClock_USART0 \
: ((ref) == USART1) ? cmuClock_USART1 \
: -1)