Lines Matching full:mux
33 struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw); in clk_cpumux_get_parent() local
36 regmap_read(mux->regmap, mux->reg, &val); in clk_cpumux_get_parent()
38 val >>= mux->shift; in clk_cpumux_get_parent()
39 val &= mux->mask; in clk_cpumux_get_parent()
46 struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw); in clk_cpumux_set_parent() local
49 val = index << mux->shift; in clk_cpumux_set_parent()
50 mask = mux->mask << mux->shift; in clk_cpumux_set_parent()
52 return regmap_update_bits(mux->regmap, mux->reg, mask, val); in clk_cpumux_set_parent()
61 mtk_clk_register_cpumux(const struct mtk_composite *mux, in mtk_clk_register_cpumux() argument
72 init.name = mux->name; in mtk_clk_register_cpumux()
74 init.parent_names = mux->parent_names; in mtk_clk_register_cpumux()
75 init.num_parents = mux->num_parents; in mtk_clk_register_cpumux()
76 init.flags = mux->flags; in mtk_clk_register_cpumux()
78 cpumux->reg = mux->mux_reg; in mtk_clk_register_cpumux()
79 cpumux->shift = mux->mux_shift; in mtk_clk_register_cpumux()
80 cpumux->mask = BIT(mux->mux_width) - 1; in mtk_clk_register_cpumux()
120 const struct mtk_composite *mux = &clks[i]; in mtk_clk_register_cpumuxes() local
122 if (!IS_ERR_OR_NULL(clk_data->hws[mux->id])) { in mtk_clk_register_cpumuxes()
124 node, mux->id); in mtk_clk_register_cpumuxes()
128 hw = mtk_clk_register_cpumux(mux, regmap); in mtk_clk_register_cpumuxes()
130 pr_err("Failed to register clk %s: %pe\n", mux->name, in mtk_clk_register_cpumuxes()
135 clk_data->hws[mux->id] = hw; in mtk_clk_register_cpumuxes()
142 const struct mtk_composite *mux = &clks[i]; in mtk_clk_register_cpumuxes() local
144 if (IS_ERR_OR_NULL(clk_data->hws[mux->id])) in mtk_clk_register_cpumuxes()
147 mtk_clk_unregister_cpumux(clk_data->hws[mux->id]); in mtk_clk_register_cpumuxes()
148 clk_data->hws[mux->id] = ERR_PTR(-ENOENT); in mtk_clk_register_cpumuxes()
161 const struct mtk_composite *mux = &clks[i - 1]; in mtk_clk_unregister_cpumuxes() local
163 if (IS_ERR_OR_NULL(clk_data->hws[mux->id])) in mtk_clk_unregister_cpumuxes()
166 mtk_clk_unregister_cpumux(clk_data->hws[mux->id]); in mtk_clk_unregister_cpumuxes()
167 clk_data->hws[mux->id] = ERR_PTR(-ENOENT); in mtk_clk_unregister_cpumuxes()