summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-29 23:48:07 +0000
committerMark Brown <broonie@linaro.org>2014-03-30 00:48:12 +0000
commit0b73aa63c193006c3d503d4903dd4792a26e1d50 (patch)
treeaf2028d5db595790560568aa155973090cfca3bd
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
downloadblackbird-op-linux-0b73aa63c193006c3d503d4903dd4792a26e1d50.tar.gz
blackbird-op-linux-0b73aa63c193006c3d503d4903dd4792a26e1d50.zip
spi: Fix handling of cs_change in core implementation
The core implementation of cs_change didn't follow the documentation which says that cs_change in the middle of the transfer means to briefly deassert chip select, instead it followed buggy drivers which change the polarity of chip select. Use a delay of 10us between deassert and reassert simply from pulling numbers out of a hat. Reported-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/spi/spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 23756b0f9036..5d826f047714 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -591,7 +591,6 @@ static int spi_transfer_one_message(struct spi_master *master,
struct spi_message *msg)
{
struct spi_transfer *xfer;
- bool cur_cs = true;
bool keep_cs = false;
int ret = 0;
@@ -627,8 +626,9 @@ static int spi_transfer_one_message(struct spi_master *master,
&msg->transfers)) {
keep_cs = true;
} else {
- cur_cs = !cur_cs;
- spi_set_cs(msg->spi, cur_cs);
+ spi_set_cs(msg->spi, false);
+ udelay(10);
+ spi_set_cs(msg->spi, true);
}
}
OpenPOWER on IntegriCloud