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: 404340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 36252140085 for ; Wed, 29 Oct 2014 07:58:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754177AbaJ1U5l (ORCPT ); Tue, 28 Oct 2014 16:57:41 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35168 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753356AbaJ1U5j (ORCPT ); Tue, 28 Oct 2014 16:57:39 -0400 Received: by mail-pa0-f53.google.com with SMTP id kx10so1579910pab.40 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=Y2UADRYTIoBFVTxzQHyHAKaN5GVwS1hUTCJ0xUh7kvnwnX8KCxZUYdHx1+bhFqLny6 /sVNClWMHYP31mE9cb6Kmyd3zvVXfB+/tzfWM15m+Jtv3gGhb40uarJgfXPWPeQi27OL qF27LKDHFNVOWUdxyD4xQtcj1ql9CvxndSvSjH9gsenxV4mBIVTQBMq/E6dh7oq6JKs6 QIXkWESuiF/v0z4/J9PcCo2G9VLuJ7OELIqL+ClrlgVdmHPT3jKkMkhCSogOsJXMb2QH hOzDa/GMPBJjPL6kDNy4x+dESLk+Bz4BFiaLAiGrT4SKFGDUYbnIQtPxGUS4Iu17KP3I YfDQ== X-Gm-Message-State: ALoCoQnhNibJkPfp4EQDXMhAmxfCks6pFG6NSEr3Q4lmXEo2XPLC4xeDcXbqSqWKRf3+ETnGAjnG 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 Cc: Sonny Rao , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Doug Anderson , robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, iivanov@mm-sol.com, syin@broadcom.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org 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 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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, };