Lines Matching refs:div
67 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_is_enabled() local
68 struct berlin2_div_map *map = &div->map; in berlin2_div_is_enabled()
71 if (div->lock) in berlin2_div_is_enabled()
72 spin_lock(div->lock); in berlin2_div_is_enabled()
74 reg = readl_relaxed(div->base + map->gate_offs); in berlin2_div_is_enabled()
77 if (div->lock) in berlin2_div_is_enabled()
78 spin_unlock(div->lock); in berlin2_div_is_enabled()
85 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_enable() local
86 struct berlin2_div_map *map = &div->map; in berlin2_div_enable()
89 if (div->lock) in berlin2_div_enable()
90 spin_lock(div->lock); in berlin2_div_enable()
92 reg = readl_relaxed(div->base + map->gate_offs); in berlin2_div_enable()
94 writel_relaxed(reg, div->base + map->gate_offs); in berlin2_div_enable()
96 if (div->lock) in berlin2_div_enable()
97 spin_unlock(div->lock); in berlin2_div_enable()
104 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_disable() local
105 struct berlin2_div_map *map = &div->map; in berlin2_div_disable()
108 if (div->lock) in berlin2_div_disable()
109 spin_lock(div->lock); in berlin2_div_disable()
111 reg = readl_relaxed(div->base + map->gate_offs); in berlin2_div_disable()
113 writel_relaxed(reg, div->base + map->gate_offs); in berlin2_div_disable()
115 if (div->lock) in berlin2_div_disable()
116 spin_unlock(div->lock); in berlin2_div_disable()
121 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_set_parent() local
122 struct berlin2_div_map *map = &div->map; in berlin2_div_set_parent()
125 if (div->lock) in berlin2_div_set_parent()
126 spin_lock(div->lock); in berlin2_div_set_parent()
129 reg = readl_relaxed(div->base + map->pll_switch_offs); in berlin2_div_set_parent()
134 writel_relaxed(reg, div->base + map->pll_switch_offs); in berlin2_div_set_parent()
138 reg = readl_relaxed(div->base + map->pll_select_offs); in berlin2_div_set_parent()
141 writel_relaxed(reg, div->base + map->pll_select_offs); in berlin2_div_set_parent()
144 if (div->lock) in berlin2_div_set_parent()
145 spin_unlock(div->lock); in berlin2_div_set_parent()
152 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_get_parent() local
153 struct berlin2_div_map *map = &div->map; in berlin2_div_get_parent()
157 if (div->lock) in berlin2_div_get_parent()
158 spin_lock(div->lock); in berlin2_div_get_parent()
161 reg = readl_relaxed(div->base + map->pll_switch_offs); in berlin2_div_get_parent()
164 reg = readl_relaxed(div->base + map->pll_select_offs); in berlin2_div_get_parent()
170 if (div->lock) in berlin2_div_get_parent()
171 spin_unlock(div->lock); in berlin2_div_get_parent()
179 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_recalc_rate() local
180 struct berlin2_div_map *map = &div->map; in berlin2_div_recalc_rate()
183 if (div->lock) in berlin2_div_recalc_rate()
184 spin_lock(div->lock); in berlin2_div_recalc_rate()
186 divsw = readl_relaxed(div->base + map->div_switch_offs) & in berlin2_div_recalc_rate()
188 div3sw = readl_relaxed(div->base + map->div3_switch_offs) & in berlin2_div_recalc_rate()
200 reg = readl_relaxed(div->base + map->div_select_offs); in berlin2_div_recalc_rate()
206 if (div->lock) in berlin2_div_recalc_rate()
207 spin_unlock(div->lock); in berlin2_div_recalc_rate()
237 struct berlin2_div *div; in berlin2_div_register() local
239 div = kzalloc(sizeof(*div), GFP_KERNEL); in berlin2_div_register()
240 if (!div) in berlin2_div_register()
244 memcpy(&div->map, map, sizeof(*map)); in berlin2_div_register()
245 div->base = base; in berlin2_div_register()
246 div->lock = lock; in berlin2_div_register()
254 &div->hw, mux_ops, &div->hw, rate_ops, in berlin2_div_register()
255 &div->hw, gate_ops, flags); in berlin2_div_register()