Commit 5aa6cf30 authored by Ben Dooks's avatar Ben Dooks Committed by Linus Torvalds

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: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1a3f7d98
...@@ -236,6 +236,19 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev) ...@@ -236,6 +236,19 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw)
{
/* for the moment, permanently enable the clock */
clk_enable(hw->clk);
/* program defaults into the registers */
writeb(0xff, hw->regs + S3C2410_SPPRE);
writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
}
static int __init s3c24xx_spi_probe(struct platform_device *pdev) static int __init s3c24xx_spi_probe(struct platform_device *pdev)
{ {
struct s3c2410_spi_info *pdata; struct s3c2410_spi_info *pdata;
...@@ -327,15 +340,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev) ...@@ -327,15 +340,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
goto err_no_clk; goto err_no_clk;
} }
/* for the moment, permanently enable the clock */ s3c24xx_spi_initialsetup(hw);
clk_enable(hw->clk);
/* program defaults into the registers */
writeb(0xff, hw->regs + S3C2410_SPPRE);
writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
/* setup any gpio we can */ /* setup any gpio we can */
...@@ -415,7 +420,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev) ...@@ -415,7 +420,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
{ {
struct s3c24xx_spi *hw = platform_get_drvdata(pdev); struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
clk_enable(hw->clk); s3c24xx_spi_initialsetup(hw);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment