Lines Matching +full:apb +full:- +full:base

1 // SPDX-License-Identifier: GPL-2.0+
5 * DesignWare APB GPIO driver
14 #include <dm/device-internal.h>
41 fdt_addr_t base; member
48 clrbits_le32(plat->base + GPIO_SWPORT_DDR(plat->bank), 1 << pin); in dwapb_gpio_direction_input()
57 setbits_le32(plat->base + GPIO_SWPORT_DDR(plat->bank), 1 << pin); in dwapb_gpio_direction_output()
60 setbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin); in dwapb_gpio_direction_output()
62 clrbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin); in dwapb_gpio_direction_output()
70 return !!(readl(plat->base + GPIO_EXT_PORT(plat->bank)) & (1 << pin)); in dwapb_gpio_get_value()
79 setbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin); in dwapb_gpio_set_value()
81 clrbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin); in dwapb_gpio_set_value()
91 gpio = readl(plat->base + GPIO_SWPORT_DDR(plat->bank)); in dwapb_gpio_get_function()
112 ret = reset_get_bulk(dev, &priv->resets); in gpio_dwapb_reset()
117 if (ret == -ENOENT || ret == -ENOTSUPP) in gpio_dwapb_reset()
124 ret = reset_deassert_bulk(&priv->resets); in gpio_dwapb_reset()
126 reset_release_bulk(&priv->resets); in gpio_dwapb_reset()
137 struct gpio_dwapb_platdata *plat = dev->platdata; in gpio_dwapb_probe()
144 priv->gpio_count = plat->pins; in gpio_dwapb_probe()
145 priv->bank_name = plat->name; in gpio_dwapb_probe()
153 const void *blob = gd->fdt_blob; in gpio_dwapb_bind()
155 fdt_addr_t base; in gpio_dwapb_bind() local
162 base = dev_read_addr(dev); in gpio_dwapb_bind()
163 if (base == FDT_ADDR_T_NONE) { in gpio_dwapb_bind()
164 debug("Can't get the GPIO register base address\n"); in gpio_dwapb_bind()
165 return -ENXIO; in gpio_dwapb_bind()
171 if (!fdtdec_get_bool(blob, node, "gpio-controller")) in gpio_dwapb_bind()
176 return -ENOMEM; in gpio_dwapb_bind()
178 plat->base = base; in gpio_dwapb_bind()
179 plat->bank = bank; in gpio_dwapb_bind()
180 plat->pins = fdtdec_get_int(blob, node, "snps,nr-gpios", 0); in gpio_dwapb_bind()
181 plat->name = fdt_stringlist_get(blob, node, "bank-name", 0, in gpio_dwapb_bind()
183 if (!plat->name) { in gpio_dwapb_bind()
188 plat->name = fdt_get_name(blob, node, NULL); in gpio_dwapb_bind()
191 ret = device_bind(dev, dev->driver, plat->name, in gpio_dwapb_bind()
192 plat, -1, &subdev); in gpio_dwapb_bind()
209 return reset_release_bulk(&priv->resets); in gpio_dwapb_remove()
215 { .compatible = "snps,dw-apb-gpio" },
220 .name = "gpio-dwapb",