Lines Matching refs:gc
179 static struct etraxfs_gpio_chip *to_etraxfs(struct gpio_chip *gc) in to_etraxfs() argument
181 return container_of(gc, struct etraxfs_gpio_chip, bgc.gc); in to_etraxfs()
184 static unsigned int etraxfs_gpio_chip_to_port(struct gpio_chip *gc) in etraxfs_gpio_chip_to_port() argument
186 return gc->label[0] - 'A'; in etraxfs_gpio_chip_to_port()
189 static int etraxfs_gpio_of_xlate(struct gpio_chip *gc, in etraxfs_gpio_of_xlate() argument
197 if (etraxfs_gpio_chip_to_port(gc) + 0xA != gpiospec->args[2]) in etraxfs_gpio_of_xlate()
200 return of_gpio_simple_xlate(gc, gpiospec, flags); in etraxfs_gpio_of_xlate()
223 return 4 * etraxfs_gpio_chip_to_port(&chip->bgc.gc) + gpio / 8; in etraxfs_gpio_to_group_pin()
311 ret = gpiochip_lock_as_irq(&chip->bgc.gc, d->hwirq); in etraxfs_gpio_irq_request_resources()
339 gpiochip_unlock_as_irq(&chip->bgc.gc, d->hwirq); in etraxfs_gpio_irq_release_resources()
445 bgc->gc.ngpio = port->ngpio; in etraxfs_gpio_probe()
446 bgc->gc.label = port->label; in etraxfs_gpio_probe()
448 bgc->gc.of_node = dev->of_node; in etraxfs_gpio_probe()
449 bgc->gc.of_gpio_n_cells = 3; in etraxfs_gpio_probe()
450 bgc->gc.of_xlate = etraxfs_gpio_of_xlate; in etraxfs_gpio_probe()
452 ret = gpiochip_add(&bgc->gc); in etraxfs_gpio_probe()
455 bgc->gc.label); in etraxfs_gpio_probe()
462 ret = gpiochip_irqchip_add(&bgc->gc, &etraxfs_gpio_irq_chip, 0, in etraxfs_gpio_probe()
466 bgc->gc.label); in etraxfs_gpio_probe()