]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/spi/spi.h
spi: Split bus and I/O locking
[linux.git] / include / linux / spi / spi.h
index 1f03483f61e5714b1c07708fee2fe3d7ffa946e3..072cb2aa24139981b0459eaa8f01d28406b384b4 100644 (file)
@@ -312,8 +312,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
  * @flags: other constraints relevant to this driver
  * @max_transfer_size: function that returns the max transfer size for
  *     a &spi_device; may be %NULL, so the default %SIZE_MAX will be used.
+ * @io_mutex: mutex for physical bus access
  * @bus_lock_spinlock: spinlock for SPI bus locking
- * @bus_lock_mutex: mutex for SPI bus locking
+ * @bus_lock_mutex: mutex for exclusion of multiple callers
  * @bus_lock_flag: indicates that the SPI bus is locked for exclusive use
  * @setup: updates the device mode and clocking records used by a
  *     device's SPI controller; protocol code may call this.  This
@@ -446,6 +447,9 @@ struct spi_master {
         */
        size_t (*max_transfer_size)(struct spi_device *spi);
 
+       /* I/O mutex */
+       struct mutex            io_mutex;
+
        /* lock and mutex for SPI bus locking */
        spinlock_t              bus_lock_spinlock;
        struct mutex            bus_lock_mutex;
@@ -1143,6 +1147,8 @@ static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd)
  * @opcode_nbits: number of lines to send opcode
  * @addr_nbits: number of lines to send address
  * @data_nbits: number of lines for data
+ * @rx_sg: Scatterlist for receive data read from flash
+ * @cur_msg_mapped: message has been mapped for DMA
  */
 struct spi_flash_read_message {
        void *buf;
@@ -1155,6 +1161,8 @@ struct spi_flash_read_message {
        u8 opcode_nbits;
        u8 addr_nbits;
        u8 data_nbits;
+       struct sg_table rx_sg;
+       bool cur_msg_mapped;
 };
 
 /* SPI core interface for flash read support */