aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/max7301.h8
-rw-r--r--include/linux/spi/spi.h12
-rw-r--r--include/linux/spi/spi_gpio.h5
3 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/spi/max7301.h b/include/linux/spi/max7301.h
index 34af0a3477bf..bcaa2f762cc1 100644
--- a/include/linux/spi/max7301.h
+++ b/include/linux/spi/max7301.h
@@ -11,6 +11,7 @@ struct max7301 {
11 struct mutex lock; 11 struct mutex lock;
12 u8 port_config[8]; /* field 0 is unused */ 12 u8 port_config[8]; /* field 0 is unused */
13 u32 out_level; /* cached output levels */ 13 u32 out_level; /* cached output levels */
14 u32 input_pullup_active;
14 struct gpio_chip chip; 15 struct gpio_chip chip;
15 struct device *dev; 16 struct device *dev;
16 int (*write)(struct device *dev, unsigned int reg, unsigned int val); 17 int (*write)(struct device *dev, unsigned int reg, unsigned int val);
@@ -20,6 +21,13 @@ struct max7301 {
20struct max7301_platform_data { 21struct max7301_platform_data {
21 /* number assigned to the first GPIO */ 22 /* number assigned to the first GPIO */
22 unsigned base; 23 unsigned base;
24 /*
25 * bitmask controlling the pullup configuration,
26 *
27 * _note_ the 4 lowest bits are unused, because the first 4
28 * ports of the controller are not used, too.
29 */
30 u32 input_pullup_active;
23}; 31};
24 32
25extern int __max730x_remove(struct device *dev); 33extern int __max730x_remove(struct device *dev);
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index af56071b06f9..ae0a5286f558 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -262,6 +262,13 @@ struct spi_master {
262#define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */ 262#define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */
263#define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */ 263#define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */
264 264
265 /* lock and mutex for SPI bus locking */
266 spinlock_t bus_lock_spinlock;
267 struct mutex bus_lock_mutex;
268
269 /* flag indicating that the SPI bus is locked for exclusive use */
270 bool bus_lock_flag;
271
265 /* Setup mode and clock, etc (spi driver may call many times). 272 /* Setup mode and clock, etc (spi driver may call many times).
266 * 273 *
267 * IMPORTANT: this may be called when transfers to another 274 * IMPORTANT: this may be called when transfers to another
@@ -542,6 +549,8 @@ static inline void spi_message_free(struct spi_message *m)
542 549
543extern int spi_setup(struct spi_device *spi); 550extern int spi_setup(struct spi_device *spi);
544extern int spi_async(struct spi_device *spi, struct spi_message *message); 551extern int spi_async(struct spi_device *spi, struct spi_message *message);
552extern int spi_async_locked(struct spi_device *spi,
553 struct spi_message *message);
545 554
546/*---------------------------------------------------------------------------*/ 555/*---------------------------------------------------------------------------*/
547 556
@@ -551,6 +560,9 @@ extern int spi_async(struct spi_device *spi, struct spi_message *message);
551 */ 560 */
552 561
553extern int spi_sync(struct spi_device *spi, struct spi_message *message); 562extern int spi_sync(struct spi_device *spi, struct spi_message *message);
563extern int spi_sync_locked(struct spi_device *spi, struct spi_message *message);
564extern int spi_bus_lock(struct spi_master *master);
565extern int spi_bus_unlock(struct spi_master *master);
554 566
555/** 567/**
556 * spi_write - SPI synchronous write 568 * spi_write - SPI synchronous write
diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h
index ca6782ee4b9f..369b3d7d5b95 100644
--- a/include/linux/spi/spi_gpio.h
+++ b/include/linux/spi/spi_gpio.h
@@ -29,11 +29,16 @@
29 * SPI_GPIO_NO_CHIPSELECT to the controller_data: 29 * SPI_GPIO_NO_CHIPSELECT to the controller_data:
30 * .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT; 30 * .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT;
31 * 31 *
32 * If the MISO or MOSI pin is not available then it should be set to
33 * SPI_GPIO_NO_MISO or SPI_GPIO_NO_MOSI.
34 *
32 * If the bitbanged bus is later switched to a "native" controller, 35 * If the bitbanged bus is later switched to a "native" controller,
33 * that platform_device and controller_data should be removed. 36 * that platform_device and controller_data should be removed.
34 */ 37 */
35 38
36#define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l) 39#define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l)
40#define SPI_GPIO_NO_MISO ((unsigned long)-1l)
41#define SPI_GPIO_NO_MOSI ((unsigned long)-1l)
37 42
38/** 43/**
39 * struct spi_gpio_platform_data - parameter for bitbanged SPI master 44 * struct spi_gpio_platform_data - parameter for bitbanged SPI master