]> git.sur5r.net Git - u-boot/blobdiff - drivers/pinctrl/uniphier/pinctrl-uniphier.h
pinctrl: uniphier: include <linux/build_bug.h> instead of <linux/bug.h>
[u-boot] / drivers / pinctrl / uniphier / pinctrl-uniphier.h
index 4de5b03c8d747b035c2b3371c474f43981ce70fb..55f2b1a4d56903621d51466bffde4863c647b6ed 100644 (file)
@@ -1,22 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C) 2015-2016 Socionext Inc.
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __PINCTRL_UNIPHIER_H__
 #define __PINCTRL_UNIPHIER_H__
 
 #include <linux/bitops.h>
-#include <linux/bug.h>
+#include <linux/build_bug.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 
-#define UNIPHIER_PINCTRL_PINMUX_BASE   0x1000
-#define UNIPHIER_PINCTRL_LOAD_PINMUX   0x1700
-#define UNIPHIER_PINCTRL_IECTRL                0x1d00
-
 #define UNIPHIER_PIN_ATTR_PACKED(iectrl)       (iectrl)
 
 static inline unsigned int uniphier_pin_get_iectrl(unsigned long data)
@@ -71,8 +66,10 @@ struct uniphier_pinctrl_socdata {
        const char * const *functions;
        int functions_count;
        unsigned caps;
-#define UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL    BIT(1)
-#define UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE  BIT(0)
+#define UNIPHIER_PINCTRL_CAPS_PUPD_SIMPLE      BIT(3)
+#define UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL    BIT(2)
+#define UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE  BIT(1)
+#define UNIPHIER_PINCTRL_CAPS_MUX_4BIT         BIT(0)
 };
 
 #define UNIPHIER_PINCTRL_PIN(a, b)                                     \
@@ -94,7 +91,12 @@ struct uniphier_pinctrl_socdata {
 #define __UNIPHIER_PINMUX_FUNCTION(func)       #func
 
 #ifdef CONFIG_SPL_BUILD
-#define UNIPHIER_PINCTRL_GROUP(grp)            { .name = NULL }
+       /*
+        * a tricky way to drop unneeded *_pins and *_muxvals arrays from SPL,
+        * suppressing "defined but not used" warnings.
+        */
+#define UNIPHIER_PINCTRL_GROUP(grp)                                    \
+       { .num_pins = ARRAY_SIZE(grp##_pins) + ARRAY_SIZE(grp##_muxvals) }
 #define UNIPHIER_PINMUX_FUNCTION(func)         NULL
 #else
 #define UNIPHIER_PINCTRL_GROUP(grp)            __UNIPHIER_PINCTRL_GROUP(grp)