Skip to contentSkip to conversation

Samsung S3C24xx DMA capable SPI driver

PATCH New Christer Weinigel 1 participant 1 message Dec 13, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Samsung S3C24xx DMA capable SPI driver

Hi David,

here's an updated version of my Samsung S3C24xx DMA capable SPI driver. It's a patch against linux-2.6.23.

The driver should be fairly complete now. It does have a bunch of module options that ought to be moved to platform data, but to keep the driver fairly self contained I'm keeping them as module options for the moment.

There are three TODO comments in the code. The first one has to do with delay_usecs, how large can that value get? Should I use udelay for that delay or do you expect it to be so large that I ought to use a timer instead?

The second one has to do with DMA mapping, I think the way I do things is safe, as long as people don't play tricks with dma_map_noncoherent, on the other hand, if they do, there's lots of other code that will break anyway, so I think I'll ignore that, as long as people do sane things it ought to work.

Finally, there is a slight cleanup issue with the DMA, but it should normally not be a problem.

Any comments?

/Christer

drivers/spi/Kconfig +7 -0
Index: linux-2.6.23/drivers/spi/Kconfig
===================================================================
@@ -174,6 +174,13 @@ config SPI_S3C24XX_GPIO
 	  the inbuilt hardware cannot provide the transfer mode, or
 	  where the board is using non hardware connected pins.
 
+config SPI_S3C24XX_DMA
+	tristate "Samsung S3C24XX series SPI using DMA"
+	depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL
+	help
+	  SPI driver for Samsung S3C24XX series ARM SoCs using DMA to
+	  perform the transfers.
+
 config SPI_TXX9
 	tristate "Toshiba TXx9 SPI controller"
 	depends on SPI_MASTER && GENERIC_GPIO && CPU_TX49XX
drivers/spi/Makefile +1 -0
Index: linux-2.6.23/drivers/spi/Makefile
===================================================================
@@ -25,6 +25,7 @@ obj-$(CONFIG_SPI_MPC52xx_PSC)		+= mpc52x
 obj-$(CONFIG_SPI_MPC83xx)		+= spi_mpc83xx.o
 obj-$(CONFIG_SPI_S3C24XX_GPIO)		+= spi_s3c24xx_gpio.o
 obj-$(CONFIG_SPI_S3C24XX)		+= spi_s3c24xx.o
+obj-$(CONFIG_SPI_S3C24XX_DMA)		+= spi_s3c24xx_dma.o
 obj-$(CONFIG_SPI_TXX9)			+= spi_txx9.o
 obj-$(CONFIG_SPI_XILINX)		+= xilinx_spi.o
 # 	... add above this line ...
drivers/spi/spi_s3c24xx_dma.c new file +830 -0

830 lines not on this page · raw message

Signature · 12 lines
Christer Weinigel
CSR Stockholm
Stadsgården 10
116 45 Stockholm, SWEDEN
+46 703 30 59 31

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace