aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-29 19:48:07 -0400
committerMark Brown <broonie@linaro.org>2014-03-29 20:48:12 -0400
commit0b73aa63c193006c3d503d4903dd4792a26e1d50 (patch)
treeaf2028d5db595790560568aa155973090cfca3bd /drivers/spi/spi.c
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
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>
Diffstat (limited to 'drivers/spi/spi.c')
-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,
591 struct spi_message *msg) 591 struct spi_message *msg)
592{ 592{
593 struct spi_transfer *xfer; 593 struct spi_transfer *xfer;
594 bool cur_cs = true;
595 bool keep_cs = false; 594 bool keep_cs = false;
596 int ret = 0; 595 int ret = 0;
597 596
@@ -627,8 +626,9 @@ static int spi_transfer_one_message(struct spi_master *master,
627 &msg->transfers)) { 626 &msg->transfers)) {
628 keep_cs = true; 627 keep_cs = true;
629 } else { 628 } else {
630 cur_cs = !cur_cs; 629 spi_set_cs(msg->spi, false);
631 spi_set_cs(msg->spi, cur_cs); 630 udelay(10);
631 spi_set_cs(msg->spi, true);
632 } 632 }
633 } 633 }
634 634