]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
pinctrl: uniphier: simplify input enable and delete pin arrays
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 13 Oct 2017 10:21:54 +0000 (19:21 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 15 Oct 2017 13:32:24 +0000 (22:32 +0900)
The pin data are implemented for old SoCs to specify the bit shift of
the IECTRL register.  They are not wortwhile given the required memory
footprint.  Delete all the pin data and enable all bits of the IECTRL
register.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c

index d314482acff73a596304581ca2d770a681ff8769..215b19ea0e901f98c441184d5240b02d696ed409 100644 (file)
@@ -9,6 +9,7 @@
 #include <dm.h>
 #include <linux/io.h>
 #include <linux/err.h>
+#include <linux/kernel.h>
 #include <linux/sizes.h>
 #include <dm/pinctrl.h>
 
@@ -81,9 +82,6 @@ static int uniphier_pinconf_input_enable_legacy(struct udevice *dev,
                                                unsigned int pin, int enable)
 {
        struct uniphier_pinctrl_priv *priv = dev_get_priv(dev);
-       int pins_count = priv->socdata->pins_count;
-       const struct uniphier_pinctrl_pin *pins = priv->socdata->pins;
-       int i;
 
        /*
         * Multiple pins share one input enable, per-pin disabling is
@@ -92,17 +90,8 @@ static int uniphier_pinconf_input_enable_legacy(struct udevice *dev,
        if (!enable)
                return -EINVAL;
 
-       for (i = 0; i < pins_count; i++) {
-               if (pins[i].number == pin) {
-                       unsigned int iectrl;
-                       u32 tmp;
-
-                       iectrl = uniphier_pin_get_iectrl(pins[i].data);
-                       tmp = readl(priv->base + UNIPHIER_PINCTRL_IECTRL);
-                       tmp |= 1 << iectrl;
-                       writel(tmp, priv->base + UNIPHIER_PINCTRL_IECTRL);
-               }
-       }
+       /* Set all bits instead of having a bunch of pin data */
+       writel(U32_MAX, priv->base + UNIPHIER_PINCTRL_IECTRL);
 
        return 0;
 }
index 709b005298ed467a9318444fd652ed90ca9323c9..7eb693d6487633126c68a24241109efbb900112c 100644 (file)
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_ld4_pins[] = {
-       UNIPHIER_PINCTRL_PIN(53, 0),
-       UNIPHIER_PINCTRL_PIN(54, 0),
-       UNIPHIER_PINCTRL_PIN(55, 0),
-       UNIPHIER_PINCTRL_PIN(56, 0),
-       UNIPHIER_PINCTRL_PIN(67, 0),
-       UNIPHIER_PINCTRL_PIN(68, 0),
-       UNIPHIER_PINCTRL_PIN(69, 0),
-       UNIPHIER_PINCTRL_PIN(70, 0),
-       UNIPHIER_PINCTRL_PIN(85, 0),
-       UNIPHIER_PINCTRL_PIN(88, 0),
-       UNIPHIER_PINCTRL_PIN(156, 0),
-};
-
 static const unsigned emmc_pins[] = {21, 22, 23, 24, 25, 26, 27};
 static const int emmc_muxvals[] = {0, 1, 1, 1, 1, 1, 1};
 static const unsigned emmc_dat8_pins[] = {28, 29, 30, 31};
@@ -132,8 +118,6 @@ static const char * const uniphier_ld4_functions[] = {
 };
 
 static struct uniphier_pinctrl_socdata uniphier_ld4_pinctrl_socdata = {
-       .pins = uniphier_ld4_pins,
-       .pins_count = ARRAY_SIZE(uniphier_ld4_pins),
        .groups = uniphier_ld4_groups,
        .groups_count = ARRAY_SIZE(uniphier_ld4_groups),
        .functions = uniphier_ld4_functions,
index df5f2d86fa16f2e31de1fe6f4a58e3cde4647dad..0695e0713acd96732462c9d98e5981349b7ba7a8 100644 (file)
@@ -11,9 +11,6 @@
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_pro4_pins[] = {
-};
-
 static const unsigned emmc_pins[] = {40, 41, 42, 43, 51, 52, 53};
 static const int emmc_muxvals[] = {1, 1, 1, 1, 1, 1, 1};
 static const unsigned emmc_dat8_pins[] = {44, 45, 46, 47};
@@ -151,8 +148,6 @@ static const char * const uniphier_pro4_functions[] = {
 };
 
 static struct uniphier_pinctrl_socdata uniphier_pro4_pinctrl_socdata = {
-       .pins = uniphier_pro4_pins,
-       .pins_count = ARRAY_SIZE(uniphier_pro4_pins),
        .groups = uniphier_pro4_groups,
        .groups_count = ARRAY_SIZE(uniphier_pro4_groups),
        .functions = uniphier_pro4_functions,
index 7b14662a711e3e59b0384e2b95fea0bf49df0180..39cdd950720a0b1aadbf04fc31f9deb720098d7c 100644 (file)
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_pro5_pins[] = {
-       UNIPHIER_PINCTRL_PIN(47, 0),
-       UNIPHIER_PINCTRL_PIN(48, 0),
-       UNIPHIER_PINCTRL_PIN(49, 0),
-       UNIPHIER_PINCTRL_PIN(50, 0),
-       UNIPHIER_PINCTRL_PIN(53, 0),
-       UNIPHIER_PINCTRL_PIN(54, 0),
-       UNIPHIER_PINCTRL_PIN(87, 0),
-       UNIPHIER_PINCTRL_PIN(88, 0),
-       UNIPHIER_PINCTRL_PIN(101, 0),
-       UNIPHIER_PINCTRL_PIN(102, 0),
-};
-
 static const unsigned emmc_pins[] = {36, 37, 38, 39, 40, 41, 42};
 static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0};
 static const unsigned emmc_dat8_pins[] = {43, 44, 45, 46};
@@ -142,8 +129,6 @@ static const char * const uniphier_pro5_functions[] = {
 };
 
 static struct uniphier_pinctrl_socdata uniphier_pro5_pinctrl_socdata = {
-       .pins = uniphier_pro5_pins,
-       .pins_count = ARRAY_SIZE(uniphier_pro5_pins),
        .groups = uniphier_pro5_groups,
        .groups_count = ARRAY_SIZE(uniphier_pro5_groups),
        .functions = uniphier_pro5_functions,
index 90d632903c93bc8dcb3696c852146d8ae555192d..70c985db7e47b29dceb514556a30a499c3c19196 100644 (file)
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_pxs2_pins[] = {
-       UNIPHIER_PINCTRL_PIN(113, 0),
-       UNIPHIER_PINCTRL_PIN(114, 0),
-       UNIPHIER_PINCTRL_PIN(115, 0),
-       UNIPHIER_PINCTRL_PIN(116, 0),
-};
-
 static const unsigned emmc_pins[] = {36, 37, 38, 39, 40, 41, 42};
 static const int emmc_muxvals[] = {9, 9, 9, 9, 9, 9, 9};
 static const unsigned emmc_dat8_pins[] = {43, 44, 45, 46};
@@ -135,8 +128,6 @@ static const char * const uniphier_pxs2_functions[] = {
 };
 
 static struct uniphier_pinctrl_socdata uniphier_pxs2_pinctrl_socdata = {
-       .pins = uniphier_pxs2_pins,
-       .pins_count = ARRAY_SIZE(uniphier_pxs2_pins),
        .groups = uniphier_pxs2_groups,
        .groups_count = ARRAY_SIZE(uniphier_pxs2_groups),
        .functions = uniphier_pxs2_functions,
index 897ce15131ba278e2b7bfd4186b1e978e7bd4213..5168bbee9f5fea14393ead824861cd12758af194 100644 (file)
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_sld8_pins[] = {
-       UNIPHIER_PINCTRL_PIN(32, 8),
-       UNIPHIER_PINCTRL_PIN(33, 8),
-       UNIPHIER_PINCTRL_PIN(34, 8),
-       UNIPHIER_PINCTRL_PIN(35, 8),
-       UNIPHIER_PINCTRL_PIN(36, 8),
-       UNIPHIER_PINCTRL_PIN(37, 8),
-       UNIPHIER_PINCTRL_PIN(38, 8),
-       UNIPHIER_PINCTRL_PIN(39, 8),
-       UNIPHIER_PINCTRL_PIN(40, 9),
-       UNIPHIER_PINCTRL_PIN(41, 0),
-       UNIPHIER_PINCTRL_PIN(42, 0),
-       UNIPHIER_PINCTRL_PIN(43, 0),
-       UNIPHIER_PINCTRL_PIN(44, 0),
-       UNIPHIER_PINCTRL_PIN(70, 0),
-       UNIPHIER_PINCTRL_PIN(71, 0),
-       UNIPHIER_PINCTRL_PIN(102, 10),
-       UNIPHIER_PINCTRL_PIN(103, 10),
-       UNIPHIER_PINCTRL_PIN(104, 11),
-       UNIPHIER_PINCTRL_PIN(105, 11),
-       UNIPHIER_PINCTRL_PIN(108, 13),
-       UNIPHIER_PINCTRL_PIN(109, 13),
-       UNIPHIER_PINCTRL_PIN(112, 0),
-       UNIPHIER_PINCTRL_PIN(113, 0),
-       UNIPHIER_PINCTRL_PIN(114, 0),
-       UNIPHIER_PINCTRL_PIN(115, 0),
-};
-
 static const unsigned emmc_pins[] = {21, 22, 23, 24, 25, 26, 27};
 static const int emmc_muxvals[] = {1, 1, 1, 1, 1, 1, 1};
 static const unsigned emmc_dat8_pins[] = {28, 29, 30, 31};
@@ -143,8 +115,6 @@ static const char * const uniphier_sld8_functions[] = {
 };
 
 static struct uniphier_pinctrl_socdata uniphier_sld8_pinctrl_socdata = {
-       .pins = uniphier_sld8_pins,
-       .pins_count = ARRAY_SIZE(uniphier_sld8_pins),
        .groups = uniphier_sld8_groups,
        .groups_count = ARRAY_SIZE(uniphier_sld8_groups),
        .functions = uniphier_sld8_functions,