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: 404339 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CBD9C140085 for ; Wed, 29 Oct 2014 07:58:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754240AbaJ1U5m (ORCPT ); Tue, 28 Oct 2014 16:57:42 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:60199 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753730AbaJ1U5j (ORCPT ); Tue, 28 Oct 2014 16:57:39 -0400 Received: by mail-pa0-f46.google.com with SMTP id lf10so1583751pab.19 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=YdfmHtS/zMNqs8HXEzTr7zD+Br31Rj+N2gLhVlU4t1zkx8estq7o5km2voi55dGJ3T r3KlfqSK54nsY9EWpQ2r8gllpSlzXVkD49Qms8CaeaNC30o4+SLPnM7zm7a/GooEllpB 50k2M+21fmN1Ws5luBehxiEHZzOcSbg4ZCqlJBNeCBmAlY2crYrwUvw3+79YQHV/aftx k9Vm1Lvc9wMl+oHfyxZ6Ft4dgjx77ZXLc+dLc8De4g1uhPYcoxyG0llJXRJGUSkaim0s LrEylqMUvTFJGJS2bN7qwizILM4QaKf75J5sAu95PrE8TT3ZPEowbBJ13ns+Sa2Lcv+j rL1A== X-Gm-Message-State: ALoCoQnT9xTjQIfHb9TlER6cUiOWnTgYtAPq3OBmGxgEbj8v1y45gAfH3kHHAjNHerKUJgbHF12/ 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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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, };