]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
[gpiospi] add clock delay to avoid smashing of bits
authormizhka <mizhka@FreeBSD.org>
Tue, 13 Dec 2016 10:03:29 +0000 (10:03 +0000)
committermizhka <mizhka@FreeBSD.org>
Tue, 13 Dec 2016 10:03:29 +0000 (10:03 +0000)
Submitted by: Hiroki Mori <yamori83@yahoo.co.jp>
Reviewed by: loos, ray, mizhka
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8749

sys/dev/gpio/gpiospi.c

index ea867eb605c115d14e52453ae0a8b2dbd6f51f8b..840241385bfcae972e2e35f3299406a70abdee38 100644 (file)
@@ -293,6 +293,7 @@ gpio_spi_txrx(struct gpio_spi_softc *sc, int cs, int mode, uint8_t data)
                        gpio_delay(sc);
                        GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev,
                            sc->sc_sclk, 1);
+                       gpio_delay(sc);
                } else {
                        /* If mode 0 or 3 */
 
@@ -312,6 +313,7 @@ gpio_spi_txrx(struct gpio_spi_softc *sc, int cs, int mode, uint8_t data)
                        gpio_delay(sc);
                        GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev,
                            sc->sc_sclk, 0);
+                       gpio_delay(sc);
                }
        }