From patchwork Tue Oct 28 20:57:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 5179881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EF724C11AC for ; Tue, 28 Oct 2014 20:59:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FF572017A for ; Tue, 28 Oct 2014 20:59:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B9FE2016C for ; Tue, 28 Oct 2014 20:59:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjDqB-0007uP-GG; Tue, 28 Oct 2014 20:58:07 +0000 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjDq0-0007q7-W1 for linux-arm-kernel@lists.infradead.org; Tue, 28 Oct 2014 20:57:57 +0000 Received: by mail-pd0-f169.google.com with SMTP id y10so1501245pdj.14 for ; Tue, 28 Oct 2014 13:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=Cn1AqRTYFin7/Aij7sKuYc/njouvPMb5GxWpqfAVstA=; b=CYui8dfBPQEFjqX3H+TMgPUN9FfynmEUCbH1J7+IEKT1lYYL4gv/DFYcGRRmbEjvl5 wtSyz+mnXYAZiYvJZomqMA9AhK+5cT6WEVUL+bHsmuLZlD1kVYHBKvHaIANEcY8KD2mv OSQcjnLgi9oERdCkJFhN1w/LZqUCxDD0qCf1o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Cn1AqRTYFin7/Aij7sKuYc/njouvPMb5GxWpqfAVstA=; b=KtWYl3YdTAr4cN4fxG/aZlxFAq/RNxpOjj0C1Ke0KCdXiJpmcnKgLihJ3CiD0OV5mX 2PAVmW/lKZq7zmUGPsX+Qf/ipiP/yKslZqDJVyZdYrLQY2KsuPVxZDUtJvfpsjelkI9Y V6/h7ib/p1T3B8+08pMU3mom4qkIgkjMwYzpH9TDr0qPD1eKUIJ43SozcV9tMW8hBFuU sJidSGeyPpo75n+/zQlkneZpBw1Iea9XUb/oYg4rVe5IKe+IMB4A4OfyX65qGqxdPOfa cENowrIE1HlQ1/ySE1P9xd+OQknFkkcEiBXXm1ZH9jzM/BmhiuLIk7qctLL7KXqu9cRr KOfg== X-Gm-Message-State: ALoCoQklUXJixKF3OhhwwQoO72uFCc4CJLLxv3QmcWGVSQ8XESjPP1N2d3q5xUFJsAfopH2PFpRm X-Received: by 10.68.138.196 with SMTP id qs4mr6002716pbb.39.1414529855030; Tue, 28 Oct 2014 13:57:35 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id i10sm2464334pdr.21.2014.10.28.13.57.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Oct 2014 13:57:33 -0700 (PDT) From: Doug Anderson To: Linus Walleij , Heiko Stuebner Subject: [RFC PATCH 1/2] pinctrl: Add output-disable Date: Tue, 28 Oct 2014 13:57:14 -0700 Message-Id: <1414529835-16207-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141028_135757_056919_AB5C7648 X-CRM114-Status: GOOD ( 12.36 ) X-Spam-Score: -0.8 (/) Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, linux-gpio@vger.kernel.org, Doug Anderson , linux-kernel@vger.kernel.org, syin@broadcom.com, linux-rockchip@lists.infradead.org, robh+dt@kernel.org, iivanov@mm-sol.com, galak@codeaurora.org, Sonny Rao , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pinctrl bindings / API allow you to specify that: - a pin should be an output - a pin should have its input path enabled / disabled ...but they don't allow you to tell a pin to stop outputting. Lets add a new setting for that just in case the bootloader (or the default state) left a pin as an output and we don't want it that way anymore. Signed-off-by: Doug Anderson --- Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt | 1 + drivers/pinctrl/pinconf-generic.c | 1 + include/linux/pinctrl/pinconf-generic.h | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index 98eb94d..9ac8591 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt @@ -183,6 +183,7 @@ low-power-enable - enable low power mode low-power-disable - disable low power mode output-low - set the pin to output mode with low level output-high - set the pin to output mode with high level +output-disable - disable output to the pin slew-rate - set the slew rate For example: diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 29ff77f..ec4d95f 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -171,6 +171,7 @@ static struct pinconf_generic_dt_params dt_params[] = { { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 }, { "output-low", PIN_CONFIG_OUTPUT, 0, }, { "output-high", PIN_CONFIG_OUTPUT, 1, }, + { "output-disable", PIN_CONFIG_OUTPUT_DISABLE, 1, }, { "slew-rate", PIN_CONFIG_SLEW_RATE, 0}, }; diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index d578a60..52b0429 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h @@ -89,6 +89,8 @@ * 1 to indicate high level, argument 0 to indicate low level. (Please * see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a * discussion around this parameter.) + * @PIN_CONFIG_OUTPUT_DISABLE: this will configure the pin _not_ to output. + * Parameter should be 1. * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if * you need to pass in custom configurations to the pin controller, use * PIN_CONFIG_END+1 as the base offset. @@ -112,6 +114,7 @@ enum pin_config_param { PIN_CONFIG_SLEW_RATE, PIN_CONFIG_LOW_POWER_MODE, PIN_CONFIG_OUTPUT, + PIN_CONFIG_OUTPUT_DISABLE, PIN_CONFIG_END = 0x7FFF, };