diff options
Diffstat (limited to 'arch/arm/mach-davinci/include/mach/spi.h')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/spi.h | 61 |
1 files changed, 53 insertions, 8 deletions
diff --git a/arch/arm/mach-davinci/include/mach/spi.h b/arch/arm/mach-davinci/include/mach/spi.h index 910efbf099c0..7af305b37868 100644 --- a/arch/arm/mach-davinci/include/mach/spi.h +++ b/arch/arm/mach-davinci/include/mach/spi.h | |||
@@ -19,26 +19,71 @@ | |||
19 | #ifndef __ARCH_ARM_DAVINCI_SPI_H | 19 | #ifndef __ARCH_ARM_DAVINCI_SPI_H |
20 | #define __ARCH_ARM_DAVINCI_SPI_H | 20 | #define __ARCH_ARM_DAVINCI_SPI_H |
21 | 21 | ||
22 | #include <mach/edma.h> | ||
23 | |||
24 | #define SPI_INTERN_CS 0xFF | ||
25 | |||
22 | enum { | 26 | enum { |
23 | SPI_VERSION_1, /* For DM355/DM365/DM6467 */ | 27 | SPI_VERSION_1, /* For DM355/DM365/DM6467 */ |
24 | SPI_VERSION_2, /* For DA8xx */ | 28 | SPI_VERSION_2, /* For DA8xx */ |
25 | }; | 29 | }; |
26 | 30 | ||
31 | /** | ||
32 | * davinci_spi_platform_data - Platform data for SPI master device on DaVinci | ||
33 | * | ||
34 | * @version: version of the SPI IP. Different DaVinci devices have slightly | ||
35 | * varying versions of the same IP. | ||
36 | * @num_chipselect: number of chipselects supported by this SPI master | ||
37 | * @intr_line: interrupt line used to connect the SPI IP to the ARM interrupt | ||
38 | * controller withn the SoC. Possible values are 0 and 1. | ||
39 | * @chip_sel: list of GPIOs which can act as chip-selects for the SPI. | ||
40 | * SPI_INTERN_CS denotes internal SPI chip-select. Not necessary | ||
41 | * to populate if all chip-selects are internal. | ||
42 | * @cshold_bug: set this to true if the SPI controller on your chip requires | ||
43 | * a write to CSHOLD bit in between transfers (like in DM355). | ||
44 | * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any | ||
45 | * device on the bus. | ||
46 | */ | ||
27 | struct davinci_spi_platform_data { | 47 | struct davinci_spi_platform_data { |
28 | u8 version; | 48 | u8 version; |
29 | u8 num_chipselect; | 49 | u8 num_chipselect; |
50 | u8 intr_line; | ||
51 | u8 *chip_sel; | ||
52 | bool cshold_bug; | ||
53 | enum dma_event_q dma_event_q; | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * davinci_spi_config - Per-chip-select configuration for SPI slave devices | ||
58 | * | ||
59 | * @wdelay: amount of delay between transmissions. Measured in number of | ||
60 | * SPI module clocks. | ||
61 | * @odd_parity: polarity of parity flag at the end of transmit data stream. | ||
62 | * 0 - odd parity, 1 - even parity. | ||
63 | * @parity_enable: enable transmission of parity at end of each transmit | ||
64 | * data stream. | ||
65 | * @io_type: type of IO transfer. Choose between polled, interrupt and DMA. | ||
66 | * @timer_disable: disable chip-select timers (setup and hold) | ||
67 | * @c2tdelay: chip-select setup time. Measured in number of SPI module clocks. | ||
68 | * @t2cdelay: chip-select hold time. Measured in number of SPI module clocks. | ||
69 | * @t2edelay: transmit data finished to SPI ENAn pin inactive time. Measured | ||
70 | * in number of SPI clocks. | ||
71 | * @c2edelay: chip-select active to SPI ENAn signal active time. Measured in | ||
72 | * number of SPI clocks. | ||
73 | */ | ||
74 | struct davinci_spi_config { | ||
30 | u8 wdelay; | 75 | u8 wdelay; |
31 | u8 odd_parity; | 76 | u8 odd_parity; |
32 | u8 parity_enable; | 77 | u8 parity_enable; |
33 | u8 wait_enable; | 78 | #define SPI_IO_TYPE_INTR 0 |
79 | #define SPI_IO_TYPE_POLL 1 | ||
80 | #define SPI_IO_TYPE_DMA 2 | ||
81 | u8 io_type; | ||
34 | u8 timer_disable; | 82 | u8 timer_disable; |
35 | u8 clk_internal; | ||
36 | u8 cs_hold; | ||
37 | u8 intr_level; | ||
38 | u8 poll_mode; | ||
39 | u8 use_dma; | ||
40 | u8 c2tdelay; | 83 | u8 c2tdelay; |
41 | u8 t2cdelay; | 84 | u8 t2cdelay; |
85 | u8 t2edelay; | ||
86 | u8 c2edelay; | ||
42 | }; | 87 | }; |
43 | 88 | ||
44 | #endif /* __ARCH_ARM_DAVINCI_SPI_H */ | 89 | #endif /* __ARCH_ARM_DAVINCI_SPI_H */ |