Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47933
b: refs/heads/master
c: 8022456
h: refs/heads/master
i:
  47931: d34d3cf
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Feb 12, 2007
1 parent 4c5bf31 commit 280d980
Show file tree
Hide file tree
Showing 2 changed files with 18 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: 0ffa0285052607513a29f529ddb5061c907fd8a6
refs/heads/master: 802245611adea5e5877d8c5d9a20f94d8131bfdd
18 changes: 17 additions & 1 deletion trunk/include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
* each slave has a chipselect signal, but it's common that not
* every chipselect is connected to a slave.
* @setup: updates the device mode and clocking records used by a
* device's SPI controller; protocol code may call this.
* device's SPI controller; protocol code may call this. This
* must fail if an unrecognized or unsupported mode is requested.
* @transfer: adds a message to the controller's transfer queue.
* @cleanup: frees controller-specific state
*
Expand Down Expand Up @@ -305,6 +306,16 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
* shifting out three bytes with word size of sixteen or twenty bits;
* the former uses two bytes per word, the latter uses four bytes.)
*
* In-memory data values are always in native CPU byte order, translated
* from the wire byte order (big-endian except with SPI_LSB_FIRST). So
* for example when bits_per_word is sixteen, buffers are 2N bytes long
* and hold N sixteen bit words in CPU byte order.
*
* When the word size of the SPI transfer is not a power-of-two multiple
* of eight bits, those in-memory words include extra bits. In-memory
* words are always seen by protocol drivers as right-justified, so the
* undefined (rx) or unused (tx) bits are always the most significant bits.
*
* 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:
Expand Down Expand Up @@ -462,6 +473,11 @@ static inline void spi_message_free(struct spi_message *m)
* changes those settings, and must be called from a context that can sleep.
* The changes take effect the next time the device is selected and data
* is transferred to or from it.
*
* Note that this call wil fail if the protocol driver specifies an option
* that the underlying controller or its driver does not support. For
* example, not all hardware supports wire transfers using nine bit words,
* LSB-first wire encoding, or active-high chipselects.
*/
static inline int
spi_setup(struct spi_device *spi)
Expand Down

0 comments on commit 280d980

Please sign in to comment.