Skip to content
Unverified Commit b5932f5c authored by Boris Brezillon's avatar Boris Brezillon Committed by Mark Brown
Browse files

spi: Make support for regular transfers optional when ->mem_ops != NULL



Some SPI/QuadSPI controllers only expose a high-level SPI memory
interface, thus preventing any regular SPI transfers from being done.

In that case, SPI controller drivers can leave all ->transfer_xxx()
hooks empty and only implement the spi_mem_ops interface.

Adjust the core to allow such situations:
- extend spi_controller_check_ops() to accept situations where all
  ->transfer_xxx() pointers are NULL only if ->mem_ops != NULL
- make sure we do not initialize the SPI message queue if
  ctlr->transfer_one and ctlr->transfer_one_message are missing
- return -ENOTSUPP if someone tries to do a regular SPI transfer on
  a controller that does not support it

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: default avatarFrieder Schrempf <frieder.schrempf@exceet.de>
Tested-by: default avatarFrieder Schrempf <frieder.schrempf@exceet.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c36ff266
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment