Skip to content

bindings: python: more flexible reconfigure_lines()

Kent Gibson linux-gpio 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3bindings: python: tests: extend reconfiguration testsbindings/python/tests/tests_line_request.py+50 -00 replies
2/3bindings: python: more flexible reconfigure_lines()bindings/python/gpiod/line_request.py+10 -70 replies
3/3bindings: python: tests: add coverage of kernel reconfigure as-is behaviourbindings/python/tests/tests_line_request.py+12 -23 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [libgpiod][PATCH 0/3] bindings: python: more flexible reconfigure_lines()

This series addresses issue #54[1], making reconfigure_lines() less restrictive in the configurations it will accept, allowing for misordered configurations and reconfiguring a subset of lines.

Patch 1 adds a set of tests for the new behaviour. These all fail with the existing bindings, but pass after patch 2 is applied.

Patch 2 is the change to reconfigure_lines() itself.

The reconfiguration of a subset of lines works better with a change to the kernel to ignore reconfiguration of lines without a direction set, i.e. a default LineSettings.
With existing kernels, if a line has been requested with flags set to non-default values those flags will be reset to default values, though that may not become evident electrically until subsequent operations are performed on the line.

Patch 3 extends the tests to demonstrate that kernel issue. A kernel patch addressing that issue has been submitted[2], and the test passes with that patch applied.

Cheers,
Kent.

[1] https://github.com/brgl/libgpiod/issues/54
[2] https://lore.kernel.org/linux-gpio/[email protected]

Kent Gibson (3):
bindings: python: tests: extend reconfiguration tests
bindings: python: more flexible reconfigure_lines()
bindings: python: tests: add coverage of kernel reconfigure as-is
behaviour

 bindings/python/gpiod/line_request.py       | 17 +++---
 bindings/python/tests/tests_line_request.py | 64 ++++++++++++++++++++-
 2 files changed, 72 insertions(+), 9 deletions(-)

--
2.39.2