aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2013-02-09 11:02:44 -0500
committerGrant Likely <grant.likely@secretlab.ca>2013-02-09 11:02:44 -0500
commit0d73299ddf1f4c3ea9f8606b49c4346871a3f139 (patch)
tree5b6a02093f8e9838346536c5805bcc5ff69dba98 /include/linux/spi
parent7410e848583f9120dd5f9414629f01bb76b5ee5f (diff)
parenta3496855d9f1948d1b977afe8bd922725ded05d5 (diff)
Merge branch spi-next from git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/pxa2xx_spi.h87
1 files changed, 7 insertions, 80 deletions
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
index 053b5ba51b25..82d5111cd0c2 100644
--- a/include/linux/spi/pxa2xx_spi.h
+++ b/include/linux/spi/pxa2xx_spi.h
@@ -29,6 +29,12 @@ struct pxa2xx_spi_master {
29 u16 num_chipselect; 29 u16 num_chipselect;
30 u8 enable_dma; 30 u8 enable_dma;
31 31
32 /* DMA engine specific config */
33 int rx_chan_id;
34 int tx_chan_id;
35 int rx_slave_id;
36 int tx_slave_id;
37
32 /* For non-PXA arches */ 38 /* For non-PXA arches */
33 struct ssp_device ssp; 39 struct ssp_device ssp;
34}; 40};
@@ -38,6 +44,7 @@ struct pxa2xx_spi_master {
38 */ 44 */
39struct pxa2xx_spi_chip { 45struct pxa2xx_spi_chip {
40 u8 tx_threshold; 46 u8 tx_threshold;
47 u8 tx_hi_threshold;
41 u8 rx_threshold; 48 u8 rx_threshold;
42 u8 dma_burst_size; 49 u8 dma_burst_size;
43 u32 timeout; 50 u32 timeout;
@@ -53,85 +60,5 @@ struct pxa2xx_spi_chip {
53 60
54extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); 61extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info);
55 62
56#else
57/*
58 * This is the implemtation for CE4100 on x86. ARM defines them in mach/ or
59 * plat/ include path.
60 * The CE4100 does not provide DMA support. This bits are here to let the driver
61 * compile and will never be used. Maybe we get DMA support at a later point in
62 * time.
63 */
64
65#define DCSR(n) (n)
66#define DSADR(n) (n)
67#define DTADR(n) (n)
68#define DCMD(n) (n)
69#define DRCMR(n) (n)
70
71#define DCSR_RUN (1 << 31) /* Run Bit */
72#define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch */
73#define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable */
74#define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */
75#define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */
76#define DCSR_ENDINTR (1 << 2) /* End Interrupt */
77#define DCSR_STARTINTR (1 << 1) /* Start Interrupt */
78#define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt */
79
80#define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable */
81#define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */
82#define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */
83#define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */
84#define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */
85#define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */
86#define DCSR_EORINTR (1 << 9) /* The end of Receive */
87
88#define DRCMR_MAPVLD (1 << 7) /* Map Valid */
89#define DRCMR_CHLNUM 0x1f /* mask for Channel Number */
90
91#define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor */
92#define DDADR_STOP (1 << 0) /* Stop */
93
94#define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */
95#define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */
96#define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */
97#define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */
98#define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */
99#define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */
100#define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */
101#define DCMD_BURST8 (1 << 16) /* 8 byte burst */
102#define DCMD_BURST16 (2 << 16) /* 16 byte burst */
103#define DCMD_BURST32 (3 << 16) /* 32 byte burst */
104#define DCMD_WIDTH1 (1 << 14) /* 1 byte width */
105#define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */
106#define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */
107#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
108
109/*
110 * Descriptor structure for PXA's DMA engine
111 * Note: this structure must always be aligned to a 16-byte boundary.
112 */
113
114typedef enum {
115 DMA_PRIO_HIGH = 0,
116 DMA_PRIO_MEDIUM = 1,
117 DMA_PRIO_LOW = 2
118} pxa_dma_prio;
119
120/*
121 * DMA registration
122 */
123
124static inline int pxa_request_dma(char *name,
125 pxa_dma_prio prio,
126 void (*irq_handler)(int, void *),
127 void *data)
128{
129 return -ENODEV;
130}
131
132static inline void pxa_free_dma(int dma_ch)
133{
134}
135
136#endif 63#endif
137#endif 64#endif