Bartosz Golaszewski
67e59a83a7
bindings: python: gpiod v2.2.4
...
Changelog:
- fix tests failing after a kernel fix to gpio-sim
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
python-v2.2.4
2025-02-11 14:10:11 +01:00
Bartosz Golaszewski
9a6c643175
bindings: python: tests: disable device before releasing the bank
...
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") uncovered an issue in Python bindings
tests where the GPIO simulator device is not disabled before removing its
configfs entries. Reorder the operations in chip_finalize() in order to
disable the device first (if needed) before releasing any other
resources.
Link: https://lore.kernel.org/r/20250203-fix-gpiosim-in-bindings-v1-2-d2c9e0f3a29d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2025-02-05 11:01:48 +01:00
Bartosz Golaszewski
7450b2a365
bindings: python: gpiod v2.2.3
...
Small bugfix release.
Changelog:
- remove unused import from chip.py
- fix potential crash due to invalid usage of PyDict_Next()
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
python-v2.2.3
2024-12-20 17:50:52 +01:00
George Harker
b91fd36941
bindings: python: fix potential PyDict_Next() crash
...
PyDict_Next() does not guarantee pos is contiguous, and pypy increments
it past the end of the dict size. Fix reliance on pos for constructing
args for libgpiod call.
Fixes: b7ba732e6a ("treewide: libgpiod v2 implementation")
Signed-off-by: George Harker <george@george-graphics.co.uk >
Link: https://lore.kernel.org/r/20241202171302.51437-1-george@george-graphics.co.uk
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-12-02 20:48:54 +01:00
Bartosz Golaszewski
a93a67648b
bindings: python: chip: remove unused import
...
We no longer use the select module directly in chip.py so drop the
unneeded import.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-11-13 12:30:31 +01:00
Bartosz Golaszewski
2371df4671
bindings: python: gpiod v2.2.2
...
Minor gpiod package release.
Changelog:
- fix Chip.request_lines() typing
- improve the output of LineSettings.__repr__()
- import gpiod attributes in external module
- specify a tar extract filter for python >= 3.12
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
python-v2.2.2
2024-11-12 15:17:56 +01:00
Vincent Fazio
b89a90aaed
bindings: python: specify a tar extract filter
...
Starting in Python 3.12, extracting files from tarballs without a filter
specified generates a DeprecationWarning [0].
For Python >= 3.12, specify the `fully_trusted_filter` filter which
replicates the behavior from previous versions.
This filter also makes sense as we should be able to trust the tarball
the maintainers generate after the hash has been verified.
[0]: https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com >
Link: https://lore.kernel.org/r/20241107205001.574426-1-vfazio@xes-inc.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-11-12 14:01:04 +01:00
Vincent Fazio
9e2795b90b
bindings: python: import gpiod attributes in external module
...
Previously, the external module relied on gpiod attributes being present
within `globals()` to construct return values back to the caller.
This assumption required callers of the external module to have imported
the attributes to populate `globals()` for the interface to work.
Having this implicit contract is opaque and prone to causing issues if
imports within gpiod modules ever get reworked.
Now, the external module explicitly imports attributes from gpiod in
order to return values back to the caller.
There should be no concern about circular imports as the external module
should be completely imported by the time callers call into it.
Since Py_gpiod_GetGlobalType is no longer used, it has been replaced
with Py_gpiod_GetModuleAttrString which returns a new PyObject*
reference for the named module and attribute that must be decremented
when no longer in use.
Closes: https://github.com/brgl/libgpiod/issues/101
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com >
Link: https://lore.kernel.org/r/20241008175139.1198980-1-vfazio@xes-inc.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-10-14 16:44:59 +02:00
Bartosz Golaszewski
f496cb942e
bindings: python: improve LineSettings.__repr__()
...
Currently, for the output of LineSettings.__repr__() to be eval()able,
the user must have pulled all the relevant definitions from gpiod.line
within the scope where it is used. Modify the output so that all the user
needs is `import gpiod`.
Reported-by: Vincent Fazio <vfazio@gmail.com >
Link: https://lore.kernel.org/r/20240920143203.6377-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-09-27 10:14:04 +02:00
Vincent Fazio
c249c05a84
bindings: python: fix Chip.request_lines() typing
...
The output_values argument was typed as a dict of tuples, however, the
code expects a dict of int|str.
Fixes: 27a69b0bfd ("bindings: python: add the output_values argument to Chip.request_lines()")
Closes: https://github.com/brgl/libgpiod/issues/96
Signed-off-by: Vincent Fazio <vfazio@gmail.com >
Link: https://lore.kernel.org/r/20240914183352.16090-1-vfazio@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-09-16 08:54:17 +02:00
Bartosz Golaszewski
e8e38dc67d
bindings: python: gpiod v2.2.1
...
Minor gpiod package release.
Changelog:
- fix requesting lines by name with multiple entries
- fix a use-after-free bug in python bindings
- fix passing the event clock property to line requests in python bindings
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
python-v2.2.1
2024-08-01 14:32:54 +02:00
Benjamin Cabé
c3be23d6d1
bindings: python: properly pass event clock settings
...
Python binding was ignoring event_clock line setting.
Signed-off-by: Benjamin Cabé <kartben@gmail.com >
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240731104658.93117-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-08-01 10:33:50 +02:00
Iker Pedrosa
cdda65e3d7
bindings: python: fix a use-after-free bug
...
`req_cfg` variable is freed and then used, which would generate an
error. Avoid this problem by freeing when the variable will no longer be
used.
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com >
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/3d8b12dd60eec59d4184c0bcc7d575b4eccbc22c.1722250385.git.ikerpedrosam@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-08-01 10:33:44 +02:00
Chuang Zhu
a1617c2f61
bindings: python: fix line request by name with multiple entries
...
When multiple entries are requested using line names in
Chip.request_lines(), only the the last entry is added to
LineRequest._name_map, causing a ValueError when trying to use functions
like LineRequest.set_value() on any former entries.
Move the required variables to the correct scope.
Signed-off-by: Chuang Zhu <git@chuang.cz >
[Bartosz: tweak the commit message]
Co-developed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240710125719.33655-2-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-08-01 10:33:35 +02:00
Bartosz Golaszewski
db68634b73
bindings: python: gpiod v2.2.0
...
Minor gpiod package release.
Changelog:
- add a script for generating sdist and wheels
- fix make build
- support casting of line.Value to bool
- test fixes
- fix __repr__() implementations
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-18 22:23:31 +02:00
Bartosz Golaszewski
d7f2bb23b5
README: add mentions on shellcheck and reuse
...
Extend the "Contributing" section of the README to include mentions of
shell scripts having to pass the `shellcheck` test and the entire tree
having to conform to `reuse lint` requirements.
Link: https://lore.kernel.org/r/20240613140117.39048-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-14 09:20:34 +02:00
Vincent Fazio
72d2fa01a2
bindings: python: add script to generate sdist and wheels
...
Introduce a shell script that generates an sdist tarball and PEP 600/656
conformant wheels.
The wheels are generated via cibuildwheel, a tool provided by the Python
Packaging Authority (PyPA) [0]. The tool leverages toolchains within
containers maintained by PyPA [1] to generate wheels that are runnable
on hosts that meet the platform compatibility tag [2] requirements.
By default, the script creates X86_64 and AArch64 CPython 3.9-3.12
wheels for glibc and musl libc based systems.
These defaults can be overridden via CIBW_* environment variables [3].
[0]: https://cibuildwheel.pypa.io/en/stable/
[1]: https://github.com/pypa/manylinux/
[2]: https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/
[3]: https://cibuildwheel.pypa.io/en/stable/options/#options-summary
Signed-off-by: Vincent Fazio <vfazio@gmail.com >
Link: https://lore.kernel.org/r/20240611205041.1448276-1-vfazio@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-12 20:15:21 +02:00
Kent Gibson
37f3676cef
tools: tests: avoid splitting and globbing
...
Fix shellcheck SC2046[1], SC2068[2], SC2068[3] and SC2206[4], all of
which are related to avoiding word splitting and globbing.
[1] https://www.shellcheck.net/wiki/SC2046
[2] https://www.shellcheck.net/wiki/SC2068
[3] https://www.shellcheck.net/wiki/SC2086
[4] https://www.shellcheck.net/wiki/SC2206
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-9-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Kent Gibson
2f140aed7d
tools: tests: shellcheck don't follow sourced file
...
Fix shellcheck SC1091 - not following.
Use a directive to prevent shellcheck complaining about sourcing
shunit2, which we don't care to check.
[1] https://www.shellcheck.net/wiki/SC1091
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-8-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Kent Gibson
934adda133
tools: tests: check exit code directly
...
Fix shellcheck SC2181[1] - check exit code directly.
[1] https://www.shellcheck.net/wiki/SC2181
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-7-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Kent Gibson
45f2d4ba38
tools: tests: don't use variables in printf format string
...
Fix shellcheck SC2059[1] - don't use variables in the printf format
string.
[1] https://www.shellcheck.net/wiki/SC2059
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-6-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Kent Gibson
48f634ab57
tools: tests: use read -r to avoid mangling backslashes
...
Fix shellcheck SC2162[1] - read without -r will mangle backslashes.
[1] https://www.shellcheck.net/wiki/SC2162
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-5-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Kent Gibson
a88ed2f9bf
tools: tests: fix unused variables
...
Fix shellckeck SC2034[1] - foo appears unused.
Prefix intentionally unused variables with "_" and remove variables
not actually used.
[1] https://www.shellcheck.net/wiki/SC2034
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-4-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Kent Gibson
57ed5cfe66
tools: tests: declare and assign separately
...
Fix shellcheck SC2155[1] - declare and assign separately to avoid
masking return values.
[1] https://www.shellcheck.net/wiki/SC2155
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-3-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Kent Gibson
ee9751a07d
tools: tests: don't mix string and array
...
Fix shellcheck SC2145[1] - argument mixes string and array.
Separate the command from the array of arguments to avoid mixing.
[1] https://www.shellcheck.net/wiki/SC2145
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240603115628.102616-2-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 14:02:35 +02:00
Khem Raj
95a2eb76bf
bindings: cxx: Migrate C++ tests to use Catch2 v3
...
Catch2 v3.x has API changes which needs to be addressed
in the tests themselves, hence this changeset is to fix
those.
Signed-off-by: Khem Raj <raj.khem@gmail.com >
Link: https://lore.kernel.org/r/20240531184223.3949069-1-raj.khem@gmail.com
[Bartosz: added a version requirement (>= 3.0) for catch2 to configure.ac]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-06-03 11:36:22 +02:00
Bartosz Golaszewski
b569b91ce1
tools: tests: remove dependency on grep
...
We only use grep in one place where we don't really need it as we can use
find directly.
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Suggested-by: Kent Gibson <warthog618@gmail.com >
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-4-e9b5be2ba8bf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-29 15:32:00 +02:00
Bartosz Golaszewski
d75d591af7
tools: tests: remove unneeded ';' in while loops
...
We're already breaking the line between while and do so there's no need
for the ';' character.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-3-e9b5be2ba8bf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-29 15:32:00 +02:00
Bartosz Golaszewski
4fae395c7c
tools: tests: use "$@" instead of $*
...
$@ does not break up quoted arguments which is what we want in all cases
in the bash test-suite. Use it instead of $*. While at it: prevent
globbing with double quotes but allow variable expansion.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-2-e9b5be2ba8bf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-29 15:32:00 +02:00
Bartosz Golaszewski
649b2baedd
tools: tests: use tabs for indentation consistently
...
Replace all spaces used for indentation with tabs.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-1-e9b5be2ba8bf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-29 15:32:00 +02:00
Kent Gibson
dee10f0807
bindings: python: fix python-tests-run make target
...
The python-tests-run target is broken as it does not correctly split
lines. It also calls Python directly rather then through the $PYTHON
variable.
Fix the line splitting and call Python using the $PYTHON variable.
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240526113234.253859-3-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-28 11:13:15 +02:00
Kent Gibson
8635780c1c
bindings: python: add Testing section to README
...
Add a section describing how to run the test suite.
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240526113234.253859-2-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-28 11:13:15 +02:00
Bartosz Golaszewski
27fe10150f
bindings: python: tests: run the Value cast test with the rest of the suite
...
Make the new test file for line definitions part of the entire test-suite
for python bindings.
Fixes: c8e3ae0499 ("bindings: python: tests: add test for casting line.Value to bool")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-23 10:08:31 +02:00
Kent Gibson
c8e3ae0499
bindings: python: tests: add test for casting line.Value to bool
...
The line.Value represents the logical line state, so intuitively you
would expect it to be able to be cast to bool, with ACTIVE
corresponding to True, and INACTIVE to False.
Add a test that line.Value can be cast to bool.
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240522004643.96863-2-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-23 09:51:53 +02:00
Kent Gibson
5f9152b0ca
bindings: python: support casting line.Value to bool
...
Python types default to being truthy when cast to bool, so casting
line.Value to bool always returns True.
Add a line.Value.__bool__() operator to map the line value to bool as
one would intuitively expect, so ACTIVE is True and INACTIVE is False.
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240522004643.96863-3-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-23 09:51:53 +02:00
Bartosz Golaszewski
47424e1ab4
TODO: add a task for migrating C++ tests to Catch2 v3
...
Current Catch2 release is v3.6. C++ tests in libgpiod still use v2.x.
Catch2 v2 and v3 are not compatible and the tests must be migrated to
the most recent major release. Add a task for it to TODO.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-23 09:36:14 +02:00
Bartosz Golaszewski
3ece522b8d
bindings: python: tests: fix invalid syntax warnings
...
Use double '/' for escaping regex special characters for patterns in
python strings to silence the following warnings:
bindings/python/tests/tests_edge_event.py:211: SyntaxWarning: invalid escape sequence '\.'
"<EdgeEvent type=Type\.RISING_EDGE timestamp_ns=[0-9]+ line_offset=0 global_seqno=1 line_seqno=1>",
bindings/python/tests/tests_info_event.py:188: SyntaxWarning: invalid escape sequence '\.'
'<InfoEvent type=Type\.LINE_REQUESTED timestamp_ns=[0-9]+ line_info=<LineInfo offset=0 name="None" used=True consumer="\?" direction=Direction\.INPUT active_low=False bias=Bias\.UNKNOWN drive=Drive\.PUSH_PULL edge_detection=Edge\.NONE event_clock=Clock\.MONOTONIC debounced=False debounce_period=0:00:00>>',
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-22 20:07:34 +02:00
Kent Gibson
0a552e7908
tests: add enable_debounce_then_edge_detection
...
A bug was recently discovered in the kernel that can result in the edge
event fifo not being correctly initialised and stack contents being
returned in edge events. The trigger for the bug is requesting a line with
debounce, but not edge detection, and then reconfiguring the line to
enable edge detection.
Add a test case that triggers the bug. This will fail on kernels that
do not contain the fix for the bug. The test is located in a new test
file, tests-kernel-uapi.c, intended to contain tests specifically
testing some aspect of the kernel uAPI, not libgpiod itself.
Signed-off-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240513160031.309139-1-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-15 10:59:52 +02:00
Bartosz Golaszewski
4caa127fe5
build: drop the LGPL-3.0 license file from EXTRA_DIST
...
The release tarball building is currently broken because it looks for
a file that no longer exists. Drop the LGPL-3.0 license file from
EXTRA_DIST.
Fixes: 76ecc337c5 ("licensing: relicense C++ bindings under LGPL-2.1-or-later")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-13 11:25:31 +02:00
Bartosz Golaszewski
35003a821e
tools: tests: accept the new gpio-sim label format in test cases
...
Since kernel commit 840a97e2fbaf ("gpio: sim: delimit the fwnode name
with a ":" when generating labels") the gpio-sim automatic labels are
generated by delimiting the device name and the fwnode name with ':'
instead of '-' for better readability. This will break the tests once
linux v6.9 is out. Act in advance and accept both forms.
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240506162506.176935-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-05-07 11:19:59 +02:00
Bartosz Golaszewski
c34a572c53
tools: add minutes as a new supported time unit
...
Make it more convenient to specify longer time periods in gpio-tools by
introducing minutes as the new time unit.
Link: https://lore.kernel.org/r/20240423100452.32958-5-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-24 09:55:36 +02:00
Bartosz Golaszewski
e943b144d5
tools: allow longer time periods
...
We currently store time as microseconds in 32-bit integers and allow
seconds as the longest time unit when parsing command-line arguments
limiting the time period possible to specify when passing arguments such
as --hold-period to 35 minutes. Let's use 64-bit integers to vastly
increase that.
Use nanosleep() instead of usleep() to extend the possible sleep time
range.
Reported-by: Gunnar Thörnqvist <gunnar@igl.se >
Link: https://lore.kernel.org/r/20240423100452.32958-4-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-24 09:55:36 +02:00
Bartosz Golaszewski
bb5a2bbf5d
tools: use ppoll() where higher timeout resolution makes sense
...
We allow timeout units to be specified in microseconds but for poll() we
need to round them up to milliseconds. Switch to ppoll() to avoid losing
precision.
Reviewed-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240423100452.32958-3-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-24 09:55:36 +02:00
Bartosz Golaszewski
9df101d6d6
tools: rename timeout to idle_timeout in gpiomon and gpionotify
...
Use a more meaningful name for the variable storing the idle timeout
value.
Suggested-by: Kent Gibson <warthog618@gmail.com >
Link: https://lore.kernel.org/r/20240423100452.32958-2-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-24 09:55:36 +02:00
Bartosz Golaszewski
4f0953c4da
doc: add a file explaining the contribution process in detail
...
Add a separate document explaining the contribution process for libgpiod
with emphasis on the Developer's Certificate of Origin.
I based the text of this document on the one written by Grant Likely[1]
and adjusted it for libgpiod.
[1] https://github.com/glikely/obs-ptz/blob/main/CONTRIBUTING.md
Suggested-by: Grant Likely <grant.likely@linaro.org >
Acked-by: Grant Likely <grant.likely@linaro.org >
Link: https://lore.kernel.org/r/20240416212141.6683-3-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-22 14:09:52 +02:00
Bartosz Golaszewski
76ecc337c5
licensing: relicense C++ bindings under LGPL-2.1-or-later
...
Commit ea84f882d5 ("licensing: relicense C++ library code under
LGPL-3.0-or-later") changed the license of C++ bindings in order to
solve potential issues with code generated from templates[1], default
implementations, etc. However this change makes the bindings less
attractive to projects that have strict licensing restrictions and avoid
GPL-3.0 code[2].
After talking to Grant Likely I decided that the best approach is to
make the bindings available under LGPL-v2.1-or-later and simply let the
end user decide which version's text to apply.
While at it: tweak the README to also mention that examples are provided
under GPL-2.0-or-later.
Link: [1] https://www.spinics.net/lists/linux-gpio/msg46605.html
Link: [2] https://github.com/brgl/libgpiod/issues/72
Suggested-by: Walter Lozano <walter.lozano@collabora.com >
Suggested-by: Grant Likely <grant.likely@linaro.org >
Acked-by: Kent Gibson <warthog618@gmail.com >
Acked-by: Kevin Hilman <khilman@baylibre.com >
Acked-by: Grant Likely <grant.likely@linaro.org >
Link: https://lore.kernel.org/r/20240416212141.6683-2-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-22 14:04:19 +02:00
Bartosz Golaszewski
6c3d0b644c
build: fix configure error messages on missing functions
...
Fix three incorrect messages that report missing library functions as
required to build the core library when they are actually needed to build
the gpio-tools.
Fixes: 9e69d7552c ("configure: improve the header and library function checks")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-10 09:46:36 +02:00
Bartosz Golaszewski
9845bf82d9
README: remove out-of-date information on python bindings
...
The way Python bindings are built has changed and the information in the
README file is now outdated. Remove the no longer valid bits and - while
at it - point the readers to sub-READMEs for Python and Rust bindings.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-08 14:24:14 +02:00
Bartosz Golaszewski
144214dfc1
doc: fix doc text alignment
...
Align the text in broken lines to the start of the paragraph in places
where this is not consistent.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-08 13:58:02 +02:00
Bartosz Golaszewski
1964b728ca
bindings: cxx: fix doxygen description of line_request::release()
...
Seems like the description was copy-pasted from chip::close(). Fix it.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
2024-04-08 11:26:11 +02:00