diff options
author | Tomas Alvarez Vanoli <tomas.alvarez-vanoli@hitachienergy.com> | 2025-07-14 15:22:16 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-07-22 13:52:01 -0600 |
commit | b408cca7b765aa5a95fc41ad90c32685a93a08e3 (patch) | |
tree | 6d69f866e0407d6964a8b7e38278c17c2784f7f3 /test/py | |
parent | 23d2c182d4be9f993a4e4d8f4fc6293e4d5a9ff8 (diff) |
km: qrio: fix set_gpio read/modify/write
Setting GPIO by reading the value of the GPRT register, toggling the
correct bit and then writing it causes input values to transfer to the
output. Here's how (example):
1) set gpio 17 and 18 as input.
2) set gpio 17 output value to 0 (read gprt, change 17 to 0, write).
3) set gpio 18 output value to 0 (read gprt, change 18 to 0, write).
The problem here is that because we set 17 as input, and it's a pull-up,
when we read gprt in step 3, the bit 17 will be 1 and not 0.
Instead of doing read/write/modify, the solution is to keep track
internally of the user set GPIOs, and replace the read step with this
static variable.
Signed-off-by: Tomas Alvarez Vanoli <tomas.alvarez-vanoli@hitachienergy.com>
Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
Diffstat (limited to 'test/py')
0 files changed, 0 insertions, 0 deletions