]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/src/drv/_tms570_rpp/spi_def.c
Rename .spi to .reg
[pes-rpp/rpp-lib.git] / rpp / src / drv / _tms570_rpp / spi_def.c
1 /*
2  * Copyright (C) 2015 Czech Technical University in Prague
3  *
4  * Authors:
5  *     - Michal Sojka <sojkam1@fel.cvut.cz>
6  *
7  * This document contains proprietary information belonging to Czech
8  * Technical University in Prague. Passing on and copying of this
9  * document, and communication of its contents is not permitted
10  * without prior written authorization.
11  *
12  */
13
14 #include "drv/spi_def.h"
15 #include "drv/spi_tms570.h"
16
17 static spi_dev_t spi_ifc1_devs[] = {
18         [SPIDEV_MC33972] = {
19                 .cs = SPI_CS_3,
20                 .dfsel = 0,
21                 .wdel = 0,
22                 .cshold = 1,
23                 .dlen = 0
24         },
25         [SPIDEV_NCV7608_2x] = {
26                 .cs = SPI_CS_4,
27                 .dfsel = 0,
28                 .wdel = 0,
29                 .cshold = 1,
30                 .dlen = 0
31         }
32 };
33
34 static spi_dev_t spi_ifc2_devs[] = {
35         [SPIDEV_SDCARD] = {
36                 .cs = SPI_CS_0,
37                 .dfsel = 0,
38                 .wdel = 0,
39                 .cshold = 1,
40                 .dlen = 0
41         }
42 };
43
44 static spi_dev_t spi_ifc3_devs[] = {
45         [SPIDEV_MCP4922_1] = {
46                 .cs = SPI_CS_0,
47                 .dfsel = 1,
48                 .wdel = 0,
49                 .cshold = 1,
50                 .dlen = 0
51         },
52         [SPIDEV_MCP4922_2] = {
53                 .cs = SPI_CS_4,
54                 .dfsel = 1,
55                 .wdel = 0,
56                 .cshold = 1,
57                 .dlen = 0
58         },
59         [SPIDEV_MCP4922_3] = {
60                 .cs = SPI_CS_5,
61                 .dfsel = 1,
62                 .wdel = 0,
63                 .cshold = 1,
64                 .dlen = 0
65         }
66 };
67
68 static spi_dev_t spi_ifc4_devs[] = {
69         [SPIDEV_L99H01] = {
70                 .cs = SPI_CS_0 | SPI_CS_DMM0,
71                 .dfsel = 1,
72                 .wdel = 0,
73                 .cshold = 1,
74                 .dlen = 0
75         },
76         [SPIDEV_TJA1082_1] = {
77                 .cs = SPI_CS_0 | SPI_CS_DMM1,
78                 .dfsel = 0,
79                 .wdel = 0,
80                 .cshold = 1,
81                 .dlen = 0
82         },
83         [SPIDEV_TJA1082_2] = {
84                 .cs = SPI_CS_0 | SPI_CS_DMM2,
85                 .dfsel = 0,
86                 .wdel = 0,
87                 .cshold = 1,
88                 .dlen = 0
89         }
90 };
91
92 /* Each SPI interface has its own static spi_tms570_drv_t struct
93    Index to this array is "SPI Interface ID -1" */
94 spi_tms570_drv_t spi_ifcs[4] = {
95         [0] = {
96                 .reg = mibspi_compat_REG1,
97                 .spi_devs = spi_ifc1_devs,
98         },
99         [1] = {
100                 .reg = spi_compat_REG2,
101                 .spi_devs = spi_ifc2_devs,
102         },
103         [2] = {
104                 .reg = mibspi_compat_REG3,
105                 .spi_devs = spi_ifc3_devs,
106         },
107         [3] = {
108                 .reg = spi_compat_REG4,
109                 .spi_devs = spi_ifc4_devs,
110         },
111 };