I am working towards using SPI in the linux environment, as NOOB.
there are many examples of I2C and Uart, but did not find any for SPI using SPI2.
in my quest I found this as a starting place.
http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/spi/
I am also following the Hardware implementation thread.
To create a spidev device, the following topic could be usefull: https://www.olimex.com/forum/index.php?topic=835.0 (https://www.olimex.com/forum/index.php?topic=835.0)
The next thing to experiment with could be the spidevtest program: http://armbedded.eu/node/318 (http://armbedded.eu/node/318)
Keep in mind that the spi driver is'nt full duplex, so either you are receiving or you are sending. That's why there's being talked about zeroing out a buffer.
Change for example in the test spi code:
.rx_buf = (unsigned long)rx,to
.rx_buf = 0,
this will give you a working spi output.
http://www.jumpnowtek.com/?option=com_content&view=article&id=57&Itemid=62 (http://www.jumpnowtek.com/?option=com_content&view=article&id=57&Itemid=62)
https://www.kernel.org/doc/Documentation/spi/spi-summary (https://www.kernel.org/doc/Documentation/spi/spi-summary)