Write to the correct GPIO registers.

Offset 0 is the direction register, not the data register.

MFC after:	1 week
This commit is contained in:
Justin Hibbits 2016-11-15 04:49:26 +00:00
parent 97fc5dbe89
commit e5c491ad33

View File

@ -173,7 +173,7 @@ qoriq_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value)
outvals = bus_read_4(sc->sc_mem, GPIO_GPDAT);
outvals &= ~(1 << pinbit);
outvals |= (value << pinbit);
bus_write_4(sc->sc_mem, 0, outvals);
bus_write_4(sc->sc_mem, GPIO_GPDAT, outvals);
GPIO_UNLOCK(sc);
@ -208,7 +208,7 @@ qoriq_gpio_pin_toggle(device_t dev, uint32_t pin)
val = bus_read_4(sc->sc_mem, GPIO_GPDAT);
val ^= (1 << (31 - pin));
bus_write_4(sc->sc_mem, 0, val);
bus_write_4(sc->sc_mem, GPIO_GPDAT, val);
GPIO_UNLOCK(sc);