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:
parent
97fc5dbe89
commit
e5c491ad33
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user