Lines Matching refs:rstc
31 #define reset_control_to_array(rstc) rt_container_of(rstc, struct reset_control_array, captain) argument
83 rt_err_t rt_reset_control_reset(struct rt_reset_control *rstc) in rt_reset_control_reset() argument
87 if (!rstc) in rt_reset_control_reset()
92 if (rstc->rstcer->ops->reset) in rt_reset_control_reset()
94 if ((err = rstc->rstcer->ops->reset(rstc))) in rt_reset_control_reset()
100 if (rstc->is_array) in rt_reset_control_reset()
102 struct reset_control_array *rstc_arr = reset_control_to_array(rstc); in rt_reset_control_reset()
116 rt_err_t rt_reset_control_assert(struct rt_reset_control *rstc) in rt_reset_control_assert() argument
120 if (!rstc) in rt_reset_control_assert()
125 if (rstc->rstcer->ops->assert) in rt_reset_control_assert()
127 if ((err = rstc->rstcer->ops->assert(rstc))) in rt_reset_control_assert()
133 if (rstc->is_array) in rt_reset_control_assert()
135 struct reset_control_array *rstc_arr = reset_control_to_array(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()
159 rt_err_t rt_reset_control_deassert(struct rt_reset_control *rstc) in rt_reset_control_deassert() argument
163 if (!rstc) in rt_reset_control_deassert()
168 if (rstc->rstcer->ops->deassert) in rt_reset_control_deassert()
170 if ((err = rstc->rstcer->ops->deassert(rstc))) in rt_reset_control_deassert()
176 if (rstc->is_array) in rt_reset_control_deassert()
178 struct reset_control_array *rstc_arr = reset_control_to_array(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()
202 int rt_reset_control_status(struct rt_reset_control *rstc) in rt_reset_control_status() argument
204 if (!rstc) in rt_reset_control_status()
209 if (rstc->rstcer->ops->status) in rt_reset_control_status()
211 return rstc->rstcer->ops->status(rstc); in rt_reset_control_status()
217 static void reset_free(struct rt_reset_control *rstc) in reset_free() argument
219 if (rstc->is_array) in reset_free()
221 struct reset_control_array *rstc_arr = reset_control_to_array(rstc); in reset_free()
229 rt_free(rstc); in reset_free()
247 void rt_reset_control_put(struct rt_reset_control *rstc) in rt_reset_control_put() argument
251 if (!rstc) in rt_reset_control_put()
256 rstcer = rstc->rstcer; in rt_reset_control_put()
260 rt_list_remove(&rstc->list); in rt_reset_control_put()
264 reset_free(rstc); in rt_reset_control_put()
271 struct rt_reset_control *rstc; in ofw_get_reset_control() local
318 rstc = &rstc_arr->captain; in ofw_get_reset_control()
319 rstc->is_array = RT_TRUE; in ofw_get_reset_control()
323 rstc = rt_calloc(1, sizeof(*rstc)); in ofw_get_reset_control()
325 if (!rstc) in ofw_get_reset_control()
372 rstc->con_id = name; in ofw_get_reset_control()
373 rstc->rstcer = rstcer; in ofw_get_reset_control()
377 err = rstcer->ops->ofw_parse(rstc, &reset_args); in ofw_get_reset_control()
388 rstc->id = reset_args.args[0]; in ofw_get_reset_control()
390 rt_list_init(&rstc->list); in ofw_get_reset_control()
394 rt_list_insert_after(&rstcer->rstc_nodes, &rstc->list); in ofw_get_reset_control()
398 return rstc; in ofw_get_reset_control()
401 if (rstc && !rstc->is_array) in ofw_get_reset_control()
403 rt_free(rstc); in ofw_get_reset_control()