diff options
Diffstat (limited to 'drivers/spi/spi_s3c24xx.c')
-rw-r--r-- | drivers/spi/spi_s3c24xx.c | 25 |
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 | ||
239 | static 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 | |||
239 | static int __init s3c24xx_spi_probe(struct platform_device *pdev) | 252 | static 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 | ||