On Friday 08 May 2009, Kieran Bingham wrote: > The following 8bits will clock the value of the register back to the master > i.e.: to read the value 0x02 from register 0x03 the following > transaction would occur > > MOSI: > 0x03## > MISO > 0x##02 > > where ## are "don't cares" > > > I can't seem to get this to happen using spi_write / spi_read.
Try spi_write_then_read() ... spi_w8r8() is an *exact* match for the idiom you're using, just wrapping write_then_read. (I presume that MontaVista's kernel isn't using some proprietary SPI interface...) > Does anyone know where some good pointers on using SPI are, or good > examples are ? Documentation/spi/spi_summary ... it's probably a bit more focussed on the lower level code (including device setup) than how to write protocol drivers. Current kernels have SPI drivers all over, with drivers/spi mostly holding the controller drivers. You can look there for examples; start with drivers/misc/eeprom, drivers/gpio, drivers/rtc, and drivers/hwmon. That's not exhaustive, and more complex drivers (network, touchscreen) exist too. - Dave _______________________________________________ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source