chip: stm32l4: Register spi character driver when both spi port and driver available
This commit is contained in:
parent
f7295dd434
commit
1717ffdb38
@ -30,6 +30,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/spi/spi_transfer.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
@ -78,6 +79,13 @@ void stm32l4_spiinitialize(void)
|
||||
else
|
||||
{
|
||||
spiinfo("INFO: SPI port 1 initialized\n");
|
||||
#ifdef CONFIG_SPI_DRIVER
|
||||
ret = spi_register(g_spi1, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
spierr("ERROR: FAILED to register driver of SPI port 1\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Setup CS, EN & IRQ line IOs */
|
||||
@ -98,6 +106,13 @@ void stm32l4_spiinitialize(void)
|
||||
else
|
||||
{
|
||||
spiinfo("INFO: SPI port 2 initialized\n");
|
||||
#ifdef CONFIG_SPI_DRIVER
|
||||
ret = spi_register(g_spi2, 2);
|
||||
if (ret < 0)
|
||||
{
|
||||
spierr("ERROR: FAILED to register driver of SPI port 2\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Setup CS, EN & IRQ line IOs */
|
||||
|
Loading…
Reference in New Issue
Block a user