diff options
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/spi.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 9d8d63109a8f..4f0f8c2e58a5 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -163,7 +163,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
163 | * each slave has a chipselect signal, but it's common that not | 163 | * each slave has a chipselect signal, but it's common that not |
164 | * every chipselect is connected to a slave. | 164 | * every chipselect is connected to a slave. |
165 | * @setup: updates the device mode and clocking records used by a | 165 | * @setup: updates the device mode and clocking records used by a |
166 | * device's SPI controller; protocol code may call this. | 166 | * device's SPI controller; protocol code may call this. This |
167 | * must fail if an unrecognized or unsupported mode is requested. | ||
167 | * @transfer: adds a message to the controller's transfer queue. | 168 | * @transfer: adds a message to the controller's transfer queue. |
168 | * @cleanup: frees controller-specific state | 169 | * @cleanup: frees controller-specific state |
169 | * | 170 | * |
@@ -305,6 +306,16 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); | |||
305 | * shifting out three bytes with word size of sixteen or twenty bits; | 306 | * shifting out three bytes with word size of sixteen or twenty bits; |
306 | * the former uses two bytes per word, the latter uses four bytes.) | 307 | * the former uses two bytes per word, the latter uses four bytes.) |
307 | * | 308 | * |
309 | * In-memory data values are always in native CPU byte order, translated | ||
310 | * from the wire byte order (big-endian except with SPI_LSB_FIRST). So | ||
311 | * for example when bits_per_word is sixteen, buffers are 2N bytes long | ||
312 | * and hold N sixteen bit words in CPU byte order. | ||
313 | * | ||
314 | * When the word size of the SPI transfer is not a power-of-two multiple | ||
315 | * of eight bits, those in-memory words include extra bits. In-memory | ||
316 | * words are always seen by protocol drivers as right-justified, so the | ||
317 | * undefined (rx) or unused (tx) bits are always the most significant bits. | ||
318 | * | ||
308 | * All SPI transfers start with the relevant chipselect active. Normally | 319 | * All SPI transfers start with the relevant chipselect active. Normally |
309 | * it stays selected until after the last transfer in a message. Drivers | 320 | * it stays selected until after the last transfer in a message. Drivers |
310 | * can affect the chipselect signal using cs_change: | 321 | * can affect the chipselect signal using cs_change: |
@@ -462,6 +473,11 @@ static inline void spi_message_free(struct spi_message *m) | |||
462 | * changes those settings, and must be called from a context that can sleep. | 473 | * changes those settings, and must be called from a context that can sleep. |
463 | * The changes take effect the next time the device is selected and data | 474 | * The changes take effect the next time the device is selected and data |
464 | * is transferred to or from it. | 475 | * is transferred to or from it. |
476 | * | ||
477 | * Note that this call wil fail if the protocol driver specifies an option | ||
478 | * that the underlying controller or its driver does not support. For | ||
479 | * example, not all hardware supports wire transfers using nine bit words, | ||
480 | * LSB-first wire encoding, or active-high chipselects. | ||
465 | */ | 481 | */ |
466 | static inline int | 482 | static inline int |
467 | spi_setup(struct spi_device *spi) | 483 | spi_setup(struct spi_device *spi) |