From cf46b973f72ddf9d1e17d6fde9aa14f61aa1afed Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 15 Oct 2008 22:02:41 -0700 Subject: 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 Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/spi/spi_s3c24xx.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/spi') diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 3eb414b84a9..c252cbac00f 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) writeb(0xff, hw->regs + S3C2410_SPPRE); writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN); writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON); + + if (hw->pdata && hw->pdata->gpio_setup) + hw->pdata->gpio_setup(hw->pdata, 1); } 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) { struct s3c24xx_spi *hw = platform_get_drvdata(pdev); + if (hw->pdata && hw->pdata->gpio_setup) + hw->pdata->gpio_setup(hw->pdata, 0); + clk_disable(hw->clk); return 0; } -- cgit v1.2.3