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: 5179851 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 444AC9F387 for ; Tue, 28 Oct 2014 20:57:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37A0C201C7 for ; Tue, 28 Oct 2014 20:57:58 +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 5AB9E2017A for ; Tue, 28 Oct 2014 20:57:57 +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 1XjDq0-0007sI-T4; Tue, 28 Oct 2014 20:57:56 +0000 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjDpy-0007q6-WA for linux-rockchip@lists.infradead.org; Tue, 28 Oct 2014 20:57:55 +0000 Received: by mail-pd0-f182.google.com with SMTP id fp1so1503741pdb.27 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=Sika+MqkcTekrNfLgUY85xgUkxlOepQXJRiu0tM/S4TTkcJoGm562OZS1TY0w4TsLR xn9EwWtmkN8626yRgvYEEaYCftd3GE+OQA2bFza2t+KD8bXAsJ3NM0Gya6vMFm7WVd/q pHjaryMXxdg0ROxcs1QIsLNIUWWkKlPCPEJzloC0JdZvHYw7LaFv9C1nNTfcUFDwdO7u 06l8sdoI1jmokgcwT6QFO9nJZe4QLcV3lTZyr3XAvIPm2eGgSrLK3642RQ4dtEZB++GE 2/5bM752Sf3VwMUFbgqCIXJrHs3vDjXH35gi1z9/RPJVBBsmHy8OvUESxH751XR/M6xu Sr7A== X-Gm-Message-State: ALoCoQmFGmDP5YM82z77DOPM7N3+EuEnncbdpEBCijtbEH5XBtg1Wazi+KH8kiy54XS8XG63gddi 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_135755_162601_3C50E1F9 X-CRM114-Status: GOOD ( 10.61 ) 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-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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, };