gpio: bcm-virt: Fix the get() method
authorPhil Elwell <phil@raspberrypi.com>
Tue, 19 Oct 2021 10:23:43 +0000 (11:23 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:26 +0000 (16:04 +0000)
commit0024a8ea894a9df405b38371b468203ee3cfad8d
treebf8ce8daf0ae8137f75efa10db42e02161f4bd16
parent7fc105ad4420fcd89e397c6219e3a7a919900a08
gpio: bcm-virt: Fix the get() method

The get() method does not understand the on-the-wire encoding of the
remote GPIO states, thinking they are simple on/off bits when they are
really pairs of 16-bit counts. Rewrite the get() handler to return the
value last written, which will eventually match the actual GPIO state
if there are no other changes.

See: https://github.com/raspberrypi/linux/issues/4638

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/gpio/gpio-bcm-virt.c