diff options
author | Imre Deak <imre.deak@nokia.com> | 2006-02-17 18:02:18 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-05-16 21:33:56 (GMT) |
commit | 4cff33f94fefcce1b3c01a9d1da6bb85fe3cbdfa (patch) | |
tree | 0ef6066c4f2c0225517a6402bb04f4b4d56afd4d /include/linux/spi/spi_bitbang.h | |
parent | 716f8954fb3029ca2df52a986b60af8d06f093ee (diff) | |
download | linux-fsl-qoriq-4cff33f94fefcce1b3c01a9d1da6bb85fe3cbdfa.tar.xz |
[PATCH] SPI: per-transfer overrides for wordsize and clocking
Some protocols (like one for some bitmap displays) require different clock
speed or word size settings for each transfer in an SPI message. This adds
those parameters to struct spi_transfer. They are to be used when they are
nonzero; otherwise the defaults from spi_device are to be used.
The patch also adds a setup_transfer callback to spi_bitbang, uses it for
messages that use those overrides, and implements it so that the pure
bitbanging code can help resolve any questions about how it should work.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/spi/spi_bitbang.h')
-rw-r--r-- | include/linux/spi/spi_bitbang.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index c961fe9..c954557 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h @@ -30,6 +30,12 @@ struct spi_bitbang { struct spi_master *master; + /* setup_transfer() changes clock and/or wordsize to match settings + * for this transfer; zeroes restore defaults from spi_device. + */ + int (*setup_transfer)(struct spi_device *spi, + struct spi_transfer *t); + void (*chipselect)(struct spi_device *spi, int is_on); #define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */ #define BITBANG_CS_INACTIVE 0 |