-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPI: cs_change not working properly #85
Comments
It definitely a bug...or incomplete implementation of the API. In order to add
Case 1 is supported as seen in the driver code. It will deactivate the chip |
Thanks for this comment. Years later, it helped me to understand why RaspberryPi spi-bcm2735 driver did not work with my code.
This suggests that in order to make CS go inactive after a transfer (including the last in a message) cs_change should be set. The more thorough description in spi.h @ohporter quoted makes clear that it's exactly the opposite for the last transfer in a message. Rpi's spi-bcm2708 driver apparently did not check the cs_change flag at all, so code using cs_change as suggested by spidev.h (user land /dev/spidev access) worked on spi-bcm2708 but not on spi-bcm2735. A good example of someone running into this is this commit on github - where the original author set cs_change intending CS to go inactive after the transfer, see his comment. The commit just comments out touching cs_change, but with no explanation why. Luckily, I eventually found this post! |
With the change of the broadcom SPI driver to gpio-driven chipselects (documented in raspberrypi/linux#1003 ) this program stopped working. Commenting out this line seems to fix it.
:-) |
In file drivers/spi/spi-omap2-mcspi.c funcion omap2_mcspi_work()
Setting cs_change is supposed to keep the chip select pin active after returning from the function.
This code does not allow to keep the transaction alive.
The text was updated successfully, but these errors were encountered: