Lines Matching refs:mux
33 struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw);
36 regmap_read(mux->regmap, mux->reg, &val);
38 val >>= mux->shift;
39 val &= mux->mask;
46 struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw);
49 val = index << mux->shift;
50 mask = mux->mask << mux->shift;
52 return regmap_update_bits(mux->regmap, mux->reg, mask, val);
62 mtk_clk_register_cpumux(struct device *dev, const struct mtk_composite *mux,
73 init.name = mux->name;
75 init.parent_names = mux->parent_names;
76 init.num_parents = mux->num_parents;
77 init.flags = mux->flags;
79 cpumux->reg = mux->mux_reg;
80 cpumux->shift = mux->mux_shift;
81 cpumux->mask = BIT(mux->mux_width) - 1;
121 const struct mtk_composite *mux = &clks[i];
123 if (!IS_ERR_OR_NULL(clk_data->hws[mux->id])) {
125 node, mux->id);
129 hw = mtk_clk_register_cpumux(dev, mux, regmap);
131 pr_err("Failed to register clk %s: %pe\n", mux->name,
136 clk_data->hws[mux->id] = hw;
143 const struct mtk_composite *mux = &clks[i];
145 if (IS_ERR_OR_NULL(clk_data->hws[mux->id]))
148 mtk_clk_unregister_cpumux(clk_data->hws[mux->id]);
149 clk_data->hws[mux->id] = ERR_PTR(-ENOENT);
162 const struct mtk_composite *mux = &clks[i - 1];
164 if (IS_ERR_OR_NULL(clk_data->hws[mux->id]))
167 mtk_clk_unregister_cpumux(clk_data->hws[mux->id]);
168 clk_data->hws[mux->id] = ERR_PTR(-ENOENT);