aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorBarry Song <barry.song@analog.com>2009-11-17 04:45:59 -0500
committerMike Frysinger <vapier@gentoo.org>2010-10-18 02:49:36 -0400
commitd3cc71f71ae13596cb988e16bfa2b15f09fb7347 (patch)
tree6fcd5e9401931dbce719bcdfd1e5b4075f392598 /arch/blackfin
parent0d2c6de2255cb299fdd77d4543738adee45f4f3f (diff)
spi/bfin_spi: redo GPIO CS handling
The common SPI layers take care of detecting CS conflicts and preventing two devices from claiming the same CS. This causes problems for the GPIO CS support we currently have as we are using CS0 to mean "GPIO CS". But if we have multiple devices using a GPIO CS, the common SPI layers see multiple devices using the virtual "CS0" and reject any such attempts. To make both work, we introduce an offset define. This represents the max number of hardware CS values that the SPI peripheral supports. If the CS is below this limit, we know we can use the hardware CS. If it's above, we treat it as a GPIO CS. This keeps the CS unique as seen by the common code and prevents conflicts. Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/include/asm/bfin5xx_spi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/blackfin/include/asm/bfin5xx_spi.h b/arch/blackfin/include/asm/bfin5xx_spi.h
index 126d25e2afa8..6f011dac378f 100644
--- a/arch/blackfin/include/asm/bfin5xx_spi.h
+++ b/arch/blackfin/include/asm/bfin5xx_spi.h
@@ -109,6 +109,8 @@
109#define CMD_SPI_GET_SYSTEMCLOCK 25 109#define CMD_SPI_GET_SYSTEMCLOCK 25
110#define CMD_SPI_SET_WRITECONTINUOUS 26 110#define CMD_SPI_SET_WRITECONTINUOUS 26
111 111
112#define MAX_CTRL_CS 8 /* cs in spi controller */
113
112/* device.platform_data for SSP controller devices */ 114/* device.platform_data for SSP controller devices */
113struct bfin5xx_spi_master { 115struct bfin5xx_spi_master {
114 u16 num_chipselect; 116 u16 num_chipselect;
@@ -124,7 +126,6 @@ struct bfin5xx_spi_chip {
124 u8 enable_dma; 126 u8 enable_dma;
125 u8 bits_per_word; 127 u8 bits_per_word;
126 u16 cs_chg_udelay; /* Some devices require 16-bit delays */ 128 u16 cs_chg_udelay; /* Some devices require 16-bit delays */
127 u32 cs_gpio;
128 /* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */ 129 /* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */
129 u16 idle_tx_val; 130 u16 idle_tx_val;
130 u8 pio_interrupt; /* Enable spi data irq */ 131 u8 pio_interrupt; /* Enable spi data irq */