Lines Matching refs:mux

27 static inline u32 clk_mux_readl(struct clk_mux *mux)  in clk_mux_readl()  argument
29 if (mux->flags & CLK_MUX_BIG_ENDIAN) in clk_mux_readl()
30 return ioread32be(mux->reg); in clk_mux_readl()
32 return readl(mux->reg); in clk_mux_readl()
35 static inline void clk_mux_writel(struct clk_mux *mux, u32 val) in clk_mux_writel() argument
37 if (mux->flags & CLK_MUX_BIG_ENDIAN) in clk_mux_writel()
38 iowrite32be(val, mux->reg); in clk_mux_writel()
40 writel(val, mux->reg); in clk_mux_writel()
90 struct clk_mux *mux = to_clk_mux(hw); in clk_mux_get_parent() local
93 val = clk_mux_readl(mux) >> mux->shift; in clk_mux_get_parent()
94 val &= mux->mask; in clk_mux_get_parent()
96 return clk_mux_val_to_index(hw, mux->table, mux->flags, val); in clk_mux_get_parent()
101 struct clk_mux *mux = to_clk_mux(hw); in clk_mux_set_parent() local
102 u32 val = clk_mux_index_to_val(mux->table, mux->flags, index); in clk_mux_set_parent()
106 if (mux->lock) in clk_mux_set_parent()
107 spin_lock_irqsave(mux->lock, flags); in clk_mux_set_parent()
109 __acquire(mux->lock); in clk_mux_set_parent()
111 if (mux->flags & CLK_MUX_HIWORD_MASK) { in clk_mux_set_parent()
112 reg = mux->mask << (mux->shift + 16); in clk_mux_set_parent()
114 reg = clk_mux_readl(mux); in clk_mux_set_parent()
115 reg &= ~(mux->mask << mux->shift); in clk_mux_set_parent()
117 val = val << mux->shift; in clk_mux_set_parent()
119 clk_mux_writel(mux, reg); in clk_mux_set_parent()
121 if (mux->lock) in clk_mux_set_parent()
122 spin_unlock_irqrestore(mux->lock, flags); in clk_mux_set_parent()
124 __release(mux->lock); in clk_mux_set_parent()
132 struct clk_mux *mux = to_clk_mux(hw); in clk_mux_determine_rate() local
134 return clk_mux_determine_rate_flags(hw, req, mux->flags); in clk_mux_determine_rate()
157 struct clk_mux *mux; in __clk_hw_register_mux() local
172 mux = kzalloc(sizeof(*mux), GFP_KERNEL); in __clk_hw_register_mux()
173 if (!mux) in __clk_hw_register_mux()
188 mux->reg = reg; in __clk_hw_register_mux()
189 mux->shift = shift; in __clk_hw_register_mux()
190 mux->mask = mask; in __clk_hw_register_mux()
191 mux->flags = clk_mux_flags; in __clk_hw_register_mux()
192 mux->lock = lock; in __clk_hw_register_mux()
193 mux->table = table; in __clk_hw_register_mux()
194 mux->hw.init = &init; in __clk_hw_register_mux()
196 hw = &mux->hw; in __clk_hw_register_mux()
202 kfree(mux); in __clk_hw_register_mux()
262 struct clk_mux *mux; in clk_unregister_mux() local
269 mux = to_clk_mux(hw); in clk_unregister_mux()
272 kfree(mux); in clk_unregister_mux()
278 struct clk_mux *mux; in clk_hw_unregister_mux() local
280 mux = to_clk_mux(hw); in clk_hw_unregister_mux()
283 kfree(mux); in clk_hw_unregister_mux()