"Mixed" mode SPI

Hi,

we have an SPI slave device that requires reading and writing in different modes.

Master -> Slave: mode 0 (sampling on rising edge)
Slave -> Master: mode 1 (sampling on falling edge)

Does someone know if there is a way to implement this using the Linux SPI interface without losing to much performance?

A transfer looks like this:
1 Byte write transfer (reg. address) to device in mode 0
followed by
1 or more bytes read (reg. content) from device in mode 1

The CS line must not be released while switching from read to write mode. So far my best solution is to manually drive the CS as a GPIO, but that's pretty slow.

Thx
Bj�rn

Hi,

we have an SPI slave device that requires reading and writing in different modes.

Master -> Slave: mode 0 (sampling on rising edge)
Slave -> Master: mode 1 (sampling on falling edge)

Yes there are such devices (e.g. TI TRF7960).

Does someone know if there is a way to implement this using the Linux SPI interface without losing to much performance?

A transfer looks like this:
1 Byte write transfer (reg. address) to device in mode 0
followed by
1 or more bytes read (reg. content) from device in mode 1

The CS line must not be released while switching from read to write mode. So far my best solution is to manually drive the CS as a GPIO, but that's pretty slow.

I have controlled a TRF7960 by using GPIO only, i.e. writing my own SPI
code. Therefore I would also be interested in a better solution that cleverly uses
the existing SPI drivers. Or extends them. Or configures them correctly.

Did you have success?

BR,
Nikolaus Schaller