[PATCH] spi: spi_s3c2410_gpio.c extra transfer mode support

Ben Dooks ben at fluff.org
Fri Feb 16 18:54:34 CET 2007


This is a direct lift of the spi patch 2.6.17-s3c2410-spi-mode23.patch
which still applies to the current development kernel.

----
To: spi-devel-general at lists.sourceforge.net

Patch from Harald Welte <laforge at openmoko.org>

Add transfer modes 2 and 3 to the S3C24XX gpio SPI driver

Signed-off-by: Harald Welte <laforge at openmoko.org>
Signed-off-by: Ben Dooks <ben-linux at fluff.org>

--- ../linux-2.6.20/drivers/spi/spi_s3c24xx_gpio.c	2007-02-04 18:44:54.000000000 +0000
+++ linux-2.6.20/drivers/spi/spi_s3c24xx_gpio.c	2007-02-16 12:28:27.000000000 +0000
@@ -73,6 +73,19 @@ static u32 s3c2410_spigpio_txrx_mode1(st
 	return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits);
 }
 
+static u32 s3c2410_spigpio_txrx_mode2(struct spi_device *spi,
+				      unsigned nsecs, u32 word, u8 bits)
+{
+	return bitbang_txrx_be_cpha0(spi, nsecs, 1, word, bits);
+}
+
+static u32 s3c2410_spigpio_txrx_mode3(struct spi_device *spi,
+				      unsigned nsecs, u32 word, u8 bits)
+{
+	return bitbang_txrx_be_cpha1(spi, nsecs, 1, word, bits);
+}
+
+
 static void s3c2410_spigpio_chipselect(struct spi_device *dev, int value)
 {
 	struct s3c2410_spigpio *sg = spidev_to_sg(dev);
@@ -108,6 +121,8 @@ static int s3c2410_spigpio_probe(struct 
 
 	sp->bitbang.txrx_word[SPI_MODE_0] = s3c2410_spigpio_txrx_mode0;
 	sp->bitbang.txrx_word[SPI_MODE_1] = s3c2410_spigpio_txrx_mode1;
+	sp->bitbang.txrx_word[SPI_MODE_2] = s3c2410_spigpio_txrx_mode2;
+	sp->bitbang.txrx_word[SPI_MODE_3] = s3c2410_spigpio_txrx_mode3;
 
 	/* set state of spi pins */
 	s3c2410_gpio_setpin(sp->info->pin_clk, 0);




More information about the openmoko-kernel mailing list