16
16
#include <zephyr/pm/device.h>
17
17
#include <zephyr/pm/policy.h>
18
18
#include <em_usart.h>
19
- #ifdef CONFIG_UART_ASYNC_API
19
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
20
20
#include <zephyr/drivers/dma.h>
21
21
#include <zephyr/drivers/dma/dma_silabs_ldma.h>
22
22
#endif
@@ -27,7 +27,7 @@ LOG_MODULE_REGISTER(uart_silabs_usart, CONFIG_UART_LOG_LEVEL);
27
27
#define SILABS_USART_TIMEOUT_TO_TIMERCOUNTER (timeout , baudrate ) \
28
28
((timeout * NSEC_PER_USEC) / ((NSEC_PER_SEC / baudrate) * SILABS_USART_TIMER_COMPARE_VALUE))
29
29
30
- #ifdef CONFIG_UART_ASYNC_API
30
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
31
31
struct uart_dma_channel {
32
32
const struct device * dma_dev ;
33
33
uint32_t dma_channel ;
@@ -64,7 +64,7 @@ struct uart_silabs_data {
64
64
uart_irq_callback_user_data_t callback ;
65
65
void * cb_data ;
66
66
#endif
67
- #ifdef CONFIG_UART_ASYNC_API
67
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
68
68
const struct device * uart_dev ;
69
69
uart_callback_t async_cb ;
70
70
void * async_user_data ;
@@ -303,7 +303,7 @@ static void uart_silabs_irq_callback_set(const struct device *dev, uart_irq_call
303
303
}
304
304
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
305
305
306
- #ifdef CONFIG_UART_ASYNC_API
306
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
307
307
static inline void async_user_callback (struct uart_silabs_data * data , struct uart_event * event )
308
308
{
309
309
if (data -> async_cb ) {
@@ -741,15 +741,15 @@ static int uart_silabs_async_init(const struct device *dev)
741
741
742
742
return 0 ;
743
743
}
744
- #endif /* CONFIG_UART_ASYNC_API */
744
+ #endif /* CONFIG_UART_SILABS_USART_ASYNC */
745
745
746
746
static void uart_silabs_isr (const struct device * dev )
747
747
{
748
748
__maybe_unused struct uart_silabs_data * data = dev -> data ;
749
749
const struct uart_silabs_config * config = dev -> config ;
750
750
USART_TypeDef * usart = config -> base ;
751
751
uint32_t flags = USART_IntGet (usart );
752
- #ifdef CONFIG_UART_ASYNC_API
752
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
753
753
struct dma_status stat ;
754
754
#endif
755
755
@@ -764,7 +764,7 @@ static void uart_silabs_isr(const struct device *dev)
764
764
data -> callback (dev , data -> cb_data );
765
765
}
766
766
#endif
767
- #ifdef CONFIG_UART_ASYNC_API
767
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
768
768
if (flags & USART_IF_TCMP1 ) {
769
769
770
770
data -> dma_rx .timeout_cnt ++ ;
@@ -814,7 +814,7 @@ static void uart_silabs_isr(const struct device *dev)
814
814
815
815
USART_IntClear (usart , USART_IF_TCMP2 );
816
816
}
817
- #endif /* CONFIG_UART_ASYNC_API */
817
+ #endif /* CONFIG_UART_SILABS_USART_ASYNC */
818
818
}
819
819
820
820
static inline USART_Parity_TypeDef uart_silabs_cfg2ll_parity (
@@ -971,7 +971,7 @@ static int uart_silabs_configure(const struct device *dev,
971
971
USART_TypeDef * base = config -> base ;
972
972
struct uart_silabs_data * data = dev -> data ;
973
973
974
- #ifdef CONFIG_UART_ASYNC_API
974
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
975
975
if (data -> dma_rx .enabled || data -> dma_tx .enabled ) {
976
976
return - EBUSY ;
977
977
}
@@ -1027,7 +1027,7 @@ static int uart_silabs_init(const struct device *dev)
1027
1027
1028
1028
config -> irq_config_func (dev );
1029
1029
1030
- #ifdef CONFIG_UART_ASYNC_API
1030
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
1031
1031
err = uart_silabs_async_init (dev );
1032
1032
if (err < 0 ) {
1033
1033
return err ;
@@ -1056,7 +1056,7 @@ static int uart_silabs_pm_action(const struct device *dev, enum pm_device_action
1056
1056
1057
1057
USART_Enable (config -> base , usartEnable );
1058
1058
} else if (IS_ENABLED (CONFIG_PM_DEVICE ) && (action == PM_DEVICE_ACTION_SUSPEND )) {
1059
- #ifdef CONFIG_UART_ASYNC_API
1059
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
1060
1060
/* Entering suspend requires there to be no active asynchronous calls. */
1061
1061
__ASSERT_NO_MSG (!data -> dma_rx .enabled );
1062
1062
__ASSERT_NO_MSG (!data -> dma_tx .enabled );
@@ -1105,7 +1105,7 @@ static DEVICE_API(uart, uart_silabs_driver_api) = {
1105
1105
.irq_update = uart_silabs_irq_update ,
1106
1106
.irq_callback_set = uart_silabs_irq_callback_set ,
1107
1107
#endif
1108
- #ifdef CONFIG_UART_ASYNC_API
1108
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
1109
1109
.callback_set = uart_silabs_async_callback_set ,
1110
1110
.tx = uart_silabs_async_tx ,
1111
1111
.tx_abort = uart_silabs_async_tx_abort ,
@@ -1115,7 +1115,7 @@ static DEVICE_API(uart, uart_silabs_driver_api) = {
1115
1115
#endif
1116
1116
};
1117
1117
1118
- #ifdef CONFIG_UART_ASYNC_API
1118
+ #ifdef CONFIG_UART_SILABS_USART_ASYNC
1119
1119
1120
1120
#define UART_DMA_CHANNEL_INIT (index , dir ) \
1121
1121
.dma_##dir = { \
0 commit comments