aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_s3c24xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi_s3c24xx.c')
-rw-r--r--drivers/spi/spi_s3c24xx.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index ec282aa92aaa..89da39f02d68 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;
@@ -270,6 +283,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
270 /* setup the master state. */ 283 /* setup the master state. */
271 284
272 master->num_chipselect = hw->pdata->num_cs; 285 master->num_chipselect = hw->pdata->num_cs;
286 master->bus_num = pdata->bus_num;
273 287
274 /* setup the state for the bitbang driver */ 288 /* setup the state for the bitbang driver */
275 289
@@ -326,15 +340,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
326 goto err_no_clk; 340 goto err_no_clk;
327 } 341 }
328 342
329 /* for the moment, permanently enable the clock */ 343 s3c24xx_spi_initialsetup(hw);
330
331 clk_enable(hw->clk);
332
333 /* program defaults into the registers */
334
335 writeb(0xff, hw->regs + S3C2410_SPPRE);
336 writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
337 writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
338 344
339 /* setup any gpio we can */ 345 /* setup any gpio we can */
340 346
@@ -414,7 +420,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
414{ 420{
415 struct s3c24xx_spi *hw = platform_get_drvdata(pdev); 421 struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
416 422
417 clk_enable(hw->clk); 423 s3c24xx_spi_initialsetup(hw);
418 return 0; 424 return 0;
419} 425}
420 426