Lines Matching refs:div
77 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_is_enabled() local
78 struct berlin2_div_map *map = &div->map; in berlin2_div_is_enabled()
81 if (div->lock) in berlin2_div_is_enabled()
82 spin_lock(div->lock); in berlin2_div_is_enabled()
84 reg = readl_relaxed(div->base + map->gate_offs); in berlin2_div_is_enabled()
87 if (div->lock) in berlin2_div_is_enabled()
88 spin_unlock(div->lock); in berlin2_div_is_enabled()
95 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_enable() local
96 struct berlin2_div_map *map = &div->map; in berlin2_div_enable()
99 if (div->lock) in berlin2_div_enable()
100 spin_lock(div->lock); in berlin2_div_enable()
102 reg = readl_relaxed(div->base + map->gate_offs); in berlin2_div_enable()
104 writel_relaxed(reg, div->base + map->gate_offs); in berlin2_div_enable()
106 if (div->lock) in berlin2_div_enable()
107 spin_unlock(div->lock); in berlin2_div_enable()
114 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_disable() local
115 struct berlin2_div_map *map = &div->map; in berlin2_div_disable()
118 if (div->lock) in berlin2_div_disable()
119 spin_lock(div->lock); in berlin2_div_disable()
121 reg = readl_relaxed(div->base + map->gate_offs); in berlin2_div_disable()
123 writel_relaxed(reg, div->base + map->gate_offs); in berlin2_div_disable()
125 if (div->lock) in berlin2_div_disable()
126 spin_unlock(div->lock); in berlin2_div_disable()
131 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_set_parent() local
132 struct berlin2_div_map *map = &div->map; in berlin2_div_set_parent()
135 if (div->lock) in berlin2_div_set_parent()
136 spin_lock(div->lock); in berlin2_div_set_parent()
139 reg = readl_relaxed(div->base + map->pll_switch_offs); in berlin2_div_set_parent()
144 writel_relaxed(reg, div->base + map->pll_switch_offs); in berlin2_div_set_parent()
148 reg = readl_relaxed(div->base + map->pll_select_offs); in berlin2_div_set_parent()
151 writel_relaxed(reg, div->base + map->pll_select_offs); in berlin2_div_set_parent()
154 if (div->lock) in berlin2_div_set_parent()
155 spin_unlock(div->lock); in berlin2_div_set_parent()
162 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_get_parent() local
163 struct berlin2_div_map *map = &div->map; in berlin2_div_get_parent()
167 if (div->lock) in berlin2_div_get_parent()
168 spin_lock(div->lock); in berlin2_div_get_parent()
171 reg = readl_relaxed(div->base + map->pll_switch_offs); in berlin2_div_get_parent()
174 reg = readl_relaxed(div->base + map->pll_select_offs); in berlin2_div_get_parent()
180 if (div->lock) in berlin2_div_get_parent()
181 spin_unlock(div->lock); in berlin2_div_get_parent()
189 struct berlin2_div *div = to_berlin2_div(hw); in berlin2_div_recalc_rate() local
190 struct berlin2_div_map *map = &div->map; in berlin2_div_recalc_rate()
193 if (div->lock) in berlin2_div_recalc_rate()
194 spin_lock(div->lock); in berlin2_div_recalc_rate()
196 divsw = readl_relaxed(div->base + map->div_switch_offs) & in berlin2_div_recalc_rate()
198 div3sw = readl_relaxed(div->base + map->div3_switch_offs) & in berlin2_div_recalc_rate()
210 reg = readl_relaxed(div->base + map->div_select_offs); in berlin2_div_recalc_rate()
216 if (div->lock) in berlin2_div_recalc_rate()
217 spin_unlock(div->lock); in berlin2_div_recalc_rate()
246 struct berlin2_div *div; in berlin2_div_register() local
248 div = kzalloc(sizeof(*div), GFP_KERNEL); in berlin2_div_register()
249 if (!div) in berlin2_div_register()
253 memcpy(&div->map, map, sizeof(*map)); in berlin2_div_register()
254 div->base = base; in berlin2_div_register()
255 div->lock = lock; in berlin2_div_register()
263 &div->hw, mux_ops, &div->hw, rate_ops, in berlin2_div_register()
264 &div->hw, gate_ops, flags); in berlin2_div_register()