Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176178
b: refs/heads/master
c: ce1807b
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Mack authored and Grant Likely committed Dec 9, 2009
1 parent 2f18357 commit af34aad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d33c861e71c57dd69d39d88b84a672adf86a2144
refs/heads/master: ce1807b2e527979bd77d8a1a1768a6365f3febb5
8 changes: 8 additions & 0 deletions trunk/drivers/spi/spi_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
#define MXC_CSPIINT 0x0c
#define MXC_RESET 0x1c

#define MX3_CSPISTAT 0x14
#define MX3_CSPISTAT_RR (1 << 3)

/* generic defines to abstract from the different register layouts */
#define MXC_INT_RR (1 << 0) /* Receive data ready interrupt */
#define MXC_INT_TE (1 << 1) /* Transmit FIFO empty interrupt */
Expand Down Expand Up @@ -593,6 +596,11 @@ static int __init spi_imx_probe(struct platform_device *pdev)
if (!cpu_is_mx31() || !cpu_is_mx35())
writel(1, spi_imx->base + MXC_RESET);

/* drain receive buffer */
if (cpu_is_mx31() || cpu_is_mx35())
while (readl(spi_imx->base + MX3_CSPISTAT) & MX3_CSPISTAT_RR)
readl(spi_imx->base + MXC_CSPIRXDATA);

spi_imx->intctrl(spi_imx, 0);

ret = spi_bitbang_start(&spi_imx->bitbang);
Expand Down

0 comments on commit af34aad

Please sign in to comment.