diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-14 14:54:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-14 14:54:09 -0400 |
commit | b171aa27700c78511086a759383b033949c9d7f0 (patch) | |
tree | 2775b0682ea342dd49c5b997de248da73ec83049 /include/linux | |
parent | 11ac552477e32835cb6970bf0a70c210807f5673 (diff) | |
parent | b4225885deb569f7afcf1f3a9f069f74cc9db591 (diff) |
Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
* 'next-spi' of git://git.secretlab.ca/git/linux-2.6:
spi/amba_pl022: Fix probe and remove hook section annotations.
spi/mpc5121: change annotations for probe and remove functions
spi/bitbang: reinitialize transfer parameters for every message
spi/spi-gpio: add support for controllers without MISO or MOSI pin
spi/bitbang: add support for SPI_MASTER_NO_{TX, RX} modes
SPI100k: Fix 8-bit and RX-only transfers
spi/mmc_spi: mmc_spi adaptations for SPI bus locking API
spi/mmc_spi: SPI bus locking API, using mutex
Fix trivial conflict in drivers/spi/mpc512x_psc_spi.c due to 'struct
of_device' => 'struct platform_device' rename and __init/__exit to
__devinit/__devexit fix.
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/spi/spi.h | 12 | ||||
-rw-r--r-- | include/linux/spi/spi_gpio.h | 5 |
2 files changed, 17 insertions, 0 deletions
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 | ||
543 | extern int spi_setup(struct spi_device *spi); | 550 | extern int spi_setup(struct spi_device *spi); |
544 | extern int spi_async(struct spi_device *spi, struct spi_message *message); | 551 | extern int spi_async(struct spi_device *spi, struct spi_message *message); |
552 | extern 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 | ||
553 | extern int spi_sync(struct spi_device *spi, struct spi_message *message); | 562 | extern int spi_sync(struct spi_device *spi, struct spi_message *message); |
563 | extern int spi_sync_locked(struct spi_device *spi, struct spi_message *message); | ||
564 | extern int spi_bus_lock(struct spi_master *master); | ||
565 | extern 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 |