diff options
Diffstat (limited to 'drivers/spi/spi_imx.c')
-rw-r--r-- | drivers/spi/spi_imx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index 89c22efedfb0..1b17f443dee7 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c | |||
@@ -44,6 +44,9 @@ | |||
44 | #define MXC_CSPIINT 0x0c | 44 | #define MXC_CSPIINT 0x0c |
45 | #define MXC_RESET 0x1c | 45 | #define MXC_RESET 0x1c |
46 | 46 | ||
47 | #define MX3_CSPISTAT 0x14 | ||
48 | #define MX3_CSPISTAT_RR (1 << 3) | ||
49 | |||
47 | /* generic defines to abstract from the different register layouts */ | 50 | /* generic defines to abstract from the different register layouts */ |
48 | #define MXC_INT_RR (1 << 0) /* Receive data ready interrupt */ | 51 | #define MXC_INT_RR (1 << 0) /* Receive data ready interrupt */ |
49 | #define MXC_INT_TE (1 << 1) /* Transmit FIFO empty interrupt */ | 52 | #define MXC_INT_TE (1 << 1) /* Transmit FIFO empty interrupt */ |
@@ -593,6 +596,11 @@ static int __init spi_imx_probe(struct platform_device *pdev) | |||
593 | if (!cpu_is_mx31() || !cpu_is_mx35()) | 596 | if (!cpu_is_mx31() || !cpu_is_mx35()) |
594 | writel(1, spi_imx->base + MXC_RESET); | 597 | writel(1, spi_imx->base + MXC_RESET); |
595 | 598 | ||
599 | /* drain receive buffer */ | ||
600 | if (cpu_is_mx31() || cpu_is_mx35()) | ||
601 | while (readl(spi_imx->base + MX3_CSPISTAT) & MX3_CSPISTAT_RR) | ||
602 | readl(spi_imx->base + MXC_CSPIRXDATA); | ||
603 | |||
596 | spi_imx->intctrl(spi_imx, 0); | 604 | spi_imx->intctrl(spi_imx, 0); |
597 | 605 | ||
598 | ret = spi_bitbang_start(&spi_imx->bitbang); | 606 | ret = spi_bitbang_start(&spi_imx->bitbang); |