aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2009-04-06 22:00:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:31:07 -0400
commitfd5e191e7610eb7ecb5e35b2045ceb6554bea15a (patch)
treef324e79410cde9dd51a0c931b2dbce70f1313e9a /include/linux/spi
parent75c8915c0ca633f7c1839618bd5c6a5e26b24094 (diff)
SPI: add dma_alignment field to spi_master
Some SPI controllers have restrictions on DMAable buffers alignemt. Currently if the buffer supplied by protocol driver is not properly aligned, the controller silently performs transfer in PIO mode. Addition of dma_alignment field to spi_master allows protocol drivers to perform proper alignment. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Cc: Bryan Wu <bryan.wu@analog.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/spi.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 68bb1c501d0d..2cc43fa380cb 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
204 * SPI slaves, and are numbered from zero to num_chipselects. 204 * SPI slaves, and are numbered from zero to num_chipselects.
205 * each slave has a chipselect signal, but it's common that not 205 * each slave has a chipselect signal, but it's common that not
206 * every chipselect is connected to a slave. 206 * every chipselect is connected to a slave.
207 * @dma_alignment: SPI controller constraint on DMA buffers alignment.
207 * @setup: updates the device mode and clocking records used by a 208 * @setup: updates the device mode and clocking records used by a
208 * device's SPI controller; protocol code may call this. This 209 * device's SPI controller; protocol code may call this. This
209 * must fail if an unrecognized or unsupported mode is requested. 210 * must fail if an unrecognized or unsupported mode is requested.
@@ -239,6 +240,11 @@ struct spi_master {
239 */ 240 */
240 u16 num_chipselect; 241 u16 num_chipselect;
241 242
243 /* some SPI controllers pose alignment requirements on DMAable
244 * buffers; let protocol drivers know about these requirements.
245 */
246 u16 dma_alignment;
247
242 /* setup mode and clock, etc (spi driver may call many times) */ 248 /* setup mode and clock, etc (spi driver may call many times) */
243 int (*setup)(struct spi_device *spi); 249 int (*setup)(struct spi_device *spi);
244 250