I have just published an initial version of a new kernel module "spi-config" that allows you to configure devices of your choice on the SPI bus.
For example - configuring the CAN Bus for PYCAN could look like this (assuming Raspien would provide an updated kernel with the module compiled in):
Code: Select all
modprobe spi-config devices=bus=0:cs=0:modalias=mcp2515:speed=10000000:gpioirq=25:pd=140024f4000220
You can change mcp2515 for any other module of your choice.
Code: Select all
modprobe spi-config devices=bus=0:cs=1:modalias=spidev:speed=4000000
or
Code: Select all
modprobe spi-config devices=bus=0:cs=0:modalias=mcp2515:speed=10000000:gpioirq=25:pd=140024f4000220,bus=0:cs=1:modalias=enc28j60:speed=16000000:gpioirq=22
For the code please see: https://github.com/msperl/spi-config
Hopefully this gets integrated with the Raspian linux kernel (posted an issue here: https://github.com/raspberrypi/linux/issues/391 to get it started). Then most of our lives may be easier without the need to compile our personal SPI-kernels...
Please review it and if it helps your work, then please ask nicely to get it included in the Raspian kernel - the more people ask for it the quicker we will get a solution...
Thanks,
Martin