linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] pinctrl: add devicetree constants for simple generic pnconfig options
Date: Sun, 9 Jun 2013 01:59:54 +0200	[thread overview]
Message-ID: <201306090159.54323.heiko@sntech.de> (raw)
In-Reply-To: <201306090159.05383.heiko@sntech.de>

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 <heiko@sntech.de>
---
 .../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 <bank pin mux CONFIG>.
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 <heiko@sntech.de>
+ *
+ * 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
-- 
1.7.2.3

  reply	other threads:[~2013-06-08 23:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-08 23:59 [PATCH 0/2] pinctrl: common handling of generic pinconfig props in dt Heiko Stübner
2013-06-08 23:59 ` Heiko Stübner [this message]
2013-06-09  0:00 ` [PATCH 2/2] pinctrl: add function to separate combined pinconfig values Heiko Stübner
2013-06-09  0:01 ` [EXAMPLE PATCH] pinctrl: add pinctrl driver for Rockchip SoCs Heiko Stübner
2013-06-10 12:55   ` Linus Walleij
2013-06-10 13:00   ` Linus Walleij
2013-06-10 13:10     ` Heiko Stübner
2013-06-10 13:35       ` [PATCH v2] " Heiko Stübner
2013-06-10 13:40       ` [EXAMPLE PATCH] " Linus Walleij
2013-06-10 18:23     ` Stephen Warren
2013-06-10 19:53       ` Rob Herring
2013-06-11  8:50       ` Linus Walleij
2013-06-10 12:52 ` [PATCH 0/2] pinctrl: common handling of generic pinconfig props in dt Linus Walleij
2013-06-10 13:06   ` Heiko Stübner
2013-06-10 13:39     ` Linus Walleij
2013-06-10 13:54       ` Heiko Stübner
2013-06-10 14:08         ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201306090159.54323.heiko@sntech.de \
    --to=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).