]> git.karo-electronics.de Git - mv-sheeva.git/commit
spi/bfin_spi: redo GPIO CS handling
authorBarry Song <barry.song@analog.com>
Tue, 17 Nov 2009 09:45:59 +0000 (09:45 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 18 Oct 2010 06:49:36 +0000 (02:49 -0400)
commitd3cc71f71ae13596cb988e16bfa2b15f09fb7347
tree6fcd5e9401931dbce719bcdfd1e5b4075f392598
parent0d2c6de2255cb299fdd77d4543738adee45f4f3f
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>
arch/blackfin/include/asm/bfin5xx_spi.h
drivers/spi/spi_bfin5xx.c