• Home
  • Raw
  • Download

Lines Matching full:mux

31 	struct clk_omap_mux *mux = to_clk_omap_mux(hw);  in ti_clk_mux_get_parent()  local
36 * FIXME need a mux-specific flag to determine if val is bitwise or in ti_clk_mux_get_parent()
42 val = ti_clk_ll_ops->clk_readl(&mux->reg) >> mux->shift; in ti_clk_mux_get_parent()
43 val &= mux->mask; in ti_clk_mux_get_parent()
45 if (mux->table) { in ti_clk_mux_get_parent()
49 if (mux->table[i] == val) in ti_clk_mux_get_parent()
54 if (val && (mux->flags & CLK_MUX_INDEX_BIT)) in ti_clk_mux_get_parent()
57 if (val && (mux->flags & CLK_MUX_INDEX_ONE)) in ti_clk_mux_get_parent()
68 struct clk_omap_mux *mux = to_clk_omap_mux(hw); in ti_clk_mux_set_parent() local
71 if (mux->table) { in ti_clk_mux_set_parent()
72 index = mux->table[index]; in ti_clk_mux_set_parent()
74 if (mux->flags & CLK_MUX_INDEX_BIT) in ti_clk_mux_set_parent()
77 if (mux->flags & CLK_MUX_INDEX_ONE) in ti_clk_mux_set_parent()
81 if (mux->flags & CLK_MUX_HIWORD_MASK) { in ti_clk_mux_set_parent()
82 val = mux->mask << (mux->shift + 16); in ti_clk_mux_set_parent()
84 val = ti_clk_ll_ops->clk_readl(&mux->reg); in ti_clk_mux_set_parent()
85 val &= ~(mux->mask << mux->shift); in ti_clk_mux_set_parent()
87 val |= index << mux->shift; in ti_clk_mux_set_parent()
88 ti_clk_ll_ops->clk_writel(val, &mux->reg); in ti_clk_mux_set_parent()
89 ti_clk_latch(&mux->reg, mux->latch); in ti_clk_mux_set_parent()
95 * clk_mux_save_context - Save the parent selcted in the mux
98 * Save the parent mux value.
102 struct clk_omap_mux *mux = to_clk_omap_mux(hw); in clk_mux_save_context() local
104 mux->saved_parent = ti_clk_mux_get_parent(hw); in clk_mux_save_context()
109 * clk_mux_restore_context - Restore the parent in the mux
112 * Restore the saved parent mux value.
116 struct clk_omap_mux *mux = to_clk_omap_mux(hw); in clk_mux_restore_context() local
118 ti_clk_mux_set_parent(hw, mux->saved_parent); in clk_mux_restore_context()
135 struct clk_omap_mux *mux; in _register_mux() local
139 /* allocate the mux */ in _register_mux()
140 mux = kzalloc(sizeof(*mux), GFP_KERNEL); in _register_mux()
141 if (!mux) in _register_mux()
151 memcpy(&mux->reg, reg, sizeof(*reg)); in _register_mux()
152 mux->shift = shift; in _register_mux()
153 mux->mask = mask; in _register_mux()
154 mux->latch = latch; in _register_mux()
155 mux->flags = clk_mux_flags; in _register_mux()
156 mux->table = table; in _register_mux()
157 mux->hw.init = &init; in _register_mux()
159 clk = ti_clk_register(dev, &mux->hw, name); in _register_mux()
162 kfree(mux); in _register_mux()
168 * of_mux_clk_setup - Setup function for simple mux rate clock
187 pr_err("mux-clock %pOFn must have parents\n", node); in of_mux_clk_setup()
226 CLK_OF_DECLARE(mux_clk, "ti,mux-clock", of_mux_clk_setup);
230 struct clk_omap_mux *mux; in ti_clk_build_component_mux() local
236 mux = kzalloc(sizeof(*mux), GFP_KERNEL); in ti_clk_build_component_mux()
237 if (!mux) in ti_clk_build_component_mux()
240 mux->shift = setup->bit_shift; in ti_clk_build_component_mux()
241 mux->latch = -EINVAL; in ti_clk_build_component_mux()
243 mux->reg.index = setup->module; in ti_clk_build_component_mux()
244 mux->reg.offset = setup->reg; in ti_clk_build_component_mux()
247 mux->flags |= CLK_MUX_INDEX_ONE; in ti_clk_build_component_mux()
251 mux->mask = num_parents - 1; in ti_clk_build_component_mux()
252 mux->mask = (1 << fls(mux->mask)) - 1; in ti_clk_build_component_mux()
254 return &mux->hw; in ti_clk_build_component_mux()
259 struct clk_omap_mux *mux; in of_ti_composite_mux_clk_setup() local
263 mux = kzalloc(sizeof(*mux), GFP_KERNEL); in of_ti_composite_mux_clk_setup()
264 if (!mux) in of_ti_composite_mux_clk_setup()
267 if (ti_clk_get_reg_addr(node, 0, &mux->reg)) in of_ti_composite_mux_clk_setup()
271 mux->shift = val; in of_ti_composite_mux_clk_setup()
274 mux->flags |= CLK_MUX_INDEX_ONE; in of_ti_composite_mux_clk_setup()
283 mux->mask = num_parents - 1; in of_ti_composite_mux_clk_setup()
284 mux->mask = (1 << fls(mux->mask)) - 1; in of_ti_composite_mux_clk_setup()
286 if (!ti_clk_add_component(node, &mux->hw, CLK_COMPONENT_TYPE_MUX)) in of_ti_composite_mux_clk_setup()
290 kfree(mux); in of_ti_composite_mux_clk_setup()
292 CLK_OF_DECLARE(ti_composite_mux_clk_setup, "ti,composite-mux-clock",