Title: [5780] trunk/drivers/spi: bug [#3713] - Add CONFIG_SPI_BFIN_LOCK.
- Revision
- 5780
- Author
- adamliyi
- Date
- 2008-12-02 02:10:24 -0600 (Tue, 02 Dec 2008)
Log Message
bug [#3713] - Add CONFIG_SPI_BFIN_LOCK.
Modified Paths
Diff
Modified: trunk/drivers/spi/Kconfig (5779 => 5780)
--- trunk/drivers/spi/Kconfig 2008-12-02 07:12:07 UTC (rev 5779)
+++ trunk/drivers/spi/Kconfig 2008-12-02 08:10:24 UTC (rev 5780)
@@ -66,6 +66,14 @@
help
This is the SPI controller master driver for Blackfin 5xx processor.
+config SPI_BFIN_LOCK
+ bool "SPI bus lock"
+ depends on SPI_BFIN
+ default n
+ help
+ Enable support for spi_lock_bus()/spi_unlock_bus(). Useful when multiple
+ SPI devices share a bus, especially for devices like MMC_SPI.
+
config SPI_AU1550
tristate "Au1550/Au12x0 SPI Controller"
depends on (SOC_AU1550 || SOC_AU1200) && EXPERIMENTAL
Modified: trunk/drivers/spi/spi_bfin5xx.c (5779 => 5780)
--- trunk/drivers/spi/spi_bfin5xx.c 2008-12-02 07:12:07 UTC (rev 5779)
+++ trunk/drivers/spi/spi_bfin5xx.c 2008-12-02 08:10:24 UTC (rev 5780)
@@ -45,8 +45,6 @@
#define QUEUE_RUNNING 0
#define QUEUE_STOPPED 1
-#define BFIN_SPI_LOCK 1
-
/* Value to send if no TX value is supplied */
#define SPI_IDLE_TXVAL 0x0000
@@ -73,7 +71,7 @@
struct list_head queue;
int busy;
int run;
-#ifdef BFIN_SPI_LOCK
+#ifdef CONFIG_SPI_BFIN_LOCK
/* SPI bus is lock by a slave for exclusive access */
int locked;
#endif
@@ -913,7 +911,7 @@
{
struct driver_data *drv_data;
unsigned long flags;
-#ifdef BFIN_SPI_LOCK
+#ifdef CONFIG_SPI_BFIN_LOCK
int locked_cs = -1;
struct spi_message *next_msg = NULL, *msg = NULL;
#endif
@@ -935,7 +933,7 @@
return;
}
-#ifdef BFIN_SPI_LOCK
+#ifdef CONFIG_SPI_BFIN_LOCK
/* Extract head of queue */
next_msg = list_entry(drv_data->queue.next,
struct spi_message, queue);
@@ -998,7 +996,7 @@
*/
static int bfin_spi_lock_bus(struct spi_device *spi)
{
-#ifdef BFIN_SPI_LOCK
+#ifdef CONFIG_SPI_BFIN_LOCK
struct driver_data *drv_data = spi_master_get_devdata(spi->master);
unsigned long flags;
@@ -1015,7 +1013,7 @@
static int bfin_spi_unlock_bus(struct spi_device *spi)
{
-#ifdef BFIN_SPI_LOCK
+#ifdef CONFIG_SPI_BFIN_LOCK
struct driver_data *drv_data = spi_master_get_devdata(spi->master);
unsigned long flags;
@@ -1253,7 +1251,7 @@
INIT_LIST_HEAD(&drv_data->queue);
spin_lock_init(&drv_data->lock);
-#ifdef BFIN_SPI_LOCK
+#ifdef CONFIG_SPI_BFIN_LOCK
drv_data->locked = 0;
#endif
drv_data->run = QUEUE_STOPPED;
@@ -1303,7 +1301,7 @@
spin_lock_irqsave(&drv_data->lock, flags);
-#ifdef BFIN_SPI_LOCK
+#ifdef CONFIG_SPI_BFIN_LOCK
drv_data->locked = 0;
#endif
/*
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits