dt-bindings: pinctrl: k3: Introduce pinmux definitions
authorVignesh R <vigneshr@ti.com>
Tue, 13 Nov 2018 06:01:08 +0000 (11:31 +0530)
committerTero Kristo <t-kristo@ti.com>
Fri, 14 Dec 2018 07:56:43 +0000 (09:56 +0200)
The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
defining pinmux configs in human readable form, instead of raw-coded
hex values.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
MAINTAINERS
include/dt-bindings/pinctrl/k3.h [new file with mode: 0644]

index f485597..9ac39fa 100644 (file)
@@ -2204,6 +2204,7 @@ S:        Supported
 F:     Documentation/devicetree/bindings/arm/ti/k3.txt
 F:     arch/arm64/boot/dts/ti/Makefile
 F:     arch/arm64/boot/dts/ti/k3-*
+F:     include/dt-bindings/pinctrl/k3.h
 
 ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
 M:     Santosh Shilimkar <ssantosh@kernel.org>
diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h
new file mode 100644 (file)
index 0000000..45e11b6
--- /dev/null
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header provides constants for pinctrl bindings for TI's K3 SoC
+ * family.
+ *
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+ */
+#ifndef _DT_BINDINGS_PINCTRL_TI_K3_H
+#define _DT_BINDINGS_PINCTRL_TI_K3_H
+
+#define PULLUDEN_SHIFT         (16)
+#define PULLTYPESEL_SHIFT      (17)
+#define RXACTIVE_SHIFT         (18)
+
+#define PULL_DISABLE           (1 << PULLUDEN_SHIFT)
+#define PULL_ENABLE            (0 << PULLUDEN_SHIFT)
+
+#define PULL_UP                        (1 << PULLTYPESEL_SHIFT | PULL_ENABLE)
+#define PULL_DOWN              (0 << PULLTYPESEL_SHIFT | PULL_ENABLE)
+
+#define INPUT_EN               (1 << RXACTIVE_SHIFT)
+#define INPUT_DISABLE          (0 << RXACTIVE_SHIFT)
+
+/* Only these macros are expected be used directly in device tree files */
+#define PIN_OUTPUT             (INPUT_DISABLE | PULL_DISABLE)
+#define PIN_OUTPUT_PULLUP      (INPUT_DISABLE | PULL_UP)
+#define PIN_OUTPUT_PULLDOWN    (INPUT_DISABLE | PULL_DOWN)
+#define PIN_INPUT              (INPUT_EN | PULL_DISABLE)
+#define PIN_INPUT_PULLUP       (INPUT_EN | PULL_UP)
+#define PIN_INPUT_PULLDOWN     (INPUT_EN | PULL_DOWN)
+
+#define AM65X_IOPAD(pa, val, muxmode)          (((pa) & 0x1fff)) ((val) | (muxmode))
+#define AM65X_WKUP_IOPAD(pa, val, muxmode)     (((pa) & 0x1fff)) ((val) | (muxmode))
+
+#endif