#include "drv/spi_def.h"
#include "drv/spi_tms570.h"
-static spi_dev_t spi_ifc1_devs[] = {
+const spi_dev_t spi_devs[_SPIDEV_COUNT] = {
[SPIDEV_MC33972] = {
+ .iface = SPI_IFACE1,
.cs = SPI_CS_3,
.dfsel = 0,
.wdel = 0,
.dlen = 0
},
[SPIDEV_NCV7608_2x] = {
+ .iface = SPI_IFACE1,
.cs = SPI_CS_4,
.dfsel = 0,
.wdel = 0,
.cshold = 1,
.dlen = 0
- }
-};
+ },
-static spi_dev_t spi_ifc2_devs[] = {
[SPIDEV_SDCARD] = {
+ .iface = SPI_IFACE2,
.cs = SPI_CS_0,
.dfsel = 0,
.wdel = 0,
.cshold = 1,
.dlen = 0
- }
-};
+ },
-static spi_dev_t spi_ifc3_devs[] = {
[SPIDEV_MCP4922_1] = {
+ .iface = SPI_IFACE3,
.cs = SPI_CS_0,
.dfsel = 1,
.wdel = 0,
.dlen = 0
},
[SPIDEV_MCP4922_2] = {
+ .iface = SPI_IFACE3,
.cs = SPI_CS_4,
.dfsel = 1,
.wdel = 0,
.dlen = 0
},
[SPIDEV_MCP4922_3] = {
+ .iface = SPI_IFACE3,
.cs = SPI_CS_5,
.dfsel = 1,
.wdel = 0,
.cshold = 1,
.dlen = 0
- }
-};
+ },
-static spi_dev_t spi_ifc4_devs[] = {
[SPIDEV_L99H01] = {
+ .iface = SPI_IFACE4,
.cs = SPI_CS_0 | SPI_CS_DMM0,
.dfsel = 1,
.wdel = 0,
.dlen = 0
},
[SPIDEV_TJA1082_1] = {
+ .iface = SPI_IFACE4,
.cs = SPI_CS_0 | SPI_CS_DMM1,
.dfsel = 0,
.wdel = 0,
.dlen = 0
},
[SPIDEV_TJA1082_2] = {
+ .iface = SPI_IFACE4,
.cs = SPI_CS_0 | SPI_CS_DMM2,
.dfsel = 0,
.wdel = 0,
.dlen = 0
}
};
-
-/* Each SPI interface has its own static spi_tms570_drv_t struct
- Index to this array is "SPI Interface ID -1" */
-spi_tms570_iface_t spi_ifcs[4] = {
- [0] = {
- .reg = mibspi_compat_REG1,
- .spi_devs = spi_ifc1_devs,
- },
- [1] = {
- .reg = spi_compat_REG2,
- .spi_devs = spi_ifc2_devs,
- },
- [2] = {
- .reg = mibspi_compat_REG3,
- .spi_devs = spi_ifc3_devs,
- },
- [3] = {
- .reg = spi_compat_REG4,
- .spi_devs = spi_ifc4_devs,
- },
-};