Lines Matching refs:range
272 static inline int gpio_to_pin(struct pinctrl_gpio_range *range, in gpio_to_pin() argument
275 unsigned int offset = gpio - range->base; in gpio_to_pin()
276 if (range->pins) in gpio_to_pin()
277 return range->pins[offset]; in gpio_to_pin()
279 return range->pin_base + offset; in gpio_to_pin()
293 struct pinctrl_gpio_range *range; in pinctrl_match_gpio_range() local
297 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_match_gpio_range()
299 if (gpio >= range->base && in pinctrl_match_gpio_range()
300 gpio < range->base + range->npins) { in pinctrl_match_gpio_range()
302 return range; in pinctrl_match_gpio_range()
326 struct pinctrl_gpio_range *range = NULL; in pinctrl_ready_for_gpio_range() local
338 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_ready_for_gpio_range()
340 if (range->base + range->npins - 1 < chip->base || in pinctrl_ready_for_gpio_range()
341 range->base > chip->base + chip->ngpio - 1) in pinctrl_ready_for_gpio_range()
379 struct pinctrl_gpio_range *range; in pinctrl_get_device_gpio_range() local
381 range = pinctrl_match_gpio_range(pctldev, gpio); in pinctrl_get_device_gpio_range()
382 if (range) { in pinctrl_get_device_gpio_range()
384 *outrange = range; in pinctrl_get_device_gpio_range()
404 struct pinctrl_gpio_range *range) in pinctrl_add_gpio_range() argument
407 list_add_tail(&range->node, &pctldev->gpio_ranges); in pinctrl_add_gpio_range()
424 struct pinctrl_gpio_range *range) in pinctrl_find_and_add_gpio_range() argument
438 pinctrl_add_gpio_range(pctldev, range); in pinctrl_find_and_add_gpio_range()
465 struct pinctrl_gpio_range *range; in pinctrl_find_gpio_range_from_pin_nolock() local
468 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_find_gpio_range_from_pin_nolock()
470 if (range->pins) { in pinctrl_find_gpio_range_from_pin_nolock()
472 for (a = 0; a < range->npins; a++) { in pinctrl_find_gpio_range_from_pin_nolock()
473 if (range->pins[a] == pin) in pinctrl_find_gpio_range_from_pin_nolock()
474 return range; in pinctrl_find_gpio_range_from_pin_nolock()
476 } else if (pin >= range->pin_base && in pinctrl_find_gpio_range_from_pin_nolock()
477 pin < range->pin_base + range->npins) in pinctrl_find_gpio_range_from_pin_nolock()
478 return range; in pinctrl_find_gpio_range_from_pin_nolock()
494 struct pinctrl_gpio_range *range; in pinctrl_find_gpio_range_from_pin() local
497 range = pinctrl_find_gpio_range_from_pin_nolock(pctldev, pin); in pinctrl_find_gpio_range_from_pin()
500 return range; in pinctrl_find_gpio_range_from_pin()
510 struct pinctrl_gpio_range *range) in pinctrl_remove_gpio_range() argument
513 list_del(&range->node); in pinctrl_remove_gpio_range()
744 struct pinctrl_gpio_range *range; in pinctrl_gpio_can_use_line() local
753 if (pinctrl_get_device_gpio_range(gpio, &pctldev, &range)) in pinctrl_gpio_can_use_line()
759 pin = gpio_to_pin(range, gpio); in pinctrl_gpio_can_use_line()
780 struct pinctrl_gpio_range *range; in pinctrl_gpio_request() local
784 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_request()
794 pin = gpio_to_pin(range, gpio); in pinctrl_gpio_request()
796 ret = pinmux_request_gpio(pctldev, range, pin, gpio); in pinctrl_gpio_request()
815 struct pinctrl_gpio_range *range; in pinctrl_gpio_free() local
819 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_free()
826 pin = gpio_to_pin(range, gpio); in pinctrl_gpio_free()
828 pinmux_free_gpio(pctldev, pin, range); in pinctrl_gpio_free()
837 struct pinctrl_gpio_range *range; in pinctrl_gpio_direction() local
841 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_direction()
849 pin = gpio_to_pin(range, gpio); in pinctrl_gpio_direction()
850 ret = pinmux_gpio_direction(pctldev, range, pin, input); in pinctrl_gpio_direction()
897 struct pinctrl_gpio_range *range; in pinctrl_gpio_set_config() local
901 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_set_config()
906 pin = gpio_to_pin(range, gpio); in pinctrl_gpio_set_config()
1606 struct pinctrl_gpio_range *range; in pinctrl_pins_show() local
1629 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_pins_show()
1630 if ((pin >= range->pin_base) && in pinctrl_pins_show()
1631 (pin < (range->pin_base + range->npins))) { in pinctrl_pins_show()
1632 gpio_num = range->base + (pin - range->pin_base); in pinctrl_pins_show()
1708 struct pinctrl_gpio_range *range; in pinctrl_gpioranges_show() local
1715 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_gpioranges_show()
1716 if (range->pins) { in pinctrl_gpioranges_show()
1719 range->id, range->name, in pinctrl_gpioranges_show()
1720 range->base, (range->base + range->npins - 1)); in pinctrl_gpioranges_show()
1721 for (a = 0; a < range->npins - 1; a++) in pinctrl_gpioranges_show()
1722 seq_printf(s, "%u, ", range->pins[a]); in pinctrl_gpioranges_show()
1723 seq_printf(s, "%u}\n", range->pins[a]); in pinctrl_gpioranges_show()
1727 range->id, range->name, in pinctrl_gpioranges_show()
1728 range->base, (range->base + range->npins - 1), in pinctrl_gpioranges_show()
1729 range->pin_base, in pinctrl_gpioranges_show()
1730 (range->pin_base + range->npins - 1)); in pinctrl_gpioranges_show()
2167 struct pinctrl_gpio_range *range, *n; in pinctrl_unregister() local
2189 list_for_each_entry_safe(range, n, &pctldev->gpio_ranges, node) in pinctrl_unregister()
2190 list_del(&range->node); in pinctrl_unregister()