diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2018-03-22 19:39:32 +0100 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2018-06-01 15:56:02 +0200 |
commit | e7e64fa0e61b3a68d2c80b9f7d262e22823c52fa (patch) | |
tree | 5cea81bc331e42796441f08d20d26a2781df9fdd /drivers/gpio | |
parent | 56d4b706d39ae0339ef33053ee702750430f8d95 (diff) |
gpio: bcm6345: convert to use live dt
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/bcm6345_gpio.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/gpio/bcm6345_gpio.c b/drivers/gpio/bcm6345_gpio.c index 1a507fce8e..d1f6cfa840 100644 --- a/drivers/gpio/bcm6345_gpio.c +++ b/drivers/gpio/bcm6345_gpio.c @@ -13,8 +13,6 @@ #include <asm/gpio.h> #include <asm/io.h> -DECLARE_GLOBAL_DATA_PTR; - struct bcm6345_gpio_priv { void __iomem *reg_dirout; void __iomem *reg_data; @@ -90,22 +88,16 @@ static int bcm6345_gpio_probe(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct bcm6345_gpio_priv *priv = dev_get_priv(dev); - fdt_addr_t data_addr, dirout_addr; - fdt_size_t data_size, dirout_size; - dirout_addr = devfdt_get_addr_size_index(dev, 0, &dirout_size); - if (dirout_addr == FDT_ADDR_T_NONE) + priv->reg_dirout = dev_remap_addr_index(dev, 0); + if (!priv->reg_dirout) return -EINVAL; - data_addr = devfdt_get_addr_size_index(dev, 1, &data_size); - if (data_addr == FDT_ADDR_T_NONE) + priv->reg_data = dev_remap_addr_index(dev, 1); + if (!priv->reg_data) return -EINVAL; - priv->reg_data = ioremap(data_addr, data_size); - priv->reg_dirout = ioremap(dirout_addr, dirout_size); - - uc_priv->gpio_count = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), - "ngpios", 32); + uc_priv->gpio_count = dev_read_u32_default(dev, "ngpios", 32); uc_priv->bank_name = dev->name; return 0; |