diff options
author | Franck Jullien <franck.jullien@gmail.com> | 2011-11-24 21:46:34 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-25 12:38:34 +0100 |
commit | 146bea9b9b79f38047f14799c959280cea50c4bf (patch) | |
tree | c39cef1e2e33fe7b5eb01793f827862d50969da1 /arch/nios2/include | |
parent | 2aad209b78fcd617ba89d4e29cac09b6948eace3 (diff) | |
download | barebox-146bea9b9b79f38047f14799c959280cea50c4bf.tar.gz barebox-146bea9b9b79f38047f14799c959280cea50c4bf.tar.xz |
spi/altera_spi: Add cs_change support
The Linux kernel says (spi.h) :
* All SPI transfers start with the relevant chipselect active. Normally
* it stays selected until after the last transfer in a message. Drivers
* can affect the chipselect signal using cs_change.
*
* (i) If the transfer isn't the last one in the message, this flag is
* used to make the chipselect briefly go inactive in the middle of the
* message. Toggling chipselect in this way may be needed to terminate
* a chip command, letting a single spi_message perform all of group of
* chip transactions together.
*
* (ii) When the transfer is the last one in the message, the chip may
* stay selected until the next transfer. On multi-device SPI busses
* with nothing blocking messages going to other devices, this is just
* a performance hint; starting a message to another device deselects
* this one. But in other cases, this can be used to ensure correctness.
* Some devices need protocol transactions to be built from a series of
* spi_message submissions, where the content of one message is
* determined by the results of previous messages and where the whole
* transaction
* ends when the chipselect goes intactive.
In other words, cs_change changes the default chipselect *behavior*.
Support of cs_change is necessary to implement the mci spi driver.
This patch also fix few things:
Passing the bus number to the brand new master device.
Disable chipselect during master->setup.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/nios2/include')
-rw-r--r-- | arch/nios2/include/asm/spi.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/nios2/include/asm/spi.h b/arch/nios2/include/asm/spi.h index 4e576b9922..6c5740c340 100644 --- a/arch/nios2/include/asm/spi.h +++ b/arch/nios2/include/asm/spi.h @@ -8,6 +8,7 @@ struct spi_altera_master { int spi_mode; int databits; int speed; + int bus_num; }; struct altera_spi { |