- Aug 01, 2024
-
-
Bartosz Golaszewski authored
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>
-
Benjamin Cabé authored
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>
-
Iker Pedrosa authored
`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>
-
Chuang Zhu authored
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>
-
- Jun 18, 2024
-
-
Bartosz Golaszewski authored
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>
-
- Jun 14, 2024
-
-
Bartosz Golaszewski authored
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>
-
- Jun 12, 2024
-
-
Vincent Fazio authored
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>
-
- Jun 03, 2024
-
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Khem Raj authored
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>
-
- May 29, 2024
-
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
$@ 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>
-
Bartosz Golaszewski authored
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>
-
- May 28, 2024
-
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
- May 23, 2024
-
-
Bartosz Golaszewski authored
Make the new test file for line definitions part of the entire test-suite for python bindings. Fixes: c8e3ae04 ("bindings: python: tests: add test for casting line.Value to bool") Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Bartosz Golaszewski authored
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>
-
- May 22, 2024
-
-
Bartosz Golaszewski authored
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>
-
- May 15, 2024
-
-
Kent Gibson authored
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>
-
- May 13, 2024
-
-
Bartosz Golaszewski authored
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: 76ecc337 ("licensing: relicense C++ bindings under LGPL-2.1-or-later") Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 07, 2024
-
-
Bartosz Golaszewski authored
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>
-
- Apr 24, 2024
-
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
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>
-
- Apr 22, 2024
-
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
Commit ea84f882 ("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>
-
- Apr 10, 2024
-
-
Bartosz Golaszewski authored
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: 9e69d755 ("configure: improve the header and library function checks") Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Apr 08, 2024
-
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
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>
-
Bartosz Golaszewski authored
Seems like the description was copy-pasted from chip::close(). Fix it. Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-