Lines Matching +full:reg +full:- +full:mux
1 // SPDX-License-Identifier: GPL-2.0+
3 // OWL mux clock driver
6 // Author: David Liu <liuwei@actions-semi.com>
11 #include <linux/clk-provider.h>
14 #include "owl-mux.h"
19 u32 reg; in owl_mux_helper_get_parent() local
22 regmap_read(common->regmap, mux_hw->reg, ®); in owl_mux_helper_get_parent()
23 parent = reg >> mux_hw->shift; in owl_mux_helper_get_parent()
24 parent &= BIT(mux_hw->width) - 1; in owl_mux_helper_get_parent()
31 struct owl_mux *mux = hw_to_owl_mux(hw); in owl_mux_get_parent() local
33 return owl_mux_helper_get_parent(&mux->common, &mux->mux_hw); in owl_mux_get_parent()
39 u32 reg; in owl_mux_helper_set_parent() local
41 regmap_read(common->regmap, mux_hw->reg, ®); in owl_mux_helper_set_parent()
42 reg &= ~GENMASK(mux_hw->width + mux_hw->shift - 1, mux_hw->shift); in owl_mux_helper_set_parent()
43 regmap_write(common->regmap, mux_hw->reg, in owl_mux_helper_set_parent()
44 reg | (index << mux_hw->shift)); in owl_mux_helper_set_parent()
51 struct owl_mux *mux = hw_to_owl_mux(hw); in owl_mux_set_parent() local
53 return owl_mux_helper_set_parent(&mux->common, &mux->mux_hw, index); in owl_mux_set_parent()