0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef __LINUX_SPI_INTERNALS_H
0013 #define __LINUX_SPI_INTERNALS_H
0014
0015 #include <linux/device.h>
0016 #include <linux/dma-direction.h>
0017 #include <linux/scatterlist.h>
0018 #include <linux/spi/spi.h>
0019
0020 void spi_flush_queue(struct spi_controller *ctrl);
0021
0022 #ifdef CONFIG_HAS_DMA
0023 int spi_map_buf(struct spi_controller *ctlr, struct device *dev,
0024 struct sg_table *sgt, void *buf, size_t len,
0025 enum dma_data_direction dir);
0026 void spi_unmap_buf(struct spi_controller *ctlr, struct device *dev,
0027 struct sg_table *sgt, enum dma_data_direction dir);
0028 #else
0029 static inline int spi_map_buf(struct spi_controller *ctlr, struct device *dev,
0030 struct sg_table *sgt, void *buf, size_t len,
0031 enum dma_data_direction dir)
0032 {
0033 return -EINVAL;
0034 }
0035
0036 static inline void spi_unmap_buf(struct spi_controller *ctlr,
0037 struct device *dev, struct sg_table *sgt,
0038 enum dma_data_direction dir)
0039 {
0040 }
0041 #endif
0042
0043 #endif