summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-21 19:44:11 -0700
committerSimon Glass <sjg@chromium.org>2016-01-21 20:42:36 -0700
commite15af8e2cdb169b59945145a118a344b52d0ffa2 (patch)
tree4baaed94c2b8f932d445b661556b4dd95c0adabf
parent183a3a0f67162a2ac1f0f4c48288417c5a6e8538 (diff)
downloadtalos-obmc-uboot-e15af8e2cdb169b59945145a118a344b52d0ffa2.tar.gz
talos-obmc-uboot-e15af8e2cdb169b59945145a118a344b52d0ffa2.zip
rockchip: spi: Correct chip-enable code
At present there is an incorrect call to rkspi_enable_chip(). It should be disabling the chip, not enabling it. Correct this and ensure that the chip is disabled when releasing the bus. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/spi/rk_spi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index 35b528fa59..412fa8ba76 100644
--- a/drivers/spi/rk_spi.c
+++ b/drivers/spi/rk_spi.c
@@ -286,6 +286,11 @@ static int rockchip_spi_claim_bus(struct udevice *dev)
static int rockchip_spi_release_bus(struct udevice *dev)
{
+ struct udevice *bus = dev->parent;
+ struct rockchip_spi_priv *priv = dev_get_priv(bus);
+
+ rkspi_enable_chip(priv->regs, false);
+
return 0;
}
@@ -314,7 +319,7 @@ static int rockchip_spi_xfer(struct udevice *dev, unsigned int bitlen,
while (len > 0) {
int todo = min(len, 0xffff);
- rkspi_enable_chip(regs, true);
+ rkspi_enable_chip(regs, false);
writel(todo - 1, &regs->ctrlr1);
rkspi_enable_chip(regs, true);
OpenPOWER on IntegriCloud