Lines Matching refs:mc
200 static struct clk_hw *mtk_clk_register_composite(const struct mtk_composite *mc, in mtk_clk_register_composite() argument
214 if (mc->mux_shift >= 0) { in mtk_clk_register_composite()
219 mux->reg = base + mc->mux_reg; in mtk_clk_register_composite()
220 mux->mask = BIT(mc->mux_width) - 1; in mtk_clk_register_composite()
221 mux->shift = mc->mux_shift; in mtk_clk_register_composite()
223 mux->flags = mc->mux_flags; in mtk_clk_register_composite()
227 parent_names = mc->parent_names; in mtk_clk_register_composite()
228 num_parents = mc->num_parents; in mtk_clk_register_composite()
230 parent = mc->parent; in mtk_clk_register_composite()
235 if (mc->gate_shift >= 0) { in mtk_clk_register_composite()
242 gate->reg = base + mc->gate_reg; in mtk_clk_register_composite()
243 gate->bit_idx = mc->gate_shift; in mtk_clk_register_composite()
251 if (mc->divider_shift >= 0) { in mtk_clk_register_composite()
258 div->reg = base + mc->divider_reg; in mtk_clk_register_composite()
259 div->shift = mc->divider_shift; in mtk_clk_register_composite()
260 div->width = mc->divider_width; in mtk_clk_register_composite()
267 hw = clk_hw_register_composite(NULL, mc->name, parent_names, num_parents, in mtk_clk_register_composite()
271 mc->flags); in mtk_clk_register_composite()
322 const struct mtk_composite *mc = &mcs[i]; in mtk_clk_register_composites() local
324 if (!IS_ERR_OR_NULL(clk_data->hws[mc->id])) { in mtk_clk_register_composites()
326 mc->id); in mtk_clk_register_composites()
330 hw = mtk_clk_register_composite(mc, base, lock); in mtk_clk_register_composites()
333 pr_err("Failed to register clk %s: %pe\n", mc->name, in mtk_clk_register_composites()
338 clk_data->hws[mc->id] = hw; in mtk_clk_register_composites()
345 const struct mtk_composite *mc = &mcs[i]; in mtk_clk_register_composites() local
350 mtk_clk_unregister_composite(clk_data->hws[mc->id]); in mtk_clk_register_composites()
351 clk_data->hws[mc->id] = ERR_PTR(-ENOENT); in mtk_clk_register_composites()
367 const struct mtk_composite *mc = &mcs[i - 1]; in mtk_clk_unregister_composites() local
369 if (IS_ERR_OR_NULL(clk_data->hws[mc->id])) in mtk_clk_unregister_composites()
372 mtk_clk_unregister_composite(clk_data->hws[mc->id]); in mtk_clk_unregister_composites()
373 clk_data->hws[mc->id] = ERR_PTR(-ENOENT); in mtk_clk_unregister_composites()