Lines Matching refs:gpiospec
89 struct of_phandle_args *gpiospec = data;
91 return chip->gpiodev->dev.of_node == gpiospec->np && chip->of_xlate && chip->of_xlate(chip, gpiospec, NULL) >= 0;
94 static struct gpio_chip *of_find_gpiochip_by_xlate(struct of_phandle_args *gpiospec)
96 return gpiochip_find(gpiospec, of_gpiochip_match_node_and_xlate);
99 static struct gpio_desc *of_xlate_and_get_gpiod_flags(struct gpio_chip *chip, struct of_phandle_args *gpiospec,
104 if (chip->of_gpio_n_cells != gpiospec->args_count) {
108 ret = chip->of_xlate(chip, gpiospec, flags);
236 struct of_phandle_args gpiospec;
241 ret = of_parse_phandle_with_args_map(np, propname, "gpio", index, &gpiospec);
247 chip = of_find_gpiochip_by_xlate(&gpiospec);
253 desc = of_xlate_and_get_gpiod_flags(chip, &gpiospec, flags);
266 of_node_put(gpiospec.np);
585 struct of_phandle_args gpiospec;
605 gpiospec.np = chip_np;
606 gpiospec.args_count = tmp;
609 ret = of_property_read_u32_index(np, "gpios", idx * tmp + i, &gpiospec.args[i]);
615 desc = of_xlate_and_get_gpiod_flags(chip, &gpiospec, &xlate_flags);
804 * of_gpio_simple_xlate - translate gpiospec to the GPIO number and flags
806 * @gpiospec: GPIO specifier as found in the device tree
813 static int of_gpio_simple_xlate(struct gpio_chip *gc, const struct of_phandle_args *gpiospec, u32 *flags)
826 if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells)) {
830 if (gpiospec->args[0] >= gc->ngpio) {
835 *flags = gpiospec->args[1];
838 return gpiospec->args[0];