[gpiospi] add clock delay to avoid smashing of bits

Submitted by:	Hiroki Mori <yamori83@yahoo.co.jp>
Reviewed by:	loos, ray, mizhka
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8749
This commit is contained in:
Michael Zhilin 2016-12-13 10:03:29 +00:00
parent 167a228d79
commit d1c38239e8

View 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);
}
}