]> git.sur5r.net Git - u-boot/blobdiff - drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / drivers / pinctrl / uniphier / pinctrl-uniphier-core.c
index d8e9948ee7cc994ac29db581ec117257d7103a2d..7b427d06ece5dc2eae3c3eb7939e7cdb5b501e37 100644 (file)
@@ -1,15 +1,15 @@
+// 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+
  */
 
 #include <common.h>
+#include <dm.h>
 #include <linux/io.h>
 #include <linux/err.h>
+#include <linux/kernel.h>
 #include <linux/sizes.h>
-#include <dm/device.h>
 #include <dm/pinctrl.h>
 
 #include "pinctrl-uniphier.h"
@@ -81,9 +81,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 +89,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;
 }
@@ -299,7 +287,7 @@ int uniphier_pinctrl_probe(struct udevice *dev,
        struct uniphier_pinctrl_priv *priv = dev_get_priv(dev);
        fdt_addr_t addr;
 
-       addr = dev_get_addr(dev->parent);
+       addr = devfdt_get_addr(dev->parent);
        if (addr == FDT_ADDR_T_NONE)
                return -EINVAL;