Lines Matching +full:reg +full:- +full:mux

1 // SPDX-License-Identifier: GPL-2.0-or-later
7 #include <linux/clk-provider.h>
11 #include "clk-uniphier.h"
16 unsigned int reg; member
25 struct uniphier_clk_mux *mux = to_uniphier_clk_mux(hw); in uniphier_clk_mux_set_parent() local
27 return regmap_write_bits(mux->regmap, mux->reg, mux->masks[index], in uniphier_clk_mux_set_parent()
28 mux->vals[index]); in uniphier_clk_mux_set_parent()
33 struct uniphier_clk_mux *mux = to_uniphier_clk_mux(hw); in uniphier_clk_mux_get_parent() local
39 ret = regmap_read(mux->regmap, mux->reg, &val); in uniphier_clk_mux_get_parent()
44 if ((mux->masks[i] & val) == mux->vals[i]) in uniphier_clk_mux_get_parent()
47 return -EINVAL; in uniphier_clk_mux_get_parent()
61 struct uniphier_clk_mux *mux; in uniphier_clk_register_mux() local
65 mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL); in uniphier_clk_register_mux()
66 if (!mux) in uniphier_clk_register_mux()
67 return ERR_PTR(-ENOMEM); in uniphier_clk_register_mux()
72 init.parent_names = data->parent_names; in uniphier_clk_register_mux()
73 init.num_parents = data->num_parents; in uniphier_clk_register_mux()
75 mux->regmap = regmap; in uniphier_clk_register_mux()
76 mux->reg = data->reg; in uniphier_clk_register_mux()
77 mux->masks = data->masks; in uniphier_clk_register_mux()
78 mux->vals = data->vals; in uniphier_clk_register_mux()
79 mux->hw.init = &init; in uniphier_clk_register_mux()
81 ret = devm_clk_hw_register(dev, &mux->hw); in uniphier_clk_register_mux()
85 return &mux->hw; in uniphier_clk_register_mux()