aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi
diff options
context:
space:
mode:
authorVignesh R <vigneshr@ti.com>2016-06-08 02:48:31 -0400
committerMark Brown <broonie@kernel.org>2016-06-08 05:26:46 -0400
commitf4502dd1da9b060a49d539eb754ff86cb97b89f0 (patch)
tree257cf2635e5b8931b06e331f678490a71817100d /include/linux/spi
parent1a695a905c18548062509178b98bc91e67510864 (diff)
spi: Add DMA support for spi_flash_read()
Few SPI devices provide accelerated read interfaces to read from SPI-NOR flash devices. These hardwares also support DMA to transfer data from flash to memory either via mem-to-mem DMA or dedicated slave DMA channels. Hence, add support for DMA in order to improve throughput and reduce CPU load. Use spi_map_buf() to get sg table for the buffer and pass it to SPI driver. Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/spi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 1f03483f61e5..7b53af4ba5f8 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1143,6 +1143,8 @@ static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd)
1143 * @opcode_nbits: number of lines to send opcode 1143 * @opcode_nbits: number of lines to send opcode
1144 * @addr_nbits: number of lines to send address 1144 * @addr_nbits: number of lines to send address
1145 * @data_nbits: number of lines for data 1145 * @data_nbits: number of lines for data
1146 * @rx_sg: Scatterlist for receive data read from flash
1147 * @cur_msg_mapped: message has been mapped for DMA
1146 */ 1148 */
1147struct spi_flash_read_message { 1149struct spi_flash_read_message {
1148 void *buf; 1150 void *buf;
@@ -1155,6 +1157,8 @@ struct spi_flash_read_message {
1155 u8 opcode_nbits; 1157 u8 opcode_nbits;
1156 u8 addr_nbits; 1158 u8 addr_nbits;
1157 u8 data_nbits; 1159 u8 data_nbits;
1160 struct sg_table rx_sg;
1161 bool cur_msg_mapped;
1158}; 1162};
1159 1163
1160/* SPI core interface for flash read support */ 1164/* SPI core interface for flash read support */