aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-12-08 10:57:34 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-08 10:57:34 +0000
commitcc3d5d375ce462167c8205c5bef3af915dae725d (patch)
tree567f2a5edc332b24f353a8651586262493d5740f /include
parent6014e96eb52b1cc04dab5ac1d122a2d1f72bb8f2 (diff)
downloadmrst-s0i3-test-cc3d5d375ce462167c8205c5bef3af915dae725d.tar.gz
mrst-s0i3-test-cc3d5d375ce462167c8205c5bef3af915dae725d.tar.xz
mrst-s0i3-test-cc3d5d375ce462167c8205c5bef3af915dae725d.zip
dw_spi: add DMA support
dw_spi driver in upstream only supports PIO mode, and this patch will support it to cowork with the Designware DMA controller used on Intel Moorestown platform It has been tested with a Option GTM501L 3G modem, to use DMA mode, DMA controller 2 of Moorestown has to be enabled Signed-off-by: Feng Tang <feng.tang@intel.com> [Typo fix and renames to match intel_mid_dma renaming] Signed-off-by: Vinod Koul <vinod.koul@intel.com> [Clean up] Signed-off-by: Feng Tang <feng.tang@intel.com> [Fix timing delay, add cpu_relax] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/spi/dw_spi.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h
index c91302f3a25..b2ecf9f1f97 100644
--- a/include/linux/spi/dw_spi.h
+++ b/include/linux/spi/dw_spi.h
@@ -1,5 +1,6 @@
#ifndef DW_SPI_HEADER_H
#define DW_SPI_HEADER_H
+
#include <linux/io.h>
/* Bit fields in CTRLR0 */
@@ -82,6 +83,13 @@ struct dw_spi_reg {
though only low 16 bits matters */
} __packed;
+struct dw_spi;
+struct dw_spi_dma_ops {
+ int (*dma_init)(struct dw_spi *dws);
+ void (*dma_exit)(struct dw_spi *dws);
+ int (*dma_transfer)(struct dw_spi *dws, int cs_change);
+};
+
struct dw_spi {
struct spi_master *master;
struct spi_device *cur_dev;
@@ -143,6 +151,9 @@ struct dw_spi {
u64 rx_param;
struct device *dma_dev;
dma_addr_t dma_addr;
+ struct dw_spi_dma_ops *dma_ops;
+ void *dma_priv; /* platform relate info */
+ struct pci_dev *dmac;
/* Bus interface info */
void *priv;
@@ -216,4 +227,8 @@ extern int dw_spi_add_host(struct dw_spi *dws);
extern void dw_spi_remove_host(struct dw_spi *dws);
extern int dw_spi_suspend_host(struct dw_spi *dws);
extern int dw_spi_resume_host(struct dw_spi *dws);
+extern void dw_spi_xfer_done(struct dw_spi *dws);
+
+/* platform related setup */
+extern int dw_spi_mid_init(struct dw_spi *dws); /* Intel MID platforms */
#endif /* DW_SPI_HEADER_H */