Lines Matching refs:rstcer
33 rt_err_t rt_reset_controller_register(struct rt_reset_controller *rstcer) in rt_reset_controller_register() argument
35 if (!rstcer) in rt_reset_controller_register()
41 rt_strncpy(rstcer->parent.name, RT_RESET_CONTROLLER_OBJ_NAME, RT_NAME_MAX); in rt_reset_controller_register()
43 rstcer->parent.name = RT_RESET_CONTROLLER_OBJ_NAME; in rt_reset_controller_register()
46 rt_list_init(&rstcer->rstc_nodes); in rt_reset_controller_register()
47 rt_spin_lock_init(&rstcer->spinlock); in rt_reset_controller_register()
49 if (rstcer->ofw_node) in rt_reset_controller_register()
51 if (!rt_ofw_data(rstcer->ofw_node)) in rt_reset_controller_register()
53 rt_ofw_data(rstcer->ofw_node) = rstcer; in rt_reset_controller_register()
60 rt_err_t rt_reset_controller_unregister(struct rt_reset_controller *rstcer) in rt_reset_controller_unregister() argument
64 if (!rstcer) in rt_reset_controller_unregister()
69 rt_spin_lock(&rstcer->spinlock); in rt_reset_controller_unregister()
71 if (!rt_list_isempty(&rstcer->rstc_nodes)) in rt_reset_controller_unregister()
78 rt_spin_unlock(&rstcer->spinlock); in rt_reset_controller_unregister()
92 if (rstc->rstcer->ops->reset) in rt_reset_control_reset()
94 if ((err = rstc->rstcer->ops->reset(rstc))) in rt_reset_control_reset()
125 if (rstc->rstcer->ops->assert) in rt_reset_control_assert()
127 if ((err = rstc->rstcer->ops->assert(rstc))) in rt_reset_control_assert()
141 if (rstc->rstcer->ops->deassert) in rt_reset_control_assert()
143 rstc->rstcer->ops->deassert(rstc); in rt_reset_control_assert()
168 if (rstc->rstcer->ops->deassert) in rt_reset_control_deassert()
170 if ((err = rstc->rstcer->ops->deassert(rstc))) in rt_reset_control_deassert()
184 if (rstc->rstcer->ops->assert) in rt_reset_control_deassert()
186 rstc->rstcer->ops->assert(rstc); in rt_reset_control_deassert()
209 if (rstc->rstcer->ops->status) in rt_reset_control_status()
211 return rstc->rstcer->ops->status(rstc); in rt_reset_control_status()
249 struct rt_reset_controller *rstcer; in rt_reset_control_put() local
256 rstcer = rstc->rstcer; in rt_reset_control_put()
258 rt_spin_lock(&rstcer->spinlock); in rt_reset_control_put()
262 rt_spin_unlock(&rstcer->spinlock); in rt_reset_control_put()
273 struct rt_reset_controller *rstcer = RT_NULL; in ofw_get_reset_control() local
350 rstcer = rt_container_of(obj, struct rt_reset_controller, parent); in ofw_get_reset_control()
355 if (!rstcer) in ofw_get_reset_control()
373 rstc->rstcer = rstcer; in ofw_get_reset_control()
375 if (rstcer->ops->ofw_parse) in ofw_get_reset_control()
377 err = rstcer->ops->ofw_parse(rstc, &reset_args); in ofw_get_reset_control()
392 rt_spin_lock(&rstcer->spinlock); in ofw_get_reset_control()
394 rt_list_insert_after(&rstcer->rstc_nodes, &rstc->list); in ofw_get_reset_control()
396 rt_spin_unlock(&rstcer->spinlock); in ofw_get_reset_control()