Lines Matching refs:desc
38 const struct pinmux_ops *ops = pctldev->desc->pmxops; in pinmux_check_ops()
90 struct pin_desc *desc = pin_desc_get(pctldev, pin); in pinmux_can_be_used_for_gpio() local
91 const struct pinmux_ops *ops = pctldev->desc->pmxops; in pinmux_can_be_used_for_gpio()
94 if (!desc || !ops) in pinmux_can_be_used_for_gpio()
97 guard(mutex)(&desc->mux_lock); in pinmux_can_be_used_for_gpio()
98 if (ops->strict && desc->mux_usecount) in pinmux_can_be_used_for_gpio()
101 return !(ops->strict && !!desc->gpio_owner); in pinmux_can_be_used_for_gpio()
117 struct pin_desc *desc; in pin_request() local
118 const struct pinmux_ops *ops = pctldev->desc->pmxops; in pin_request()
121 desc = pin_desc_get(pctldev, pin); in pin_request()
122 if (desc == NULL) { in pin_request()
130 pin, desc->name, owner); in pin_request()
132 scoped_guard(mutex, &desc->mux_lock) { in pin_request()
134 desc->mux_usecount && strcmp(desc->mux_owner, owner)) { in pin_request()
137 desc->name, desc->mux_owner, owner); in pin_request()
141 if ((gpio_range || ops->strict) && desc->gpio_owner) { in pin_request()
144 desc->name, desc->gpio_owner, owner); in pin_request()
149 desc->gpio_owner = owner; in pin_request()
151 desc->mux_usecount++; in pin_request()
152 if (desc->mux_usecount > 1) in pin_request()
155 desc->mux_owner = owner; in pin_request()
187 scoped_guard(mutex, &desc->mux_lock) { in pin_request()
189 desc->gpio_owner = NULL; in pin_request()
191 desc->mux_usecount--; in pin_request()
192 if (!desc->mux_usecount) in pin_request()
193 desc->mux_owner = NULL; in pin_request()
219 const struct pinmux_ops *ops = pctldev->desc->pmxops; in pin_free()
220 struct pin_desc *desc; in pin_free() local
223 desc = pin_desc_get(pctldev, pin); in pin_free()
224 if (desc == NULL) { in pin_free()
230 scoped_guard(mutex, &desc->mux_lock) { in pin_free()
235 if (WARN_ON(!desc->mux_usecount)) in pin_free()
237 desc->mux_usecount--; in pin_free()
238 if (desc->mux_usecount) in pin_free()
252 scoped_guard(mutex, &desc->mux_lock) { in pin_free()
254 owner = desc->gpio_owner; in pin_free()
255 desc->gpio_owner = NULL; in pin_free()
257 owner = desc->mux_owner; in pin_free()
258 desc->mux_owner = NULL; in pin_free()
259 desc->mux_setting = NULL; in pin_free()
323 ops = pctldev->desc->pmxops; in pinmux_gpio_direction()
336 const struct pinmux_ops *ops = pctldev->desc->pmxops; in pinmux_func_name_to_selector()
357 const struct pinmux_ops *pmxops = pctldev->desc->pmxops; in pinmux_map_to_setting()
421 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; in pinmux_enable_setting()
422 const struct pinmux_ops *ops = pctldev->desc->pmxops; in pinmux_enable_setting()
427 struct pin_desc *desc; in pinmux_enable_setting() local
452 desc = pin_desc_get(pctldev, pins[i]); in pinmux_enable_setting()
453 pname = desc ? desc->name : "non-existing"; in pinmux_enable_setting()
467 desc = pin_desc_get(pctldev, pins[i]); in pinmux_enable_setting()
468 if (desc == NULL) { in pinmux_enable_setting()
474 scoped_guard(mutex, &desc->mux_lock) in pinmux_enable_setting()
475 desc->mux_setting = &(setting->data.mux); in pinmux_enable_setting()
488 desc = pin_desc_get(pctldev, pins[i]); in pinmux_enable_setting()
489 if (desc) { in pinmux_enable_setting()
490 scoped_guard(mutex, &desc->mux_lock) in pinmux_enable_setting()
491 desc->mux_setting = NULL; in pinmux_enable_setting()
505 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; in pinmux_disable_setting()
510 struct pin_desc *desc; in pinmux_disable_setting() local
530 desc = pin_desc_get(pctldev, pins[i]); in pinmux_disable_setting()
531 if (desc == NULL) { in pinmux_disable_setting()
537 scoped_guard(mutex, &desc->mux_lock) in pinmux_disable_setting()
538 is_equal = (desc->mux_setting == &(setting->data.mux)); in pinmux_disable_setting()
551 pins[i], desc->name, gname); in pinmux_disable_setting()
562 const struct pinmux_ops *pmxops = pctldev->desc->pmxops; in pinmux_functions_show()
604 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; in pinmux_pins_show()
605 const struct pinmux_ops *pmxops = pctldev->desc->pmxops; in pinmux_pins_show()
622 for (i = 0; i < pctldev->desc->npins; i++) { in pinmux_pins_show()
623 struct pin_desc *desc; in pinmux_pins_show() local
626 pin = pctldev->desc->pins[i].number; in pinmux_pins_show()
627 desc = pin_desc_get(pctldev, pin); in pinmux_pins_show()
629 if (desc == NULL) in pinmux_pins_show()
632 scoped_guard(mutex, &desc->mux_lock) { in pinmux_pins_show()
633 if (desc->mux_owner && in pinmux_pins_show()
634 !strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev))) in pinmux_pins_show()
638 if (desc->mux_owner) in pinmux_pins_show()
640 pin, desc->name, desc->mux_owner, in pinmux_pins_show()
642 else if (desc->gpio_owner) in pinmux_pins_show()
644 pin, desc->name, desc->gpio_owner); in pinmux_pins_show()
647 pin, desc->name); in pinmux_pins_show()
650 seq_printf(s, "pin %d (%s): %s %s%s", pin, desc->name, in pinmux_pins_show()
651 desc->mux_owner ? desc->mux_owner in pinmux_pins_show()
653 desc->gpio_owner ? desc->gpio_owner in pinmux_pins_show()
659 if (desc->mux_setting) in pinmux_pins_show()
662 desc->mux_setting->func), in pinmux_pins_show()
664 desc->mux_setting->group)); in pinmux_pins_show()
686 const struct pinmux_ops *pmxops = pctldev->desc->pmxops; in pinmux_show_setting()
687 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; in pinmux_show_setting()
704 const struct pinmux_ops *pmxops = pctldev->desc->pmxops; in pinmux_select()