diff options
Diffstat (limited to 'drivers/spi/mpc52xx_spi.c')
-rw-r--r-- | drivers/spi/mpc52xx_spi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c index ef8379b2c172..232225088bc1 100644 --- a/drivers/spi/mpc52xx_spi.c +++ b/drivers/spi/mpc52xx_spi.c | |||
@@ -391,6 +391,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
391 | struct mpc52xx_spi *ms; | 391 | struct mpc52xx_spi *ms; |
392 | void __iomem *regs; | 392 | void __iomem *regs; |
393 | int rc; | 393 | int rc; |
394 | u8 ctrl1; | ||
394 | 395 | ||
395 | /* MMIO registers */ | 396 | /* MMIO registers */ |
396 | dev_dbg(&op->dev, "probing mpc5200 SPI device\n"); | 397 | dev_dbg(&op->dev, "probing mpc5200 SPI device\n"); |
@@ -399,7 +400,8 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
399 | return -ENODEV; | 400 | return -ENODEV; |
400 | 401 | ||
401 | /* initialize the device */ | 402 | /* initialize the device */ |
402 | out_8(regs+SPI_CTRL1, SPI_CTRL1_SPIE | SPI_CTRL1_SPE | SPI_CTRL1_MSTR); | 403 | ctrl1 = SPI_CTRL1_SPIE | SPI_CTRL1_SPE | SPI_CTRL1_MSTR; |
404 | out_8(regs + SPI_CTRL1, ctrl1); | ||
403 | out_8(regs + SPI_CTRL2, 0x0); | 405 | out_8(regs + SPI_CTRL2, 0x0); |
404 | out_8(regs + SPI_DATADIR, 0xe); /* Set output pins */ | 406 | out_8(regs + SPI_DATADIR, 0xe); /* Set output pins */ |
405 | out_8(regs + SPI_PORTDATA, 0x8); /* Deassert /SS signal */ | 407 | out_8(regs + SPI_PORTDATA, 0x8); /* Deassert /SS signal */ |
@@ -409,6 +411,8 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
409 | * on the SPI bus. This fault will also occur if the SPI signals | 411 | * on the SPI bus. This fault will also occur if the SPI signals |
410 | * are not connected to any pins (port_config setting) */ | 412 | * are not connected to any pins (port_config setting) */ |
411 | in_8(regs + SPI_STATUS); | 413 | in_8(regs + SPI_STATUS); |
414 | out_8(regs + SPI_CTRL1, ctrl1); | ||
415 | |||
412 | in_8(regs + SPI_DATA); | 416 | in_8(regs + SPI_DATA); |
413 | if (in_8(regs + SPI_STATUS) & SPI_STATUS_MODF) { | 417 | if (in_8(regs + SPI_STATUS) & SPI_STATUS_MODF) { |
414 | dev_err(&op->dev, "mode fault; is port_config correct?\n"); | 418 | dev_err(&op->dev, "mode fault; is port_config correct?\n"); |