Lines Matching refs:rcdev
15 static inline struct mtk_clk_rst_data *to_mtk_clk_rst_data(struct reset_controller_dev *rcdev) in to_mtk_clk_rst_data() argument
17 return container_of(rcdev, struct mtk_clk_rst_data, rcdev); in to_mtk_clk_rst_data()
20 static int mtk_reset_update(struct reset_controller_dev *rcdev, in mtk_reset_update() argument
23 struct mtk_clk_rst_data *data = to_mtk_clk_rst_data(rcdev); in mtk_reset_update()
31 static int mtk_reset_assert(struct reset_controller_dev *rcdev, in mtk_reset_assert() argument
34 return mtk_reset_update(rcdev, id, false); in mtk_reset_assert()
37 static int mtk_reset_deassert(struct reset_controller_dev *rcdev, in mtk_reset_deassert() argument
40 return mtk_reset_update(rcdev, id, true); in mtk_reset_deassert()
43 static int mtk_reset(struct reset_controller_dev *rcdev, unsigned long id) in mtk_reset() argument
47 ret = mtk_reset_assert(rcdev, id); in mtk_reset()
51 return mtk_reset_deassert(rcdev, id); in mtk_reset()
54 static int mtk_reset_update_set_clr(struct reset_controller_dev *rcdev, in mtk_reset_update_set_clr() argument
57 struct mtk_clk_rst_data *data = to_mtk_clk_rst_data(rcdev); in mtk_reset_update_set_clr()
66 static int mtk_reset_assert_set_clr(struct reset_controller_dev *rcdev, in mtk_reset_assert_set_clr() argument
69 return mtk_reset_update_set_clr(rcdev, id, false); in mtk_reset_assert_set_clr()
72 static int mtk_reset_deassert_set_clr(struct reset_controller_dev *rcdev, in mtk_reset_deassert_set_clr() argument
75 return mtk_reset_update_set_clr(rcdev, id, true); in mtk_reset_deassert_set_clr()
78 static int mtk_reset_set_clr(struct reset_controller_dev *rcdev, in mtk_reset_set_clr() argument
83 ret = mtk_reset_assert_set_clr(rcdev, id); in mtk_reset_set_clr()
86 return mtk_reset_deassert_set_clr(rcdev, id); in mtk_reset_set_clr()
101 static int reset_xlate(struct reset_controller_dev *rcdev, in reset_xlate() argument
104 struct mtk_clk_rst_data *data = to_mtk_clk_rst_data(rcdev); in reset_xlate()
106 if (reset_spec->args[0] >= rcdev->nr_resets || in reset_xlate()
150 data->rcdev.owner = THIS_MODULE; in mtk_register_reset_controller()
151 data->rcdev.ops = rcops; in mtk_register_reset_controller()
152 data->rcdev.of_node = np; in mtk_register_reset_controller()
155 data->rcdev.of_reset_n_cells = 1; in mtk_register_reset_controller()
156 data->rcdev.nr_resets = desc->rst_idx_map_nr; in mtk_register_reset_controller()
157 data->rcdev.of_xlate = reset_xlate; in mtk_register_reset_controller()
159 data->rcdev.nr_resets = desc->rst_bank_nr * RST_NR_PER_BANK; in mtk_register_reset_controller()
162 ret = reset_controller_register(&data->rcdev); in mtk_register_reset_controller()
210 data->rcdev.owner = THIS_MODULE; in mtk_register_reset_controller_with_dev()
211 data->rcdev.ops = rcops; in mtk_register_reset_controller_with_dev()
212 data->rcdev.of_node = np; in mtk_register_reset_controller_with_dev()
213 data->rcdev.dev = dev; in mtk_register_reset_controller_with_dev()
216 data->rcdev.of_reset_n_cells = 1; in mtk_register_reset_controller_with_dev()
217 data->rcdev.nr_resets = desc->rst_idx_map_nr; in mtk_register_reset_controller_with_dev()
218 data->rcdev.of_xlate = reset_xlate; in mtk_register_reset_controller_with_dev()
220 data->rcdev.nr_resets = desc->rst_bank_nr * RST_NR_PER_BANK; in mtk_register_reset_controller_with_dev()
223 ret = devm_reset_controller_register(dev, &data->rcdev); in mtk_register_reset_controller_with_dev()