All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pxa2xx_spi: wait_rx_stall before deasserting CS on PIO mode
@ 2008-08-17 22:53 Daniel Ribeiro
       [not found] ` <6669365c0808171553i3f64b667t18fcea589d94411a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Ribeiro @ 2008-08-17 22:53 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi,

I am converting a driver from ssp.c API to pxa2xx_spi. But
when using PIO mode i am getting bogus rx data.

I did some tests, and it looks like CS is being deasserted
before the IO is done.

The following patch solved the issue for me.

Please CC me on replies, im not subscribed to spi-devel.

-- 
Daniel Ribeiro


-- patch --
pxa2xx_spi: wait_rx_stall before deasserting CS on PIO mode

Signed-off-by: Daniel Ribeiro <drwyrm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 0c452c4..4a9c34e 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -593,6 +593,10 @@ static void int_transfer_complete(struct
driver_data *drv_d {
        void __iomem *reg = drv_data->ioaddr;

+       if (wait_ssp_rx_stall(drv_data->ioaddr) == 0)
+               dev_err(&drv_data->pdev->dev,
+                       "interrupt_transfer: ssp rx stall failed\n");
+
        /* Stop SSP */
        write_SSSR(drv_data->clear_sr, reg);
        write_SSCR1(read_SSCR1(reg) & ~drv_data->int_cr1, reg);

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-09-12  2:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-17 22:53 [PATCH] pxa2xx_spi: wait_rx_stall before deasserting CS on PIO mode Daniel Ribeiro
     [not found] ` <6669365c0808171553i3f64b667t18fcea589d94411a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-17 22:59   ` Daniel Ribeiro
2008-08-18 18:53   ` Ned Forrester
     [not found]     ` <48A9C515.3000908-/d+BM93fTQY@public.gmane.org>
2008-08-18 19:27       ` Daniel Ribeiro
     [not found]         ` <6669365c0808181227k2fa01d6fu570cebc10630f55d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-18 20:47           ` Ned Forrester
     [not found]             ` <48A9DFD9.9000708-/d+BM93fTQY@public.gmane.org>
2008-08-18 23:06               ` Daniel Ribeiro
     [not found]                 ` <6669365c0808181606u4ead2f27h1f2286f9365e8a7a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-19  5:58                   ` Ned Forrester
2008-08-19  5:58                   ` Daniel Ribeiro
     [not found]                     ` <6669365c0808182258t6c4a5086xd9425435930e6d8f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-19  6:08                       ` Ned Forrester
2008-08-19 16:48                       ` Ned Forrester
2008-09-11 17:41           ` David Brownell
     [not found]             ` <200809111041.20900.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-12  1:53               ` Daniel Ribeiro
2008-09-12  2:53                 ` Ned Forrester
2008-09-12  2:59                 ` Ned Forrester

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.