diff options
author | Harald Welte <laforge@openmoko.org> | 2007-02-20 16:58:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-20 20:10:16 -0500 |
commit | d23c6c21af5624c774adb6fa7155000bfd75ba40 (patch) | |
tree | f10a831dc217e3eaba5291ff4a0c32baba55485e | |
parent | bb2d1c36c7f3a78d482622289c8de0c1a5fe790f (diff) |
[PATCH] spi_s3c2410_gpio.c spi mode 2 and 3 support
Add transfer modes 2 and 3 to the S3C24XX gpio SPI driver
Signed-off-by: Harald Welte <laforge@openmoko.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/spi/spi_s3c24xx_gpio.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/spi/spi_s3c24xx_gpio.c b/drivers/spi/spi_s3c24xx_gpio.c index eda53ed04cbc..611ac22b7cdc 100644 --- a/drivers/spi/spi_s3c24xx_gpio.c +++ b/drivers/spi/spi_s3c24xx_gpio.c | |||
@@ -73,6 +73,19 @@ static u32 s3c2410_spigpio_txrx_mode1(struct spi_device *spi, | |||
73 | return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits); | 73 | return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits); |
74 | } | 74 | } |
75 | 75 | ||
76 | static u32 s3c2410_spigpio_txrx_mode2(struct spi_device *spi, | ||
77 | unsigned nsecs, u32 word, u8 bits) | ||
78 | { | ||
79 | return bitbang_txrx_be_cpha0(spi, nsecs, 1, word, bits); | ||
80 | } | ||
81 | |||
82 | static u32 s3c2410_spigpio_txrx_mode3(struct spi_device *spi, | ||
83 | unsigned nsecs, u32 word, u8 bits) | ||
84 | { | ||
85 | return bitbang_txrx_be_cpha1(spi, nsecs, 1, word, bits); | ||
86 | } | ||
87 | |||
88 | |||
76 | static void s3c2410_spigpio_chipselect(struct spi_device *dev, int value) | 89 | static void s3c2410_spigpio_chipselect(struct spi_device *dev, int value) |
77 | { | 90 | { |
78 | struct s3c2410_spigpio *sg = spidev_to_sg(dev); | 91 | struct s3c2410_spigpio *sg = spidev_to_sg(dev); |
@@ -108,6 +121,8 @@ static int s3c2410_spigpio_probe(struct platform_device *dev) | |||
108 | 121 | ||
109 | sp->bitbang.txrx_word[SPI_MODE_0] = s3c2410_spigpio_txrx_mode0; | 122 | sp->bitbang.txrx_word[SPI_MODE_0] = s3c2410_spigpio_txrx_mode0; |
110 | sp->bitbang.txrx_word[SPI_MODE_1] = s3c2410_spigpio_txrx_mode1; | 123 | sp->bitbang.txrx_word[SPI_MODE_1] = s3c2410_spigpio_txrx_mode1; |
124 | sp->bitbang.txrx_word[SPI_MODE_2] = s3c2410_spigpio_txrx_mode2; | ||
125 | sp->bitbang.txrx_word[SPI_MODE_3] = s3c2410_spigpio_txrx_mode3; | ||
111 | 126 | ||
112 | /* set state of spi pins */ | 127 | /* set state of spi pins */ |
113 | s3c2410_gpio_setpin(sp->info->pin_clk, 0); | 128 | s3c2410_gpio_setpin(sp->info->pin_clk, 0); |