linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libgpiod][PATCH] bindings: rust: tests: set direction when reconfiguring lines
@ 2024-07-08  9:48 Bartosz Golaszewski
  2024-07-08 18:54 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-07-08  9:48 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij, Viresh Kumar, Erik Schilling
  Cc: linux-gpio, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Linux kernel commit b44039638741 ("gpiolib: cdev: Ignore reconfiguration
without direction") made the direction setting mandatory for line config
passed to the kernel when reconfiguring requested lines. Fix the Rust
test cases which don't do it and now fail due to the rest of the
settings being ignored.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 bindings/rust/libgpiod/tests/line_request.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bindings/rust/libgpiod/tests/line_request.rs b/bindings/rust/libgpiod/tests/line_request.rs
index 4e095a4..4ba0d18 100644
--- a/bindings/rust/libgpiod/tests/line_request.rs
+++ b/bindings/rust/libgpiod/tests/line_request.rs
@@ -138,6 +138,7 @@ mod line_request {
             // Value read properly after reconfigure
             let mut lsettings = line::Settings::new().unwrap();
             lsettings.set_active_low(true);
+            lsettings.set_direction(Direction::Input).unwrap();
             let mut lconfig = line::Config::new().unwrap();
             lconfig.add_line_settings(&offsets, lsettings).unwrap();
             request.reconfigure_lines(&lconfig).unwrap();
@@ -452,6 +453,7 @@ mod line_request {
             let mut lconfig = line::Config::new().unwrap();
             let mut lsettings = line::Settings::new().unwrap();
             lsettings.set_event_clock(EventClock::Monotonic).unwrap();
+            lsettings.set_direction(Direction::Input).unwrap();
             lconfig.add_line_settings(&[0], lsettings).unwrap();
             config.request().reconfigure_lines(&lconfig).unwrap();
             let info = config.chip().line_info(0).unwrap();
@@ -460,6 +462,7 @@ mod line_request {
             let mut lconfig = line::Config::new().unwrap();
             let mut lsettings = line::Settings::new().unwrap();
             lsettings.set_event_clock(EventClock::Realtime).unwrap();
+            lsettings.set_direction(Direction::Input).unwrap();
             lconfig.add_line_settings(&[0], lsettings).unwrap();
             config.request().reconfigure_lines(&lconfig).unwrap();
             let info = config.chip().line_info(0).unwrap();
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [libgpiod][PATCH] bindings: rust: tests: set direction when reconfiguring lines
  2024-07-08  9:48 [libgpiod][PATCH] bindings: rust: tests: set direction when reconfiguring lines Bartosz Golaszewski
@ 2024-07-08 18:54 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-07-08 18:54 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij, Viresh Kumar, Erik Schilling,
	Bartosz Golaszewski
  Cc: Bartosz Golaszewski, linux-gpio

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Mon, 08 Jul 2024 11:48:58 +0200, Bartosz Golaszewski wrote:
> Linux kernel commit b44039638741 ("gpiolib: cdev: Ignore reconfiguration
> without direction") made the direction setting mandatory for line config
> passed to the kernel when reconfiguring requested lines. Fix the Rust
> test cases which don't do it and now fail due to the rest of the
> settings being ignored.
> 
> 
> [...]

Applied, thanks!

[1/1] bindings: rust: tests: set direction when reconfiguring lines
      commit: 2515fae57d88e0f4e916e66e358912b9f98914dd

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-08 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08  9:48 [libgpiod][PATCH] bindings: rust: tests: set direction when reconfiguring lines Bartosz Golaszewski
2024-07-08 18:54 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).