Spi mode configuration vf61

hello,

I need to configure a SPI port to operate with chip select low (CS high with low transitions). But when I try to configure bits SPI_CS_HIGH or SPI_NO_CS in VF61 I’m getting the error “spidev spi1.2: setup: unsupported mode bits 4” (error for SPI_CS_HIGH configuration).

looking for the issue, I found that the driver used for Colibri (drivers/spi/spi-fsl-dspi.c), only allows bits SPI_CPOL | SPI_CPHA to be configured.

So, there is a way to configure the CS to operate as I’m mention before?

Regards.

As you noted, it seems that the driver currently does not support this flag. However, looking into the Vybrid Reference Manual the DSPI module seems to support chip select polarity. (SPIx_MCR, PCSIS field).

The issue is not quite trivial since chip selects are something which are always affected. E.g. if you have one slave with high active and another slave with low active chip select connected to the same master, the driver needs to be aware of that before communicating with any of the two devices… As far as I understand the SPI framework is taking care of that via ->setup calls tothe driver on device add.

I created a patch which should take care of all that, however due to lack of a device which requires an active high chip select I could not really test it…

0001-spi-spi-fsl-dspi-support-chip-select-polarity.patch