aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-08-04 16:41:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-04 19:58:45 -0400
commit5aa6cf302c2758702348aab7457e516d3a5121b9 (patch)
treeb6bd87a9ae0d4d854e9f8e0c286ea9353f0b5445
parent1a3f7d98e5f50f21ce6fb1406a35531d9596c5c6 (diff)
spi: S3C24XX: reset register status on resume.
Fix a bug in the spi_s3c24xx driver where it does not reset the registers of the hardware when resuming from suspend (this block has been reset over suspend). 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.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 1c643c9e1f15..21661c7959c8 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -236,6 +236,19 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
236 return IRQ_HANDLED; 236 return IRQ_HANDLED;
237} 237}
238 238
239static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw)
240{
241 /* for the moment, permanently enable the clock */
242
243 clk_enable(hw->clk);
244
245 /* program defaults into the registers */
246
247 writeb(0xff, hw->regs + S3C2410_SPPRE);
248 writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
249 writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
250}
251
239static int __init s3c24xx_spi_probe(struct platform_device *pdev) 252static int __init s3c24xx_spi_probe(struct platform_device *pdev)
240{ 253{
241 struct s3c2410_spi_info *pdata; 254 struct s3c2410_spi_info *pdata;
@@ -327,15 +340,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
327 goto err_no_clk; 340 goto err_no_clk;
328 } 341 }
329 342
330 /* for the moment, permanently enable the clock */ 343 s3c24xx_spi_initialsetup(hw);
331
332 clk_enable(hw->clk);
333
334 /* program defaults into the registers */
335
336 writeb(0xff, hw->regs + S3C2410_SPPRE);
337 writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
338 writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
339 344
340 /* setup any gpio we can */ 345 /* setup any gpio we can */
341 346
@@ -415,7 +420,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
415{ 420{
416 struct s3c24xx_spi *hw = platform_get_drvdata(pdev); 421 struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
417 422
418 clk_enable(hw->clk); 423 s3c24xx_spi_initialsetup(hw);
419 return 0; 424 return 0;
420} 425}
421 426