From: Sonic Zhang <sonic.adi@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 2/2] bfin: discard invalid data and clear RXS in bf5xx spi driver
Date: Mon, 4 Mar 2013 15:20:09 +0800 [thread overview]
Message-ID: <1362381609-23716-2-git-send-email-sonic.adi@gmail.com> (raw)
In-Reply-To: <1362381609-23716-1-git-send-email-sonic.adi@gmail.com>
From: Scott Jiang <scott.jiang.linux@gmail.com>
There may be dirty data in RDBR, so we should discard invalid data.
This operation also clears RXS bit in STAT register.
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/spi/bfin_spi.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index fff384a..1845e4f 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -250,6 +250,8 @@ void spi_release_bus(struct spi_slave *slave)
static int spi_pio_xfer(struct bfin_spi_slave *bss, const u8 *tx, u8 *rx,
uint bytes)
{
+ /* discard invalid data and clear RXS */
+ read_SPI_RDBR(bss);
/* todo: take advantage of hardware fifos */
while (bytes--) {
u8 value = (tx ? *tx++ : CONFIG_BFIN_SPI_IDLE_VAL);
--
1.7.0.4
next prev parent reply other threads:[~2013-03-04 7:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 7:20 [U-Boot] [PATCH v1 1/2] bfin: Remove spi dma function in bf5xx Sonic Zhang
2013-03-04 7:20 ` Sonic Zhang [this message]
2013-03-12 11:19 ` Mike Frysinger
2013-03-13 3:13 ` Scott Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362381609-23716-2-git-send-email-sonic.adi@gmail.com \
--to=sonic.adi@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.