From patchwork Sun Feb 11 10:14:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Gibson X-Patchwork-Id: 199403 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1859053dyd; Sun, 11 Feb 2024 02:15:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQtI4NENJ7wxRgLxsatYRPPBcT1Fm8Z6C6sI5VnsDRZ1B3h9a4M82ZaS/JodUSzepkTMurreIshr9KktXxu+Tug3E8Kw== X-Google-Smtp-Source: AGHT+IGHQ+2L3dXWZfBx9RPQjZ57AdIhHikrV3jF+MSwSFOsnbEhLXMy9+zZDNDuNMqdhdz18ozR X-Received: by 2002:a17:906:6c89:b0:a3c:5766:58df with SMTP id s9-20020a1709066c8900b00a3c576658dfmr1138673ejr.6.1707646512195; Sun, 11 Feb 2024 02:15:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707646512; cv=pass; d=google.com; s=arc-20160816; b=MZuwX2/soDCa/1Hg4N2FCkt5gY5Wf4IRVxFCqAte6X3osgsdVgojR1aIpAe+68IbCg OqRpSMo423bCGsN9qK/VhZJj7n1Vv5Td7c58lMedFCisZZbXajXggDHgOj5gsM4RXn15 DTh9hqDhHsKHMf+qheAeBGQK2cyFgErQTFLpeSrce0Ss0W9w66EeyNDxg8j5IMAhUDb8 sF3TmujIygZFebjhWGG2DV4Gp6IOQri4HbtWMKTa/NJQQcWRKd8aZULICFG7Gam3vrJo bMkzdTg0fAJeWSEqgLiDbqOp/15Oe8dWYLrx1p8oUpi1INuRYLTp+bl30ggiHCbKs6RT namQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Blc6hLuk1jJGYRb9CW+5BR8z1UC6d8gl1Uq+cUruLp8=; fh=I0eVxwT7kvcyqsotnnB0VItrYf2e2725xfVxqjzvQh4=; b=ugSBEjRbP6TXGowBYgd+FTGhKJ7UcwrnaXvKhV3T0D2SeoYnqg1DHZufwI23xDnBtG qEceRaS5sBiBLpAuC2wKSy5JU5tPwymbVji3afjD+sq04e7Bc8dWwxWGc6mTLDlcffOJ eBmBjgJTzhzWcLn8krWH6uFTHVBDFf7MRnJeuQwGudjywxqM5cC4JSJjDEDFmngvNySA gZS+DHlER+hSyQroNfX/RvdQZ9fp6fCX5d+PmddSZ2H2ajL1jYOxXNtWr3iMyEp54QL1 X5m46o/J5nTmS1ZUYkwxG4/uaFlr3Ar0N8zz3XyJRGyw7ILgrK27BbgtYy8XZvKlT0N7 eGbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QV1O5a4E; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-60693-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60693-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCU7XRC61mmShO4a5VnsaFyGG8tWiGIaca2IQOMpz8GfOTD5U21wKiIvSepdJvVMoD4bPOhrj+MID1TY3fPYmYcVKO/YVA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a23-20020a1709066d5700b00a3c5f12d1c5si778845ejt.266.2024.02.11.02.15.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 02:15:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60693-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QV1O5a4E; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-60693-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60693-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 CA0BF1F2295F for ; Sun, 11 Feb 2024 10:15:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B6915A108; Sun, 11 Feb 2024 10:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QV1O5a4E" Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 3D56459B40; Sun, 11 Feb 2024 10:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707646493; cv=none; b=a/+48eJ7OSdmvf8iYKadASmv6jzftN8n4n+LieMJF3y8trUh0gwWrfuqEUWblqqR1OT2lSdHCCWiq0xk00mppp/ZHqz9leJle9DPYLMWXk5JF6YooBZQlP1sgtB2rFmgDKvG6vp/Ah+UAFIjkFarJS+IKxVjgWPN6S2itBrl5iQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707646493; c=relaxed/simple; bh=5HxlEksVyEjp5vwu1YWeFpsI9Pu5L4mnVbXPjNxQXSI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=QHu89p+9oFFO8J4BdK6Wpcte9RwrithoxbHlJ0lXQYR9UexI05iFWAqIyTuMY/FSNENCuLeNoZx0RBjWHmmTq3qXMIajr2FLtpbgwi5qlpYB30UPUX0Xzh63ozmnHg9JlhkwmfzSOksB2EFTnH0WdvntvMjzx89NDsz4YqVwN6E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QV1O5a4E; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso1766550a12.3; Sun, 11 Feb 2024 02:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707646491; x=1708251291; 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=Blc6hLuk1jJGYRb9CW+5BR8z1UC6d8gl1Uq+cUruLp8=; b=QV1O5a4Ee4SIW2+j2kVK5kliRGFZgJj7b8IG8qqsqp+zPZlaleGSqk2++vlsDcNbpF qVyYC4LE5kABA69JU0mxbBw+YPlVNOI7A3ufNq0E4m2SSAZlq4yU28YGkEKcSa0ktrR3 3qq8ZKX9XW2Mqpwp9ssHPGVlNMGxb86gnbwlGyPaCuSZtsr9OsQRgEtCqB2uJ9I0+JAO WRysEhP44/KCYop8K8eDH/le4GQuFSDf8J3Oe2dyLa8baFHxUE0MyaeVJK3VE8fTvms5 zvsZ1+XKiXv6LleeOgEjCJPDqsBCB+9L9u8zYk6d3+cubGB5OYgQ1fpyE/kjrMzrO3lm w9AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707646491; x=1708251291; 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=Blc6hLuk1jJGYRb9CW+5BR8z1UC6d8gl1Uq+cUruLp8=; b=nMGSNgLdzo0O5Iu8ZJl/3NDeq7y1STWDcA92qJgbM4oXnbC1mjuiuUcilYQ3zsYIiS lV4TbYAVFlTMHN1IHeM34g5whYhKFrpX8J3GZZ9x1CWVDLX61w5BDq4/3E0gRlDwTvhF l0mrH74wFOsvGbAp8klYb20PlzbzJ+vCjTLpH1NYvpI/OVe3IVN0gPzuYSKqBY1U/RHJ vxq52Pr4oi4dWsdBzpDCJNR7WZXVcI1Esa2GRN+BrQGWTBMcdiPYM1RXp68/+HNwYB9S DTjh5eYVFXGUst1s6+B2C3At3lP01iEgLmS93LY/po5qsHiJlzJghibhtPeUW+/aY2zw Hp9g== X-Forwarded-Encrypted: i=1; AJvYcCUlmE55MLUyYLnd+Bb335Qbsuqga9wrnEejHwEMKfhAifRGLs8uiTrTyN2BQN3hH9rPjFY0zaH+5ADmJfZuCBAKfW8gHRJdM0USLg== X-Gm-Message-State: AOJu0YwQrVPHI9Z16UcJwbnHg1OImC8F8Id+6IZAJARZUFvZ+MRNcIZf xJy7kHO/GlKy35M6snwfi1ANX8vGpVgBT4s6aIIPVl4o15uOD+OioYWlw1VE X-Received: by 2002:a05:6a21:9188:b0:19e:8b31:f1ae with SMTP id tp8-20020a056a21918800b0019e8b31f1aemr6804727pzb.29.1707646491257; Sun, 11 Feb 2024 02:14:51 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWCx+RIFOebjwfywA0OkLnpAhcJ1BFPAb+3VGchp0s+0NSim3fyKZKJFc1Lu7pxbyc87ffxWxRHPw+utCuqmQh41uKn1/o/siHifU9XMiAvmnEYVd6XsBhyiel4yjYMpyLXMA4V3i2t/xYMYOWmIIkj9Wqi/7KC5TljkqcF8+pmVOWzA0g= Received: from rigel.home.arpa ([220.235.35.85]) by smtp.gmail.com with ESMTPSA id y23-20020aa78557000000b006e09ec69d7dsm3184009pfn.98.2024.02.11.02.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 02:14:50 -0800 (PST) From: Kent Gibson To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org, andy@kernel.org Cc: Kent Gibson Subject: [PATCH] gpio: uapi: clarify default_values being logical Date: Sun, 11 Feb 2024 18:14:21 +0800 Message-Id: <20240211101421.166779-1-warthog618@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790597149283619801 X-GMAIL-MSGID: 1790597149283619801 The documentation for default_values mentions high/low which can be confusing, particularly when the ACTIVE_LOW flag is set. Replace high/low with active/inactive to clarify that the values are logical not physical. Similarly, clarify the interpretation of values in struct gpiohandle_data. Signed-off-by: Kent Gibson Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij --- include/uapi/linux/gpio.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/gpio.h b/include/uapi/linux/gpio.h index 103cd3c6c81e..f7cb8ae87df7 100644 --- a/include/uapi/linux/gpio.h +++ b/include/uapi/linux/gpio.h @@ -399,8 +399,8 @@ struct gpioline_info_changed { * a batch of input or output lines, but they must all have the same * characteristics, i.e. all inputs or all outputs, all active low etc * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested - * line, this specifies the default output value, should be 0 (low) or - * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high) + * line, this specifies the default output value, should be 0 (inactive) or + * 1 (active). Anything other than 0 or 1 will be interpreted as active. * @consumer_label: a desired consumer label for the selected GPIO line(s) * such as "my-bitbanged-relay" * @lines: number of lines requested in this request, i.e. the number of @@ -426,8 +426,8 @@ struct gpiohandle_request { * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added * together * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags, - * this specifies the default output value, should be 0 (low) or - * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high) + * this specifies the default output value, should be 0 (inactive) or + * 1 (active). Anything other than 0 or 1 will be interpreted as active. * @padding: reserved for future use and should be zero filled * * Note: This struct is part of ABI v1 and is deprecated. @@ -443,7 +443,8 @@ struct gpiohandle_config { * struct gpiohandle_data - Information of values on a GPIO handle * @values: when getting the state of lines this contains the current * state of a line, when setting the state of lines these should contain - * the desired target state + * the desired target state. States are 0 (inactive) or 1 (active). + * When setting, anything other than 0 or 1 will be interpreted as active. * * Note: This struct is part of ABI v1 and is deprecated. * Use ABI v2 and &struct gpio_v2_line_values instead.