Lines Matching refs:pctldev
74 const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev) in pinctrl_dev_get_name() argument
77 return pctldev->desc->name; in pinctrl_dev_get_name()
81 const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev) in pinctrl_dev_get_devname() argument
83 return dev_name(pctldev->dev); in pinctrl_dev_get_devname()
87 void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev) in pinctrl_dev_get_drvdata() argument
89 return pctldev->driver_data; in pinctrl_dev_get_drvdata()
102 struct pinctrl_dev *pctldev; in get_pinctrl_dev_from_devname() local
109 list_for_each_entry(pctldev, &pinctrldev_list, node) { in get_pinctrl_dev_from_devname()
110 if (!strcmp(dev_name(pctldev->dev), devname)) { in get_pinctrl_dev_from_devname()
113 return pctldev; in get_pinctrl_dev_from_devname()
124 struct pinctrl_dev *pctldev; in get_pinctrl_dev_from_of_node() local
128 list_for_each_entry(pctldev, &pinctrldev_list, node) in get_pinctrl_dev_from_of_node()
129 if (pctldev->dev->of_node == np) { in get_pinctrl_dev_from_of_node()
131 return pctldev; in get_pinctrl_dev_from_of_node()
144 int pin_get_from_name(struct pinctrl_dev *pctldev, const char *name) in pin_get_from_name() argument
149 for (i = 0; i < pctldev->desc->npins; i++) { in pin_get_from_name()
152 pin = pctldev->desc->pins[i].number; in pin_get_from_name()
153 desc = pin_desc_get(pctldev, pin); in pin_get_from_name()
167 const char *pin_get_name(struct pinctrl_dev *pctldev, const unsigned pin) in pin_get_name() argument
171 desc = pin_desc_get(pctldev, pin); in pin_get_name()
173 dev_err(pctldev->dev, "failed to get pin(%d) name\n", in pin_get_name()
183 static void pinctrl_free_pindescs(struct pinctrl_dev *pctldev, in pinctrl_free_pindescs() argument
192 pindesc = radix_tree_lookup(&pctldev->pin_desc_tree, in pinctrl_free_pindescs()
195 radix_tree_delete(&pctldev->pin_desc_tree, in pinctrl_free_pindescs()
204 static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev, in pinctrl_register_one_pin() argument
209 pindesc = pin_desc_get(pctldev, pin->number); in pinctrl_register_one_pin()
211 dev_err(pctldev->dev, "pin %d already registered\n", in pinctrl_register_one_pin()
221 pindesc->pctldev = pctldev; in pinctrl_register_one_pin()
237 radix_tree_insert(&pctldev->pin_desc_tree, pin->number, pindesc); in pinctrl_register_one_pin()
239 pin->number, pindesc->name, pctldev->desc->name); in pinctrl_register_one_pin()
243 static int pinctrl_register_pins(struct pinctrl_dev *pctldev, in pinctrl_register_pins() argument
251 ret = pinctrl_register_one_pin(pctldev, &pins[i]); in pinctrl_register_pins()
291 pinctrl_match_gpio_range(struct pinctrl_dev *pctldev, unsigned gpio) in pinctrl_match_gpio_range() argument
295 mutex_lock(&pctldev->mutex); in pinctrl_match_gpio_range()
297 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_match_gpio_range()
301 mutex_unlock(&pctldev->mutex); in pinctrl_match_gpio_range()
305 mutex_unlock(&pctldev->mutex); in pinctrl_match_gpio_range()
325 struct pinctrl_dev *pctldev; in pinctrl_ready_for_gpio_range() local
335 list_for_each_entry(pctldev, &pinctrldev_list, node) { in pinctrl_ready_for_gpio_range()
337 mutex_lock(&pctldev->mutex); in pinctrl_ready_for_gpio_range()
338 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_ready_for_gpio_range()
343 mutex_unlock(&pctldev->mutex); in pinctrl_ready_for_gpio_range()
347 mutex_unlock(&pctldev->mutex); in pinctrl_ready_for_gpio_range()
373 struct pinctrl_dev *pctldev; in pinctrl_get_device_gpio_range() local
378 list_for_each_entry(pctldev, &pinctrldev_list, node) { in pinctrl_get_device_gpio_range()
381 range = pinctrl_match_gpio_range(pctldev, gpio); in pinctrl_get_device_gpio_range()
383 *outdev = pctldev; in pinctrl_get_device_gpio_range()
403 void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, in pinctrl_add_gpio_range() argument
406 mutex_lock(&pctldev->mutex); in pinctrl_add_gpio_range()
407 list_add_tail(&range->node, &pctldev->gpio_ranges); in pinctrl_add_gpio_range()
408 mutex_unlock(&pctldev->mutex); in pinctrl_add_gpio_range()
412 void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, in pinctrl_add_gpio_ranges() argument
419 pinctrl_add_gpio_range(pctldev, &ranges[i]); in pinctrl_add_gpio_ranges()
426 struct pinctrl_dev *pctldev; in pinctrl_find_and_add_gpio_range() local
428 pctldev = get_pinctrl_dev_from_devname(devname); in pinctrl_find_and_add_gpio_range()
435 if (!pctldev) { in pinctrl_find_and_add_gpio_range()
438 pinctrl_add_gpio_range(pctldev, range); in pinctrl_find_and_add_gpio_range()
440 return pctldev; in pinctrl_find_and_add_gpio_range()
444 int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, const char *pin_group, in pinctrl_get_group_pins() argument
447 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; in pinctrl_get_group_pins()
453 gs = pinctrl_get_group_selector(pctldev, pin_group); in pinctrl_get_group_pins()
457 return pctlops->get_group_pins(pctldev, gs, pins, num_pins); in pinctrl_get_group_pins()
462 pinctrl_find_gpio_range_from_pin_nolock(struct pinctrl_dev *pctldev, in pinctrl_find_gpio_range_from_pin_nolock() argument
468 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_find_gpio_range_from_pin_nolock()
491 pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, in pinctrl_find_gpio_range_from_pin() argument
496 mutex_lock(&pctldev->mutex); in pinctrl_find_gpio_range_from_pin()
497 range = pinctrl_find_gpio_range_from_pin_nolock(pctldev, pin); in pinctrl_find_gpio_range_from_pin()
498 mutex_unlock(&pctldev->mutex); in pinctrl_find_gpio_range_from_pin()
509 void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, in pinctrl_remove_gpio_range() argument
512 mutex_lock(&pctldev->mutex); in pinctrl_remove_gpio_range()
514 mutex_unlock(&pctldev->mutex); in pinctrl_remove_gpio_range()
524 int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev) in pinctrl_generic_get_group_count() argument
526 return pctldev->num_groups; in pinctrl_generic_get_group_count()
535 const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev, in pinctrl_generic_get_group_name() argument
540 group = radix_tree_lookup(&pctldev->pin_group_tree, in pinctrl_generic_get_group_name()
556 int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev, in pinctrl_generic_get_group_pins() argument
563 group = radix_tree_lookup(&pctldev->pin_group_tree, in pinctrl_generic_get_group_pins()
566 dev_err(pctldev->dev, "%s could not find pingroup%i\n", in pinctrl_generic_get_group_pins()
583 struct group_desc *pinctrl_generic_get_group(struct pinctrl_dev *pctldev, in pinctrl_generic_get_group() argument
588 group = radix_tree_lookup(&pctldev->pin_group_tree, in pinctrl_generic_get_group()
597 static int pinctrl_generic_group_name_to_selector(struct pinctrl_dev *pctldev, in pinctrl_generic_group_name_to_selector() argument
600 const struct pinctrl_ops *ops = pctldev->desc->pctlops; in pinctrl_generic_group_name_to_selector()
601 int ngroups = ops->get_groups_count(pctldev); in pinctrl_generic_group_name_to_selector()
606 const char *gname = ops->get_group_name(pctldev, selector); in pinctrl_generic_group_name_to_selector()
627 int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name, in pinctrl_generic_add_group() argument
636 selector = pinctrl_generic_group_name_to_selector(pctldev, name); in pinctrl_generic_add_group()
640 selector = pctldev->num_groups; in pinctrl_generic_add_group()
642 group = devm_kzalloc(pctldev->dev, sizeof(*group), GFP_KERNEL); in pinctrl_generic_add_group()
651 radix_tree_insert(&pctldev->pin_group_tree, selector, group); in pinctrl_generic_add_group()
653 pctldev->num_groups++; in pinctrl_generic_add_group()
666 int pinctrl_generic_remove_group(struct pinctrl_dev *pctldev, in pinctrl_generic_remove_group() argument
671 group = radix_tree_lookup(&pctldev->pin_group_tree, in pinctrl_generic_remove_group()
676 radix_tree_delete(&pctldev->pin_group_tree, selector); in pinctrl_generic_remove_group()
677 devm_kfree(pctldev->dev, group); in pinctrl_generic_remove_group()
679 pctldev->num_groups--; in pinctrl_generic_remove_group()
692 static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev) in pinctrl_generic_free_groups() argument
697 radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0) in pinctrl_generic_free_groups()
698 radix_tree_delete(&pctldev->pin_group_tree, iter.index); in pinctrl_generic_free_groups()
700 pctldev->num_groups = 0; in pinctrl_generic_free_groups()
704 static inline void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev) in pinctrl_generic_free_groups() argument
714 int pinctrl_get_group_selector(struct pinctrl_dev *pctldev, in pinctrl_get_group_selector() argument
717 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; in pinctrl_get_group_selector()
718 unsigned ngroups = pctlops->get_groups_count(pctldev); in pinctrl_get_group_selector()
722 const char *gname = pctlops->get_group_name(pctldev, in pinctrl_get_group_selector()
725 dev_dbg(pctldev->dev, in pinctrl_get_group_selector()
735 dev_err(pctldev->dev, "does not have pin group %s\n", in pinctrl_get_group_selector()
743 struct pinctrl_dev *pctldev; in pinctrl_gpio_can_use_line() local
753 if (pinctrl_get_device_gpio_range(gpio, &pctldev, &range)) in pinctrl_gpio_can_use_line()
756 mutex_lock(&pctldev->mutex); in pinctrl_gpio_can_use_line()
761 result = pinmux_can_be_used_for_gpio(pctldev, pin); in pinctrl_gpio_can_use_line()
763 mutex_unlock(&pctldev->mutex); in pinctrl_gpio_can_use_line()
779 struct pinctrl_dev *pctldev; in pinctrl_gpio_request() local
784 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_request()
791 mutex_lock(&pctldev->mutex); in pinctrl_gpio_request()
796 ret = pinmux_request_gpio(pctldev, range, pin, gpio); in pinctrl_gpio_request()
798 mutex_unlock(&pctldev->mutex); in pinctrl_gpio_request()
814 struct pinctrl_dev *pctldev; in pinctrl_gpio_free() local
819 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_free()
823 mutex_lock(&pctldev->mutex); in pinctrl_gpio_free()
828 pinmux_free_gpio(pctldev, pin, range); in pinctrl_gpio_free()
830 mutex_unlock(&pctldev->mutex); in pinctrl_gpio_free()
836 struct pinctrl_dev *pctldev; in pinctrl_gpio_direction() local
841 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_direction()
846 mutex_lock(&pctldev->mutex); in pinctrl_gpio_direction()
850 ret = pinmux_gpio_direction(pctldev, range, pin, input); in pinctrl_gpio_direction()
852 mutex_unlock(&pctldev->mutex); in pinctrl_gpio_direction()
898 struct pinctrl_dev *pctldev; in pinctrl_gpio_set_config() local
901 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); in pinctrl_gpio_set_config()
905 mutex_lock(&pctldev->mutex); in pinctrl_gpio_set_config()
907 ret = pinconf_set_config(pctldev, pin, configs, ARRAY_SIZE(configs)); in pinctrl_gpio_set_config()
908 mutex_unlock(&pctldev->mutex); in pinctrl_gpio_set_config()
943 static int add_setting(struct pinctrl *p, struct pinctrl_dev *pctldev, in add_setting() argument
965 if (pctldev) in add_setting()
966 setting->pctldev = pctldev; in add_setting()
968 setting->pctldev = in add_setting()
970 if (!setting->pctldev) { in add_setting()
1026 struct pinctrl_dev *pctldev) in create_pinctrl() argument
1047 ret = pinctrl_dt_to_map(p, pctldev); in create_pinctrl()
1068 if (pctldev && in create_pinctrl()
1069 strcmp(dev_name(pctldev->dev), map->ctrl_dev_name)) in create_pinctrl()
1072 ret = add_setting(p, pctldev, map); in create_pinctrl()
1225 static void pinctrl_link_add(struct pinctrl_dev *pctldev, in pinctrl_link_add() argument
1228 if (pctldev->desc->link_consumers) in pinctrl_link_add()
1229 device_link_add(consumer, pctldev->dev, in pinctrl_link_add()
1280 if (p != setting->pctldev->p) in pinctrl_commit_state()
1281 pinctrl_link_add(setting->pctldev, p->dev); in pinctrl_commit_state()
1304 if (p != setting->pctldev->p) in pinctrl_commit_state()
1305 pinctrl_link_add(setting->pctldev, p->dev); in pinctrl_commit_state()
1502 int pinctrl_force_sleep(struct pinctrl_dev *pctldev) in pinctrl_force_sleep() argument
1504 if (!IS_ERR(pctldev->p) && !IS_ERR(pctldev->hog_sleep)) in pinctrl_force_sleep()
1505 return pinctrl_commit_state(pctldev->p, pctldev->hog_sleep); in pinctrl_force_sleep()
1514 int pinctrl_force_default(struct pinctrl_dev *pctldev) in pinctrl_force_default() argument
1516 if (!IS_ERR(pctldev->p) && !IS_ERR(pctldev->hog_default)) in pinctrl_force_default()
1517 return pinctrl_commit_state(pctldev->p, pctldev->hog_default); in pinctrl_force_default()
1625 struct pinctrl_dev *pctldev = s->private; in pinctrl_pins_show() local
1626 const struct pinctrl_ops *ops = pctldev->desc->pctlops; in pinctrl_pins_show()
1634 seq_printf(s, "registered pins: %d\n", pctldev->desc->npins); in pinctrl_pins_show()
1636 mutex_lock(&pctldev->mutex); in pinctrl_pins_show()
1639 for (i = 0; i < pctldev->desc->npins; i++) { in pinctrl_pins_show()
1642 pin = pctldev->desc->pins[i].number; in pinctrl_pins_show()
1643 desc = pin_desc_get(pctldev, pin); in pinctrl_pins_show()
1652 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_pins_show()
1671 ops->pin_dbg_show(pctldev, s, pin); in pinctrl_pins_show()
1676 mutex_unlock(&pctldev->mutex); in pinctrl_pins_show()
1684 struct pinctrl_dev *pctldev = s->private; in pinctrl_groups_show() local
1685 const struct pinctrl_ops *ops = pctldev->desc->pctlops; in pinctrl_groups_show()
1688 mutex_lock(&pctldev->mutex); in pinctrl_groups_show()
1690 ngroups = ops->get_groups_count(pctldev); in pinctrl_groups_show()
1696 const char *gname = ops->get_group_name(pctldev, selector); in pinctrl_groups_show()
1702 ret = ops->get_group_pins(pctldev, selector, in pinctrl_groups_show()
1710 pname = pin_get_name(pctldev, pins[i]); in pinctrl_groups_show()
1712 mutex_unlock(&pctldev->mutex); in pinctrl_groups_show()
1722 mutex_unlock(&pctldev->mutex); in pinctrl_groups_show()
1730 struct pinctrl_dev *pctldev = s->private; in pinctrl_gpioranges_show() local
1735 mutex_lock(&pctldev->mutex); in pinctrl_gpioranges_show()
1738 list_for_each_entry(range, &pctldev->gpio_ranges, node) { in pinctrl_gpioranges_show()
1756 mutex_unlock(&pctldev->mutex); in pinctrl_gpioranges_show()
1764 struct pinctrl_dev *pctldev; in pinctrl_devices_show() local
1770 list_for_each_entry(pctldev, &pinctrldev_list, node) { in pinctrl_devices_show()
1771 seq_printf(s, "%s ", pctldev->desc->name); in pinctrl_devices_show()
1772 if (pctldev->desc->pmxops) in pinctrl_devices_show()
1776 if (pctldev->desc->confops) in pinctrl_devices_show()
1862 struct pinctrl_dev *pctldev = setting->pctldev; in pinctrl_show() local
1866 pinctrl_dev_get_name(pctldev)); in pinctrl_show()
1891 static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) in pinctrl_init_device_debugfs() argument
1896 if (pctldev->desc->name && in pinctrl_init_device_debugfs()
1897 strcmp(dev_name(pctldev->dev), pctldev->desc->name)) { in pinctrl_init_device_debugfs()
1898 debugfs_name = devm_kasprintf(pctldev->dev, GFP_KERNEL, in pinctrl_init_device_debugfs()
1899 "%s-%s", dev_name(pctldev->dev), in pinctrl_init_device_debugfs()
1900 pctldev->desc->name); in pinctrl_init_device_debugfs()
1903 dev_name(pctldev->dev)); in pinctrl_init_device_debugfs()
1907 debugfs_name = dev_name(pctldev->dev); in pinctrl_init_device_debugfs()
1911 pctldev->device_root = device_root; in pinctrl_init_device_debugfs()
1915 dev_name(pctldev->dev)); in pinctrl_init_device_debugfs()
1919 device_root, pctldev, &pinctrl_pins_fops); in pinctrl_init_device_debugfs()
1921 device_root, pctldev, &pinctrl_groups_fops); in pinctrl_init_device_debugfs()
1923 device_root, pctldev, &pinctrl_gpioranges_fops); in pinctrl_init_device_debugfs()
1924 if (pctldev->desc->pmxops) in pinctrl_init_device_debugfs()
1925 pinmux_init_device_debugfs(device_root, pctldev); in pinctrl_init_device_debugfs()
1926 if (pctldev->desc->confops) in pinctrl_init_device_debugfs()
1927 pinconf_init_device_debugfs(device_root, pctldev); in pinctrl_init_device_debugfs()
1930 static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) in pinctrl_remove_device_debugfs() argument
1932 debugfs_remove_recursive(pctldev->device_root); in pinctrl_remove_device_debugfs()
1954 static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) in pinctrl_init_device_debugfs() argument
1962 static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) in pinctrl_remove_device_debugfs() argument
1968 static int pinctrl_check_ops(struct pinctrl_dev *pctldev) in pinctrl_check_ops() argument
1970 const struct pinctrl_ops *ops = pctldev->desc->pctlops; in pinctrl_check_ops()
1990 struct pinctrl_dev *pctldev; in pinctrl_init_controller() local
1998 pctldev = kzalloc(sizeof(*pctldev), GFP_KERNEL); in pinctrl_init_controller()
1999 if (!pctldev) in pinctrl_init_controller()
2003 pctldev->owner = pctldesc->owner; in pinctrl_init_controller()
2004 pctldev->desc = pctldesc; in pinctrl_init_controller()
2005 pctldev->driver_data = driver_data; in pinctrl_init_controller()
2006 INIT_RADIX_TREE(&pctldev->pin_desc_tree, GFP_KERNEL); in pinctrl_init_controller()
2008 INIT_RADIX_TREE(&pctldev->pin_group_tree, GFP_KERNEL); in pinctrl_init_controller()
2011 INIT_RADIX_TREE(&pctldev->pin_function_tree, GFP_KERNEL); in pinctrl_init_controller()
2013 INIT_LIST_HEAD(&pctldev->gpio_ranges); in pinctrl_init_controller()
2014 INIT_LIST_HEAD(&pctldev->node); in pinctrl_init_controller()
2015 pctldev->dev = dev; in pinctrl_init_controller()
2016 mutex_init(&pctldev->mutex); in pinctrl_init_controller()
2019 ret = pinctrl_check_ops(pctldev); in pinctrl_init_controller()
2027 ret = pinmux_check_ops(pctldev); in pinctrl_init_controller()
2034 ret = pinconf_check_ops(pctldev); in pinctrl_init_controller()
2041 ret = pinctrl_register_pins(pctldev, pctldesc->pins, pctldesc->npins); in pinctrl_init_controller()
2044 pinctrl_free_pindescs(pctldev, pctldesc->pins, in pinctrl_init_controller()
2049 return pctldev; in pinctrl_init_controller()
2052 mutex_destroy(&pctldev->mutex); in pinctrl_init_controller()
2053 kfree(pctldev); in pinctrl_init_controller()
2057 static int pinctrl_claim_hogs(struct pinctrl_dev *pctldev) in pinctrl_claim_hogs() argument
2059 pctldev->p = create_pinctrl(pctldev->dev, pctldev); in pinctrl_claim_hogs()
2060 if (PTR_ERR(pctldev->p) == -ENODEV) { in pinctrl_claim_hogs()
2061 dev_dbg(pctldev->dev, "no hogs found\n"); in pinctrl_claim_hogs()
2066 if (IS_ERR(pctldev->p)) { in pinctrl_claim_hogs()
2067 dev_err(pctldev->dev, "error claiming hogs: %li\n", in pinctrl_claim_hogs()
2068 PTR_ERR(pctldev->p)); in pinctrl_claim_hogs()
2070 return PTR_ERR(pctldev->p); in pinctrl_claim_hogs()
2073 pctldev->hog_default = in pinctrl_claim_hogs()
2074 pinctrl_lookup_state(pctldev->p, PINCTRL_STATE_DEFAULT); in pinctrl_claim_hogs()
2075 if (IS_ERR(pctldev->hog_default)) { in pinctrl_claim_hogs()
2076 dev_dbg(pctldev->dev, in pinctrl_claim_hogs()
2079 if (pinctrl_select_state(pctldev->p, in pinctrl_claim_hogs()
2080 pctldev->hog_default)) in pinctrl_claim_hogs()
2081 dev_err(pctldev->dev, in pinctrl_claim_hogs()
2085 pctldev->hog_sleep = in pinctrl_claim_hogs()
2086 pinctrl_lookup_state(pctldev->p, in pinctrl_claim_hogs()
2088 if (IS_ERR(pctldev->hog_sleep)) in pinctrl_claim_hogs()
2089 dev_dbg(pctldev->dev, in pinctrl_claim_hogs()
2095 int pinctrl_enable(struct pinctrl_dev *pctldev) in pinctrl_enable() argument
2099 error = pinctrl_claim_hogs(pctldev); in pinctrl_enable()
2101 dev_err(pctldev->dev, "could not claim hogs: %i\n", in pinctrl_enable()
2103 pinctrl_free_pindescs(pctldev, pctldev->desc->pins, in pinctrl_enable()
2104 pctldev->desc->npins); in pinctrl_enable()
2105 mutex_destroy(&pctldev->mutex); in pinctrl_enable()
2106 kfree(pctldev); in pinctrl_enable()
2112 list_add_tail(&pctldev->node, &pinctrldev_list); in pinctrl_enable()
2115 pinctrl_init_device_debugfs(pctldev); in pinctrl_enable()
2135 struct pinctrl_dev *pctldev; in pinctrl_register() local
2138 pctldev = pinctrl_init_controller(pctldesc, dev, driver_data); in pinctrl_register()
2139 if (IS_ERR(pctldev)) in pinctrl_register()
2140 return pctldev; in pinctrl_register()
2142 error = pinctrl_enable(pctldev); in pinctrl_register()
2146 return pctldev; in pinctrl_register()
2162 struct pinctrl_dev **pctldev) in pinctrl_register_and_init() argument
2176 *pctldev = p; in pinctrl_register_and_init()
2188 void pinctrl_unregister(struct pinctrl_dev *pctldev) in pinctrl_unregister() argument
2192 if (!pctldev) in pinctrl_unregister()
2195 mutex_lock(&pctldev->mutex); in pinctrl_unregister()
2196 pinctrl_remove_device_debugfs(pctldev); in pinctrl_unregister()
2197 mutex_unlock(&pctldev->mutex); in pinctrl_unregister()
2199 if (!IS_ERR_OR_NULL(pctldev->p)) in pinctrl_unregister()
2200 pinctrl_put(pctldev->p); in pinctrl_unregister()
2203 mutex_lock(&pctldev->mutex); in pinctrl_unregister()
2205 list_del(&pctldev->node); in pinctrl_unregister()
2206 pinmux_generic_free_functions(pctldev); in pinctrl_unregister()
2207 pinctrl_generic_free_groups(pctldev); in pinctrl_unregister()
2209 pinctrl_free_pindescs(pctldev, pctldev->desc->pins, in pinctrl_unregister()
2210 pctldev->desc->npins); in pinctrl_unregister()
2212 list_for_each_entry_safe(range, n, &pctldev->gpio_ranges, node) in pinctrl_unregister()
2215 mutex_unlock(&pctldev->mutex); in pinctrl_unregister()
2216 mutex_destroy(&pctldev->mutex); in pinctrl_unregister()
2217 kfree(pctldev); in pinctrl_unregister()
2224 struct pinctrl_dev *pctldev = *(struct pinctrl_dev **)res; in devm_pinctrl_dev_release() local
2226 pinctrl_unregister(pctldev); in devm_pinctrl_dev_release()
2231 struct pctldev **r = res; in devm_pinctrl_dev_match()
2254 struct pinctrl_dev **ptr, *pctldev; in devm_pinctrl_register() local
2260 pctldev = pinctrl_register(pctldesc, dev, driver_data); in devm_pinctrl_register()
2261 if (IS_ERR(pctldev)) { in devm_pinctrl_register()
2263 return pctldev; in devm_pinctrl_register()
2266 *ptr = pctldev; in devm_pinctrl_register()
2269 return pctldev; in devm_pinctrl_register()
2287 struct pinctrl_dev **pctldev) in devm_pinctrl_register_and_init() argument
2296 error = pinctrl_register_and_init(pctldesc, dev, driver_data, pctldev); in devm_pinctrl_register_and_init()
2302 *ptr = *pctldev; in devm_pinctrl_register_and_init()
2314 void devm_pinctrl_unregister(struct device *dev, struct pinctrl_dev *pctldev) in devm_pinctrl_unregister() argument
2317 devm_pinctrl_dev_match, pctldev)); in devm_pinctrl_unregister()