From 11742120437affad9b93cbd50ba57bedbb187d50 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 15 Oct 2008 22:02:41 -0700 Subject: [PATCH] --- yaml --- r: 114791 b: refs/heads/master c: cf46b973f72ddf9d1e17d6fde9aa14f61aa1afed h: refs/heads/master i: 114789: c9a3b5393d95b5566e39da437111ed0b7a06b311 114787: e26b5c6ae7500bb36f48b28bc5cf1b3caf85225e 114783: dff47181c70551d708f3d2a488890c0f52908989 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-s3c2410/include/mach/spi.h | 1 + trunk/drivers/spi/spi_s3c24xx.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 66d2d7cacd39..a61371f2d341 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f9b90e39cbc5c4d6ef60022fd1f25d541df0aad1 +refs/heads/master: cf46b973f72ddf9d1e17d6fde9aa14f61aa1afed diff --git a/trunk/arch/arm/mach-s3c2410/include/mach/spi.h b/trunk/arch/arm/mach-s3c2410/include/mach/spi.h index 921b13b4f0a0..46d46f5b99f2 100644 --- a/trunk/arch/arm/mach-s3c2410/include/mach/spi.h +++ b/trunk/arch/arm/mach-s3c2410/include/mach/spi.h @@ -18,6 +18,7 @@ struct s3c2410_spi_info { unsigned int num_cs; /* total chipselects */ int bus_num; /* bus number to use. */ + void (*gpio_setup)(struct s3c2410_spi_info *spi, int enable); void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); }; diff --git a/trunk/drivers/spi/spi_s3c24xx.c b/trunk/drivers/spi/spi_s3c24xx.c index 3eb414b84a9d..c252cbac00f1 100644 --- a/trunk/drivers/spi/spi_s3c24xx.c +++ b/trunk/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; }