aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi/dw_spi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/spi/dw_spi.h')
-rw-r--r--include/linux/spi/dw_spi.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h
index c91302f3a257..6cd10f6ad472 100644
--- a/include/linux/spi/dw_spi.h
+++ b/include/linux/spi/dw_spi.h
@@ -1,5 +1,6 @@
1#ifndef DW_SPI_HEADER_H 1#ifndef DW_SPI_HEADER_H
2#define DW_SPI_HEADER_H 2#define DW_SPI_HEADER_H
3
3#include <linux/io.h> 4#include <linux/io.h>
4 5
5/* Bit fields in CTRLR0 */ 6/* Bit fields in CTRLR0 */
@@ -82,6 +83,13 @@ struct dw_spi_reg {
82 though only low 16 bits matters */ 83 though only low 16 bits matters */
83} __packed; 84} __packed;
84 85
86struct dw_spi;
87struct dw_spi_dma_ops {
88 int (*dma_init)(struct dw_spi *dws);
89 void (*dma_exit)(struct dw_spi *dws);
90 int (*dma_transfer)(struct dw_spi *dws, int cs_change);
91};
92
85struct dw_spi { 93struct dw_spi {
86 struct spi_master *master; 94 struct spi_master *master;
87 struct spi_device *cur_dev; 95 struct spi_device *cur_dev;
@@ -136,13 +144,15 @@ struct dw_spi {
136 /* Dma info */ 144 /* Dma info */
137 int dma_inited; 145 int dma_inited;
138 struct dma_chan *txchan; 146 struct dma_chan *txchan;
147 struct scatterlist tx_sgl;
139 struct dma_chan *rxchan; 148 struct dma_chan *rxchan;
140 int txdma_done; 149 struct scatterlist rx_sgl;
141 int rxdma_done; 150 int dma_chan_done;
142 u64 tx_param;
143 u64 rx_param;
144 struct device *dma_dev; 151 struct device *dma_dev;
145 dma_addr_t dma_addr; 152 dma_addr_t dma_addr; /* phy address of the Data register */
153 struct dw_spi_dma_ops *dma_ops;
154 void *dma_priv; /* platform relate info */
155 struct pci_dev *dmac;
146 156
147 /* Bus interface info */ 157 /* Bus interface info */
148 void *priv; 158 void *priv;
@@ -216,4 +226,8 @@ extern int dw_spi_add_host(struct dw_spi *dws);
216extern void dw_spi_remove_host(struct dw_spi *dws); 226extern void dw_spi_remove_host(struct dw_spi *dws);
217extern int dw_spi_suspend_host(struct dw_spi *dws); 227extern int dw_spi_suspend_host(struct dw_spi *dws);
218extern int dw_spi_resume_host(struct dw_spi *dws); 228extern int dw_spi_resume_host(struct dw_spi *dws);
229extern void dw_spi_xfer_done(struct dw_spi *dws);
230
231/* platform related setup */
232extern int dw_spi_mid_init(struct dw_spi *dws); /* Intel MID platforms */
219#endif /* DW_SPI_HEADER_H */ 233#endif /* DW_SPI_HEADER_H */