+/*
+ * Copyright (C) 2015 Czech Technical University in Prague
+ *
+ * Authors:
+ * - Michal Sojka <sojkam1@fel.cvut.cz>
+ *
+ * This document contains proprietary information belonging to Czech
+ * Technical University in Prague. Passing on and copying of this
+ * document, and communication of its contents is not permitted
+ * without prior written authorization.
+ *
+ */
+
+#include "drv/spi_def.h"
+#include "drv/spi_tms570.h"
+
+static spi_dev_t spi_ifc1_devs[] = {
+ [SPIDEV_MC33972] = {
+ .cs = SPI_CS_3,
+ .dfsel = 0,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ },
+ [SPIDEV_NCV7608_2x] = {
+ .cs = SPI_CS_4,
+ .dfsel = 0,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ }
+};
+
+static spi_dev_t spi_ifc2_devs[] = {
+ [SPIDEV_SDCARD] = {
+ .cs = SPI_CS_0,
+ .dfsel = 0,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ }
+};
+
+static spi_dev_t spi_ifc3_devs[] = {
+ [SPIDEV_MCP4922_1] = {
+ .cs = SPI_CS_0,
+ .dfsel = 1,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ },
+ [SPIDEV_MCP4922_2] = {
+ .cs = SPI_CS_4,
+ .dfsel = 1,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ },
+ [SPIDEV_MCP4922_3] = {
+ .cs = SPI_CS_5,
+ .dfsel = 1,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ }
+};
+
+static spi_dev_t spi_ifc4_devs[] = {
+ [SPIDEV_L99H01] = {
+ .cs = SPI_CS_0 | SPI_CS_DMM0,
+ .dfsel = 1,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ },
+ [SPIDEV_TJA1082_1] = {
+ .cs = SPI_CS_0 | SPI_CS_DMM1,
+ .dfsel = 0,
+ .wdel = 0,
+ .cshold = 1,
+ .dlen = 0
+ },
+ [SPIDEV_TJA1082_2] = {
+ .cs = SPI_CS_0 | SPI_CS_DMM2,
+ .dfsel = 0,
+ .wdel = 0,
+ .cshold = 1,
+ .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_drv_t spi_ifcs[4] = {
+ [0] = {
+ .spi = mibspi_compat_REG1,
+ .spi_devs = spi_ifc1_devs,
+ },
+ [1] = {
+ .spi = spi_compat_REG2,
+ .spi_devs = spi_ifc2_devs,
+ },
+ [2] = {
+ .spi = mibspi_compat_REG3,
+ .spi_devs = spi_ifc3_devs,
+ },
+ [3] = {
+ .spi = spi_compat_REG4,
+ .spi_devs = spi_ifc4_devs,
+ },
+};