I'm using ti-sdk-am335x-evm-05.05.00.00 and an AM335x EVM. Linux 3.2.0-psp04.06.00.08
The SPI is working fine, when I generate the uImage and boot the kernel on my board I can see the spidev2.0 device file in the /dev folder. The communication is also working and I'm able to execute an application that writes to and reads from the bus.
My problem is that I need to control the CS line. The communication model I intend to do issues more then one command to the slave device and waits for it's response. In this scenario, if the CS goes from "enable" to "disable" it would be considered as a communication error by the slave and nothing would work. I'm not trying to make it enable the device all the time either, it should disable the line after the command is done.
Right now, when my application (user space) issues a write call to the spidev driver, CS goes from 1 to 0 before the SCLK starts and returns to 1 after the number of bytes I send is written. The same thing happens when I issue a read call.
My first thought was to change the file drivers/spi/spidev.c so that I could add a command to the ioctl call in order to control the CS pin as I see fit. This would work if I knew what to change in the other functions and files...
Anyone knows a simpler way to do this or what I should change to make it work?
Thanks a lot!
Davi