Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi doc updates

Update two points in the SPI interface documentation:

- Update description of the "chip stays selected after message ends"
mode. In some cases it's required for correctness; it isn't just a
performance tweak. (Yes: to use this mode on mult-device busses, another
programming interface will be needed. One draft has been circulated
already.)

- Clarify spi_setup(), highlighting that callers must ensure that no
requests are queued (can't change configuration except between I/Os), and
that the device must be deselected when this returns (which is a key part
of why it's called during device init).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Brownell and committed by
Linus Torvalds
f5a9c77d ed456662

+13 -7
+13 -7
include/linux/spi/spi.h
··· 341 341 * chip transactions together. 342 342 * 343 343 * (ii) When the transfer is the last one in the message, the chip may 344 - * stay selected until the next transfer. This is purely a performance 345 - * hint; the controller driver may need to select a different device 346 - * for the next message. 344 + * stay selected until the next transfer. On multi-device SPI busses 345 + * with nothing blocking messages going to other devices, this is just 346 + * a performance hint; starting a message to another device deselects 347 + * this one. But in other cases, this can be used to ensure correctness. 348 + * Some devices need protocol transactions to be built from a series of 349 + * spi_message submissions, where the content of one message is determined 350 + * by the results of previous messages and where the whole transaction 351 + * ends when the chipselect goes intactive. 347 352 * 348 353 * The code that submits an spi_message (and its spi_transfers) 349 354 * to the lower layers is responsible for managing its memory. ··· 485 480 /** 486 481 * spi_setup - setup SPI mode and clock rate 487 482 * @spi: the device whose settings are being modified 488 - * Context: can sleep 483 + * Context: can sleep, and no requests are queued to the device 489 484 * 490 485 * SPI protocol drivers may need to update the transfer mode if the 491 - * device doesn't work with the mode 0 default. They may likewise need 486 + * device doesn't work with its default. They may likewise need 492 487 * to update clock rates or word sizes from initial values. This function 493 488 * changes those settings, and must be called from a context that can sleep. 494 - * The changes take effect the next time the device is selected and data 495 - * is transferred to or from it. 489 + * Except for SPI_CS_HIGH, which takes effect immediately, the changes take 490 + * effect the next time the device is selected and data is transferred to 491 + * or from it. When this function returns, the spi device is deselected. 496 492 * 497 493 * Note that this call will fail if the protocol driver specifies an option 498 494 * that the underlying controller or its driver does not support. For