I need to write a protocol driver for an SPI chip we are using in our application.
I have followed the instructions in those two guides:
http://www.jumpnowtek.com/?option=com_content&view=article&id=57&Itemid=62
http://processors.wiki.ti.com/index.php/TI81XX_PSP_McSPI_Driver_User_Guide
After muxing all the pins to their SPI functions in u-boot, and enabling SPI clock from uboot (CM_ALWON_SPI_CLKCTRL = 0x2), and adding the following code to the board file in the kernel:
struct spi_board_info __initdata dm385_spi_slave_info[] = {
{
.modalias = "an41919a",
.irq = -1,
.max_speed_hz = 10 * 1000 * 1000,
.bus_num = 1,
.chip_select = 0,
.mode = SPI_MODE_3 | SPI_CS_HIGH,
},
};
I can see that once omap2_mcspi.ko is loaded, it shows that it configured a new slave device at bus 1, cs 0, with all the above parameters, and once I load my an41919a.ko module, the probe callback function gets called.
But when I try to use an spi_write() command, I get a return value of 0, indicating no error, but no actual signals can be seen on a logic analyzer looking at the SPI wires.
From looking at omap2_mcspi.c code, it seems like the register configurations are different from what the DM385 TRM mentions for the SPI module.
Is the omap2_mcspi.c compatible with DM385? If yes, what else could I be missing? I have tried playing around with the pull down/up settings in the pinmux of the SPI bus without any results.