--- drivers/spi/Makefile | 1 + drivers/spi/spi_test_devices.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) Index: work-powerpc.git/drivers/spi/Makefile =================================================================== --- work-powerpc.git.orig/drivers/spi/Makefile +++ work-powerpc.git/drivers/spi/Makefile @@ -35,3 +35,4 @@ obj-$(CONFIG_SPI_SPIDEV) += spidev.o # SPI slave drivers (protocol for that link) # ... add above this line ... +obj-m += spi_test_devices.o Index: work-powerpc.git/drivers/spi/spi_test_devices.c =================================================================== --- /dev/null +++ work-powerpc.git/drivers/spi/spi_test_devices.c @@ -0,0 +1,38 @@ +#include +#include +#include + +static struct spi_board_info spi_info[7]; +static struct spi_device *spidev[7]; +static int testdev_init(void) +{ + struct spi_board_info *info; + int i; + + for (i=0; i<7; i++) { + struct spi_master *master; + + info = &spi_info[i]; + //info->max_speed_hz = 2*1000000; + info->max_speed_hz = 100000; + //info->max_speed_hz = 1*1000000; + strcpy(info->modalias, "spidev"); + + master = spi_busnum_to_master(i); + if (master) + spidev[i] = spi_new_device(master, info); + } + return 0; +} + +static void testdev_exit(void) +{ + /* there is no _remove? */ + /*for (i=0; i<7; i++) { + }*/ +} + +module_init(testdev_init); +module_exit(testdev_exit); + +MODULE_LICENSE("GPL");