I am having trouble transmitting data with the OMAPL138's SPI1 port. I am programing the SPI control registers via a linux driver through the ARM side. I am doing the following procedure and I am able to write and read data with the SPI port just fine, however the writing only works when I have a printk (highlighted red) statement before disabling the SPI. Without the printk, the data never gets written, looks I am disabling the SPI port before it gets a chance to write the data. Is there a bit I can poll that indicates when the data is transmitted completely (once it leaves the TX shift register)? I've tried polling the TXINTFLG and TXFULL flags but those don't seem to indicate for what I'm looking for. Would I have to add a dummy wait in place of the prink statement? I'd rather poll a bit instead. Please advice.
1)Configure the SPI control registers and release the reset
2)Enabling SPI with SPIGCR1
3)Writing SPIDAT1 register to write data to an external device.
-printk(KERN_NOTICE " Dummy print")
4)Disabling SPI with SPIGCR1
Note: For reading (receive) data, I poll the RXINTFLG until it equals 1, before disabling the SPI and it reads just fine.