On Sun, 16 Nov 2008 17:59:52 +0000 Andy Green <[EMAIL PROTECTED]> wrote:
> As Simon suggests the DMA thing doesn't buy us much in practice, but > if we want to get the lis302dl into mainline with an existing > timer-based competing implementation already there the interrupt mode > bitbang SPI would. So if we are going to blow out our mailreaders on > this, let's do it discussing what moves us forward rather than > sideways. I've looked around a bit at the SPI implementation [1], in order to see what would need to be done to make the interface usable from interrupt context. What I'm currently thinking is to add a new function pointer to the spi_master datastructure, being basically int (*transfer_sync)(struct spi_device *spi, struct spi_message *mesg); which would be implemented in spi_bitbang.c. This function should be possible to base on bitbang_work (without looping over a list). The next issue is bitbang->txrx_bufs, which is implemented in s3c24xx_spi_txrx() in spi_s3c24xx.c. This function blocks and waits for an interrupt and therefore needs to be reimplemented. Perhaps another function pointer in the spi_bitbang structure then. It can be noted that some other implementations have this function being synchronous already, e.g., in omap_uwire.c (uwire_txrx). I'm not surprised if this mail doesn't make any sense, and I guess there are also more pressing issues in the openmoko project than discussing how to get the accelerometer driver upstream. // Simon [1] Thank you, Eclipse!