From patchwork Wed Jul 31 10:46:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1967032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=ttqwtlYA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=linux-gpio+bounces-8485-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WYph12ZYTz1yYq for ; Wed, 31 Jul 2024 20:47:13 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A89311F258F2 for ; Wed, 31 Jul 2024 10:47:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E352D1A8C18; Wed, 31 Jul 2024 10:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ttqwtlYA" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79A6F18A951 for ; Wed, 31 Jul 2024 10:47:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722422825; cv=none; b=lMmm439a/TPZrn7Ai3RjSStjz1+JI9fLZg5WeIfYzGbBHkbUw4sabjMH9fAoVLSLHSanaqVAe6W7xhTAXvUJoJE3safU1ijX9Vy2jh/452GmCDrC+OqMU3WvmAvKvFONIG4QGDaFv9GHX0Q1TQi7+/Nej+LsNJdtqu5PSCnhZVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722422825; c=relaxed/simple; bh=Ki2uv8YYiTtiAT8ump+cHg3zsbOcoedVx0u50QzMXRY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=t1FZ3ghB5qaT04ycCzwV/vGMK6HQrywqMRnRlKk5zAODDlhMbC5v9dpxXDPOL2Iz0cWpW/znNzp0Seksaa1Kak5QLbolLDzNWSxPfEcXJmrib9M6KW4HEKZ1iCc15lm1Xxcsjuo9QDy5UFnvRGCOFnFc7IhxlQWb9igLareZgJI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ttqwtlYA; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3683329f787so2963797f8f.1 for ; Wed, 31 Jul 2024 03:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1722422822; x=1723027622; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wOsBks1Ukj/kM2aiU4wDpwEQWU7zGWRB95dIXwbabeA=; b=ttqwtlYARTEIyhMv6fB4cofcCoOnmUOpL4zgJOdbF8DeldpslT26zWUme8ZTc8yJHe l2ZXZfFE70jyUM1X+HZFUGNUHpAGbiS7oaQlcSajcBS5YV3Odi7jz2OTNBGaMXMPAdvG U3NAURJb/ZJyqSOCQ929n01yCgQLgcnKVI10X+SZBwdZMRPW2me+gPQWw9C5S6e6Wyml /oWJ5qW96BQiiHDXG7b3jBtz+u6D5vCi47T4qJ0Ufj1DvlZQTvKsLgpvF7W5mtNrwSR/ L2VwN81PJVBI/UXjKa1bEPVvg3VapQT7agfYtAmv80mXgNJSv5VMx/mYkrfCqFyGhOF5 UweA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722422822; x=1723027622; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wOsBks1Ukj/kM2aiU4wDpwEQWU7zGWRB95dIXwbabeA=; b=GTO7ddABQuNlLEYVid12M2thLpauHhLKcCDjow23f+jgBInQhXuRVNB8I/VPr3d3K4 72tse8xYbaNpGr5nmoAfvG7J14CaHEghHe1zdKN597bpKoDmt3MUfqUcuEllzM4Avb4Z 2GXHRF1U/wCWrFZ1FAzExdN3IJ5bY/jRGUi8EB6FMgtlr0cor2JZ6/XxyoAjIGgjKqKA G/a6sff5ndC2BrJwYMmt8U6QqPXjDMYFJRvqs6mZr2RNL20EuraO6766ziCLK8krMDJ/ sSXIl5Upb7TvbWNux/z4MMpF+ohE4R/9nzAFk2khu3o4GLGDqWcDai6vGRaJcT+KBtMx q6jw== X-Gm-Message-State: AOJu0YxW9l0yv+FGHtnhkmV6hSHozBqrApuHlrm4fW/pu+1hoDMInRee tlCZVR4oBvtqNhbMVqIGkAKmjNVouI4EbdxRVRhnwQf16k5OUMrCIdgKxboWdNU= X-Google-Smtp-Source: AGHT+IGVNIlPo7QzLmaqPdIDbk9kD2jKhAUNneCDHdm53tFykRiBQxGY8tuEOnCGljwjPqDh8QS2MQ== X-Received: by 2002:a05:6000:1884:b0:366:e991:b9ac with SMTP id ffacd0b85a97d-36b5cef8f6bmr10647782f8f.14.1722422821568; Wed, 31 Jul 2024 03:47:01 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:9c3f:3dd8:b524:cb31]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b36857d4fsm16858877f8f.86.2024.07.31.03.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 03:47:01 -0700 (PDT) From: Bartosz Golaszewski To: =?utf-8?q?Benjamin_Cab=C3=A9?= , Kent Gibson , Linus Walleij Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH libgpiod 1/2] bindings: python: properly pass event clock settings Date: Wed, 31 Jul 2024 12:46:57 +0200 Message-ID: <20240731104658.93117-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Benjamin Cabé Python binding was ignoring event_clock line setting. Signed-off-by: Benjamin Cabé Signed-off-by: Bartosz Golaszewski Reviewed-by: Kent Gibson --- bindings/python/gpiod/ext/line-settings.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindings/python/gpiod/ext/line-settings.c b/bindings/python/gpiod/ext/line-settings.c index 2cacbef..650235e 100644 --- a/bindings/python/gpiod/ext/line-settings.c +++ b/bindings/python/gpiod/ext/line-settings.c @@ -79,6 +79,10 @@ line_settings_init(line_settings_object *self, PyObject *args, PyObject *kwargs) if (ret) return set_error(); + ret = gpiod_line_settings_set_event_clock(self->settings, event_clock); + if (ret) + return set_error(); + return 0; } From patchwork Wed Jul 31 10:46:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1967033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=q47REmeK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=linux-gpio+bounces-8486-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WYph21lyZz1yfG for ; Wed, 31 Jul 2024 20:47:14 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 748E21F25A75 for ; Wed, 31 Jul 2024 10:47:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2724C1AAE37; Wed, 31 Jul 2024 10:47:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="q47REmeK" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED9FE190473 for ; Wed, 31 Jul 2024 10:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722422826; cv=none; b=WB8TPpTZXklyeBwurifPoAOOE31ET8MHE3sYfp8S85GAfng8zl/X+M5u5uN/FsjC/oNVNs3kuY55ra8vG9DMEJuFEXpPi28uU+QNzRWBsncDWYO+3OA5fPmJHfNQB8pOge351ONlcvpH4NJem+LdlOcPuZcTUTEkGZloOT58gCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722422826; c=relaxed/simple; bh=/cZtWCXClI0s7oslJl5APzGNkmMfEQStuilPuZQHgHA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rj1bkKMFqyLfL+gZoj59de3HJaTPWXSQ1UH7AYBatrXKAPQCEyPvE0h3yYmJ3wGalgoqKn5uEbntTDwTQftF20iod3EoSYs5oUpIvsYr0HK2sCGv7L+qx9i5LyEp29+6Paeb7/IEIEqrqjGNvpo33F9UIU0ODz2Ia55uMlSIJt0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=q47REmeK; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42816ca797fso31409865e9.2 for ; Wed, 31 Jul 2024 03:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1722422823; x=1723027623; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fx1ZrEqt/ZDCS6mVU6O51ZbqHlRK8YKmuHp9oGOVSE8=; b=q47REmeKvwnL3AKgBAZRqx/FtVFpEfcw7jeurjnCSKeILIKab08sOhJ+02f+X1cCoF vbVJbIU4BuR1e5519peE8/8WE6Xh1oxxGvVQIGXCeoRs2uVJoQDZGE75Z9D/R7fSsZUW vIg8VazG+j6N0GqOm9UO2YIXy8R77GC1aLZ9kQtIk41tI/04qaNK5pnpmZhg6CaDFH0o BIMry7P4xc7heN2RuWjUJebSDdWkDtXHVGP9Id/daAw3VZicvcT5ETm7FMrsM4h4nR38 PEXIYEqZFVMEvOAKsqmdmz3LnvAst35NlQG+3CtG//vokJGRfxeKirMvA41nBCJWqBRS tKyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722422823; x=1723027623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fx1ZrEqt/ZDCS6mVU6O51ZbqHlRK8YKmuHp9oGOVSE8=; b=hO9DD7Cw5yRnswnrhBs6tarorYN7nkCJpd8BmK7ExE31eToWOw1TvxeU3OQQdpBumc VMZ3Er/GCms21Ev/wbVj4xCEszCK7gjL4Sh/+2LkbIZIkSH2grj8GIVp7+aAgisP+uoj jqJ33izganBtxY7HQCq/vWoS5/kdh7MxZcFhWwTNwNABpVTGeSiojoWHQvuJaLTgII55 2gIjAqkyX47tMnJxrfbsmu/ys3lV3p54xl6RZe6502Yc4meFfa2oY4kzh1AjrE0Zj8q9 mL5YgNz2dBeWc6PYk07licG3K7BhdGVOll2tNlrHiqNwYHW9DYKwtqHf4rZLZn4wUoFw LrnQ== X-Gm-Message-State: AOJu0YxGIOPinE7je9zyiSZKAzZgAStxbLKufp0PqY4mE8GLwN3+EfV9 nYDsVbSsMPSUdhkT5wx/Cy4rLKuplyw1FO4EasNYzM2j30ouhamPca87nOqWpBc= X-Google-Smtp-Source: AGHT+IEcfN0MOtpCUrZtesQvz3Yc+o558xInd3R4xlcDxF/Y8As6ZP1WlZKl03io4qEwAHGhkEdLbQ== X-Received: by 2002:a05:600c:354a:b0:426:6c70:dd9c with SMTP id 5b1f17b1804b1-42811e0b770mr98500155e9.31.1722422823245; Wed, 31 Jul 2024 03:47:03 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:9c3f:3dd8:b524:cb31]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b36857d4fsm16858877f8f.86.2024.07.31.03.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 03:47:02 -0700 (PDT) From: Bartosz Golaszewski To: =?utf-8?q?Benjamin_Cab=C3=A9?= , Kent Gibson , Linus Walleij Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH libgpiod 2/2] bindings: python: tests: check that event clock is property set in request Date: Wed, 31 Jul 2024 12:46:58 +0200 Message-ID: <20240731104658.93117-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240731104658.93117-1-brgl@bgdev.pl> References: <20240731104658.93117-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski We currently only have a test-case that checks if the event clock property is correctly set in the LineSettings object but not whether it is actually passed to the line request. Extend the existing test-case for line requests to account for event clocks as well. Signed-off-by: Bartosz Golaszewski --- bindings/python/tests/tests_line_request.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bindings/python/tests/tests_line_request.py b/bindings/python/tests/tests_line_request.py index c79a324..dce5941 100644 --- a/bindings/python/tests/tests_line_request.py +++ b/bindings/python/tests/tests_line_request.py @@ -5,7 +5,7 @@ import errno import gpiod from . import gpiosim -from gpiod.line import Direction, Drive, Edge, Value +from gpiod.line import Clock, Direction, Drive, Edge, Value from unittest import TestCase Pull = gpiosim.Chip.Pull @@ -302,12 +302,15 @@ class LineRequestComplexConfig(TestCase): direction=Direction.OUTPUT, output_value=Value.ACTIVE ), (1, 3, 5): gpiod.LineSettings( - direction=Direction.INPUT, edge_detection=Edge.BOTH + direction=Direction.INPUT, + edge_detection=Edge.BOTH, + event_clock=Clock.REALTIME, ), }, ) as req: self.assertEqual(chip.get_line_info(2).direction, Direction.OUTPUT) self.assertEqual(chip.get_line_info(3).edge_detection, Edge.BOTH) + self.assertEqual(chip.get_line_info(5).event_clock, Clock.REALTIME) class LineRequestMixedConfigByName(TestCase):