Skip to content

Commit 79c7463

Browse files
authored
allwinner: Update pull-up/down registers using OR logic (#20)
1 parent 712a469 commit 79c7463

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

allwinner/gpio.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ func (p *Pin) In(pull gpio.Pull, edge gpio.Edge) error {
270270
drvGPIO.gpioMemory.groups[p.group].pull[off] &^= 3 << shift
271271
switch pull {
272272
case gpio.PullDown:
273-
drvGPIO.gpioMemory.groups[p.group].pull[off] = 2 << shift
273+
drvGPIO.gpioMemory.groups[p.group].pull[off] |= 2 << shift
274274
case gpio.PullUp:
275-
drvGPIO.gpioMemory.groups[p.group].pull[off] = 1 << shift
275+
drvGPIO.gpioMemory.groups[p.group].pull[off] |= 1 << shift
276276
default:
277277
}
278278
}

allwinner/gpio_pl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ func (p *PinPL) In(pull gpio.Pull, edge gpio.Edge) error {
231231
drvGPIOPL.gpioMemoryPL.pull[off] &^= 3 << shift
232232
switch pull {
233233
case gpio.PullDown:
234-
drvGPIOPL.gpioMemoryPL.pull[off] = 2 << shift
234+
drvGPIOPL.gpioMemoryPL.pull[off] |= 2 << shift
235235
case gpio.PullUp:
236-
drvGPIOPL.gpioMemoryPL.pull[off] = 1 << shift
236+
drvGPIOPL.gpioMemoryPL.pull[off] |= 1 << shift
237237
default:
238238
}
239239
}

0 commit comments

Comments
 (0)