]> git.sur5r.net Git - u-boot/commitdiff
rockchip: spi: Correct chip-enable code
authorSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 02:44:11 +0000 (19:44 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 03:42:36 +0000 (20:42 -0700)
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>
drivers/spi/rk_spi.c

index 35b528fa59d6d059a1c5f8d6c1813da1637265b3..412fa8ba768fa63b6ea7b9d24a29bfaf19941ddf 100644 (file)
@@ -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);