From: eric miao Date: Fri, 23 Nov 2007 06:55:59 +0000 (+0800) Subject: [ARM] pxa: ensure SSP TX FIFO is empty instead of not full for pxa3xx X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=732ce16066964bb7b60947750e48374cc32bd310;p=linux-beck.git [ARM] pxa: ensure SSP TX FIFO is empty instead of not full for pxa3xx Signed-off-by: eric miao Signed-off-by: Russell King --- diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c index 575b662200a7..4954da907d42 100644 --- a/arch/arm/mach-pxa/ssp.c +++ b/arch/arm/mach-pxa/ssp.c @@ -138,6 +138,16 @@ int ssp_flush(struct ssp_dev *dev) struct ssp_device *ssp = dev->ssp; int timeout = TIMEOUT * 2; + /* ensure TX FIFO is empty instead of not full */ + if (cpu_is_pxa3xx()) { + while (__raw_readl(ssp->mmio_base + SSSR) & 0xf00) { + if (!--timeout) + return -ETIMEDOUT; + cpu_relax(); + } + timeout = TIMEOUT * 2; + } + do { while (__raw_readl(ssp->mmio_base + SSSR) & SSSR_RNE) { if (!--timeout)