Lines Matching refs:rcdev
42 struct reset_controller_dev *rcdev; member
65 static const char *rcdev_name(struct reset_controller_dev *rcdev) in rcdev_name() argument
67 if (rcdev->dev) in rcdev_name()
68 return dev_name(rcdev->dev); in rcdev_name()
70 if (rcdev->of_node) in rcdev_name()
71 return rcdev->of_node->full_name; in rcdev_name()
86 static int of_reset_simple_xlate(struct reset_controller_dev *rcdev, in of_reset_simple_xlate() argument
89 if (reset_spec->args[0] >= rcdev->nr_resets) in of_reset_simple_xlate()
99 int reset_controller_register(struct reset_controller_dev *rcdev) in reset_controller_register() argument
101 if (!rcdev->of_xlate) { in reset_controller_register()
102 rcdev->of_reset_n_cells = 1; in reset_controller_register()
103 rcdev->of_xlate = of_reset_simple_xlate; in reset_controller_register()
106 INIT_LIST_HEAD(&rcdev->reset_control_head); in reset_controller_register()
109 list_add(&rcdev->list, &reset_controller_list); in reset_controller_register()
120 void reset_controller_unregister(struct reset_controller_dev *rcdev) in reset_controller_unregister() argument
123 list_del(&rcdev->list); in reset_controller_unregister()
143 struct reset_controller_dev *rcdev) in devm_reset_controller_register() argument
153 ret = reset_controller_register(rcdev); in devm_reset_controller_register()
159 *rcdevp = rcdev; in devm_reset_controller_register()
339 if (!rstc->rcdev->ops->reset) in reset_control_reset()
353 ret = rstc->rcdev->ops->reset(rstc->rcdev, rstc->id); in reset_control_reset()
466 if (!rstc->rcdev->ops->assert) in reset_control_assert()
474 if (!rstc->rcdev->ops->assert) in reset_control_assert()
479 rcdev_name(rstc->rcdev), rstc->id); in reset_control_assert()
484 return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id); in reset_control_assert()
549 rcdev_name(rstc->rcdev), rstc->id); in reset_control_deassert()
561 if (!rstc->rcdev->ops->deassert) in reset_control_deassert()
564 return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id); in reset_control_deassert()
612 if (rstc->rcdev->ops->status) in reset_control_status()
613 return rstc->rcdev->ops->status(rstc->rcdev, rstc->id); in reset_control_status()
659 list_for_each_entry(rc, &rstc->rcdev->reset_control_head, list) { in reset_control_acquire()
748 __reset_control_get_internal(struct reset_controller_dev *rcdev, in __reset_control_get_internal() argument
755 list_for_each_entry(rstc, &rcdev->reset_control_head, list) { in __reset_control_get_internal()
777 if (!try_module_get(rcdev->owner)) { in __reset_control_get_internal()
782 rstc->rcdev = rcdev; in __reset_control_get_internal()
783 list_add(&rstc->list, &rcdev->reset_control_head); in __reset_control_get_internal()
799 module_put(rstc->rcdev->owner); in __reset_control_release()
817 struct reset_controller_dev *r, *rcdev; in __of_reset_control_get() local
842 rcdev = NULL; in __of_reset_control_get()
845 rcdev = r; in __of_reset_control_get()
850 if (!rcdev) { in __of_reset_control_get()
855 if (WARN_ON(args.args_count != rcdev->of_reset_n_cells)) { in __of_reset_control_get()
860 rstc_id = rcdev->of_xlate(rcdev, &args); in __of_reset_control_get()
867 rstc = __reset_control_get_internal(rcdev, rstc_id, shared, acquired); in __of_reset_control_get()
880 struct reset_controller_dev *rcdev; in __reset_controller_by_name() local
884 list_for_each_entry(rcdev, &reset_controller_list, list) { in __reset_controller_by_name()
885 if (!rcdev->dev) in __reset_controller_by_name()
888 if (!strcmp(name, dev_name(rcdev->dev))) in __reset_controller_by_name()
889 return rcdev; in __reset_controller_by_name()
900 struct reset_controller_dev *rcdev; in __reset_control_get_from_lookup() local
914 rcdev = __reset_controller_by_name(lookup->provider); in __reset_control_get_from_lookup()
915 if (!rcdev) { in __reset_control_get_from_lookup()
922 rstc = __reset_control_get_internal(rcdev, in __reset_control_get_from_lookup()