devicetree: spi: stm32h7: Allow to enable SPI FIFO from DT
Allow to enable/disable the STM32 SPI FIFO usage from devicetree. Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
This commit is contained in:
parent
042b522506
commit
cc9c90c767
3 changed files with 9 additions and 1 deletions
|
@ -1146,7 +1146,9 @@ static void spi_stm32_irq_config_func_##id(const struct device *dev) \
|
|||
#define SPI_DMA_STATUS_SEM(id)
|
||||
#endif
|
||||
|
||||
|
||||
#define SPI_SUPPORTS_FIFO(id) DT_INST_NODE_HAS_PROP(id, fifo_enable)
|
||||
#define SPI_GET_FIFO_PROP(id) DT_INST_PROP(id, fifo_enable)
|
||||
#define SPI_FIFO_ENABLED(id) COND_CODE_1(SPI_SUPPORTS_FIFO(id), (SPI_GET_FIFO_PROP(id)), (0))
|
||||
|
||||
#define STM32_SPI_INIT(id) \
|
||||
STM32_SPI_IRQ_HANDLER_DECL(id); \
|
||||
|
@ -1161,6 +1163,7 @@ static const struct spi_stm32_config spi_stm32_cfg_##id = { \
|
|||
.pclken = pclken_##id, \
|
||||
.pclk_len = DT_INST_NUM_CLOCKS(id), \
|
||||
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(id), \
|
||||
.fifo_enabled = SPI_FIFO_ENABLED(id), \
|
||||
STM32_SPI_IRQ_HANDLER_FUNC(id) \
|
||||
IF_ENABLED(DT_HAS_COMPAT_STATUS_OKAY(st_stm32_spi_subghz), \
|
||||
(.use_subghzspi_nss = \
|
||||
|
|
|
@ -34,6 +34,7 @@ struct spi_stm32_config {
|
|||
#endif
|
||||
size_t pclk_len;
|
||||
const struct stm32_pclken *pclken;
|
||||
bool fifo_enabled;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SPI_STM32_DMA
|
||||
|
|
|
@ -27,3 +27,7 @@ properties:
|
|||
description: |
|
||||
(Master SS Idleness) minimum clock inserted between
|
||||
start and first data transaction.
|
||||
|
||||
fifo-enable:
|
||||
type: boolean
|
||||
description: Enable the SPI FIFO usage for performance improvement.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue