diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-10-16 01:02:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:38 -0400 |
commit | cf46b973f72ddf9d1e17d6fde9aa14f61aa1afed (patch) | |
tree | 37f6c04067d55f1267c0ddd49bcb59063a5c5fa3 | |
parent | f9b90e39cbc5c4d6ef60022fd1f25d541df0aad1 (diff) |
spi_s3c24xx: pin configuration updates
Add a pin configuration callback for the s3c24xx SPI driver, as there are
several options depending on the channel and the chip in use.
This is needed as the controller may not have been setup by the initial
bootloader and the fact that the SPI controller gets reset over
suspend/resume into slave mode but the GPIO function registers do not.
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-- | arch/arm/mach-s3c2410/include/mach/spi.h | 1 | ||||
-rw-r--r-- | drivers/spi/spi_s3c24xx.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/spi.h b/arch/arm/mach-s3c2410/include/mach/spi.h index 921b13b4f0a0..46d46f5b99f2 100644 --- a/arch/arm/mach-s3c2410/include/mach/spi.h +++ b/arch/arm/mach-s3c2410/include/mach/spi.h | |||
@@ -18,6 +18,7 @@ struct s3c2410_spi_info { | |||
18 | unsigned int num_cs; /* total chipselects */ | 18 | unsigned int num_cs; /* total chipselects */ |
19 | int bus_num; /* bus number to use. */ | 19 | int bus_num; /* bus number to use. */ |
20 | 20 | ||
21 | void (*gpio_setup)(struct s3c2410_spi_info *spi, int enable); | ||
21 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); | 22 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); |
22 | }; | 23 | }; |
23 | 24 | ||
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 3eb414b84a9d..c252cbac00f1 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -247,6 +247,9 @@ static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw) | |||
247 | writeb(0xff, hw->regs + S3C2410_SPPRE); | 247 | writeb(0xff, hw->regs + S3C2410_SPPRE); |
248 | writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN); | 248 | writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN); |
249 | writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON); | 249 | writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON); |
250 | |||
251 | if (hw->pdata && hw->pdata->gpio_setup) | ||
252 | hw->pdata->gpio_setup(hw->pdata, 1); | ||
250 | } | 253 | } |
251 | 254 | ||
252 | static int __init s3c24xx_spi_probe(struct platform_device *pdev) | 255 | static int __init s3c24xx_spi_probe(struct platform_device *pdev) |
@@ -412,6 +415,9 @@ static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) | |||
412 | { | 415 | { |
413 | struct s3c24xx_spi *hw = platform_get_drvdata(pdev); | 416 | struct s3c24xx_spi *hw = platform_get_drvdata(pdev); |
414 | 417 | ||
418 | if (hw->pdata && hw->pdata->gpio_setup) | ||
419 | hw->pdata->gpio_setup(hw->pdata, 0); | ||
420 | |||
415 | clk_disable(hw->clk); | 421 | clk_disable(hw->clk); |
416 | return 0; | 422 | return 0; |
417 | } | 423 | } |