]> git.karo-electronics.de Git - karo-tx-linux.git/commit
spi: Provide common spi_message processing loop
authorMark Brown <broonie@linaro.org>
Sat, 5 Oct 2013 10:50:40 +0000 (11:50 +0100)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:56:12 +0000 (09:56 +0800)
commit54d2dd2c49e8b66cea03fcf8fcadcce6186eccb1
tree7f638258ce439b9e0447bdd0610074b1417234a8
parent0d7035e7acf984ae5e4d3e1bb09d4d49d8fb1e21
spi: Provide common spi_message processing loop

The loops which SPI controller drivers use to process the list of transfers
in a spi_message are typically very similar and have some error prone areas
such as the handling of /CS. Help simplify drivers by factoring this code
out into the core - if drivers provide a transfer_one() function instead
of a transfer_one_message() function the core will handle processing at the
message level.

/CS can be controlled by either setting cs_gpio or providing a set_cs
function. If this is not possible for hardware reasons then both can be
omitted and the driver should continue to implement manual /CS handling.

This is a first step in refactoring and it is expected that there will be
further enhancements, for example factoring out of the mapping of transfers
for DMA and the initiation and completion of interrupt driven transfers.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/spi/spi.c
include/linux/spi/spi.h
include/trace/events/spi.h