]> Git Repo - J-u-boot.git/blobdiff - drivers/gpio/bcm6345_gpio.c
net: mediatek: fix gmac2 usability for mt7629
[J-u-boot.git] / drivers / gpio / bcm6345_gpio.c
index d1f6cfa8405d6f0e4ae9ff184f8fc3dfa37e7904..e76c84e806ad5f7f91df6fbb0aabe6c146213a6e 100644 (file)
@@ -7,11 +7,11 @@
  *     Copyright (C) 2008-2011 Florian Fainelli <[email protected]>
  */
 
-#include <common.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <linux/bitops.h>
 
 struct bcm6345_gpio_priv {
        void __iomem *reg_dirout;
@@ -22,7 +22,7 @@ static int bcm6345_gpio_get_value(struct udevice *dev, unsigned offset)
 {
        struct bcm6345_gpio_priv *priv = dev_get_priv(dev);
 
-       return !!(readl_be(priv->reg_data) & BIT(offset));
+       return !!(readl(priv->reg_data) & BIT(offset));
 }
 
 static int bcm6345_gpio_set_value(struct udevice *dev, unsigned offset,
@@ -31,9 +31,9 @@ static int bcm6345_gpio_set_value(struct udevice *dev, unsigned offset,
        struct bcm6345_gpio_priv *priv = dev_get_priv(dev);
 
        if (value)
-               setbits_be32(priv->reg_data, BIT(offset));
+               setbits_32(priv->reg_data, BIT(offset));
        else
-               clrbits_be32(priv->reg_data, BIT(offset));
+               clrbits_32(priv->reg_data, BIT(offset));
 
        return 0;
 }
@@ -42,9 +42,9 @@ static int bcm6345_gpio_set_direction(void __iomem *dirout, unsigned offset,
                                      bool input)
 {
        if (input)
-               clrbits_be32(dirout, BIT(offset));
+               clrbits_32(dirout, BIT(offset));
        else
-               setbits_be32(dirout, BIT(offset));
+               setbits_32(dirout, BIT(offset));
 
        return 0;
 }
@@ -70,7 +70,7 @@ static int bcm6345_gpio_get_function(struct udevice *dev, unsigned offset)
 {
        struct bcm6345_gpio_priv *priv = dev_get_priv(dev);
 
-       if (readl_be(priv->reg_dirout) & BIT(offset))
+       if (readl(priv->reg_dirout) & BIT(offset))
                return GPIOF_OUTPUT;
        else
                return GPIOF_INPUT;
@@ -113,6 +113,6 @@ U_BOOT_DRIVER(bcm6345_gpio) = {
        .id = UCLASS_GPIO,
        .of_match = bcm6345_gpio_ids,
        .ops = &bcm6345_gpio_ops,
-       .priv_auto_alloc_size = sizeof(struct bcm6345_gpio_priv),
+       .priv_auto      = sizeof(struct bcm6345_gpio_priv),
        .probe = bcm6345_gpio_probe,
 };
This page took 0.027529 seconds and 4 git commands to generate.