From patchwork Sat Jun 8 23:59:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 2693181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id CFC073FC8C for ; Sun, 9 Jun 2013 00:01:05 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UlT3q-0003B8-Cb; Sun, 09 Jun 2013 00:00:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UlT3V-0006Su-NE; Sun, 09 Jun 2013 00:00:21 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UlT3S-0006S7-5Y for linux-arm-kernel@lists.infradead.org; Sun, 09 Jun 2013 00:00:19 +0000 Received: from 146-52-32-150-dynip.superkabel.de ([146.52.32.150] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UlT36-0006Y3-2v; Sun, 09 Jun 2013 01:59:56 +0200 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Linus Walleij Subject: [PATCH 1/2] pinctrl: add devicetree constants for simple generic pnconfig options Date: Sun, 9 Jun 2013 01:59:54 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) References: <201306090159.05383.heiko@sntech.de> In-Reply-To: <201306090159.05383.heiko@sntech.de> MIME-Version: 1.0 Message-Id: <201306090159.54323.heiko@sntech.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130608_200018_345131_7D5E8CFB X-CRM114-Status: GOOD ( 15.93 ) X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Patrice Chotard X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Most pinconfig options either ignore the argument or only have two states for them. Therefore it's possible to combine them into one value in dt bindings as bits, resulting in smaller pin definitions. Signed-off-by: Heiko Stuebner --- .../bindings/pinctrl/pinctrl-bindings.txt | 6 +++ include/dt-bindings/pinctrl/pinconfig.h | 37 ++++++++++++++++++++ 2 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/pinctrl/pinconfig.h diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index c95ea82..d206da0 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt @@ -126,3 +126,9 @@ device; they may be grandchildren, for example. Whether this is legal, and whether there is any interaction between the child and intermediate parent nodes, is again defined entirely by the binding for the individual pin controller device. + +== Generic pinctrl config settings == + +dt-bindings/pinctrl/pinconfig.h defines a set of constants to combine basic +generic pinconfig settings, like pulls, into one value, that can be used +in pinctrl bindings like . diff --git a/include/dt-bindings/pinctrl/pinconfig.h b/include/dt-bindings/pinctrl/pinconfig.h new file mode 100644 index 0000000..b6ad251 --- /dev/null +++ b/include/dt-bindings/pinctrl/pinconfig.h @@ -0,0 +1,37 @@ +/* + * Header providing constants for generic pinconf bindings. + * + * Copyright (c) 2013 MundoReader S.L. + * Author: Heiko Stuebner + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __DT_BINDINGS_PINCTRL_PINCONFIG_H__ +#define __DT_BINDINGS_PINCTRL_PINCONFIG_H__ + +#define PINCONFIG_NONE 0 +#define PINCONFIG_BIAS_DISABLE (1 << 0) +#define PINCONFIG_BIAS_HIGH_IMPEDANCE (1 << 1) +#define PINCONFIG_BIAS_BUS_HOLD (1 << 2) +#define PINCONFIG_BIAS_PULL_PIN_DEFAULT (1 << 3) +#define PINCONFIG_BIAS_PULL_UP (1 << 4) +#define PINCONFIG_BIAS_PULL_DOWN (1 << 5) +#define PINCONFIG_DRIVE_PUSH_PULL (1 << 6) +#define PINCONFIG_DRIVE_OPEN_DRAIN (1 << 7) +#define PINCONFIG_DRIVE_OPEN_SOURCE (1 << 8) +#define PINCONFIG_INPUT_SCHMITT_ENABLE (1 << 9) +#define PINCONFIG_INPUT_SCHMITT_DISABLE (1 << 10) +#define PINCONFIG_LOW_POWER_MODE (1 << 11) +#define PINCONFIG_OUTPUT_LOW (1 << 12) +#define PINCONFIG_OUTPUT_HIGH (1 << 13) + +#endif