Commit graph

3 commits

Author SHA1 Message Date
Benjamin Berg 23bca2a8ac spi: Fix pointer cast on 32bit architectures 2021-07-06 20:56:16 +00:00
Benjamin Berg b4f564cafc spi-transfer: Keep CS asserted during long transfers
Long transfers need to be split into multiple chunks because of
limitations by the spidev kernel driver. If this happens, we need to
make sure that the CS line remains high between the different chunks.

Add code to split the transfer into chunks and ask the driver to not
deassert CS after the transfer. Technically, this is only an
optimization as concurrent access to another device might still cause
deselection. However, this should mean that devices work without having
to change the spidev module parameter.

Use the feature in the hope that it will work. However, print a message
(not a warning), to help with debugging in case someone does run into
issues because of this.
2021-06-21 22:24:58 +00:00
Benjamin Berg 7fcce7891a spi-transfer: Add SPI transfer helper routines
These routines assume that any messages is composed of a write and/or
read part. While the API allows sending and receiving as part of one
messages/transfer, it does not permit full duplex operation where data is
both send and received at the same time.
2021-04-08 16:52:20 +00:00