diff options
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/74x164_gpio.c | 2 | ||||
-rw-r--r-- | drivers/gpio/altera_pio.c | 4 | ||||
-rw-r--r-- | drivers/gpio/atmel_pio4.c | 5 | ||||
-rw-r--r-- | drivers/gpio/dwapb_gpio.c | 6 | ||||
-rw-r--r-- | drivers/gpio/gpio-uclass.c | 6 | ||||
-rw-r--r-- | drivers/gpio/intel_broadwell_gpio.c | 4 | ||||
-rw-r--r-- | drivers/gpio/intel_ich6_gpio.c | 4 | ||||
-rw-r--r-- | drivers/gpio/lpc32xx_gpio.c | 2 | ||||
-rw-r--r-- | drivers/gpio/mpc85xx_gpio.c | 8 | ||||
-rw-r--r-- | drivers/gpio/msm_gpio.c | 4 | ||||
-rw-r--r-- | drivers/gpio/omap_gpio.c | 2 | ||||
-rw-r--r-- | drivers/gpio/pca953x_gpio.c | 2 | ||||
-rw-r--r-- | drivers/gpio/pcf8575_gpio.c | 8 | ||||
-rw-r--r-- | drivers/gpio/pic32_gpio.c | 3 | ||||
-rw-r--r-- | drivers/gpio/pm8916_gpio.c | 4 | ||||
-rw-r--r-- | drivers/gpio/s5p_gpio.c | 4 | ||||
-rw-r--r-- | drivers/gpio/sandbox.c | 6 | ||||
-rw-r--r-- | drivers/gpio/sunxi_gpio.c | 2 | ||||
-rw-r--r-- | drivers/gpio/tegra186_gpio.c | 2 | ||||
-rw-r--r-- | drivers/gpio/tegra_gpio.c | 5 | ||||
-rw-r--r-- | drivers/gpio/vybrid_gpio.c | 2 |
21 files changed, 44 insertions, 41 deletions
diff --git a/drivers/gpio/74x164_gpio.c b/drivers/gpio/74x164_gpio.c index 9ac10a7..750eedf 100644 --- a/drivers/gpio/74x164_gpio.c +++ b/drivers/gpio/74x164_gpio.c @@ -130,7 +130,7 @@ static int gen_74x164_probe(struct udevice *dev) char *str, name[32]; int ret; const void *fdt = gd->fdt_blob; - int node = dev->of_offset; + int node = dev_of_offset(dev); snprintf(name, sizeof(name), "%s_", dev->name); str = strdup(name); diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c index 6f42bf8..92849c5 100644 --- a/drivers/gpio/altera_pio.c +++ b/drivers/gpio/altera_pio.c @@ -92,9 +92,9 @@ static int altera_pio_ofdata_to_platdata(struct udevice *dev) plat->regs = map_physmem(dev_get_addr(dev), sizeof(struct altera_pio_regs), MAP_NOCACHE); - plat->gpio_count = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + plat->gpio_count = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "altr,gpio-bank-width", 32); - plat->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, + plat->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "gpio-bank-name", NULL); return 0; diff --git a/drivers/gpio/atmel_pio4.c b/drivers/gpio/atmel_pio4.c index cb90b02..81c3047 100644 --- a/drivers/gpio/atmel_pio4.c +++ b/drivers/gpio/atmel_pio4.c @@ -276,7 +276,7 @@ static const struct dm_gpio_ops atmel_pio4_ops = { static int atmel_pio4_bind(struct udevice *dev) { - return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false); + return dm_scan_fdt_node(dev, gd->fdt_blob, dev_of_offset(dev), false); } static int atmel_pio4_probe(struct udevice *dev) @@ -308,7 +308,8 @@ static int atmel_pio4_probe(struct udevice *dev) pioctrl_data = (struct atmel_pioctrl_data *)dev_get_driver_data(dev); nbanks = pioctrl_data->nbanks; - uc_priv->bank_name = fdt_get_name(gd->fdt_blob, dev->of_offset, NULL); + uc_priv->bank_name = fdt_get_name(gd->fdt_blob, dev_of_offset(dev), + NULL); uc_priv->gpio_count = nbanks * ATMEL_PIO_NPINS_PER_BANK; return 0; diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 85e0a86..7d1904c 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -112,13 +112,13 @@ static int gpio_dwapb_bind(struct udevice *dev) if (plat) return 0; - base = fdtdec_get_addr(blob, dev->of_offset, "reg"); + base = fdtdec_get_addr(blob, dev_of_offset(dev), "reg"); if (base == FDT_ADDR_T_NONE) { debug("Can't get the GPIO register base address\n"); return -ENXIO; } - for (node = fdt_first_subnode(blob, dev->of_offset); + for (node = fdt_first_subnode(blob, dev_of_offset(dev)); node > 0; node = fdt_next_subnode(blob, node)) { if (!fdtdec_get_bool(blob, node, "gpio-controller")) @@ -142,7 +142,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (ret) goto err; - subdev->of_offset = node; + dev_set_of_offset(subdev, node); bank++; } diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index 4559739..9ab9df4 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -707,7 +707,7 @@ int gpio_request_by_name(struct udevice *dev, const char *list_name, int index, * calls in gpio_request_by_name(), but we can do this until * gpio_request_by_name_nodev() can be dropped. */ - return gpio_request_by_name_nodev(gd->fdt_blob, dev->of_offset, + return gpio_request_by_name_nodev(gd->fdt_blob, dev_of_offset(dev), list_name, index, desc, flags); } @@ -746,7 +746,7 @@ int gpio_request_list_by_name(struct udevice *dev, const char *list_name, * calls in gpio_request_by_name(), but we can do this until * gpio_request_list_by_name_nodev() can be dropped. */ - return gpio_request_list_by_name_nodev(gd->fdt_blob, dev->of_offset, + return gpio_request_list_by_name_nodev(gd->fdt_blob, dev_of_offset(dev), list_name, desc, max_count, flags); } @@ -755,7 +755,7 @@ int gpio_get_list_count(struct udevice *dev, const char *list_name) { int ret; - ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev->of_offset, + ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev), list_name, "#gpio-cells", 0, -1, NULL); if (ret) { diff --git a/drivers/gpio/intel_broadwell_gpio.c b/drivers/gpio/intel_broadwell_gpio.c index 81ce446..790577a 100644 --- a/drivers/gpio/intel_broadwell_gpio.c +++ b/drivers/gpio/intel_broadwell_gpio.c @@ -149,14 +149,14 @@ static int broadwell_gpio_ofdata_to_platdata(struct udevice *dev) if (ret) return ret; - bank = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", -1); + bank = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "reg", -1); if (bank == -1) { debug("%s: Invalid bank number %d\n", __func__, bank); return -EINVAL; } plat->bank = bank; plat->base_addr = gpiobase; - plat->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, + plat->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "bank-name", NULL); return 0; diff --git a/drivers/gpio/intel_ich6_gpio.c b/drivers/gpio/intel_ich6_gpio.c index fd6181f..8b78226 100644 --- a/drivers/gpio/intel_ich6_gpio.c +++ b/drivers/gpio/intel_ich6_gpio.c @@ -94,14 +94,14 @@ static int gpio_ich6_ofdata_to_platdata(struct udevice *dev) if (ret) return ret; - offset = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", -1); + offset = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "reg", -1); if (offset == -1) { debug("%s: Invalid register offset %d\n", __func__, offset); return -EINVAL; } plat->offset = offset; plat->base_addr = gpiobase + offset; - plat->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, + plat->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "bank-name", NULL); return 0; diff --git a/drivers/gpio/lpc32xx_gpio.c b/drivers/gpio/lpc32xx_gpio.c index 9674ee7..1bf945a 100644 --- a/drivers/gpio/lpc32xx_gpio.c +++ b/drivers/gpio/lpc32xx_gpio.c @@ -297,7 +297,7 @@ static int lpc32xx_gpio_probe(struct udevice *dev) struct lpc32xx_gpio_priv *gpio_priv = dev_get_priv(dev); struct gpio_dev_priv *uc_priv = dev->uclass_priv; - if (dev->of_offset == -1) { + if (dev_of_offset(dev) == -1) { /* Tell the uclass how many GPIOs we have */ uc_priv->gpio_count = LPC32XX_GPIOS; } diff --git a/drivers/gpio/mpc85xx_gpio.c b/drivers/gpio/mpc85xx_gpio.c index 168c696..cfeb6e7 100644 --- a/drivers/gpio/mpc85xx_gpio.c +++ b/drivers/gpio/mpc85xx_gpio.c @@ -169,13 +169,13 @@ static int mpc85xx_gpio_ofdata_to_platdata(struct udevice *dev) { fdt_addr_t addr; fdt_size_t size; - addr = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, dev->of_offset, - "reg", 0, &size, false); + addr = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, + dev_of_offset(dev), "reg", 0, &size, false); plat->addr = addr; plat->size = size; - plat->ngpios = fdtdec_get_int(gd->fdt_blob, dev->of_offset, - "ngpios", 32); + plat->ngpios = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), + "ngpios", 32); return 0; } diff --git a/drivers/gpio/msm_gpio.c b/drivers/gpio/msm_gpio.c index 0302979..01ce1d6 100644 --- a/drivers/gpio/msm_gpio.c +++ b/drivers/gpio/msm_gpio.c @@ -106,9 +106,9 @@ static int msm_gpio_ofdata_to_platdata(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); - uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "gpio-count", 0); - uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, + uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "gpio-bank-name", NULL); if (uc_priv->bank_name == NULL) uc_priv->bank_name = "soc"; diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c index f906b97..5338552 100644 --- a/drivers/gpio/omap_gpio.c +++ b/drivers/gpio/omap_gpio.c @@ -320,7 +320,7 @@ static int omap_gpio_bind(struct udevice *dev) return -ENOMEM; plat->base = base_addr; - plat->port_name = fdt_get_name(gd->fdt_blob, dev->of_offset, NULL); + plat->port_name = fdt_get_name(gd->fdt_blob, dev_of_offset(dev), NULL); dev->platdata = plat; return 0; diff --git a/drivers/gpio/pca953x_gpio.c b/drivers/gpio/pca953x_gpio.c index 0410add..b81f0fa 100644 --- a/drivers/gpio/pca953x_gpio.c +++ b/drivers/gpio/pca953x_gpio.c @@ -265,7 +265,7 @@ static int pca953x_probe(struct udevice *dev) return -ENODEV; } - addr = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", 0); + addr = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "reg", 0); if (addr == 0) return -ENODEV; diff --git a/drivers/gpio/pcf8575_gpio.c b/drivers/gpio/pcf8575_gpio.c index 2bda0ff..2cbb9e6 100644 --- a/drivers/gpio/pcf8575_gpio.c +++ b/drivers/gpio/pcf8575_gpio.c @@ -131,15 +131,15 @@ static int pcf8575_ofdata_platdata(struct udevice *dev) int n_latch; - uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "gpio-count", 16); - uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, + uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "gpio-bank-name", NULL); if (!uc_priv->bank_name) uc_priv->bank_name = fdt_get_name(gd->fdt_blob, - dev->of_offset, NULL); + dev_of_offset(dev), NULL); - n_latch = fdtdec_get_uint(gd->fdt_blob, dev->of_offset, + n_latch = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), "lines-initial-states", 0); plat->out = ~n_latch; diff --git a/drivers/gpio/pic32_gpio.c b/drivers/gpio/pic32_gpio.c index 7a037f3..e838ad4 100644 --- a/drivers/gpio/pic32_gpio.c +++ b/drivers/gpio/pic32_gpio.c @@ -133,7 +133,8 @@ static int pic32_gpio_probe(struct udevice *dev) char *end; int bank; - addr = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg", &size); + addr = fdtdec_get_addr_size(gd->fdt_blob, dev_of_offset(dev), "reg", + &size); if (addr == FDT_ADDR_T_NONE) return -EINVAL; diff --git a/drivers/gpio/pm8916_gpio.c b/drivers/gpio/pm8916_gpio.c index 0b61975..e38cee8 100644 --- a/drivers/gpio/pm8916_gpio.c +++ b/drivers/gpio/pm8916_gpio.c @@ -193,9 +193,9 @@ static int pm8916_gpio_ofdata_to_platdata(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); - uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "gpio-count", 0); - uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, + uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "gpio-bank-name", NULL); if (uc_priv->bank_name == NULL) uc_priv->bank_name = "pm8916"; diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index 377fed4..042996e 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -317,7 +317,7 @@ static int gpio_exynos_bind(struct udevice *parent) return 0; base = (struct s5p_gpio_bank *)dev_get_addr(parent); - for (node = fdt_first_subnode(blob, parent->of_offset), bank = base; + for (node = fdt_first_subnode(blob, dev_of_offset(parent)), bank = base; node > 0; node = fdt_next_subnode(blob, node), bank++) { struct exynos_gpio_platdata *plat; @@ -337,7 +337,7 @@ static int gpio_exynos_bind(struct udevice *parent) if (ret) return ret; - dev->of_offset = node; + dev_set_of_offset(dev, node); reg = dev_get_addr(dev); if (reg != FDT_ADDR_T_NONE) diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index f6435a0..ae6d930 100644 --- a/drivers/gpio/sandbox.c +++ b/drivers/gpio/sandbox.c @@ -197,9 +197,9 @@ static int sandbox_gpio_ofdata_to_platdata(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); - uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + uc_priv->gpio_count = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "num-gpios", 0); - uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset, + uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "gpio-bank-name", NULL); return 0; @@ -209,7 +209,7 @@ static int gpio_sandbox_probe(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); - if (dev->of_offset == -1) { + if (dev_of_offset(dev) == -1) { /* Tell the uclass how many GPIOs we have */ uc_priv->gpio_count = CONFIG_SANDBOX_GPIO_COUNT; } diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c index e8accaa..8d2bb18 100644 --- a/drivers/gpio/sunxi_gpio.c +++ b/drivers/gpio/sunxi_gpio.c @@ -312,7 +312,7 @@ static int gpio_sunxi_bind(struct udevice *parent) plat->bank_name, plat, -1, &dev); if (ret) return ret; - dev->of_offset = parent->of_offset; + dev_set_of_offset(dev, dev_of_offset(parent)); } return 0; diff --git a/drivers/gpio/tegra186_gpio.c b/drivers/gpio/tegra186_gpio.c index 1c68151..b0c22e5 100644 --- a/drivers/gpio/tegra186_gpio.c +++ b/drivers/gpio/tegra186_gpio.c @@ -197,7 +197,7 @@ static int tegra186_gpio_bind(struct udevice *parent) -1, &dev); if (ret) return ret; - dev->of_offset = parent->of_offset; + dev_set_of_offset(dev, dev_of_offset(parent)); } return 0; diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c index 5a03115..b01968a 100644 --- a/drivers/gpio/tegra_gpio.c +++ b/drivers/gpio/tegra_gpio.c @@ -337,7 +337,8 @@ static int gpio_tegra_bind(struct udevice *parent) * This driver does not make use of interrupts, other than to figure * out the number of GPIO banks */ - if (!fdt_getprop(gd->fdt_blob, parent->of_offset, "interrupts", &len)) + if (!fdt_getprop(gd->fdt_blob, dev_of_offset(parent), "interrupts", + &len)) return -EINVAL; bank_count = len / 3 / sizeof(u32); ctlr = (struct gpio_ctlr *)dev_get_addr(parent); @@ -363,7 +364,7 @@ static int gpio_tegra_bind(struct udevice *parent) plat->port_name, plat, -1, &dev); if (ret) return ret; - dev->of_offset = parent->of_offset; + dev_set_of_offset(dev, dev_of_offset(parent)); } } diff --git a/drivers/gpio/vybrid_gpio.c b/drivers/gpio/vybrid_gpio.c index a30ba5d..458104e 100644 --- a/drivers/gpio/vybrid_gpio.c +++ b/drivers/gpio/vybrid_gpio.c @@ -129,7 +129,7 @@ static int vybrid_gpio_bind(struct udevice *dev) plat->base = base_addr; plat->chip = dev->req_seq; - plat->port_name = fdt_get_name(gd->fdt_blob, dev->of_offset, NULL); + plat->port_name = fdt_get_name(gd->fdt_blob, dev_of_offset(dev), NULL); dev->platdata = plat; return 0; |