Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143807
b: refs/heads/master
c: 6e538aa
h: refs/heads/master
i:
  143805: 0d9e1b3
  143803: 955c254
  143799: 8063c5f
  143791: 1b22d07
  143775: 43887f3
  143743: dfe7ec4
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Apr 21, 2009
1 parent 63a7487 commit edc985c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14fadca793e39742f442df53391cdd1437b9262f
refs/heads/master: 6e538aaf50ae782a890cbc02c27950448d8193e1
6 changes: 6 additions & 0 deletions trunk/Documentation/spi/spi-summary
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,16 @@ SPI MASTER METHODS
This sets up the device clock rate, SPI mode, and word sizes.
Drivers may change the defaults provided by board_info, and then
call spi_setup(spi) to invoke this routine. It may sleep.

Unless each SPI slave has its own configuration registers, don't
change them right away ... otherwise drivers could corrupt I/O
that's in progress for other SPI devices.

** BUG ALERT: for some reason the first version of
** many spi_master drivers seems to get this wrong.
** When you code setup(), ASSUME that the controller
** is actively processing transfers for another device.

master->transfer(struct spi_device *spi, struct spi_message *message)
This must not sleep. Its responsibility is arrange that the
transfer happens and its complete() callback is issued. The two
Expand Down
7 changes: 6 additions & 1 deletion trunk/include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ struct spi_master {
*/
u16 dma_alignment;

/* setup mode and clock, etc (spi driver may call many times) */
/* Setup mode and clock, etc (spi driver may call many times).
*
* IMPORTANT: this may be called when transfers to another
* device are active. DO NOT UPDATE SHARED REGISTERS in ways
* which could break those transfers.
*/
int (*setup)(struct spi_device *spi);

/* bidirectional bulk transfers
Expand Down

0 comments on commit edc985c

Please sign in to comment.