From patchwork Thu Oct 5 02:58:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 13409720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B3D9E936F8 for ; Thu, 5 Oct 2023 02:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cp7NhI55tFcdcBaykPP3HHwswrTMMh8hAKIpc5Np3Kg=; b=rNgS9ytAYx5T24 5RTOZtWGTK6Wx0eYk1YO2op94mjdrSRE3HtIWst7qlUZsKE4F+Ge7qsVHcHqV6XT9KU3UcE8kfvVH iBvT73GTUq8TK5qLHHgFf/4FuUPLt0h6bxWfsUfneMXXWIU9NIKwWXWD4FTVQ8cjqnpLQmIz0iBGg jchQ1aOAZ34kfd4Kyx3sZdHzJIU4dScMd0bKIDPST2uGGOb3AG1V/qyaKV1fT6L6hbiQISVUz6ZK2 dY1kO4hx9FFFd4+6jWiEHlP8efyQ1Px3F0k95+wjiixVx2SpOpjnTD5LBgi9CB2AytXaxGxGZmKPf vhKWQJY1lMZVvacsAuSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qoEaF-001GoQ-24; Thu, 05 Oct 2023 02:59:27 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qoEaC-001Gnb-26 for linux-arm-kernel@lists.infradead.org; Thu, 05 Oct 2023 02:59:26 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6c61dd1c229so94834a34.0 for ; Wed, 04 Oct 2023 19:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696474763; x=1697079563; darn=lists.infradead.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=C71OcQAzBT261vJLaVS0ZLT3a6uuXRpHLmHkJwsnefw=; b=m1F6hPjbzt/mFd4Oz3arf4pH96hJBFKpCvd3MiPCHoVlGLgu2iTxSc1r1oZspuugo2 BL/eCuqByBN2TRVF/rUAiUAt/JZObtnZ+FaHoF+84U67OJYQm9y8z0DwMkvcqMZs2QQZ 6Yz0TIi9UIUhzgsox8pN+dcwdzJEM3VPyuRE4w/VNBbm0wEo1RLWuMpaSK+BtkFRTBQT jlBuxyl4xuCW/jblzGLGzJR5Z5VXnuEYMx0QblVtnbMfv+2dRH1CI2lyANmXyBFtR/l4 Jg0lxg7k0XBzAbeNEssiTxP54QXZi17nmChVEOuYwsJlw7y4m+XxIW5BETo3GfEs0wS9 q8Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696474763; x=1697079563; 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=C71OcQAzBT261vJLaVS0ZLT3a6uuXRpHLmHkJwsnefw=; b=hstoTrvCULrL4ITiaF0eOJwkRPv+/s3mZnB9R3+gvSgh3KRKLp0S4y3M2Ub7PYhVIg /L+U9PIbU7+stclCCCXcX9R69uIYyHI5Dx57wyz5A2W6zbydp2+/0BcQtNhx6Z+JN68v qzFm23VY9w2J/VRLyfxUj6ynzqW7ZuoPmQ7Z9Yk69huC5SaaURaboo4kXAQ/9CukIhv+ oR+dcDHJGWPsP7B3VFsBLNEF5U9SBIUF4m263eonJgM8OSsd+2CRhFfsDpqspvgaa32n iZUpjyIB/ZxZ5lXJmPB7j2nxGo6VuOTYbB2Wp0gcDvGqGaefLCbnOzMzGbEz+Bp9XmXT 4sLg== X-Gm-Message-State: AOJu0YwenHb1VJR3UP1pLX3xlDGUw5OT07BAjun4/mGqGUIMMC1C35ue ry8lilahXFLFdqJxWPOHIn+qGg== X-Google-Smtp-Source: AGHT+IFLE3a+7Vp/OvWCFi9446MZ5SR2US5WlY9g/kRa6BRPFqm4JfQA8hECuQL2KLgO1V/YM25PiQ== X-Received: by 2002:a05:6830:4867:b0:6bf:500f:b570 with SMTP id dx7-20020a056830486700b006bf500fb570mr3559438otb.3.1696474763244; Wed, 04 Oct 2023 19:59:23 -0700 (PDT) Received: from octopus.. ([2400:4050:c3e1:100:a16d:fce2:497:afb7]) by smtp.gmail.com with ESMTPSA id b18-20020a637152000000b005782ad723casm269265pgn.27.2023.10.04.19.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 19:59:22 -0700 (PDT) From: AKASHI Takahiro To: sudeep.holla@arm.com, cristian.marussi@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linus.walleij@linaro.org Cc: Oleksii_Moisieiev@epam.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, AKASHI Takahiro Subject: [RFC v2 1/5] pinctrl: define PIN_CONFIG_INPUT Date: Thu, 5 Oct 2023 11:58:39 +0900 Message-Id: <20231005025843.508689-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231005025843.508689-1-takahiro.akashi@linaro.org> References: <20231005025843.508689-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231004_195924_691908_180638DD X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This configuration is intended to be used to allow a pin controller based GPIO driver to obtain a value at a gpio input pin. Signed-off-by: AKASHI Takahiro Reviewed-by: Linus Walleij --- RFC v2 (Oct 5, 2023) * improve a comment against @PIN_CONFIG_INPUT as per Linus RFC(Oct 2, 2023) --- include/linux/pinctrl/pinconf-generic.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index d74b7a4ea154..da0d80aa532d 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h @@ -67,6 +67,10 @@ struct pinctrl_map; * passed as argument. The argument is in mA. * @PIN_CONFIG_DRIVE_STRENGTH_UA: the pin will sink or source at most the current * passed as argument. The argument is in uA. + * @PIN_CONFIG_INPUT: This will obtain a value on an input pin. To put a line + * into input mode, @PIN_CONFIG_INPUT_ENABLE must be used. Otherwise, + * an error will be returned. The returned argument is 1 for logic high + * and 0 for logic low. * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, * which means it will wait for signals to settle when reading inputs. The * argument gives the debounce time in usecs. Setting the @@ -128,6 +132,7 @@ enum pin_config_param { PIN_CONFIG_DRIVE_PUSH_PULL, PIN_CONFIG_DRIVE_STRENGTH, PIN_CONFIG_DRIVE_STRENGTH_UA, + PIN_CONFIG_INPUT, PIN_CONFIG_INPUT_DEBOUNCE, PIN_CONFIG_INPUT_ENABLE, PIN_CONFIG_INPUT_SCHMITT,