Commit f138ca1373d7ec9fca33ae21f1b5ff3898fd493f
Committed by
Kim Phillips
1 parent
037e9d33db
Exists in
master
and in
57 other branches
mpc8xxx_spi: fix SPI support on MPC8308RDB
The MPC8308RDB Reference Manual states that no bits in the SPMODE register are allowed to change while the enable (EN) bit is set. This driver changes the character length bits (LEN) while the enable (EN) bit is set. Clearing the EN bit while changing the LEN bits makes the driver work correctly on MPC8308RDB. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
drivers/spi/mpc8xxx_spi.c
| ... | ... | @@ -124,6 +124,8 @@ |
| 124 | 124 | * len > 16 0 |
| 125 | 125 | */ |
| 126 | 126 | |
| 127 | + spi->mode &= ~SPI_MODE_EN; | |
| 128 | + | |
| 127 | 129 | if (bitlen <= 16) { |
| 128 | 130 | if (bitlen <= 4) |
| 129 | 131 | spi->mode = (spi->mode & 0xff0fffff) | |
| ... | ... | @@ -137,6 +139,8 @@ |
| 137 | 139 | bitlen -= 32; |
| 138 | 140 | dout += 4; |
| 139 | 141 | } |
| 142 | + | |
| 143 | + spi->mode |= SPI_MODE_EN; | |
| 140 | 144 | |
| 141 | 145 | spi->tx = tmpdout; /* Write the data out */ |
| 142 | 146 | debug("*** spi_xfer: ... %08x written\n", tmpdout); |